diff --git a/.gitignore b/.gitignore index cbf676d..2daa9f7 100644 --- a/.gitignore +++ b/.gitignore @@ -170,4 +170,10 @@ cython_debug/ # PyPI configuration file .pypirc -.envrc \ No newline at end of file +.envrc + +private + +# build dir contains the cloned specs +# from which we generate the pydantic classes +build \ No newline at end of file diff --git a/README.md b/README.md index e4f2359..4c9532c 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,33 @@ # Pydantic EDA -**WIP!** - Pydantic models for EDA OpenAPI spec. Models are generated for the EDA Core API as well as for the apps shipped with EDA Playground at the time of the generation. ## Usage ## Generation -Store Github auth token in a `GH_AUTH_TOKEN` environment variable. For example, with `gh` cli: +Install dev dependencies: ``` -export GH_AUTH_TOKEN=$(gh auth token) +uv sync --all-groups ``` -Install dev dependencies: +Generate models for a specific version of the openapi repo (git ref): ``` -uv add --dev 'datamodel-code-generator[http]' rich ruff httpx +python gen_models.py --version v25.4.1 ``` -Generate models for a specific version of openapi repo: +The generation script clones the eda-labs/openapi repo at the provided ref and generated models from there. -``` -python gen_models.py --version v24.12.1 -``` +## Modifications + +The generation script transforms all schema objects in the source openapi files by removing `com.nokia.eda..`, as DMCG project has issues with treating schema nodes with dots in their names as module-based schemas. Therefore, the original schema nodes undergo that mutation by the script. + +## Versions + +The following table matches the project version with the version of the EDA delivery from which the models were generated. + +| pydantic_eda | EDA release | +| ------------ | ----------- | +| 0.3.0 | 25.4.1 | diff --git a/cached_specs.json b/cached_specs.json deleted file mode 100644 index 2365b82..0000000 --- a/cached_specs.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "v25.4.1": [ - { - "name": "core", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/core/core.json" - }, - { - "name": "aaa", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/aaa.eda.nokia.com/v1alpha1/aaa.json" - }, - { - "name": "aifabrics", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/aifabrics.eda.nokia.com/v1alpha1/aifabrics.json" - }, - { - "name": "appstore", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/appstore.eda.nokia.com/v1/appstore.json" - }, - { - "name": "bootstrap", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/bootstrap.eda.nokia.com/v1alpha1/bootstrap.json" - }, - { - "name": "certcheck", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/certcheck.eda.nokia.com/v1alpha1/certcheck.json" - }, - { - "name": "components", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/components.eda.nokia.com/v1/components.json" - }, - { - "name": "config", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/config.eda.nokia.com/v1alpha1/config.json" - }, - { - "name": "core", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/core.eda.nokia.com/v1/core.json" - }, - { - "name": "environment", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/environment.eda.nokia.com/v1alpha1/environment.json" - }, - { - "name": "fabrics", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/fabrics.eda.nokia.com/v1alpha1/fabrics.json" - }, - { - "name": "filters", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/filters.eda.nokia.com/v1alpha1/filters.json" - }, - { - "name": "interfaces", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/interfaces.eda.nokia.com/v1alpha1/interfaces.json" - }, - { - "name": "oam", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/oam.eda.nokia.com/v1alpha1/oam.json" - }, - { - "name": "os", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/os.eda.nokia.com/v1alpha1/os.json" - }, - { - "name": "protocols", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/protocols.eda.nokia.com/v1alpha1/protocols.json" - }, - { - "name": "qos", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/qos.eda.nokia.com/v1alpha1/qos.json" - }, - { - "name": "routing", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/routing.eda.nokia.com/v1alpha1/routing.json" - }, - { - "name": "routingpolicies", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/routingpolicies.eda.nokia.com/v1alpha1/routingpolicies.json" - }, - { - "name": "security", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/security.eda.nokia.com/v1alpha1/security.json" - }, - { - "name": "services", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/services.eda.nokia.com/v1alpha1/services.json" - }, - { - "name": "siteinfo", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/siteinfo.eda.nokia.com/v1alpha1/siteinfo.json" - }, - { - "name": "system", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/system.eda.nokia.com/v1alpha1/system.json" - }, - { - "name": "timing", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/timing.eda.nokia.com/v1alpha1/timing.json" - }, - { - "name": "topologies", - "url": "https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/topologies.eda.nokia.com/v1alpha1/topologies.json" - } - ] -} \ No newline at end of file diff --git a/gen_models.py b/gen_models.py index d717abb..e150c76 100644 --- a/gen_models.py +++ b/gen_models.py @@ -3,13 +3,11 @@ import argparse import json import logging -import os +import shutil import subprocess +import sys from pathlib import Path -from venv import logger -import httpx -from httpx import HTTPStatusError, RequestError from rich.logging import RichHandler from rich.traceback import install @@ -27,190 +25,280 @@ logger = logging.getLogger(__name__) -class OpenAPIDiscovery: +class Generator: def __init__( self, - input_dir: str, output_dir: str, version: str, verbose: bool, - use_cache: bool, ): - self.base_url = "https://api.github.com/repos/eda-labs/openapi" - self.raw_base = f"https://raw.githubusercontent.com/eda-labs/openapi/{version}" - self.gh_token = os.environ.get("GH_AUTH_TOKEN") - if self.gh_token == "": - logger.error("GH_AUTH_TOKEN environment variable is not set.") - exit(1) - - self.headers = { - "Accept": "application/vnd.github.v3+json", - "Authorization": f"Bearer {self.gh_token}", - } - self.cache_file = Path("cached_specs.json") - self.input_dir = Path(input_dir) + # openapi repo + self.repo_url = "https://github.com/eda-labs/openapi" + + # a dir to clone the openapi repo + self.build_dir = Path("./build") + # delete build dir if it exists before creating an empty one + if self.build_dir.exists(): + shutil.rmtree(self.build_dir) + self.build_dir.mkdir(exist_ok=True) + self.output_dir = Path(output_dir) self.verbose = verbose - self.use_cache = use_cache + self.version = version if self.verbose: logger.setLevel(logging.DEBUG) - # Configure retry strategy with httpx - transport = httpx.HTTPTransport( - retries=3, + def clone_repo(self): + """ + Clone the openapi repo under the build dir + """ + subprocess.run( + ["git", "clone", "-b", self.version, self.repo_url, self.build_dir], + check=True, + stderr=subprocess.DEVNULL, ) - self.client = httpx.Client( - timeout=30.0, - transport=transport, - headers=self.headers, - follow_redirects=True, + def process_specs(self): + """ + Process the specs under the build dir + """ + + # Process apps directory + apps_dir = self.build_dir.joinpath("apps") + if not apps_dir.exists(): + logger.info("apps dir not found in the cloned specs repo") + sys.exit(1) + + for spec_file in apps_dir.glob("**/*.json"): + # uncomment and change to a desired name if you want to generate + # just one model + # if spec_file.name != "services.json": + # continue + + logger.info(f"Processing {spec_file}") + api_name, api_version = extract_name_version(spec_file) + logger.debug(f"API name: {api_name}, API version: {api_version}") + + self.sanitize_schema_objects(spec_file, api_name, api_version) + + self.generate_classes_for_spec(spec_file, api_name, api_version) + + # process the core spec that is a single file in its own dir + core_dir = self.build_dir.joinpath("core") + if not core_dir.exists(): + logger.info("core dir not found in the cloned specs repo") + sys.exit(1) + + for spec_file in core_dir.glob("**/*.json"): + api_name = "core" + # core api has a v0.0.1 in the spec but that will change + # for now use v1alpha1 + api_version = "v1alpha1" + logger.debug(f"API name: {api_name}, API version: {api_version}") + self.sanitize_schema_objects(spec_file, api_name, api_version) + self.generate_classes_for_spec(spec_file, api_name, api_version) + + def generate_classes_for_spec( + self, spec_file: Path, api_name: str, api_version: str + ): + """ + Generate Pydantic classes for the given sanitized spec file + :param spec_file: Path to the spec file + :param api_name: Name of the API + :param api_version: Version of the API + """ + + app_parent_dir = "apps" + + # when generating models for the core api we put it right + # under the pydantic_eda output dir, while all the apps + # go under pydantic_eda/apps/ + if spec_file.parts[1] == "core": + app_parent_dir = "" + + dest_file = self.output_dir.joinpath( + app_parent_dir, api_name, api_version, "models.py" ) - def get_contents(self, path=""): - url = f"{self.base_url}/contents/{path}" - logger.info(f"Fetching contents from: {url}") + # Create all parent directories of the dest file + dest_file.parent.mkdir(parents=True, exist_ok=True) + + cmd = [ + "datamodel-codegen", + "--input", + spec_file, + "--input-file-type", + "openapi", + "--openapi-scopes", + "schemas", + "--output-model-type", + "pydantic_v2.BaseModel", + "--formatters", + "ruff-format", + "--use-annotated", + "--parent-scoped-naming", + "--collapse-root-models", + "--disable-timestamp", + "--reuse-model", + "--keep-model-order", + "--use-schema-description", + "--enum-field-as-literal", + "all", + "--output", + dest_file, + ] + + # the core API should use the file name as the output of the DMCG command + # the core app does not have apps dir in its URL + # if "apps" not in url_parts and module_name == "core": + # cmd[-1] = str(output_dir) + "/core.py" try: - response = self.client.get(url) - response.raise_for_status() - - # Rate limiting info - remaining = response.headers.get("X-RateLimit-Remaining") - if remaining: - logger.info(f"API calls remaining: {remaining}") - - content = response.json() - if isinstance(content, str): - raise ValueError(f"Unexpected response format: {content}") - return content - - except HTTPStatusError as e: - logger.error(f"HTTP error occurred: {e}") - raise - except RequestError as e: - logger.error(f"Request error occurred: {e}") - raise - - def load_cached_specs(self) -> dict[str, list[dict[str, str]]]: - try: - if self.cache_file.exists() and self.cache_file.stat().st_size > 0: - with open(self.cache_file) as f: - cached = json.load(f) - return cached - except (json.JSONDecodeError, OSError) as e: - logger.warning(f"Cache read error: {e}") - return {"": []} - - def save_specs_cache(self, specs): - try: - with open(self.cache_file, "w") as f: - json.dump(specs, f, indent=2) - except OSError as e: - logger.error(f"Failed to save cache: {e}") - - def discover_specs(self, use_cache=True) -> dict[str, list[dict[str, str]]]: - if use_cache: - cached = self.load_cached_specs() - if cached: - logger.info("Using cached specs") - return cached - - specs = {self.version: []} - specs_for_version = specs[self.version] - - # Check core path - core_specs = self.get_contents("core") - for spec in core_specs: - if spec.get("type") == "file" and spec.get("name", "").endswith(".json"): - specs_for_version.append( - { - "name": Path(spec["name"]).stem, - "url": f"{self.raw_base}/core/{spec['name']}", - } - ) - - # Check apps path - apps = self.get_contents("apps") - for app in apps: - if app.get("type") == "dir": - versions = self.get_contents(app["path"]) - for version in versions: - if version.get("type") == "dir": - files = self.get_contents(version["path"]) - for file in files: - if file.get("name", "").endswith(".json"): - specs_for_version.append( - { - "name": app["name"].split(".")[0], - "url": f"{self.raw_base}/{file['path']}", - } - ) - - if specs: - self.save_specs_cache(specs) - - return specs + logger.info(f"Generating models for {spec_file}...") + subprocess.run(cmd, check=True) + except subprocess.CalledProcessError as e: + logger.error(f"Error generating models for {spec_file}: {e}") + + def sanitize_schema_objects(self, spec_file: Path, api_name: str, api_version: str): + """ + Sanitize schema objects by removing extra info like com.nokia.com, app name and api version + :param spec_file: Path to the spec file + """ + # Open and load the JSON file + with open(spec_file, "r") as f: + spec_data = json.load(f) + + if ( + "components" not in spec_data + or "schemas" not in spec_data["components"] + ): + logger.info(f"No schemas found in {spec_file}") + return + + for name, data in spec_data["components"]["schemas"].items(): + logger.debug(f"Schema name: {name}") + + # gating flag to track if any schemas were changed + # when flipped to true it means we need to write the in-mem file to disk in the output dir + modified = False + + # Check and fix the info.title field if it has a trailing dot + # if "info" in spec_data and "title" in spec_data["info"]: + # title = spec_data["info"]["title"] + # if title.endswith("."): + # spec_data["info"]["title"] = title.rstrip(".") + # logger.debug( + # f"Removed trailing dot from title: {title} -> {spec_data['info']['title']}" + # ) + # modified = True + + schemas = spec_data["components"]["schemas"] + new_schemas = {} + + # Create new schema dictionary with renamed keys + for schema_name, schema_def in schemas.items(): + # if we have a dotted module name, dmcg will create bad shit + # we need to remove the dotted parts and only keep the name + # as this will make the schema clean + # so for com.nokia.eda.services.v1alpha1.BridgeDomainList + # we will keep only BridgeDomainList + # we also need to ensure that all references to the original schema node + # are updated to the new name + if "com.nokia.eda" in schema_name: + new_name = schema_name.split(".")[-1] + + logger.debug(f"Renaming schema: {schema_name} -> {new_name}") + + new_schemas[new_name] = schema_def + + modified = True + else: + new_schemas[schema_name] = schema_def + + # Replace the original schemas with the renamed ones + if modified: + spec_data["components"]["schemas"] = new_schemas + + # Remove the paths section entirely as it's not needed for model generation + # and it contains old ref links with dots in schema names + if "paths" in spec_data: + logger.debug(f"Removing paths section from {spec_file}") + del spec_data["paths"] + + # Recursively update all $ref values in the entire spec + self._update_refs(spec_data, api_name, api_version) + + # Write the modified spec back to the file + with open( + spec_file, + "w", + ) as f: + json.dump(spec_data, f, indent=2) + logger.info(f"Wrote schema to {spec_file}") def generate_models(self): output_dir = self.output_dir output_dir.mkdir(exist_ok=True) - specs: dict[str, list[dict[str, str]]] = self.discover_specs( - use_cache=self.use_cache - ) - if not specs: - logger.warning("No specs found!") - return - - if self.version not in specs: - logger.warning(f"No specs found for version {self.version}") - return - - for spec in specs[self.version]: - url_parts = spec["url"].split("/") - module_name = url_parts[-1].replace(".json", "") - - cmd = [ - "datamodel-codegen", - "--url", - spec["url"], - "--output-model-type", - "pydantic_v2.BaseModel", - "--use-annotated", - "--enum-field-as-literal", - "all", - "--output", - str(output_dir), - ] - - # the core API should use the file name as the output of the DMCG command - # the core app does not have apps dir in its URL - if "apps" not in url_parts and module_name == "core": - cmd[-1] = str(output_dir) + "/core.py" - - try: - logger.info(f"Generating models for {module_name}...") - subprocess.run(cmd, check=True) - except subprocess.CalledProcessError as e: - logger.error(f"Error generating models for {module_name}: {e}") - - def __del__(self): - self.client.close() + self.clone_repo() + + self.process_specs() + + # for spec in specs[self.version]: + # url_parts = spec["url"].split("/") + # module_name = url_parts[-1].replace(".json", "") + + def _update_refs(self, obj, api_name: str, api_version: str): + """ + Recursively update all $ref values in the object to use simplified schema names + :param obj: The object to update + """ + if isinstance(obj, dict): + for key, value in list(obj.items()): + if ( + key == "$ref" + and isinstance(value, str) + and f"#/components/schemas/com.nokia.eda.{api_name}.{api_version}" + in value + ): + # replace the unnecessary parts from the ref value + new_value = value.replace( + f"com.nokia.eda.{api_name}.{api_version}.", "" + ) + obj[key] = new_value + elif isinstance(value, (dict, list)): + self._update_refs(value, api_name, api_version) + elif isinstance(obj, list): + for item in obj: + if isinstance(item, (dict, list)): + self._update_refs(item, api_name, api_version) + + +def extract_name_version(file: Path) -> tuple[str, str]: + """Extract the API name and version from the spec file name. + Spec filename contains the build dir, e.g. + build/apps/bootstrap.eda.nokia.com/v1alpha1/bootstrap.json + + This func then extracts the app/api name -> bootstrap + and api version -> v1alpha1 + """ + # split the file name by the dot + parts = file.parts + # the name is the filename without the extension + name = file.stem + # the version is the second to last part + version = parts[-2] + + return name, version if __name__ == "__main__": parser = argparse.ArgumentParser( description="Discover OpenAPI specifications and generate Pydantic models." ) - parser.add_argument( - "--input", - type=str, - default="./openapi_specs", - help="Path to the OpenAPI specifications directory. Default: ./openapi_specs", - ) + parser.add_argument( "--output", type=str, @@ -228,19 +316,12 @@ def __del__(self): action="store_true", help="Enable verbose logging. Default: False", ) - parser.add_argument( - "--no-cache", - action="store_true", - help="Force fresh discovery by ignoring the cache. Default: False", - ) args = parser.parse_args() - discovery = OpenAPIDiscovery( - input_dir=args.input, + generator = Generator( output_dir=args.output, version=args.version, verbose=args.verbose, - use_cache=not args.no_cache, ) - discovery.generate_models() + generator.generate_models() diff --git a/pydantic_eda/__init__.py b/pydantic_eda/__init__.py deleted file mode 100644 index bf9322a..0000000 --- a/pydantic_eda/__init__.py +++ /dev/null @@ -1,132 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/topologies.eda.nokia.com/v1alpha1/topologies.json -# timestamp: 2025-05-07T11:44:28+00:00 - -from __future__ import annotations - -from typing import Annotated, Any, Dict, List, Optional - -from pydantic import BaseModel, Field, RootModel - - -class AppGroupVersion(BaseModel): - groupVersion: Optional[str] = None - version: Optional[str] = None - - -class ErrorIndex(BaseModel): - index: Optional[int] = None - - -class ErrorItem(BaseModel): - error: Optional[Dict[str, Any]] = None - type: Optional[str] = None - - -class ErrorResponse(BaseModel): - code: Annotated[ - int, Field(description='the numeric HTTP error code for the response.') - ] - details: Annotated[ - Optional[str], Field(description='The optional details of the error response.') - ] = None - dictionary: Annotated[ - Optional[Dict[str, Any]], - Field( - description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' - ), - ] = None - errors: Annotated[ - Optional[List[ErrorItem]], - Field( - description='Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats' - ), - ] = None - index: Optional[ErrorIndex] = None - internal: Annotated[ - Optional[int], - Field( - description="Internal error code in cases where we don't have an array of errors" - ), - ] = None - message: Annotated[ - str, Field(description='The basic text error message for the error response.') - ] - ref: Annotated[ - Optional[str], - Field( - description='Reference to the error source. Should typically be the URI of the request' - ), - ] = None - type: Annotated[ - Optional[str], - Field( - description='URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code' - ), - ] = None - - -class K8SPatchOp(BaseModel): - from_: Annotated[Optional[str], Field(alias='from')] = None - op: str - path: str - value: Optional[Dict[str, Any]] = None - x_permissive: Annotated[Optional[bool], Field(alias='x-permissive')] = None - - -class Patch(RootModel[List[K8SPatchOp]]): - root: List[K8SPatchOp] - - -class Resource(BaseModel): - kind: Optional[str] = None - name: Optional[str] = None - namespaced: Optional[bool] = None - readOnly: Optional[bool] = None - singularName: Optional[str] = None - uiCategory: Optional[str] = None - - -class ResourceHistoryEntry(BaseModel): - author: Optional[str] = None - changeType: Optional[str] = None - commitTime: Optional[str] = None - hash: Optional[str] = None - message: Optional[str] = None - transactionId: Optional[int] = None - - -class ResourceList(BaseModel): - apiVersion: Optional[str] = None - groupVersion: Optional[str] = None - kind: Optional[str] = None - resources: Optional[List[Resource]] = None - - -class StatusDetails(BaseModel): - group: Optional[str] = None - kind: Optional[str] = None - name: Optional[str] = None - - -class UIResult(RootModel[str]): - root: str - - -class AppGroup(BaseModel): - apiVersion: Optional[str] = None - kind: Optional[str] = None - name: Optional[str] = None - preferredVersion: Optional[AppGroupVersion] = None - versions: Optional[List[AppGroupVersion]] = None - - -class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): - root: List[ResourceHistoryEntry] - - -class Status(BaseModel): - apiVersion: Optional[str] = None - details: Optional[StatusDetails] = None - kind: Optional[str] = None - string: Optional[str] = None diff --git a/pydantic_eda/apps/aaa/v1alpha1/models.py b/pydantic_eda/apps/aaa/v1alpha1/models.py new file mode 100644 index 0000000..ddcad6e --- /dev/null +++ b/pydantic_eda/apps/aaa/v1alpha1/models.py @@ -0,0 +1,282 @@ +# generated by datamodel-codegen: +# filename: aaa.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class NodeGroup(BaseModel): + """ + NodeGroup is the Schema for the nodegroups API + """ + + apiVersion: str + kind: str + metadata: NodeGroupMetadata + spec: Annotated[ + NodeGroupSpec, + Field( + description="NodeGroup is a representation of a group on a node, including the services it has access to, any RBAC, and TACACS configuration.\nNodeGroups are deployed to nodes by NodeUser or other permission-consuming resources.", + title="Specification", + ), + ] + status: Annotated[ + Optional[NodeGroupStatus], + Field(description="Deployment status of this NodeGroup.", title="Status"), + ] = None + + +class NodeGroupDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class NodeGroupDeletedResources(RootModel[List[NodeGroupDeletedResourceEntry]]): + root: List[NodeGroupDeletedResourceEntry] + + +class NodeGroupList(BaseModel): + """ + NodeGroupList is a list of nodegroups + """ + + apiVersion: str + items: Optional[List[NodeGroup]] = None + kind: str + + +class NodeGroupMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class NodeGroupSpec(BaseModel): + """ + NodeGroup is a representation of a group on a node, including the services it has access to, any RBAC, and TACACS configuration. + NodeGroups are deployed to nodes by NodeUser or other permission-consuming resources. + """ + + groupName: Annotated[ + Optional[str], + Field( + description="Set the local name for this group. If not provided, the resource name will be used.", + title="Group Name", + ), + ] = None + rules: Annotated[ + Optional[List[NodeGroupSpecRule]], + Field(description="Rules for this group.", title="Rules"), + ] = None + services: Annotated[ + List[ + Literal[ + "CLI", + "FTP", + "GNMI", + "GNOI", + "GNSI", + "GRIBI", + "Reflection", + "JSON-RPC", + "NETCONF", + ] + ], + Field(description="Enabled services for this group", title="Services"), + ] + superuser: Annotated[ + Optional[bool], + Field(description="Make members of this group superusers.", title="Superuser"), + ] = None + tacacs: Annotated[ + Optional[NodeGroupSpecTacacs], + Field(description="TACACS configuration.", title="TACACS"), + ] = None + + +class NodeGroupSpecRule(BaseModel): + action: Annotated[ + Literal["Deny", "ReadWrite", "Read"], + Field(description="Set the action for this entry.", title="Action"), + ] + match: Annotated[ + Optional[str], + Field( + description='Set the match for this entry. This is a string to match input against - for example "interface" for srl or "configure port" for sros.\nRules here should be specified in the target specific format.', + title="Match", + ), + ] = None + operatingSystem: Annotated[ + Literal["srl", "sros"], + Field( + description="Operating system to match against for this rule.\nOperating system to deploy this rule to.", + title="Operating System", + ), + ] + + +class NodeGroupSpecTacacs(BaseModel): + """ + TACACS configuration. + """ + + privilegeLevel: Annotated[ + Optional[int], + Field( + description="Set the privilege level for this group.", + ge=0, + le=15, + title="Privilege Level", + ), + ] = None + + +class NodeGroupStatus(BaseModel): + """ + Deployment status of this NodeGroup. + """ + + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of TopoNodes group has been deployed to.", title="Nodes" + ), + ] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/aifabrics/v1alpha1/models.py b/pydantic_eda/apps/aifabrics/v1alpha1/models.py new file mode 100644 index 0000000..9ed85f5 --- /dev/null +++ b/pydantic_eda/apps/aifabrics/v1alpha1/models.py @@ -0,0 +1,476 @@ +# generated by datamodel-codegen: +# filename: aifabrics.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class Backend(BaseModel): + """ + Backend is the Schema for the backends API + """ + + apiVersion: str + kind: str + metadata: BackendMetadata + spec: Annotated[ + BackendSpec, + Field( + description="BackendSpec defines the desired state of Backend", + title="Specification", + ), + ] + status: Annotated[ + Optional[BackendStatus], + Field( + description="BackendStatus defines the observed state of Backend", + title="Status", + ), + ] = None + + +class BackendDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class BackendDeletedResources(RootModel[List[BackendDeletedResourceEntry]]): + root: List[BackendDeletedResourceEntry] + + +class BackendList(BaseModel): + """ + BackendList is a list of backends + """ + + apiVersion: str + items: Optional[List[Backend]] = None + kind: str + + +class BackendMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class BackendSpec(BaseModel): + """ + BackendSpec defines the desired state of Backend + """ + + asnPool: Annotated[ + Optional[str], + Field( + description="Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol.", + title="Autonomous System Pool", + ), + ] = None + gpuIsolationGroups: Annotated[ + List[BackendSpecGpuIsolationGroup], + Field( + description="GPU Isolation Groups are used to isolate GPU traffic over the network, GPUs in different GPU isolation groups will not be able to communicate with each other. If all GPUs across all stripes need to be able to communicate with each other, create a single GPUIsolationGroup selecting all GPU facing interfaces.", + title="GPU Isolation Groups", + ), + ] + rocev2QoS: Annotated[ + BackendSpecRocev2QoS, + Field( + description="Set of properties to configure the RoCEv2 QoS.", + title="RoCEv2 QoS", + ), + ] + stripeConnector: Annotated[ + Optional[BackendSpecStripeConnector], + Field( + description="StripeConnector is the spine layer interconnecting multiple stripes.", + title="Stripe Connector", + ), + ] = None + stripes: Annotated[ + List[BackendSpecStripe], + Field( + description="A list of stripes, stripes contain a set of nodes (rails).", + title="Stripes", + ), + ] + systemPoolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. If specified under the Leaf/Spine/Superspine/Borderleaf those will take precedence.", + title="IPv4 Pool - System IP", + ), + ] = None + + +class BackendSpecGpuIsolationGroup(BaseModel): + interfaceSelector: Annotated[List[str], Field(title="Interface Selector")] + name: Annotated[ + str, Field(description="Name of the IsolationGroup.", title="Isolation Group") + ] + + +class BackendSpecRocev2QoS(BaseModel): + """ + Set of properties to configure the RoCEv2 QoS. + """ + + ecnMaxDropProbabilityPercent: Annotated[ + int, + Field( + description="If the queue depth is between min and max threshold then this the probability with which packets are dropped or marked.", + title="ECN Max Drop Probability Percent", + ), + ] + ecnSlopeMaxThresholdPercent: Annotated[ + int, + Field( + description="The maximum threshold parameter for a RED-managed queue in percent. When the average queue length exceeds the max value, all packets are dropped (or marked if ECN is enabled). Mutually exclusive with min-threshold and max-threshold.", + title="ECN Max Threshold Percent", + ), + ] + ecnSlopeMinThresholdPercent: Annotated[ + int, + Field( + description="The mininum threshold parameter for a RED-managed queue in percent. When the average queue length is less than min, all packets are admitted to the queue. Mutually exclusive with min-threshold and max-threshold.", + title="ECN Min Threshold Percent", + ), + ] + pfcDeadlockDetectionTimer: Annotated[ + int, + Field( + description="Number of milliseconds during which outgoing interface is receiving pfc-pause-frames before triggering recovery-timer.", + title="PFC Deadlock Detection Timer", + ), + ] + pfcDeadlockRecoveryTimer: Annotated[ + int, + Field( + description="Number of milliseconds during which the pfc-pause-frames will be ignored.", + title="PFC Deadlock Recovery Timer", + ), + ] + queueMaximumBurstSize: Annotated[ + int, + Field( + description="Maximum amount of shared buffer memory available to the queue in bytes.", + ge=0, + le=4294967295, + title="Maximum Burst Size", + ), + ] + + +class BackendSpecStripe(BaseModel): + asnPool: Annotated[ + Optional[str], + Field( + description="Optional reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. If left blank, ASN allocation will be done from the ASNAllocationRange.", + title="Autonomous System Pool", + ), + ] = None + gpuVlan: Annotated[ + int, + Field( + description="The VLAN used on interfaces facing the GPU servers.", + title="GPU VLAN", + ), + ] + name: Annotated[ + str, Field(description="The name of the Stripe.", title="Stripe Name") + ] + nodeSelector: Annotated[ + List[str], + Field( + description="Node selector to select the nodes to be used for this stripe.", + title="Node Selector", + ), + ] + stripeID: Annotated[ + int, Field(description="Unique ID for a stripe", title="Stripe ID") + ] + systemPoolIPV4: Annotated[ + Optional[str], + Field( + description="Optional reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. If left blank, system IP allocation will be done from the SystemIPV4Subnet.", + title="IPv4 Pool - System IP", + ), + ] = None + + +class BackendSpecStripeConnector(BaseModel): + """ + StripeConnector is the spine layer interconnecting multiple stripes. + """ + + asnPool: Annotated[ + Optional[str], + Field( + description="Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations.", + title="Autonomous System Pool", + ), + ] = None + linkSelector: Annotated[ + List[str], + Field( + description="Selects TopoLinks to include in this AI Fabric, the selected TopoLinks will be used to create ISLs between the stripe connector devices and the leaf devices.", + title="Link Selector", + ), + ] + name: Annotated[ + str, + Field( + description="The name of the Stripe Connector.", + title="Stripe Connector Name", + ), + ] + nodeSelector: Annotated[ + List[str], + Field( + description="Node selector to select the nodes to be used for this stripe connector.", + title="Node Selector", + ), + ] + systemPoolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces for the stripe connector devices. If not specified, the system will use the default IPAllocationPool.", + title="IPv4 Pool - System IP", + ), + ] = None + + +class BackendStatus(BaseModel): + """ + BackendStatus defines the observed state of Backend + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the Fabric. The health score of the Fabric is determined by the aggregate health score of the resources emited by the Fabric such as ISL, DefaultRouteReflectors etc.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the Fabric. The operational state of the fabric is determined by monitoring the operational state of the following resources (if applicable): DefaultRouters, ISLs.", + title="Operational State", + ), + ] = None + stripeConnector: Annotated[ + Optional[BackendStatusStripeConnector], + Field(description="Stripe connector in the Backend.", title="Stripe Connector"), + ] = None + stripes: Annotated[ + Optional[List[BackendStatusStripe]], + Field(description="List of stripes in the Backend.", title="Stripes"), + ] = None + + +class BackendStatusStripe(BaseModel): + leafNodes: Annotated[ + Optional[List[BackendStatusStripeLeafNode]], + Field(description="List of leaf nodes in the Stripe.", title="Leaf Nodes"), + ] = None + name: Annotated[ + Optional[str], Field(description="The name of the Stripe.", title="Stripe Name") + ] = None + + +class BackendStatusStripeConnector(BaseModel): + """ + Stripe connector in the Backend. + """ + + name: Annotated[ + Optional[str], + Field( + description="The name of the Stripe Connector.", + title="Stripe Connector Name", + ), + ] = None + stripeConnectorNodes: Annotated[ + Optional[List[BackendStatusStripeConnectorStripeConnectorNode]], + Field( + description="List of stripe connector nodes in the Stripe.", + title="Leaf Nodes", + ), + ] = None + + +class BackendStatusStripeConnectorStripeConnectorNode(BaseModel): + node: Annotated[ + Optional[str], Field(description="Name of the TopoNode.", title="Node") + ] = None + operatingSystem: Annotated[ + Optional[str], + Field( + description="Operating system running on the node.", + title="Operating System", + ), + ] = None + operatingSystemVersion: Annotated[ + Optional[str], + Field( + description="Operating system version running on the node.", + title="Operating System Version", + ), + ] = None + + +BackendStatusStripeLeafNode = BackendStatusStripeConnectorStripeConnectorNode + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/appstore/v1/models.py b/pydantic_eda/apps/appstore/v1/models.py new file mode 100644 index 0000000..0b036fa --- /dev/null +++ b/pydantic_eda/apps/appstore/v1/models.py @@ -0,0 +1,384 @@ +# generated by datamodel-codegen: +# filename: appstore.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import datetime + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class Catalog(BaseModel): + """ + Catalog is the Schema for the catalogs API + """ + + apiVersion: str + kind: str + metadata: CatalogMetadata + spec: Annotated[ + CatalogSpec, + Field( + description="CatalogSpec defines the desired state of a Catalog.", + title="Specification", + ), + ] + status: Annotated[ + Optional[CatalogStatus], + Field( + description="CatalogStatus defines the observed state of a Catalog.", + title="Status", + ), + ] = None + + +class CatalogDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + transactionId: Optional[int] = None + + +class CatalogDeletedResources(RootModel[List[CatalogDeletedResourceEntry]]): + root: List[CatalogDeletedResourceEntry] + + +class CatalogList(BaseModel): + """ + CatalogList is a list of catalogs + """ + + apiVersion: str + items: Optional[List[Catalog]] = None + kind: str + + +class CatalogMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + + +class CatalogSpec(BaseModel): + """ + CatalogSpec defines the desired state of a Catalog. + """ + + authSecretRef: Annotated[ + Optional[str], + Field( + description="AuthSecretRef is the authentication secret reference, used for authentication.\nMust be in the same namespace as the catalog.", + title="Authentication Secret Reference", + ), + ] = None + description: Annotated[ + Optional[str], + Field( + description="Description is an optional short description of the catalog.", + max_length=70, + title="Description", + ), + ] = None + refreshInterval: Annotated[ + Optional[int], + Field( + description="RefreshInterval tells the controller how often it should check the remote catalog for new updates, in seconds.\nDefault is 180 seconds. Minimum is 30 seconds for production environments; 10 seconds for test environments.", + title="Refresh Interval", + ), + ] = 180 + remoteType: Annotated[ + Optional[Literal["git"]], + Field( + description="RemoteType type of the catalog, only 'git' is supported at the moment.", + title="Remote Type", + ), + ] = "git" + remoteURL: Annotated[ + Optional[str], + Field( + description="RemoteURL is the HTTP(S) remote URL of the catalog. Supported URI schemes: 'https://' and 'http://'.\nDefault is HTTPS if no scheme is given.", + title="Remote URL", + ), + ] = None + skipTLSVerify: Annotated[ + Optional[bool], + Field( + description="SkipTLSVerify skips the validity check for the server's certificate. This will make HTTPS connections insecure.", + title="Skip TLS Verify", + ), + ] = False + title: Annotated[ + Optional[str], + Field( + description="Title is an UI-friendly name for the catalog.", + max_length=50, + title="Title", + ), + ] = None + + +class CatalogStatus(BaseModel): + """ + CatalogStatus defines the observed state of a Catalog. + """ + + error: Annotated[ + Optional[str], + Field( + description="Error denotes the last error that was encountered by the controller.", + title="Error", + ), + ] = None + lastRefreshTime: Annotated[ + Optional[datetime], + Field( + description="LastRefreshTime is the last attempt to refresh the catalog cache by the controller.", + title="Last Refresh Time", + ), + ] = None + operational: Annotated[ + Optional[bool], + Field( + description="Operational reports whether the catalog remote is operational.", + title="Operational", + ), + ] = False + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Registry(BaseModel): + """ + Registry is the Schema for the registries API + """ + + apiVersion: str + kind: str + metadata: RegistryMetadata + spec: Annotated[ + RegistrySpec, + Field( + description="RegistrySpec defines the desired state of a Registry", + title="Specification", + ), + ] + status: Annotated[ + Optional[RegistryStatus], + Field( + description="RegistryStatus defines the observed state of Registry", + title="Status", + ), + ] = None + + +RegistryDeletedResourceEntry = CatalogDeletedResourceEntry + + +class RegistryDeletedResources(RootModel[List[RegistryDeletedResourceEntry]]): + root: List[RegistryDeletedResourceEntry] + + +class RegistryList(BaseModel): + """ + RegistryList is a list of registries + """ + + apiVersion: str + items: Optional[List[Registry]] = None + kind: str + + +RegistryMetadata = CatalogMetadata + + +class RegistrySpec(BaseModel): + """ + RegistrySpec defines the desired state of a Registry + """ + + authSecretRef: Annotated[ + Optional[str], + Field( + description="AuthSecretRef is the authentication secret reference, used for authentication.\nMust be in the same namespace as the catalog.", + title="Authentication Secret Reference", + ), + ] = None + mirror: Annotated[ + Optional[str], + Field( + description="Mirror registry of the original remote registry.\nApp store will use the mirror instead of the original registry that is referenced by a catalog.", + title="Mirror", + ), + ] = None + remoteURL: Annotated[ + str, + Field( + description="RemoteURL is the remote URL of the registry. Supported URI schemes: 'https://' and 'http://'.\n\tDefault is HTTPS if no scheme is given.", + title="Remote URL", + ), + ] + skipTLSVerify: Annotated[ + Optional[bool], + Field( + description="Skip TLS Verification on connection", title="Skip TLS Verify" + ), + ] = False + title: Annotated[ + Optional[str], + Field( + description="Title is an UI-friendly name for the catalog.", + max_length=50, + title="Title", + ), + ] = None + + +class RegistryStatus(BaseModel): + """ + RegistryStatus defines the observed state of Registry + """ + + error: Annotated[ + str, + Field( + description="Error denotes the last error that was encountered by the controller.", + title="Error", + ), + ] + reachable: Annotated[ + Optional[bool], + Field( + description="Reachable indicates if the registry is reachable.", + title="Reachable", + ), + ] = False + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/bootstrap/v1alpha1/models.py b/pydantic_eda/apps/bootstrap/v1alpha1/models.py new file mode 100644 index 0000000..cfe3e94 --- /dev/null +++ b/pydantic_eda/apps/bootstrap/v1alpha1/models.py @@ -0,0 +1,323 @@ +# generated by datamodel-codegen: +# filename: bootstrap.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class Init(BaseModel): + """ + Init is the Schema for the inits API + """ + + apiVersion: str + kind: str + metadata: InitMetadata + spec: Annotated[ + InitSpec, + Field( + description="InitSpec defines the desired state of Init", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="InitStatus defines the observed state of Init", title="Status" + ), + ] = None + + +class InitDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class InitDeletedResources(RootModel[List[InitDeletedResourceEntry]]): + root: List[InitDeletedResourceEntry] + + +class InitList(BaseModel): + """ + InitList is a list of inits + """ + + apiVersion: str + items: Optional[List[Init]] = None + kind: str + + +class InitMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class InitSpec(BaseModel): + """ + InitSpec defines the desired state of Init + """ + + commitSave: Annotated[ + Optional[bool], + Field( + description="Save a startup configuration after each commit.", + title="Commit Save", + ), + ] = None + mgmt: Annotated[ + Optional[InitSpecMgmt], + Field( + description="Optional management interface settings.\nAllows setting DHCP clients or static IPs as well as\nthe IP MTU.", + title="Mgmt", + ), + ] = None + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Optional node selectors to perform initial configuration for.\nIf not provided initialization is performed for all nodes.", + title="Node Selector", + ), + ] = None + + +class InitSpecMgmt(BaseModel): + """ + Optional management interface settings. + Allows setting DHCP clients or static IPs as well as + the IP MTU. + """ + + ipMTU: Annotated[ + Optional[int], + Field(description="Set the management interface IP MTU.", title="IP MTU"), + ] = None + ipv4DHCP: Annotated[ + Optional[bool], + Field(description="Enable IPv4 DHCP client.", title="IPv4 DHCP Client"), + ] = None + ipv6DHCP: Annotated[ + Optional[bool], + Field(description="Enable IPv6 DHCP client.", title="IPv6 DHCP Client"), + ] = None + staticRoutes: Annotated[ + Optional[List[InitSpecMgmtStaticRoute]], + Field( + description="Optional list of static routes to add to the management network instance as part of the initial configuration.", + title="Static Routes", + ), + ] = None + + +class InitSpecMgmtStaticRoute(BaseModel): + nextHop: Annotated[ + Optional[str], Field(description="Static route next hop.", title="Next Hop") + ] = None + prefix: Annotated[ + Optional[str], Field(description="Static route prefix.", title="Prefix") + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class ManagementRouter(BaseModel): + """ + ManagementRouter is the Schema for the managementrouters API + """ + + apiVersion: str + kind: str + metadata: ManagementRouterMetadata + spec: Annotated[ + ManagementRouterSpec, + Field( + description="ManagementRouterSpec defines the desired state of ManagementRouter", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="ManagementRouterStatus defines the observed state of ManagementRouter", + title="Status", + ), + ] = None + + +ManagementRouterDeletedResourceEntry = InitDeletedResourceEntry + + +class ManagementRouterDeletedResources( + RootModel[List[ManagementRouterDeletedResourceEntry]] +): + root: List[ManagementRouterDeletedResourceEntry] + + +class ManagementRouterList(BaseModel): + """ + ManagementRouterList is a list of managementrouters + """ + + apiVersion: str + items: Optional[List[ManagementRouter]] = None + kind: str + + +ManagementRouterMetadata = InitMetadata + + +class ManagementRouterSpec(BaseModel): + """ + ManagementRouterSpec defines the desired state of ManagementRouter + """ + + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Selects TopoNodes on which to configure the management VRF. When left empty, all TopoNodes are selected.", + title="Node Selector", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of TopoNodes on which to configure the management VRF. When left empty, all TopoNodes are selected.", + title="Nodes", + ), + ] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/components/v1/models.py b/pydantic_eda/apps/components/v1/models.py new file mode 100644 index 0000000..b680dc8 --- /dev/null +++ b/pydantic_eda/apps/components/v1/models.py @@ -0,0 +1,1490 @@ +# generated by datamodel-codegen: +# filename: components.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class Chassis(BaseModel): + """ + Chassis is the Schema for the chassis API + """ + + apiVersion: str + kind: str + metadata: ChassisMetadata + spec: Annotated[ + Dict[str, Any], + Field( + description="ChassisSpec defines the desired state of Chassis", + title="Specification", + ), + ] + status: Annotated[ + Optional[ChassisStatus], + Field( + description="ChassisStatus defines the observed state of Chassis", + title="Status", + ), + ] = None + + +class ChassisList(BaseModel): + """ + ChassisList is a list of chassis + """ + + apiVersion: str + items: Optional[List[Chassis]] = None + kind: str + + +class ChassisMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class ChassisStatus(BaseModel): + """ + ChassisStatus defines the observed state of Chassis + """ + + chassisMacAddress: Annotated[ + Optional[str], + Field(description="MAC Address of the Chassis", title="Chassis MAC Address"), + ] = None + children: Annotated[ + Optional[List[ChassisStatusChildrenItem]], + Field(description="References to children components", title="Children"), + ] = None + commonLanguageEquipmentIdentifier: Annotated[ + Optional[str], + Field(description="The CLEI code of this component", title="CLEI Code"), + ] = None + lastBooted: Annotated[ + Optional[date], + Field( + description="The date and time this component last booted", + title="Last Booted", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The date and time this component last changed operational state", + title="Last Change", + ), + ] = None + manufacturedDate: Annotated[ + Optional[date], + Field( + description="The date this component was manufactured", + title="Manufactured Date", + ), + ] = None + operationalState: Annotated[ + Optional[Literal["Up", "Down", "Rebooting", "Unknown", "Starting", "Empty"]], + Field( + description="Indicates the current operational state of this component.", + title="Operational State", + ), + ] = None + partNumber: Annotated[ + Optional[str], + Field( + description="The discovered part number of this component", + title="Part Number", + ), + ] = None + removable: Annotated[ + Optional[bool], + Field( + description="Indicates if this component is removable", title="Removable" + ), + ] = None + serialNumber: Annotated[ + Optional[str], + Field( + description="The discovered serial number of this component", + title="Serial Number", + ), + ] = None + target: Annotated[ + Optional[str], + Field(description="Target this component resides on.", title="Target"), + ] = None + type: Annotated[ + Optional[str], + Field(description="Component type, as provided by the target", title="Type"), + ] = None + + +class ChassisStatusChildrenItem(BaseModel): + name: Annotated[ + Optional[str], Field(description="Reference to a child component", title="Name") + ] = None + type: Annotated[ + Optional[ + Literal[ + "Fan", + "FanTray", + "PowerSupply", + "PowerModule", + "PowerShelf", + "InterfaceModule", + "ControlModule", + "FabricModule", + "Chassis", + "Transceiver", + ] + ], + Field(description="Type of the child component", title="Type"), + ] = None + + +class Component(BaseModel): + """ + Component is the Schema for the components API + """ + + apiVersion: str + kind: str + metadata: ComponentMetadata + spec: Annotated[ + ComponentSpec, + Field( + description="ComponentSpec defines the desired state of Component", + title="Specification", + ), + ] + status: Annotated[ + Optional[ComponentStatus], + Field( + description="ComponentStatus defines the observed state of Component", + title="Status", + ), + ] = None + + +class ComponentList(BaseModel): + """ + ComponentList is a list of components + """ + + apiVersion: str + items: Optional[List[Component]] = None + kind: str + + +ComponentMetadata = ChassisMetadata + + +class ComponentSpec(BaseModel): + """ + ComponentSpec defines the desired state of Component + """ + + node: Annotated[ + str, + Field( + description="TopologyNode this Component resides on.\nIndicates the operation in which to apply the configuration", + title="Node", + ), + ] + slot: Annotated[ + Optional[str], + Field( + description="Slot this Component resides in, unset for Components that do not have a slot or ID.", + title="Slot", + ), + ] = None + type: Annotated[ + Literal[ + "Fan", + "FanTray", + "PowerSupply", + "PowerModule", + "PowerShelf", + "InterfaceModule", + "ControlModule", + "FabricModule", + "Chassis", + "Transceiver", + ], + Field(description="Type of Component.", title="Type"), + ] + + +class ComponentStatus(BaseModel): + """ + ComponentStatus defines the observed state of Component + """ + + enabled: Annotated[ + Optional[bool], + Field( + description="The administrative status of this Component.", title="Enabled" + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The date and time this Component last changed operational state", + title="Last Change", + ), + ] = None + manufacturedDate: Annotated[ + Optional[date], + Field( + description="The date this Component was manufactured", + title="Manufactured Date", + ), + ] = None + operationalState: Annotated[ + Optional[Literal["Up", "Down", "Rebooting", "Unknown", "Starting", "Empty"]], + Field( + description="Indicates the current operational state of this Component.", + title="Operational State", + ), + ] = None + partNumber: Annotated[ + Optional[str], + Field( + description="The discovered part number of this Component", + title="Part Number", + ), + ] = None + serialNumber: Annotated[ + Optional[str], + Field( + description="The discovered serial number of this Component", + title="Serial Number", + ), + ] = None + type: Annotated[ + Optional[str], + Field(description="Component type, as provided by the node.", title="Type"), + ] = None + + +class ControlModule(BaseModel): + """ + ControlModule is the Schema for the controlmodules API + """ + + apiVersion: str + kind: str + metadata: ControlModuleMetadata + spec: Annotated[ + Dict[str, Any], + Field( + description="ControlModuleSpec defines the desired state of ControlModule", + title="Specification", + ), + ] + status: Annotated[ + Optional[ControlModuleStatus], + Field( + description="ControlModuleStatus defines the observed state of ControlModule", + title="Status", + ), + ] = None + + +class ControlModuleList(BaseModel): + """ + ControlModuleList is a list of controlmodules + """ + + apiVersion: str + items: Optional[List[ControlModule]] = None + kind: str + + +ControlModuleMetadata = ChassisMetadata + + +class ControlModuleStatus(BaseModel): + """ + ControlModuleStatus defines the observed state of ControlModule + """ + + commonLanguageEquipmentIdentifier: Annotated[ + Optional[str], + Field(description="The CLEI code of this component", title="CLEI Code"), + ] = None + lastBooted: Annotated[ + Optional[date], + Field( + description="The date and time this component last booted", + title="Last Booted", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The date and time this component last changed operational state", + title="Last Change", + ), + ] = None + locatorEnabled: Annotated[ + Optional[bool], + Field( + description="Indicates if the locator LED for the component is active", + title="Locator Enabled", + ), + ] = None + manufacturedDate: Annotated[ + Optional[date], + Field( + description="The date this component was manufactured", + title="Manufactured Date", + ), + ] = None + operationalState: Annotated[ + Optional[Literal["Up", "Down", "Rebooting", "Unknown", "Starting", "Empty"]], + Field( + description="Indicates the current operational state of this component.", + title="Operational State", + ), + ] = None + parent: Annotated[ + Optional[str], + Field(description="Reference to a parent component", title="Parent"), + ] = None + parentType: Annotated[ + Optional[ + Literal[ + "Fan", + "FanTray", + "PowerSupply", + "PowerModule", + "PowerShelf", + "InterfaceModule", + "ControlModule", + "FabricModule", + "Chassis", + "Transceiver", + ] + ], + Field(description="Type of the parent component", title="Parent Type"), + ] = None + partNumber: Annotated[ + Optional[str], + Field( + description="The discovered part number of this component", + title="Part Number", + ), + ] = None + removable: Annotated[ + Optional[bool], + Field( + description="Indicates if this component is removable", title="Removable" + ), + ] = None + role: Annotated[ + Optional[Literal["Active", "Standby"]], + Field(description="Role of the control module", title="Role"), + ] = None + serialNumber: Annotated[ + Optional[str], + Field( + description="The discovered serial number of this component", + title="Serial Number", + ), + ] = None + slot: Annotated[ + Optional[str], + Field( + description="Slot this component resides in, unset for components that do not have a slot or ID", + title="Slot", + ), + ] = None + softwareVersion: Annotated[ + Optional[str], + Field( + description="Version string of the software running on this component", + title="Software Version", + ), + ] = None + target: Annotated[ + Optional[str], + Field(description="Target this component resides on.", title="Target"), + ] = None + temperature: Annotated[ + Optional[ControlModuleStatusTemperature], + Field( + description="Temperature information for this component", + title="Temperature", + ), + ] = None + type: Annotated[ + Optional[str], + Field(description="Component type, as provided by the target", title="Type"), + ] = None + + +class ControlModuleStatusTemperature(BaseModel): + """ + Temperature information for this component + """ + + alarmState: Annotated[ + Optional[bool], + Field( + description="The temperature alarm state, as reported by the component", + title="Alarm State", + ), + ] = None + instant: Annotated[ + Optional[int], + Field(description="The current temperature of this component", title="Instant"), + ] = None + margin: Annotated[ + Optional[int], + Field(description="The margin temperature of this component", title="Margin"), + ] = None + maximum: Annotated[ + Optional[int], + Field(description="The maximum temperature of this component", title="Maximum"), + ] = None + threshold: Annotated[ + Optional[int], + Field( + description="The threshold temperature of this component", title="Threshold" + ), + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class FabricModule(BaseModel): + """ + FabricModule is the Schema for the fabricmodules API + """ + + apiVersion: str + kind: str + metadata: FabricModuleMetadata + spec: Annotated[ + Dict[str, Any], + Field( + description="FabricModuleSpec defines the desired state of FabricModule", + title="Specification", + ), + ] + status: Annotated[ + Optional[FabricModuleStatus], + Field( + description="FabricModuleStatus defines the observed state of FabricModule", + title="Status", + ), + ] = None + + +class FabricModuleList(BaseModel): + """ + FabricModuleList is a list of fabricmodules + """ + + apiVersion: str + items: Optional[List[FabricModule]] = None + kind: str + + +FabricModuleMetadata = ChassisMetadata + + +class FabricModuleStatus(BaseModel): + """ + FabricModuleStatus defines the observed state of FabricModule + """ + + commonLanguageEquipmentIdentifier: Annotated[ + Optional[str], + Field(description="The CLEI code of this component", title="CLEI Code"), + ] = None + lastBooted: Annotated[ + Optional[date], + Field( + description="The date and time this component last booted", + title="Last Booted", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The date and time this component last changed operational state", + title="Last Change", + ), + ] = None + locatorEnabled: Annotated[ + Optional[bool], + Field( + description="Indicates if the locator LED for the component is active", + title="Locator Enabled", + ), + ] = None + manufacturedDate: Annotated[ + Optional[date], + Field( + description="The date this component was manufactured", + title="Manufactured Date", + ), + ] = None + operationalState: Annotated[ + Optional[Literal["Up", "Down", "Rebooting", "Unknown", "Starting", "Empty"]], + Field( + description="Indicates the current operational state of this component.", + title="Operational State", + ), + ] = None + parent: Annotated[ + Optional[str], + Field(description="Reference to a parent component", title="Parent"), + ] = None + parentType: Annotated[ + Optional[ + Literal[ + "Fan", + "FanTray", + "PowerSupply", + "PowerModule", + "PowerShelf", + "InterfaceModule", + "ControlModule", + "FabricModule", + "Chassis", + "Transceiver", + ] + ], + Field(description="Type of the parent component", title="Parent Type"), + ] = None + partNumber: Annotated[ + Optional[str], + Field( + description="The discovered part number of this component", + title="Part Number", + ), + ] = None + removable: Annotated[ + Optional[bool], + Field( + description="Indicates if this component is removable", title="Removable" + ), + ] = None + serialNumber: Annotated[ + Optional[str], + Field( + description="The discovered serial number of this component", + title="Serial Number", + ), + ] = None + slot: Annotated[ + Optional[str], + Field( + description="Slot this component resides in, unset for components that do not have a slot or ID", + title="Slot", + ), + ] = None + softwareVersion: Annotated[ + Optional[str], + Field( + description="Version string of the software running on this component", + title="Software Version", + ), + ] = None + target: Annotated[ + Optional[str], + Field(description="Target this component resides on.", title="Target"), + ] = None + temperature: Annotated[ + Optional[FabricModuleStatusTemperature], + Field( + description="Temperature information for this component", + title="Temperature", + ), + ] = None + type: Annotated[ + Optional[str], + Field(description="Component type, as provided by the target", title="Type"), + ] = None + + +FabricModuleStatusTemperature = ControlModuleStatusTemperature + + +class Fan(BaseModel): + """ + Fan is the Schema for the fans API + """ + + apiVersion: str + kind: str + metadata: FanMetadata + spec: Annotated[ + Dict[str, Any], + Field( + description="FanSpec defines the desired state of Fan", + title="Specification", + ), + ] + status: Annotated[ + Optional[FanStatus], + Field( + description="FanStatus defines the observed state of Fan", title="Status" + ), + ] = None + + +class FanList(BaseModel): + """ + FanList is a list of fans + """ + + apiVersion: str + items: Optional[List[Fan]] = None + kind: str + + +FanMetadata = ChassisMetadata + + +class FanStatus(BaseModel): + """ + FanStatus defines the observed state of Fan + """ + + commonLanguageEquipmentIdentifier: Annotated[ + Optional[str], + Field(description="The CLEI code of this component", title="CLEI Code"), + ] = None + lastBooted: Annotated[ + Optional[date], + Field( + description="The date and time this component last booted", + title="Last Booted", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The date and time this component last changed operational state", + title="Last Change", + ), + ] = None + locatorEnabled: Annotated[ + Optional[bool], + Field( + description="Indicates if the locator LED for the component is active", + title="Locator Enabled", + ), + ] = None + manufacturedDate: Annotated[ + Optional[date], + Field( + description="The date this component was manufactured", + title="Manufactured Date", + ), + ] = None + operationalState: Annotated[ + Optional[Literal["Up", "Down", "Rebooting", "Unknown", "Starting", "Empty"]], + Field( + description="Indicates the current operational state of this component.", + title="Operational State", + ), + ] = None + parent: Annotated[ + Optional[str], + Field(description="Reference to a parent component", title="Parent"), + ] = None + parentType: Annotated[ + Optional[ + Literal[ + "Fan", + "FanTray", + "PowerSupply", + "PowerModule", + "PowerShelf", + "InterfaceModule", + "ControlModule", + "FabricModule", + "Chassis", + "Transceiver", + ] + ], + Field(description="Type of the parent component", title="Parent Type"), + ] = None + partNumber: Annotated[ + Optional[str], + Field( + description="The discovered part number of this component", + title="Part Number", + ), + ] = None + removable: Annotated[ + Optional[bool], + Field( + description="Indicates if this component is removable", title="Removable" + ), + ] = None + serialNumber: Annotated[ + Optional[str], + Field( + description="The discovered serial number of this component", + title="Serial Number", + ), + ] = None + slot: Annotated[ + Optional[str], + Field( + description="Slot this component resides in, unset for components that do not have a slot or ID", + title="Slot", + ), + ] = None + target: Annotated[ + Optional[str], + Field(description="Target this component resides on.", title="Target"), + ] = None + type: Annotated[ + Optional[str], + Field(description="Component type, as provided by the target", title="Type"), + ] = None + + +class InterfaceModule(BaseModel): + """ + InterfaceModule is the Schema for the interfacemodules API + """ + + apiVersion: str + kind: str + metadata: InterfaceModuleMetadata + spec: Annotated[ + Dict[str, Any], + Field( + description="InterfaceModuleSpec defines the desired state of InterfaceModule", + title="Specification", + ), + ] + status: Annotated[ + Optional[InterfaceModuleStatus], + Field( + description="InterfaceModuleStatus defines the observed state of InterfaceModule", + title="Status", + ), + ] = None + + +class InterfaceModuleList(BaseModel): + """ + InterfaceModuleList is a list of interfacemodules + """ + + apiVersion: str + items: Optional[List[InterfaceModule]] = None + kind: str + + +InterfaceModuleMetadata = ChassisMetadata + + +class InterfaceModuleStatus(BaseModel): + """ + InterfaceModuleStatus defines the observed state of InterfaceModule + """ + + commonLanguageEquipmentIdentifier: Annotated[ + Optional[str], + Field(description="The CLEI code of this component", title="CLEI Code"), + ] = None + lastBooted: Annotated[ + Optional[date], + Field( + description="The date and time this component last booted", + title="Last Booted", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The date and time this component last changed operational state", + title="Last Change", + ), + ] = None + locatorEnabled: Annotated[ + Optional[bool], + Field( + description="Indicates if the locator LED for the component is active", + title="Locator Enabled", + ), + ] = None + manufacturedDate: Annotated[ + Optional[date], + Field( + description="The date this component was manufactured", + title="Manufactured Date", + ), + ] = None + operationalState: Annotated[ + Optional[Literal["Up", "Down", "Rebooting", "Unknown", "Starting", "Empty"]], + Field( + description="Indicates the current operational state of this component.", + title="Operational State", + ), + ] = None + parent: Annotated[ + Optional[str], + Field(description="Reference to a parent component", title="Parent"), + ] = None + parentType: Annotated[ + Optional[ + Literal[ + "Fan", + "FanTray", + "PowerSupply", + "PowerModule", + "PowerShelf", + "InterfaceModule", + "ControlModule", + "FabricModule", + "Chassis", + "Transceiver", + ] + ], + Field(description="Type of the parent component", title="Parent Type"), + ] = None + partNumber: Annotated[ + Optional[str], + Field( + description="The discovered part number of this component", + title="Part Number", + ), + ] = None + removable: Annotated[ + Optional[bool], + Field( + description="Indicates if this component is removable", title="Removable" + ), + ] = None + serialNumber: Annotated[ + Optional[str], + Field( + description="The discovered serial number of this component", + title="Serial Number", + ), + ] = None + slot: Annotated[ + Optional[str], + Field( + description="Slot this component resides in, unset for components that do not have a slot or ID", + title="Slot", + ), + ] = None + softwareVersion: Annotated[ + Optional[str], + Field( + description="Version string of the software running on this component", + title="Software Version", + ), + ] = None + target: Annotated[ + Optional[str], + Field(description="Target this component resides on.", title="Target"), + ] = None + temperature: Annotated[ + Optional[InterfaceModuleStatusTemperature], + Field( + description="Temperature information for this component", + title="Temperature", + ), + ] = None + type: Annotated[ + Optional[str], + Field(description="Component type, as provided by the target", title="Type"), + ] = None + + +InterfaceModuleStatusTemperature = ControlModuleStatusTemperature + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Monitor(BaseModel): + """ + Monitor is the Schema for the monitors API + """ + + apiVersion: str + kind: str + metadata: MonitorMetadata + spec: Annotated[ + MonitorSpec, + Field( + description="MonitorSpec defines the desired state of Monitor", + title="Specification", + ), + ] + status: Annotated[ + Optional[MonitorStatus], + Field( + description="MonitorStatus defines the observed state of Monitor", + title="Status", + ), + ] = None + + +class MonitorDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class MonitorDeletedResources(RootModel[List[MonitorDeletedResourceEntry]]): + root: List[MonitorDeletedResourceEntry] + + +class MonitorList(BaseModel): + """ + MonitorList is a list of monitors + """ + + apiVersion: str + items: Optional[List[Monitor]] = None + kind: str + + +MonitorMetadata = ChassisMetadata + + +class MonitorSpec(BaseModel): + """ + MonitorSpec defines the desired state of Monitor + """ + + cpu: Annotated[ + Optional[MonitorSpecCpu], + Field( + description="CPU monitoring for targets matching this Monitor.", title="CPU" + ), + ] = None + memory: Annotated[ + Optional[MonitorSpecMemory], + Field( + description="Memory monitoring for targets matching this Monitor.", + title="Memory", + ), + ] = None + targetSelector: Annotated[ + Optional[List[str]], + Field( + description="Selector to use when including targets to monitor.", + title="Target Selector", + ), + ] = None + targets: Annotated[ + Optional[List[str]], + Field(description="References to targets to monitor.", title="Targets"), + ] = None + volume: Annotated[ + Optional[MonitorSpecVolume], + Field( + description="Volume monitoring for targets matching this Monitor.", + title="Volume", + ), + ] = None + + +class MonitorSpecCpu(BaseModel): + """ + CPU monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable CPU monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorSpecCpuUtilization], + Field( + description="Parameters relating to CPU utilization monitoring.", + title="Thresholds", + ), + ] = None + + +class MonitorSpecCpuUtilization(BaseModel): + """ + Parameters relating to CPU utilization monitoring. + """ + + criticalThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.", + ge=1, + le=100, + title="Critical Threshold", + ), + ] = 95 + fallingDelta: Annotated[ + Optional[int], + Field( + description="The delta in which a triggered threshold must drop below to clear an alarm.\nFor example, with a criticalThreshold of 90 and a fallingDelta of 5, the critical alarm will clear when the utilization drops below 85.", + ge=1, + le=25, + title="Falling Delta", + ), + ] = 5 + majorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.", + ge=1, + le=100, + title="Major Threshold", + ), + ] = 90 + minorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a minor alarm.", + ge=1, + le=100, + title="Minor Threshold", + ), + ] = 80 + + +class MonitorSpecMemory(BaseModel): + """ + Memory monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable memory monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorSpecMemoryUtilization], + Field( + description="Parameters relating to memory utilization monitoring.", + title="Thresholds", + ), + ] = None + + +class MonitorSpecMemoryUtilization(BaseModel): + """ + Parameters relating to memory utilization monitoring. + """ + + criticalThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.", + ge=1, + le=100, + title="Critical Threshold", + ), + ] = 95 + fallingDelta: Annotated[ + Optional[int], + Field( + description="The delta in which a triggered threshold must drop below to clear an alarm.\nFor example, with a criticalThreshold of 90 and a fallingDelta of 5, the critical alarm will clear when the utilization drops below 85.", + ge=1, + le=25, + title="Falling Delta", + ), + ] = 5 + majorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.", + ge=1, + le=100, + title="Major Threshold", + ), + ] = 90 + minorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a minor alarm.", + ge=1, + le=100, + title="Minor Threshold", + ), + ] = 80 + + +class MonitorSpecVolume(BaseModel): + """ + Volume monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable volume monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorSpecVolumeUtilization], + Field( + description="Parameters relating to volume utilization monitoring.", + title="Thresholds", + ), + ] = None + + +class MonitorSpecVolumeUtilization(BaseModel): + """ + Parameters relating to volume utilization monitoring. + """ + + criticalThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.", + ge=1, + le=100, + title="Critical Threshold", + ), + ] = 95 + fallingDelta: Annotated[ + Optional[int], + Field( + description="The delta in which a triggered threshold must drop below to clear an alarm.\nFor example, with a criticalThreshold of 90 and a fallingDelta of 5, the critical alarm will clear when the utilization drops below 85.", + ge=1, + le=25, + title="Falling Delta", + ), + ] = 5 + majorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.", + ge=1, + le=100, + title="Major Threshold", + ), + ] = 90 + minorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a minor alarm.", + ge=1, + le=100, + title="Minor Threshold", + ), + ] = 80 + + +class MonitorStatus(BaseModel): + """ + MonitorStatus defines the observed state of Monitor + """ + + targets: Annotated[ + Optional[List[str]], + Field(description="Targets being monitored.", title="Targets"), + ] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class PowerSupply(BaseModel): + """ + PowerSupply is the Schema for the powersupplies API + """ + + apiVersion: str + kind: str + metadata: PowerSupplyMetadata + spec: Annotated[ + PowerSupplySpec, + Field( + description="PowerSupplySpec defines the desired state of PowerSupply", + title="Specification", + ), + ] + status: Annotated[ + Optional[PowerSupplyStatus], + Field( + description="PowerSupplyStatus defines the observed state of PowerSupply", + title="Status", + ), + ] = None + + +class PowerSupplyList(BaseModel): + """ + PowerSupplyList is a list of powersupplies + """ + + apiVersion: str + items: Optional[List[PowerSupply]] = None + kind: str + + +PowerSupplyMetadata = ChassisMetadata + + +class PowerSupplySpec(BaseModel): + """ + PowerSupplySpec defines the desired state of PowerSupply + """ + + foo: Annotated[ + str, + Field( + description='INSERT ADDITIONAL SPEC FIELDS - define desired state of cluster\nImportant: Run "edabuilder generate" to regenerate code after modifying this file' + ), + ] + + +class PowerSupplyStatus(BaseModel): + """ + PowerSupplyStatus defines the observed state of PowerSupply + """ + + commonLanguageEquipmentIdentifier: Annotated[ + Optional[str], + Field(description="The CLEI code of this component", title="CLEI Code"), + ] = None + lastBooted: Annotated[ + Optional[date], + Field( + description="The date and time this component last booted", + title="Last Booted", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The date and time this component last changed operational state", + title="Last Change", + ), + ] = None + locatorEnabled: Annotated[ + Optional[bool], + Field( + description="Indicates if the locator LED for the component is active", + title="Locator Enabled", + ), + ] = None + manufacturedDate: Annotated[ + Optional[date], + Field( + description="The date this component was manufactured", + title="Manufactured Date", + ), + ] = None + operationalState: Annotated[ + Optional[Literal["Up", "Down", "Rebooting", "Unknown", "Starting", "Empty"]], + Field( + description="Indicates the current operational state of this component.", + title="Operational State", + ), + ] = None + parent: Annotated[ + Optional[str], + Field(description="Reference to a parent component", title="Parent"), + ] = None + parentType: Annotated[ + Optional[ + Literal[ + "Fan", + "FanTray", + "PowerSupply", + "PowerModule", + "PowerShelf", + "InterfaceModule", + "ControlModule", + "FabricModule", + "Chassis", + "Transceiver", + ] + ], + Field(description="Type of the parent component", title="Parent Type"), + ] = None + partNumber: Annotated[ + Optional[str], + Field( + description="The discovered part number of this component", + title="Part Number", + ), + ] = None + removable: Annotated[ + Optional[bool], + Field( + description="Indicates if this component is removable", title="Removable" + ), + ] = None + serialNumber: Annotated[ + Optional[str], + Field( + description="The discovered serial number of this component", + title="Serial Number", + ), + ] = None + slot: Annotated[ + Optional[str], + Field( + description="Slot this component resides in, unset for components that do not have a slot or ID", + title="Slot", + ), + ] = None + softwareVersion: Annotated[ + Optional[str], + Field( + description="Version string of the software running on this component", + title="Software Version", + ), + ] = None + target: Annotated[ + Optional[str], + Field(description="Target this component resides on.", title="Target"), + ] = None + temperature: Annotated[ + Optional[PowerSupplyStatusTemperature], + Field( + description="Temperature information for this component", + title="Temperature", + ), + ] = None + type: Annotated[ + Optional[str], + Field(description="Component type, as provided by the target", title="Type"), + ] = None + + +PowerSupplyStatusTemperature = ControlModuleStatusTemperature + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/config/v1alpha1/models.py b/pydantic_eda/apps/config/v1alpha1/models.py new file mode 100644 index 0000000..9e3e83a --- /dev/null +++ b/pydantic_eda/apps/config/v1alpha1/models.py @@ -0,0 +1,279 @@ +# generated by datamodel-codegen: +# filename: config.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class Configlet(BaseModel): + """ + Configlet is the Schema for the configlets API + """ + + apiVersion: str + kind: str + metadata: ConfigletMetadata + spec: Annotated[ + ConfigletSpec, + Field( + description="Configlet is a configuration snippet that can be applied to a set of targets.\nThe path on the target is provided in jspath notation, and the configuration is provided as a JSON string.\nConfiglets can be applied to a set of targets based on a label selector, a list of targets, or a combination of both.", + title="Specification", + ), + ] + status: Annotated[ + Optional[ConfigletStatus], + Field(description="Deployment status of this Configlet.", title="Status"), + ] = None + + +class ConfigletDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class ConfigletDeletedResources(RootModel[List[ConfigletDeletedResourceEntry]]): + root: List[ConfigletDeletedResourceEntry] + + +class ConfigletList(BaseModel): + """ + ConfigletList is a list of configlets + """ + + apiVersion: str + items: Optional[List[Configlet]] = None + kind: str + + +class ConfigletMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class ConfigletSpec(BaseModel): + """ + Configlet is a configuration snippet that can be applied to a set of targets. + The path on the target is provided in jspath notation, and the configuration is provided as a JSON string. + Configlets can be applied to a set of targets based on a label selector, a list of targets, or a combination of both. + """ + + configs: Annotated[ + List[ConfigletSpecConfig], + Field( + description="Configurations to apply, being sets of paths, operations and JSON configurations.", + title="Configurations", + ), + ] + endpointSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector to use to match targets to deploy Configlet to.", + title="Target Selector", + ), + ] = None + endpoints: Annotated[ + Optional[List[str]], + Field( + description="Reference to targets to deploy Configlet to.", title="Targets" + ), + ] = None + operatingSystem: Annotated[ + Optional[Literal["srl", "sros"]], + Field( + description="Operating system to match against when selecting targets.", + title="Operating System", + ), + ] = None + priority: Annotated[ + Optional[int], + Field( + description="Priority of this Configlet, between -100 and 100. Higher priorities overwrite lower priorities in the event of conflicts.", + ge=-100, + le=100, + title="Priority", + ), + ] = 0 + version: Annotated[ + Optional[str], + Field( + description="Version to match against when selecting targets.", + title="Version", + ), + ] = None + + +class ConfigletSpecConfig(BaseModel): + config: Annotated[ + str, + Field( + description="JSON-formatted string representing the configuration to apply.", + title="Configuration", + ), + ] + operation: Annotated[ + Literal["Create", "Update", "Delete"], + Field( + description="Indicates the operation in which to apply the configuration.", + title="Operation", + ), + ] + path: Annotated[ + str, + Field( + description="Path to apply the configuration in jspath notation, including any keys if relevant, e.g. .system.information.", + title="Path", + ), + ] + + +class ConfigletStatus(BaseModel): + """ + Deployment status of this Configlet. + """ + + endpoints: Annotated[ + Optional[List[str]], + Field( + description="List of targets this configlet has been applied to.", + title="Targets", + ), + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/core/v1/models.py b/pydantic_eda/apps/core/v1/models.py new file mode 100644 index 0000000..363f628 --- /dev/null +++ b/pydantic_eda/apps/core/v1/models.py @@ -0,0 +1,2642 @@ +# generated by datamodel-codegen: +# filename: core.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel, SecretStr +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ClusterRole(BaseModel): + """ + ClusterRole is the Schema for the clusterroles API + """ + + apiVersion: str + kind: str + metadata: ClusterRoleMetadata + spec: Annotated[ + ClusterRoleSpec, + Field( + description="ClusterRole defines a set of permissions to access EDA resources.\nClusterRoles and users are bound via groups, selecting a set of users and a set of ClusterRoles to bind.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="RoleStatus defines the observed state of Role", title="Status" + ), + ] = None + + +class ClusterRoleDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + transactionId: Optional[int] = None + + +class ClusterRoleDeletedResources(RootModel[List[ClusterRoleDeletedResourceEntry]]): + root: List[ClusterRoleDeletedResourceEntry] + + +class ClusterRoleList(BaseModel): + """ + ClusterRoleList is a list of clusterroles + """ + + apiVersion: str + items: Optional[List[ClusterRole]] = None + kind: str + + +class ClusterRoleMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + + +class ClusterRoleSpec(BaseModel): + """ + ClusterRole defines a set of permissions to access EDA resources. + ClusterRoles and users are bound via groups, selecting a set of users and a set of ClusterRoles to bind. + """ + + description: Annotated[ + Optional[str], + Field(description="A description for the role.", title="Description"), + ] = None + resourceRules: Annotated[ + Optional[List[ClusterRoleSpecResourceRule]], + Field(description="Rules for access to resources.", title="Resource Rules"), + ] = None + tableRules: Annotated[ + Optional[List[ClusterRoleSpecTableRule]], + Field( + description="Rules for access to EDB tables, including via EQL.", + title="Table Rules", + ), + ] = None + urlRules: Annotated[ + Optional[List[ClusterRoleSpecUrlRule]], + Field( + description="Rules for access to APIServer proxied routes.", + title="URL Rules", + ), + ] = None + + +class ClusterRoleSpecResourceRule(BaseModel): + """ + A role rule controlling access to a kubernetes resource. + """ + + apiGroups: Annotated[ + List[ClusterRoleSpecResourceRuleApiGroup], + Field( + description='The API groups for the resources controlled by the rule.\nAn API group consists of an apiGroup and a version, e.g. "apigroup/version".\nThe API group can be a wildcard ("*"), in which case it will match any API group.', + min_length=1, + title="API Groups", + ), + ] + permissions: Annotated[ + Literal["none", "read", "readWrite"], + Field( + description="Permissions for resources specified by the rule.", + title="Permissions", + ), + ] + resources: Annotated[ + List[ClusterRoleSpecResourceRuleResource], + Field( + description='Names for the resources controlled by the rule.\nIt can be a wildcard ("*"), in which case it will match any resource\nin the matching API groups.', + min_length=1, + title="Resources", + ), + ] + + +class ClusterRoleSpecResourceRuleApiGroup(RootModel[str]): + root: Annotated[str, Field(min_length=1)] + + +class ClusterRoleSpecResourceRuleResource(ClusterRoleSpecResourceRuleApiGroup): + pass + + +class ClusterRoleSpecTableRule(BaseModel): + """ + A role rule controlling access to a EDB table. Note that + there is never write access to EDB. + """ + + path: Annotated[ + str, + Field( + description='EDB path to which this rule applies. It can end in ".*"\nin which case the final portion of the table path can be anything, if the\nprefix matches. It can end in ".**" in which case the table path can be\nanything if the prefix matches.', + min_length=1, + pattern="^\\..*", + title="Path", + ), + ] + permissions: Annotated[ + Literal["none", "read"], + Field(description="Permissions for the given EDB path.", title="Permissions"), + ] + + +class ClusterRoleSpecUrlRule(BaseModel): + """ + A role rule controlling access to an API server proxy. + """ + + path: Annotated[ + str, + Field( + description='The API server URL path to which this rule applies. It can end in "/*"\nin which case the final portion of the URL path can be anything, if the\nprefix matches. It can end in "/**" in which case the URL path can be\nanything if the prefix matches.', + min_length=1, + pattern="^/.*", + title="Path", + ), + ] + permissions: Annotated[ + Literal["none", "read", "readWrite"], + Field( + description="The permissions for the API server URL for the rule.", + title="Permissions", + ), + ] + + +class Deviation(BaseModel): + """ + Deviation is the Schema for the deviations API + """ + + apiVersion: str + kind: str + metadata: DeviationMetadata + spec: Annotated[ + DeviationSpec, + Field( + description="Deviations are used to represent differences between the intended and actual state of a target.\nThey indicate the intended state - or the computed configuration EDA expects, and compare this to the actual or running state, or the configuration retrieved from the target.\nDeviations are most often generated by out-of-band changes to a target by an external system or user, and\ncan be accepted or rejected. Rejecting a Deviation will result in the intended configuration being re-applied, undoing the out-of-band change.\nDeviations are raised per table, meaning a single change on a target may result in more than one Deviation.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="DeviationStatus defines the observed state of Deviation", + title="Status", + ), + ] = None + + +class DeviationAction(BaseModel): + """ + DeviationAction is the Schema for the deviationactions API + """ + + apiVersion: str + kind: str + metadata: DeviationActionMetadata + spec: Annotated[ + DeviationActionSpec, + Field( + description="DeviationAction allows manual and API-driven actions to be performed on Deviation resources.\nThey are the only means to which and end user can accept or reject deviations, as Deviation resources themselves are read only.", + title="Specification", + ), + ] + status: Annotated[ + Optional[DeviationActionStatus], + Field( + description="DeviationActionStatus defines the observed state of DeviationAction", + title="Status", + ), + ] = None + + +class DeviationActionDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class DeviationActionDeletedResources( + RootModel[List[DeviationActionDeletedResourceEntry]] +): + root: List[DeviationActionDeletedResourceEntry] + + +class DeviationActionList(BaseModel): + """ + DeviationActionList is a list of deviationactions + """ + + apiVersion: str + items: Optional[List[DeviationAction]] = None + kind: str + + +class DeviationActionMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class DeviationActionSpec(BaseModel): + """ + DeviationAction allows manual and API-driven actions to be performed on Deviation resources. + They are the only means to which and end user can accept or reject deviations, as Deviation resources themselves are read only. + """ + + actions: Annotated[ + List[DeviationActionSpecAction], + Field( + description="The set of actions to perform on the target.", title="Actions" + ), + ] + nodeEndpoint: Annotated[ + str, + Field( + description="The target on which this action is to be performed.", + title="Target", + ), + ] + + +class DeviationActionSpecAction(BaseModel): + action: Annotated[ + Literal["setAccept", "clearAccept", "reject"], + Field(description="Action to perform on matching Deviations.", title="Action"), + ] + path: Annotated[ + str, + Field( + description="Path to match Deviation resources on this target. Only one action is allowed per path.", + title="Path", + ), + ] + recurse: Annotated[ + Optional[bool], + Field( + description="Recursively accept/reject Deviations from the specified path.", + title="Recurse", + ), + ] = None + + +class DeviationActionStatus(BaseModel): + """ + DeviationActionStatus defines the observed state of DeviationAction + """ + + result: Annotated[ + Optional[Literal["OK", "Failed"]], + Field(description="The result of the set of actions.", title="Result"), + ] = None + transactionId: Annotated[ + Optional[int], + Field( + description="The transaction id these actions were part of.", + title="Transaction Id", + ), + ] = None + + +class DeviationList(BaseModel): + """ + DeviationList is a list of deviations + """ + + apiVersion: str + items: Optional[List[Deviation]] = None + kind: str + + +DeviationMetadata = DeviationActionMetadata + + +class DeviationSpec(BaseModel): + """ + Deviations are used to represent differences between the intended and actual state of a target. + They indicate the intended state - or the computed configuration EDA expects, and compare this to the actual or running state, or the configuration retrieved from the target. + Deviations are most often generated by out-of-band changes to a target by an external system or user, and + can be accepted or rejected. Rejecting a Deviation will result in the intended configuration being re-applied, undoing the out-of-band change. + Deviations are raised per table, meaning a single change on a target may result in more than one Deviation. + """ + + accepted: Annotated[ + Optional[bool], + Field( + description="Indicates whether this Deviation has been accepted.", + title="Accepted", + ), + ] = None + associatedCrs: Annotated[ + Optional[List[DeviationSpecAssociatedCr]], + Field( + description="Resources impacted by this Deviation.", + title="Associated Resources", + ), + ] = None + intendedValues: Annotated[ + Optional[str], + Field( + description="JSON object containing intended values of fields at the specified path.", + title="Intended Values", + ), + ] = None + nodeEndpoint: Annotated[ + str, + Field(description="Target on which this Deviation is present.", title="Target"), + ] + operation: Annotated[ + Literal["create", "delete"], + Field( + description="Indicates the operation in this Deviation.", title="Operation" + ), + ] + path: Annotated[ + str, + Field( + description='Path on the target this Deviation is present at. This path is relative to the target\'s root, without any EDA prefixes - for example ".system" rather than ".namespace.node.srl.system".', + title="Path", + ), + ] + runningValues: Annotated[ + Optional[str], + Field( + description="JSON object containing running values of fields at the specified path.", + title="Running Values", + ), + ] = None + + +class DeviationSpecAssociatedCr(BaseModel): + groupVersion: Annotated[ + str, + Field( + description="Group and version of the resource.", title="Group + Version" + ), + ] + kind: Annotated[str, Field(description="Kind of the resource.", title="Kind")] + name: Annotated[str, Field(description="Name of the resource.", title="Name")] + + +class EdgeInterface(BaseModel): + """ + EdgeInterface is the Schema for the edgeinterfaces API + """ + + apiVersion: str + kind: str + metadata: EdgeInterfaceMetadata + spec: Annotated[ + EdgeInterfaceSpec, + Field( + description="EdgeInterfaceSpec defines the desired state of EdgeInterface", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="EdgeInterfaceStatus defines the observed state of EdgeInterface", + title="Status", + ), + ] = None + + +EdgeInterfaceDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class EdgeInterfaceDeletedResources(RootModel[List[EdgeInterfaceDeletedResourceEntry]]): + root: List[EdgeInterfaceDeletedResourceEntry] + + +class EdgeInterfaceList(BaseModel): + """ + EdgeInterfaceList is a list of edgeinterfaces + """ + + apiVersion: str + items: Optional[List[EdgeInterface]] = None + kind: str + + +EdgeInterfaceMetadata = DeviationActionMetadata + + +class EdgeInterfaceSpec(BaseModel): + """ + EdgeInterfaceSpec defines the desired state of EdgeInterface + """ + + bridgeDomain: Annotated[ + Optional[str], + Field(description="Reference to a Bridge Domain", title="bridgeDomain"), + ] = None + encapType: Annotated[ + Literal["null", "dot1q"], + Field( + description="Indicates if the EdgeInterface uses VLAN tagging", + title="Encapsulation", + ), + ] + gatewayIPV4Addresses: Annotated[ + Optional[List[EdgeInterfaceSpecGatewayIPV4Address]], + Field( + description="List of gateway IPv4 addresses in ip/mask form - e.g. 192.168.0.1/24", + title="Gateway IPv4 Addresses", + ), + ] = None + gatewayIPV6Addresses: Annotated[ + Optional[List[EdgeInterfaceSpecGatewayIPV6Address]], + Field( + description="List of gateway IPv6 addresses in ip/mask form - e.g. fc00::1/120", + title="Gateway IPv6 Addresses", + ), + ] = None + interfaceResource: Annotated[ + str, Field(description="Reference to an interface", title="Interface Resource") + ] + router: Annotated[ + Optional[str], Field(description="Reference to a Router", title="Router") + ] = None + vlanID: Annotated[ + Optional[int], + Field( + description="Single value between 0-4094 supported", + ge=0, + le=4094, + title="VLAN ID", + ), + ] = None + + +class EdgeInterfaceSpecGatewayIPV4Address(BaseModel): + ipPrefix: Annotated[ + str, Field(description="Address and mask to use", title="IP Prefix") + ] + primary: Annotated[ + Optional[bool], + Field( + description="Indicates which address to use as primary for broadcast", + title="Primary", + ), + ] = None + + +EdgeInterfaceSpecGatewayIPV6Address = EdgeInterfaceSpecGatewayIPV4Address + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class HttpProxy(BaseModel): + """ + HttpProxy is the Schema for the httpproxies API + """ + + apiVersion: str + kind: str + metadata: HttpProxyMetadata + spec: Annotated[ + HttpProxySpec, + Field( + description="HttpProxySpec defines the desired state of HttpProxy", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="HttpProxyStatus defines the observed state of HttpProxy", + title="Status", + ), + ] = None + + +HttpProxyDeletedResourceEntry = ClusterRoleDeletedResourceEntry + + +class HttpProxyDeletedResources(RootModel[List[HttpProxyDeletedResourceEntry]]): + root: List[HttpProxyDeletedResourceEntry] + + +class HttpProxyList(BaseModel): + """ + HttpProxyList is a list of httpproxies + """ + + apiVersion: str + items: Optional[List[HttpProxy]] = None + kind: str + + +HttpProxyMetadata = ClusterRoleMetadata + + +class HttpProxySpec(BaseModel): + """ + HttpProxySpec defines the desired state of HttpProxy + """ + + authType: Annotated[ + Literal["atDestination", "inApiServer"], + Field( + description='Determines where authentication happens.\nIf "atDestination", then no authentication happens in API server and any auth tokens are forwarded as is.\nIf "inApiServer", then authentication happens within the API server and auth tokens are stripped prior to forwarding.', + title="Authentication Type", + ), + ] + rootUrl: Annotated[ + str, + Field( + description="The proxy destination, including the protocol.", title="Git" + ), + ] + + +class IPAllocationPool(BaseModel): + """ + IPAllocationPool is the Schema for the ipallocationpools API + """ + + apiVersion: str + kind: str + metadata: IPAllocationPoolMetadata + spec: Annotated[ + IPAllocationPoolSpec, + Field( + description="IPAllocationPool is a generic IP allocation pool supporting allocation of IPv4 and/or IPv6 addresses from a set of segments.\nIt is different from IPInSubnetAllocationPool in that it returns a single unzoned IP address, i.e. an IP address without a subnet. For example a 10.1.1.0/24 segment could return 10.1.1.1.\nConsult application documentation to know which pool type to use for a given use case.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="IPAllocationPoolStatus defines the observed state of IPAllocationPool", + title="Status", + ), + ] = None + + +IPAllocationPoolDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class IPAllocationPoolDeletedResources( + RootModel[List[IPAllocationPoolDeletedResourceEntry]] +): + root: List[IPAllocationPoolDeletedResourceEntry] + + +class IPAllocationPoolList(BaseModel): + """ + IPAllocationPoolList is a list of ipallocationpools + """ + + apiVersion: str + items: Optional[List[IPAllocationPool]] = None + kind: str + + +IPAllocationPoolMetadata = DeviationActionMetadata + + +class IPAllocationPoolSpec(BaseModel): + """ + IPAllocationPool is a generic IP allocation pool supporting allocation of IPv4 and/or IPv6 addresses from a set of segments. + It is different from IPInSubnetAllocationPool in that it returns a single unzoned IP address, i.e. an IP address without a subnet. For example a 10.1.1.0/24 segment could return 10.1.1.1. + Consult application documentation to know which pool type to use for a given use case. + """ + + publishAllocations: Annotated[ + Optional[bool], + Field( + description="If true, allocations in segments will be published to EDB, available to query via EQL and trigger state applications off of.", + title="Publish Allocations", + ), + ] = None + segments: Annotated[ + List[IPAllocationPoolSpecSegment], + Field( + description="List of segments containing IPv4 or IPv6 addresses to allocate.", + min_length=1, + title="Segments", + ), + ] + + +class IPAllocationPoolSpecSegment(BaseModel): + allocations: Annotated[ + Optional[List[IPAllocationPoolSpecSegmentAllocation]], + Field( + description="List of reservations to exclude from allocations from this segment.", + title="Allocations", + ), + ] = None + reservations: Annotated[ + Optional[List[IPAllocationPoolSpecSegmentReservation]], + Field( + description="List of ranges to exclude from allocations from this segment.", + title="Reservations", + ), + ] = None + subnet: Annotated[ + str, Field(description="IPv4 or IPv6 subnet, e.g. 10.1.1.0/24.", title="Subnet") + ] + + +class IPAllocationPoolSpecSegmentAllocation(BaseModel): + name: Annotated[str, Field(description="Name of this allocation.", title="Name")] + value: Annotated[str, Field(description="Allocation to reserve.", title="Value")] + + +class IPAllocationPoolSpecSegmentReservation(BaseModel): + end: Annotated[str, Field(description="Value to reserve to.", title="End")] + start: Annotated[str, Field(description="Value to start reserving.", title="Start")] + + +class IPInSubnetAllocationPool(BaseModel): + """ + IPInSubnetAllocationPool is the Schema for the ipinsubnetallocationpools API + """ + + apiVersion: str + kind: str + metadata: IPInSubnetAllocationPoolMetadata + spec: Annotated[ + IPInSubnetAllocationPoolSpec, + Field( + description="IPInSubnetAllocationPool is a generic IP allocation pool supporting allocation of IPv4 and/or IPv6 addresses from a set of segments.\nIt is different from IPAllocationPool in that it returns a single zoned IP address, i.e. an IP address with a subnet. For example a 10.1.1.0/24 segment could return 10.1.1.1/24.\nConsult application documentation to know which pool type to use for a given use case.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="IPInSubnetAllocationPoolStatus defines the observed state of IPInSubnetAllocationPool", + title="Status", + ), + ] = None + + +IPInSubnetAllocationPoolDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class IPInSubnetAllocationPoolDeletedResources( + RootModel[List[IPInSubnetAllocationPoolDeletedResourceEntry]] +): + root: List[IPInSubnetAllocationPoolDeletedResourceEntry] + + +class IPInSubnetAllocationPoolList(BaseModel): + """ + IPInSubnetAllocationPoolList is a list of ipinsubnetallocationpools + """ + + apiVersion: str + items: Optional[List[IPInSubnetAllocationPool]] = None + kind: str + + +IPInSubnetAllocationPoolMetadata = DeviationActionMetadata + + +class IPInSubnetAllocationPoolSpec(BaseModel): + """ + IPInSubnetAllocationPool is a generic IP allocation pool supporting allocation of IPv4 and/or IPv6 addresses from a set of segments. + It is different from IPAllocationPool in that it returns a single zoned IP address, i.e. an IP address with a subnet. For example a 10.1.1.0/24 segment could return 10.1.1.1/24. + Consult application documentation to know which pool type to use for a given use case. + """ + + publishAllocations: Annotated[ + Optional[bool], + Field( + description="If true, allocations in segments will be published to EDB, available to query via EQL and trigger state applications off of.", + title="Publish Allocations", + ), + ] = None + segments: Annotated[ + List[IPInSubnetAllocationPoolSpecSegment], + Field( + description="List of segments containing IPv4 or IPv6 addresses to allocate.", + min_length=1, + title="Segments", + ), + ] + + +class IPInSubnetAllocationPoolSpecSegment(BaseModel): + allocations: Annotated[ + Optional[List[IPInSubnetAllocationPoolSpecSegmentAllocation]], + Field( + description="List of reservations to exclude from allocations from this segment.", + title="Allocations", + ), + ] = None + reservations: Annotated[ + Optional[List[IPInSubnetAllocationPoolSpecSegmentReservation]], + Field( + description="List of ranges to exclude from allocations from this segment.", + title="Reservations", + ), + ] = None + subnet: Annotated[ + str, Field(description="IPv4 or IPv6 subnet, e.g. 10.1.1.0/24.", title="Subnet") + ] + + +IPInSubnetAllocationPoolSpecSegmentAllocation = IPAllocationPoolSpecSegmentAllocation + + +IPInSubnetAllocationPoolSpecSegmentReservation = IPAllocationPoolSpecSegmentReservation + + +class IndexAllocationPool(BaseModel): + """ + IndexAllocationPool is the Schema for the indexallocationpools API + """ + + apiVersion: str + kind: str + metadata: IndexAllocationPoolMetadata + spec: Annotated[ + IndexAllocationPoolSpec, + Field( + description="IndexAllocationPool is a generic allocation pool supporting allocation of indexes from a set of segments.\nIt supports allocating things like VLANs, subinterface indexes, autonomous system numbers, or any other integer-based index.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="IndexAllocationPoolStatus defines the observed state of IndexAllocationPool", + title="Status", + ), + ] = None + + +IndexAllocationPoolDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class IndexAllocationPoolDeletedResources( + RootModel[List[IndexAllocationPoolDeletedResourceEntry]] +): + root: List[IndexAllocationPoolDeletedResourceEntry] + + +class IndexAllocationPoolList(BaseModel): + """ + IndexAllocationPoolList is a list of indexallocationpools + """ + + apiVersion: str + items: Optional[List[IndexAllocationPool]] = None + kind: str + + +IndexAllocationPoolMetadata = DeviationActionMetadata + + +class IndexAllocationPoolSpec(BaseModel): + """ + IndexAllocationPool is a generic allocation pool supporting allocation of indexes from a set of segments. + It supports allocating things like VLANs, subinterface indexes, autonomous system numbers, or any other integer-based index. + """ + + publishAllocations: Annotated[ + Optional[bool], + Field( + description="If true, allocations in segments will be published to EDB, available to query via EQL and trigger state applications off of.", + title="Publish Allocations", + ), + ] = None + segments: Annotated[ + List[IndexAllocationPoolSpecSegment], + Field( + description="List of segments containing indexes to allocate.", + min_length=1, + title="Segments", + ), + ] + + +class IndexAllocationPoolSpecSegment(BaseModel): + allocations: Annotated[ + Optional[List[IndexAllocationPoolSpecSegmentAllocation]], + Field( + description="List of reservations to exclude from allocations from this segment.", + title="Allocations", + ), + ] = None + reservations: Annotated[ + Optional[List[IndexAllocationPoolSpecSegmentReservation]], + Field( + description="Range of reservations to exclude from allocations from this segment.", + title="Reservations", + ), + ] = None + size: Annotated[ + int, Field(description="Number of elements in the segment.", title="Size") + ] + start: Annotated[ + int, Field(description="Starting value of the segment.", title="Start") + ] + + +class IndexAllocationPoolSpecSegmentAllocation(BaseModel): + name: Annotated[str, Field(description="Name of this allocation.", title="Name")] + value: Annotated[int, Field(description="Index to reserve.", title="Value")] + + +class IndexAllocationPoolSpecSegmentReservation(BaseModel): + end: Annotated[int, Field(description="Value to reserve to.", title="End")] + start: Annotated[int, Field(description="Value to start reserving.", title="Start")] + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class License(BaseModel): + """ + License is the Schema for the licenses API + """ + + apiVersion: str + kind: str + metadata: LicenseMetadata + spec: Annotated[ + LicenseSpec, + Field( + description='A License represents an application license providing functionality within EDA. A license providing the "base" feature must be provided/valid for transactions to be processed.', + title="Specification", + ), + ] + status: Annotated[ + Optional[LicenseStatus], + Field(description="Status information for this license.", title="Status"), + ] = None + + +class LicenseList(BaseModel): + """ + LicenseList is a list of licenses + """ + + apiVersion: str + items: Optional[List[License]] = None + kind: str + + +LicenseMetadata = ClusterRoleMetadata + + +class LicenseSpec(BaseModel): + """ + A License represents an application license providing functionality within EDA. A license providing the "base" feature must be provided/valid for transactions to be processed. + """ + + data: Annotated[ + str, + Field( + description="The license key. This is a base64 encoded string.", + title="Data", + ), + ] + enabled: Annotated[ + Optional[bool], + Field( + description="Indicates if this license is available for use.", + title="Enabled", + ), + ] = True + + +class LicenseStatus(BaseModel): + """ + Status information for this license. + """ + + comment: Annotated[ + Optional[str], + Field(description="Any comment provided in the license.", title="Comment"), + ] = None + expirationDate: Annotated[ + Optional[date], + Field( + description="Date and time the license expires.", title="Expiration Date" + ), + ] = None + expired: Annotated[ + bool, + Field(description="Indicates if the license has expired.", title="Expired"), + ] + issuedDate: Annotated[ + Optional[date], + Field(description="Date and time the license was issued.", title="Issued Date"), + ] = None + used: Annotated[ + bool, Field(description="Indicates if license has been used.", title="Used") + ] + valid: Annotated[ + bool, Field(description="Indicates if the license is valid.", title="Valid") + ] + + +class Namespace(BaseModel): + """ + Namespace is the Schema for the namespaces API + """ + + apiVersion: str + kind: str + metadata: NamespaceMetadata + spec: Annotated[ + NamespaceSpec, + Field( + description="A Namespace is a logical partition within the cluster that provides a mechanism for isolating resources.\nNamespaces allow for resource segmentation, enabling multiple teams or applications to share the same cluster without conflict.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="NamespaceStatus defines the observed state of Namespace", + title="Status", + ), + ] = None + + +NamespaceDeletedResourceEntry = ClusterRoleDeletedResourceEntry + + +class NamespaceDeletedResources(RootModel[List[NamespaceDeletedResourceEntry]]): + root: List[NamespaceDeletedResourceEntry] + + +class NamespaceList(BaseModel): + """ + NamespaceList is a list of namespaces + """ + + apiVersion: str + items: Optional[List[Namespace]] = None + kind: str + + +NamespaceMetadata = ClusterRoleMetadata + + +class NamespaceSpec(BaseModel): + """ + A Namespace is a logical partition within the cluster that provides a mechanism for isolating resources. + Namespaces allow for resource segmentation, enabling multiple teams or applications to share the same cluster without conflict. + """ + + description: Annotated[ + Optional[str], + Field( + description="An optional description of the use of the namespace.", + title="Description", + ), + ] = None + + +class NodeProfile(BaseModel): + """ + NodeProfile is the Schema for the nodeprofiles API + """ + + apiVersion: str + kind: str + metadata: NodeProfileMetadata + spec: Annotated[ + NodeProfileSpec, + Field( + description="NodeProfileSpec defines the desired state of NodeProfile", + title="Specification", + ), + ] + status: Annotated[Optional[Dict[str, Any]], Field(title="Status")] = None + + +NodeProfileDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class NodeProfileDeletedResources(RootModel[List[NodeProfileDeletedResourceEntry]]): + root: List[NodeProfileDeletedResourceEntry] + + +class NodeProfileList(BaseModel): + """ + NodeProfileList is a list of nodeprofiles + """ + + apiVersion: str + items: Optional[List[NodeProfile]] = None + kind: str + + +NodeProfileMetadata = DeviationActionMetadata + + +class NodeProfileSpec(BaseModel): + """ + NodeProfileSpec defines the desired state of NodeProfile + """ + + annotate: Annotated[ + Optional[bool], + Field( + description="Indicates if NPP should annotate sent configuration.", + title="Annotations", + ), + ] = False + containerImage: Annotated[ + Optional[str], + Field( + description="Container image to use when simulating TopoNodes referencing this NodeProfile, e.g. ghcr.io/nokia/srlinux:24.7.1.", + title="Container Image", + ), + ] = None + dhcp: Annotated[ + Optional[NodeProfileSpecDhcp], + Field( + description="DHCP options to use when onboarding the TopoNode. Optional if not bootstrapping using EDA.", + title="DHCP", + ), + ] = None + imagePullSecret: Annotated[ + Optional[str], + Field( + description="Secret used to authenticate to the container registry where the container image is hosted.", + title="Image Pull Secret", + ), + ] = None + images: Annotated[ + Optional[List[NodeProfileSpecImage]], + Field( + description="URLs hosting software images for bootstrapping TopoNodes referencing this NodeProfile.", + title="Images", + ), + ] = None + license: Annotated[ + Optional[str], + Field( + description="ConfigMap containing a license for TopoNodes referencing this NodeProfile.", + title="License", + ), + ] = None + llmDb: Annotated[ + Optional[str], + Field( + description="URL containing LLDB to use when interacting with LLM-DB and OpenAI for query autocompletion, e.g. http://eda-asvr/llmdb/ce-llm-db-srlinux-24.7.1.tar.gz.", + title="LLMDB", + ), + ] = None + nodeUser: Annotated[ + str, + Field( + description="Reference to a NodeUser to use for authentication to TopoNodes referencing this NodeProfile.", + title="Node User", + ), + ] + onboardingPassword: Annotated[ + Optional[SecretStr], + Field( + description="The password to use when onboarding TopoNodes referencing this NodeProfile, e.g. admin.", + title="Onboarding Password", + ), + ] = None + onboardingUsername: Annotated[ + Optional[str], + Field( + description="The username to use when onboarding TopoNodes referencing this NodeProfile, e.g. admin.", + title="Onboarding Username", + ), + ] = None + operatingSystem: Annotated[ + Literal["srl", "sros", "nxos"], + Field( + description="Sets the operating system of this NodeProfile, e.g. srl.", + title="Operating System", + ), + ] + platformPath: Annotated[ + Optional[str], + Field( + description="JSPath to use for retrieving the version string from TopoNodes referencing this NodeProfile, e.g. .platform.chassis.type.", + title="Platform Path", + ), + ] = None + port: Annotated[ + Optional[int], + Field( + description="Port used to establish a connection to the TopoNode, e.g. 57400.", + ge=1, + le=65535, + title="Port", + ), + ] = 57400 + serialNumberPath: Annotated[ + Optional[str], + Field( + description="JSPath to use for retrieving the serial number string from TopoNodes referencing this NodeProfile, e.g. .platform.chassis.serial-number.", + title="Serial Number Path", + ), + ] = None + version: Annotated[ + str, + Field( + description="Sets the software version of this NodeProfile, e.g. 24.7.1 (for srl), or 24.7.r1 (for sros).", + title="Version", + ), + ] + versionMatch: Annotated[ + Optional[str], + Field( + description="Regular expression to match the node-retrieved version string to TopoNode version, e.g. v0\\.0\\.0.*.", + title="Version Match", + ), + ] = None + versionPath: Annotated[ + Optional[str], + Field( + description="JSPath to use for retrieving the version string from TopoNodes referencing this NodeProfile, e.g. .system.information.version.", + title="Version Path", + ), + ] = None + yang: Annotated[ + str, + Field( + description="URL containing YANG modules and schema profile to use when interacting with TopoNodes referencing this NodeProfile, e.g. http://eda-asvr/schemaprofiles/srlinux-24.7.1.zip.", + title="YANG", + ), + ] + + +class NodeProfileSpecDhcp(BaseModel): + """ + DHCP options to use when onboarding the TopoNode. Optional if not bootstrapping using EDA. + """ + + dhcp4Options: Annotated[ + Optional[List[NodeProfileSpecDhcpDhcp4Option]], + Field( + description="DHCPv4 options to return to TopoNodes referencing this NodeProfile.", + title="DHCPv4 Options", + ), + ] = None + dhcp6Options: Annotated[ + Optional[List[NodeProfileSpecDhcpDhcp6Option]], + Field( + description="DHCPv6 options to return to TopoNodes referencing this NodeProfile.", + title="DHCPv6 Options", + ), + ] = None + managementPoolv4: Annotated[ + Optional[str], + Field( + description="IPInSubnetAllocationPool to use for IPv4 allocations of the management address for TopoNodes referencing this NodeProfile.", + title="Management Pool - IPv4", + ), + ] = None + managementPoolv6: Annotated[ + Optional[str], + Field( + description="IPInSubnetAllocationPool to use for IPv6 allocations of the management address for TopoNodes referencing this NodeProfile.", + title="Management Pool - IPv6", + ), + ] = None + preferredAddressFamily: Annotated[ + Optional[Literal["IPv4", "IPv6"]], + Field( + description="Preferred IP address family", title="Preferred Address Family" + ), + ] = None + + +class NodeProfileSpecDhcpDhcp4Option(BaseModel): + option: Annotated[ + Literal[ + "1-SubnetMask", + "2-TimeOffset", + "3-Router", + "4-TimeServer", + "5-NameServer", + "6-DomainNameServer", + "7-LogServer", + "8-QuoteServer", + "9-LPRServer", + "10-ImpressServer", + "11-ResourceLocationServer", + "12-HostName", + "13-BootFileSize", + "14-MeritDumpFile", + "15-DomainName", + "16-SwapServer", + "17-RootPath", + "18-ExtensionsPath", + "19-IPForwarding", + "20-NonLocalSourceRouting", + "21-PolicyFilter", + "22-MaximumDatagramAssemblySize", + "23-DefaultIPTTL", + "24-PathMTUAgingTimeout", + "25-PathMTUPlateauTable", + "26-InterfaceMTU", + "27-AllSubnetsAreLocal", + "28-BroadcastAddress", + "29-PerformMaskDiscovery", + "30-MaskSupplier", + "31-PerformRouterDiscovery", + "32-RouterSolicitationAddress", + "33-StaticRoutingTable", + "34-TrailerEncapsulation", + "35-ArpCacheTimeout", + "36-EthernetEncapsulation", + "37-DefaulTCPTTL", + "38-TCPKeepaliveInterval", + "39-TCPKeepaliveGarbage", + "40-NetworkInformationServiceDomain", + "41-NetworkInformationServers", + "42-NTPServers", + "43-VendorSpecificInformation", + "44-NetBIOSOverTCPIPNameServer", + "45-NetBIOSOverTCPIPDatagramDistributionServer", + "46-NetBIOSOverTCPIPNodeType", + "47-NetBIOSOverTCPIPScope", + "48-XWindowSystemFontServer", + "49-XWindowSystemDisplayManager", + "50-RequestedIPAddress", + "51-IPAddressLeaseTime", + "52-OptionOverload", + "53-DHCPMessageType", + "54-ServerIdentifier", + "55-ParameterRequestList", + "56-Message", + "57-MaximumDHCPMessageSize", + "58-RenewTimeValue", + "59-RebindingTimeValue", + "60-ClassIdentifier", + "61-ClientIdentifier", + "62-NetWareIPDomainName", + "63-NetWareIPInformation", + "64-NetworkInformationServicePlusDomain", + "65-NetworkInformationServicePlusServers", + "66-TFTPServerName", + "67-BootfileName", + "68-MobileIPHomeAgent", + "69-SimpleMailTransportProtocolServer", + "70-PostOfficeProtocolServer", + "71-NetworkNewsTransportProtocolServer", + "72-DefaultWorldWideWebServer", + "73-DefaultFingerServer", + "74-DefaultInternetRelayChatServer", + "75-StreetTalkServer", + "76-StreetTalkDirectoryAssistanceServer", + "77-UserClassInformation", + "78-SLPDirectoryAgent", + "79-SLPServiceScope", + "80-RapidCommit", + "81-FQDN", + "82-RelayAgentInformation", + "83-InternetStorageNameService", + "85-NDSServers", + "86-NDSTreeName", + "87-NDSContext", + "88-BCMCSControllerDomainNameList", + "89-BCMCSControllerIPv4AddressList", + "90-Authentication", + "91-ClientLastTransactionTime", + "92-AssociatedIP", + "93-ClientSystemArchitectureType", + "94-ClientNetworkInterfaceIdentifier", + "95-LDAP", + "97-ClientMachineIdentifier", + "98-OpenGroupUserAuthentication", + "99-GeoConfCivic", + "100-IEEE10031TZString", + "101-ReferenceToTZDatabase", + "112-NetInfoParentServerAddress", + "113-NetInfoParentServerTag", + "114-URL", + "116-AutoConfigure", + "117-NameServiceSearch", + "118-SubnetSelection", + "119-DNSDomainSearchList", + "120-SIPServers", + "121-ClasslessStaticRoute", + "122-CCC", + "123-GeoConf", + "124-VendorIdentifyingVendorClass", + "125-VendorIdentifyingVendorSpecific", + "128-TFTPServerIPAddress", + "129-CallServerIPAddress", + "130-DiscriminationString", + "131-RemoteStatisticsServerIPAddress", + "132-8021PVLANID", + "133-8021QL2Priority", + "134-DiffservCodePoint", + "135-HTTPProxyForPhoneSpecificApplications", + "136-PANAAuthenticationAgent", + "137-LoSTServer", + "138-CAPWAPAccessControllerAddresses", + "139-OPTIONIPv4AddressMoS", + "140-OPTIONIPv4FQDNMoS", + "141-SIPUAConfigurationServiceDomains", + "142-OPTIONIPv4AddressANDSF", + "143-OPTIONIPv6AddressANDSF", + "150-TFTPServerAddress", + "151-StatusCode", + "152-BaseTime", + "153-StartTimeOfState", + "154-QueryStartTime", + "155-QueryEndTime", + "156-DHCPState", + "157-DataSource", + "175-Etherboot", + "176-IPTelephone", + "177-EtherbootPacketCableAndCableHome", + "208-PXELinuxMagicString", + "209-PXELinuxConfigFile", + "210-PXELinuxPathPrefix", + "211-PXELinuxRebootTime", + "212-OPTION6RD", + "213-OPTIONv4AccessDomain", + "220-SubnetAllocation", + "221-VirtualSubnetAllocation", + "224-Reserved", + "225-Reserved", + "226-Reserved", + "227-Reserved", + "228-Reserved", + "229-Reserved", + "230-Reserved", + "231-Reserved", + "232-Reserved", + "233-Reserved", + "234-Reserved", + "235-Reserved", + "236-Reserved", + "237-Reserved", + "238-Reserved", + "239-Reserved", + "240-Reserved", + "241-Reserved", + "242-Reserved", + "243-Reserved", + "244-Reserved", + "245-Reserved", + "246-Reserved", + "247-Reserved", + "248-Reserved", + "249-Reserved", + "250-Reserved", + "251-Reserved", + "252-Reserved", + "253-Reserved", + "254-Reserved", + "255-End", + ], + Field(description="DHCPv4 option to return to the TopoNode.", title="Option"), + ] + value: Annotated[ + List[str], + Field( + description="Value to return to the TopoNode for the specified option.", + min_length=1, + title="Value", + ), + ] + + +class NodeProfileSpecDhcpDhcp6Option(BaseModel): + option: Annotated[ + Literal["59-BootfileUrl"], + Field(description="DHCPv6 option to return to the TopoNode.", title="Option"), + ] + value: Annotated[ + List[str], + Field( + description="Value to return to the TopoNode for the specified option.", + min_length=1, + title="Value", + ), + ] + + +class NodeProfileSpecImage(BaseModel): + image: Annotated[ + str, + Field( + description="URL hosting the software image, e.g. srlimages/srlinux-24.7.1.bin.", + title="Image", + ), + ] + imageMd5: Annotated[ + Optional[str], + Field( + description="URL hosting the software image md5 hash. e.g. srlimages/srlinux-24.7.1.bin.md5.", + title="Image MD5", + ), + ] = None + + +class NodeUser(BaseModel): + """ + NodeUser is the Schema for the nodeusers API + """ + + apiVersion: str + kind: str + metadata: NodeUserMetadata + spec: Annotated[ + NodeUserSpec, + Field( + description="The NodeUser resource represents a user that can be deployed to a set of TopoNodes. It supports managing the user's password, SSH keys, and group bindings.\nAdditionally a NodeUser is referenced by a NodeProfile to indicate how NPP should connect to TopoNodes.", + title="Specification", + ), + ] + status: Annotated[ + Optional[NodeUserStatus], + Field(description="Deployment status of this NodeUser.", title="Status"), + ] = None + + +NodeUserDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class NodeUserDeletedResources(RootModel[List[NodeUserDeletedResourceEntry]]): + root: List[NodeUserDeletedResourceEntry] + + +class NodeUserList(BaseModel): + """ + NodeUserList is a list of nodeusers + """ + + apiVersion: str + items: Optional[List[NodeUser]] = None + kind: str + + +NodeUserMetadata = DeviationActionMetadata + + +class NodeUserSpec(BaseModel): + """ + The NodeUser resource represents a user that can be deployed to a set of TopoNodes. It supports managing the user's password, SSH keys, and group bindings. + Additionally a NodeUser is referenced by a NodeProfile to indicate how NPP should connect to TopoNodes. + """ + + groupBindings: Annotated[ + List[NodeUserSpecGroupBinding], + Field( + description="Matching of this user to node-specific permissions via groups.", + title="Group Bindings", + ), + ] + password: Annotated[ + SecretStr, Field(description="Password for this user.", title="Password") + ] + sshPublicKeys: Annotated[ + Optional[List[str]], + Field( + description="SSH public keys to deploy for the user.", + title="SSH Public Keys", + ), + ] = None + username: Annotated[ + Optional[str], + Field( + description="Name of this user. If not provided, the name of the resource will be used.", + max_length=32, + title="Username", + ), + ] = None + + +class NodeUserSpecGroupBinding(BaseModel): + groups: Annotated[ + List[str], Field(description="Assigned groups for this user.", title="Groups") + ] + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Selector to use when selecting TopoNodes to deploy this user to.", + title="Node Selector", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field(description=" TopoNodes to deploy this user to.", title="Nodes"), + ] = None + + +class NodeUserStatus(BaseModel): + """ + Deployment status of this NodeUser. + """ + + groupBindings: Annotated[ + Optional[List[NodeUserStatusGroupBinding]], + Field( + description="List of TopoNodes user has been deployed to, along with corresponding groups.", + title="Group Bindings", + ), + ] = None + + +class NodeUserStatusGroupBinding(BaseModel): + groups: Annotated[ + Optional[List[str]], + Field( + description="Groups this user is a member of on this node.", title="Groups" + ), + ] = None + node: Annotated[ + Optional[str], Field(description="Node this user is deployed to.", title="Node") + ] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Role(BaseModel): + """ + Role is the Schema for the roles API + """ + + apiVersion: str + kind: str + metadata: RoleMetadata + spec: Annotated[ + RoleSpec, + Field( + description="RoleSpec defines the desired state of Role", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="RoleStatus defines the observed state of Role", title="Status" + ), + ] = None + + +RoleDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class RoleDeletedResources(RootModel[List[RoleDeletedResourceEntry]]): + root: List[RoleDeletedResourceEntry] + + +class RoleList(BaseModel): + """ + RoleList is a list of roles + """ + + apiVersion: str + items: Optional[List[Role]] = None + kind: str + + +RoleMetadata = DeviationActionMetadata + + +class RoleSpec(BaseModel): + """ + RoleSpec defines the desired state of Role + """ + + description: Annotated[ + Optional[str], + Field(description="A description for the role.", title="Description"), + ] = None + resourceRules: Annotated[ + Optional[List[RoleSpecResourceRule]], + Field( + description="The rules for access to kubernetes resources", + title="Resource Rules", + ), + ] = None + tableRules: Annotated[ + Optional[List[RoleSpecTableRule]], + Field( + description="The rules for access to the database tables.", + title="Table Rules", + ), + ] = None + urlRules: Annotated[ + Optional[List[RoleSpecUrlRule]], + Field( + description="The rules for access to api-server proxied routes.", + title="URL Rules", + ), + ] = None + + +class RoleSpecResourceRule(BaseModel): + """ + A role rule controlling access to a kubernetes resource. + """ + + apiGroups: Annotated[ + List[RoleSpecResourceRuleApiGroup], + Field( + description='The API groups for the resources controlled by the rule.\nAn API group consists of an apiGroup and a version, e.g. "apigroup/version".\nThe API group can be a wildcard ("*"), in which case it will match any API group.', + min_length=1, + title="API Groups", + ), + ] + permissions: Annotated[ + Literal["none", "read", "readWrite"], + Field( + description="Permissions for resources specified by the rule.", + title="Permissions", + ), + ] + resources: Annotated[ + List[RoleSpecResourceRuleResource], + Field( + description='Names for the resources controlled by the rule.\nIt can be a wildcard ("*"), in which case it will match any resource\nin the matching API groups.', + min_length=1, + title="Resources", + ), + ] + + +class RoleSpecResourceRuleApiGroup(ClusterRoleSpecResourceRuleApiGroup): + pass + + +class RoleSpecResourceRuleResource(ClusterRoleSpecResourceRuleApiGroup): + pass + + +RoleSpecTableRule = ClusterRoleSpecTableRule + + +RoleSpecUrlRule = ClusterRoleSpecUrlRule + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class SubnetAllocationPool(BaseModel): + """ + SubnetAllocationPool is the Schema for the subnetallocationpools API + """ + + apiVersion: str + kind: str + metadata: SubnetAllocationPoolMetadata + spec: Annotated[ + SubnetAllocationPoolSpec, + Field( + description="SubnetAllocationPool is a generic subnet allocation pool supporting allocation of IPv4 and/or IPv6 child subnets from a list of parent subnet segments.\nIt allocates a subnet of the configured length from the provided parent subnet.\nFor example a pool could return 10.1.0.8/29 when a segment is defined as subnet 10.1.0.0/16 with subnet length 29.\nConsult application documentation to know which pool type to use for a given use case.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="SubnetAllocationPoolStatus defines the observed state of SubnetAllocationPool", + title="Status", + ), + ] = None + + +SubnetAllocationPoolDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class SubnetAllocationPoolDeletedResources( + RootModel[List[SubnetAllocationPoolDeletedResourceEntry]] +): + root: List[SubnetAllocationPoolDeletedResourceEntry] + + +class SubnetAllocationPoolList(BaseModel): + """ + SubnetAllocationPoolList is a list of subnetallocationpools + """ + + apiVersion: str + items: Optional[List[SubnetAllocationPool]] = None + kind: str + + +SubnetAllocationPoolMetadata = DeviationActionMetadata + + +class SubnetAllocationPoolSpec(BaseModel): + """ + SubnetAllocationPool is a generic subnet allocation pool supporting allocation of IPv4 and/or IPv6 child subnets from a list of parent subnet segments. + It allocates a subnet of the configured length from the provided parent subnet. + For example a pool could return 10.1.0.8/29 when a segment is defined as subnet 10.1.0.0/16 with subnet length 29. + Consult application documentation to know which pool type to use for a given use case. + """ + + publishAllocations: Annotated[ + Optional[bool], + Field( + description="If true, allocations in segments will be published to EDB, available to query via EQL and trigger state applications off of.", + title="Publish Allocations", + ), + ] = None + segments: Annotated[ + List[SubnetAllocationPoolSpecSegment], + Field( + description="List of segments containing subnets to allocate.", + min_length=1, + title="Segments", + ), + ] + + +class SubnetAllocationPoolSpecSegment(BaseModel): + allocations: Annotated[ + Optional[List[SubnetAllocationPoolSpecSegmentAllocation]], + Field( + description="List of reservations to exclude from allocations from this segment.", + title="Allocations", + ), + ] = None + reservations: Annotated[ + Optional[List[SubnetAllocationPoolSpecSegmentReservation]], + Field( + description="List of ranges to exclude from allocations from this segment.", + title="Reservations", + ), + ] = None + subnet: Annotated[ + str, + Field( + description="IPv4 or IPv6 subnet to allocate subnets from, e.g. 10.1.0.0/16.", + title="Subnet", + ), + ] + subnetLength: Annotated[ + int, + Field( + description="The size of the subnets to be allocated from within the parent subnet, e.g. 29 (which could allocate 10.1.0.8/29, for example).", + title="Subnet Length", + ), + ] + + +SubnetAllocationPoolSpecSegmentAllocation = IPAllocationPoolSpecSegmentAllocation + + +SubnetAllocationPoolSpecSegmentReservation = IPAllocationPoolSpecSegmentReservation + + +class TopoBreakout(BaseModel): + """ + TopoBreakout is the Schema for the topobreakouts API + """ + + apiVersion: str + kind: str + metadata: TopoBreakoutMetadata + spec: Annotated[ + TopoBreakoutSpec, + Field( + description="TopoBreakoutSpec defines the desired state of TopoBreakout", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="TopoBreakoutStatus defines the observed state of TopoBreakout", + title="Status", + ), + ] = None + + +TopoBreakoutDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class TopoBreakoutDeletedResources(RootModel[List[TopoBreakoutDeletedResourceEntry]]): + root: List[TopoBreakoutDeletedResourceEntry] + + +class TopoBreakoutList(BaseModel): + """ + TopoBreakoutList is a list of topobreakouts + """ + + apiVersion: str + items: Optional[List[TopoBreakout]] = None + kind: str + + +TopoBreakoutMetadata = DeviationActionMetadata + + +class TopoBreakoutSpec(BaseModel): + """ + TopoBreakoutSpec defines the desired state of TopoBreakout + """ + + channels: Annotated[ + int, + Field( + description="The number of breakout channels to create", + ge=1, + le=8, + title="Number of Channels", + ), + ] + interface: Annotated[ + Optional[List[str]], + Field( + description="A list of normalized parent interface/port", + title="Normalized Parent Interface", + ), + ] = None + node: Annotated[ + List[str], + Field( + description="Reference to a list of TopoNodes where the parent interfaces are to be broken out", + title="Node", + ), + ] + speed: Annotated[ + Literal["800G", "400G", "200G", "100G", "50G", "40G", "25G", "10G"], + Field(description="The speed of each breakout channel", title="Speed"), + ] + + +class TopoLink(BaseModel): + """ + TopoLink is the Schema for the topolinks API + """ + + apiVersion: str + kind: str + metadata: TopoLinkMetadata + spec: Annotated[ + TopoLinkSpec, + Field( + description="TopoLink represents a logical link between two TopoNodes. It may include more than one physical link, being used to represent a LAG or multihomed link.\nTo create a point to point link with a single interface on both sides use a single link property.\nTo create a point to point link with a LAG configured on both side, use two links with matching nodes.\nA multihomed LAG is created by using two or more links where the A side and/or B side can be different.\nCreating a link with only A specified will create an edge interface.", + title="Specification", + ), + ] + status: Annotated[ + Optional[TopoLinkStatus], + Field( + description="TopoLinkStatus defines the observed state of TopoLink", + title="Status", + ), + ] = None + + +TopoLinkDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class TopoLinkDeletedResources(RootModel[List[TopoLinkDeletedResourceEntry]]): + root: List[TopoLinkDeletedResourceEntry] + + +class TopoLinkList(BaseModel): + """ + TopoLinkList is a list of topolinks + """ + + apiVersion: str + items: Optional[List[TopoLink]] = None + kind: str + + +TopoLinkMetadata = DeviationActionMetadata + + +class TopoLinkSpec(BaseModel): + """ + TopoLink represents a logical link between two TopoNodes. It may include more than one physical link, being used to represent a LAG or multihomed link. + To create a point to point link with a single interface on both sides use a single link property. + To create a point to point link with a LAG configured on both side, use two links with matching nodes. + A multihomed LAG is created by using two or more links where the A side and/or B side can be different. + Creating a link with only A specified will create an edge interface. + """ + + links: Annotated[ + List[TopoLinkSpecLink], + Field( + description="Define the set of physical links making up this TopoLink.", + min_length=1, + title="Links", + ), + ] + + +class TopoLinkSpecLink(BaseModel): + local: Annotated[ + TopoLinkSpecLinkLocal, + Field(description='Local, or "A" endpoint of the link.', title="A"), + ] + remote: Annotated[ + Optional[TopoLinkSpecLinkRemote], + Field(description='Remote, or "B" endpoint of the link.', title="B"), + ] = None + speed: Annotated[ + Optional[ + Literal[ + "800G", + "400G", + "200G", + "100G", + "50G", + "40G", + "25G", + "10G", + "2.5G", + "1G", + "100M", + ] + ], + Field(description="Speed of the link.", title="Speed"), + ] = None + type: Annotated[ + Literal["edge", "interSwitch", "loopback"], + Field( + description="Specify the type of link.\nIf type is set to edge, topology information for the remote device can be set; when doing so the Remote Node can be set as the hostname of the remote device and Remote Interface as the remote interface name in the device specific format, e.g. eth0.", + title="Type", + ), + ] + + +class TopoLinkSpecLinkLocal(BaseModel): + """ + Local, or "A" endpoint of the link. + """ + + interface: Annotated[ + Optional[str], + Field( + description="Normalized name of the interface/port, e.g. ethernet-1-1.", + title="Interface", + ), + ] = None + interfaceResource: Annotated[ + str, Field(description="Reference to a Interface.", title="Interface Resource") + ] + node: Annotated[str, Field(description="Reference to a TopoNode.", title="Node")] + + +class TopoLinkSpecLinkRemote(BaseModel): + """ + Remote, or "B" endpoint of the link. + """ + + interface: Annotated[ + Optional[str], + Field( + description="Normalized name of the interface/port, e.g. ethernet-1-1.", + title="Interface", + ), + ] = None + interfaceResource: Annotated[ + str, Field(description="Reference to a Interface.", title="Interface Resource") + ] + node: Annotated[str, Field(description="Reference to a TopoNode.", title="Node")] + + +class TopoLinkStatus(BaseModel): + """ + TopoLinkStatus defines the observed state of TopoLink + """ + + members: Annotated[ + Optional[List[TopoLinkStatusMember]], + Field(description="List of members present on the TopoLink.", title="Members"), + ] = None + operationalState: Annotated[ + str, + Field( + description="Indicates the aggregate operational state of the TopoLink.", + title="Operational State", + ), + ] + + +class TopoLinkStatusMember(BaseModel): + """ + MemberStatus defines the state of each member of a TopoLink + """ + + interface: Annotated[ + Optional[str], Field(description="Reference to an Interface", title="Interface") + ] = None + node: Annotated[str, Field(description="Reference to a TopoNode", title="Node")] + operationalState: Annotated[ + str, + Field( + description="Indicates the operational state of the TopoLink member.", + title="Operational State", + ), + ] + + +class TopoNode(BaseModel): + """ + TopoNode is the Schema for the toponodes API + """ + + apiVersion: str + kind: str + metadata: TopoNodeMetadata + spec: Annotated[ + TopoNodeSpec, + Field( + description="A managed network element is represented via a TopoNode resource, describing characteristics of a specific element in the topology.", + title="Specification", + ), + ] + status: Annotated[ + Optional[TopoNodeStatus], + Field( + description="TopoNodeStatus defines the observed state of TopoNode", + title="Status", + ), + ] = None + + +TopoNodeDeletedResourceEntry = DeviationActionDeletedResourceEntry + + +class TopoNodeDeletedResources(RootModel[List[TopoNodeDeletedResourceEntry]]): + root: List[TopoNodeDeletedResourceEntry] + + +class TopoNodeList(BaseModel): + """ + TopoNodeList is a list of toponodes + """ + + apiVersion: str + items: Optional[List[TopoNode]] = None + kind: str + + +TopoNodeMetadata = DeviationActionMetadata + + +class TopoNodeSpec(BaseModel): + """ + A managed network element is represented via a TopoNode resource, describing characteristics of a specific element in the topology. + """ + + component: Annotated[ + Optional[List[TopoNodeSpecComponentItem]], + Field( + description="List of components within the TopoNode.\nUsed to define the type and location of linecards, fabrics (SFM), media adapter cards (MDA) and control cards (CPM).", + title="Components", + ), + ] = None + license: Annotated[ + Optional[str], + Field( + description="Reference to a ConfigMap containing a license for the TopoNode. Overrides the license set in the referenced NodeProfile, if present.", + title="License", + ), + ] = None + macAddress: Annotated[ + Optional[str], + Field( + description="MAC address to associate with this TopoNode.\nTypically the chassis MAC address, optionally sent by a node in DHCP requests.\nNot required when a TopoNode is not being bootstrapped by EDA, or is simulated through CX.", + title="MAC Address", + ), + ] = None + nodeProfile: Annotated[ + str, + Field( + description="Reference to a NodeProfile to use with this TopoNode.", + title="Node Profile", + ), + ] + npp: Annotated[ + Optional[TopoNodeSpecNpp], + Field( + description="Options relating to NPP interactions with the node.", + title="NPP", + ), + ] = None + onBoarded: Annotated[ + Optional[bool], + Field( + description="Indicates if this TopoNode has been bootstrapped or is reachable via configured credentials. Set by BootstrapServer when it completes onboarding functions for a given TopoNode.\nMost applications ignore TopoNodes that have not been onboarded yet.", + title="Onboarded", + ), + ] = False + operatingSystem: Annotated[ + Literal["srl", "sros", "nxos"], + Field( + description="Operating system running on this TopoNode, e.g. srl.", + title="Operating System", + ), + ] + platform: Annotated[ + str, + Field( + description="Platform type of this TopoNode, e.g. 7220 IXR-D3L.", + title="Platform", + ), + ] + productionAddress: Annotated[ + Optional[TopoNodeSpecProductionAddress], + Field( + description="Production address of this TopoNode - this is the address the real, production instance of this TopoNode uses.\nIf left blank, an address will be allocated from the management IP pool specified in the referenced NodeProfile.\nIf this TopoNode is not bootstrapped by EDA this field must be provided.", + title="Production Address", + ), + ] = None + serialNumber: Annotated[ + Optional[str], + Field( + description="Serial number of this TopoNode, optionally sent by a node in DHCP requests.\nNot required when a TopoNode is not being bootstrapped by EDA, or is simulated through CX.", + title="Serial Number", + ), + ] = None + systemInterface: Annotated[ + Optional[str], + Field( + description="Name of the Interface resource representing the primary loopback on the TopoNode.", + title="System Interface", + ), + ] = None + version: Annotated[ + str, + Field( + description="Sets the software version of this TopoNode, e.g. 24.7.1 (for srl), or 24.7.r1 (for sros).", + title="Version", + ), + ] + + +class TopoNodeSpecComponentItem(BaseModel): + kind: Annotated[ + Literal[ + "lineCard", + "fabric", + "mda", + "connector", + "xiom", + "powerShelf", + "powerModule", + ], + Field(description="The kind of Component, e.g. lineCard.", title="Kind"), + ] + slot: Annotated[ + Optional[str], + Field( + description="The slot this Component resides in, unset for Components that do not have a slot or ID.\ne.g. 1 would denote the linecard slot 1, 1/1 would denote linecard slot 1 mda slot 1.", + title="Slot", + ), + ] = None + type: Annotated[ + str, + Field( + description="Denotes the type of hardware being provisioned, e.g. xcm-x20.", + title="Type", + ), + ] + + +class TopoNodeSpecNpp(BaseModel): + """ + Options relating to NPP interactions with the node. + """ + + mode: Annotated[ + Optional[Literal["normal", "maintenance", "null", "emulate"]], + Field( + description='The mode in which this TopoNode is functioning.\n"normal" (the default)\n indicates that NPP is expecting an endpoint to exist, and will accept and confirm changes only if the endpoint\n accepts them.\n"maintenance"\n indicates that no changes will be accepted for the TopoNode, irrespective if the endpoint is up and reachable.\n The exception is if an upgrade is occuring, in which case changes will be accepted.\n"null"\n\t indicates that changes will be accepted from CRs and no NPP will be spun up. NPP validation will not occur.\n This may be useful in playground mode to avoid spinning up of 1000s of NPPs.\n"emulate"\n indicates that changes will be accepted at the NPP level, without pushing them to a endpoint. NPP validation\n still occurs. If no IP address is present, we also run in emulate mode.', + title="Mode", + ), + ] = "normal" + + +class TopoNodeSpecProductionAddress(BaseModel): + """ + Production address of this TopoNode - this is the address the real, production instance of this TopoNode uses. + If left blank, an address will be allocated from the management IP pool specified in the referenced NodeProfile. + If this TopoNode is not bootstrapped by EDA this field must be provided. + """ + + ipv4: Annotated[ + Optional[str], Field(description="The IPv4 production address", title="IPv4") + ] = None + ipv6: Annotated[ + Optional[str], Field(description="The IPv6 production address", title="IPv6") + ] = None + + +class TopoNodeStatus(BaseModel): + """ + TopoNodeStatus defines the observed state of TopoNode + """ + + node_details: Annotated[ + Optional[str], + Field( + alias="node-details", + description="Address and port used to connected to the node.", + title="Node Address", + ), + ] = None + node_state: Annotated[ + Optional[str], + Field( + alias="node-state", + description='The current state of the connection between NPP and the node.\n"TryingToConnect"\n NPP is attempting to connect and establish connectivity to the node\n"WaitingForInitialCfg"\n NPP is connected to the node but waiting for intial config to push\n"Committing"\n\t NPP is in progress of commiting\n"RetryingCommit"\n NPP lost sync to node and is re-pushing current config\n"Synced"\n NPP is in fully synced state\n"Standby"\n NPP is running in standby mode. This state is only used on standby clusters with georedundancy.\n"NoIpAddress"\n NPP is running but there is no IP address for node. This only happen in sim setups when\n CX has not created the simulated node, or the simulated pod failed to launch due to image error.', + title="Node", + ), + ] = None + npp_details: Annotated[ + Optional[str], + Field( + alias="npp-details", + description="NPP address and port for this TopoNode.", + title="NPP Address", + ), + ] = None + npp_pod: Annotated[ + Optional[str], + Field(alias="npp-pod", description="NPP pod name", title="NPP Pod"), + ] = None + npp_state: Annotated[ + Optional[str], + Field( + alias="npp-state", + description="The current state of the connection between ConfigEngine and NPP.", + title="NPP", + ), + ] = None + operatingSystem: Annotated[ + Optional[str], + Field( + description="Operational operating system running on this TopoNode, e.g. srl, sros.", + title="Operating System", + ), + ] = None + platform: Annotated[ + Optional[str], + Field( + description="Operational platform type of this TopoNode, e.g. 7220 IXR-D3L.", + title="Platform", + ), + ] = None + simulate: Annotated[ + Optional[bool], + Field( + description="Simulate using CX - if true CX is reponsible for generating the TargetNode resource.", + title="Simulate", + ), + ] = None + version: Annotated[ + Optional[str], + Field( + description="Operational software version of this TopoNode, e.g. 24.7.1 (for srl), or 24.7.r1 (for sros).", + title="Version", + ), + ] = None + + +class UIResult(RootModel[str]): + root: str + + +class UdpProxy(BaseModel): + """ + UdpProxy is the Schema for the udpproxies API + """ + + apiVersion: str + kind: str + metadata: UdpProxyMetadata + spec: Annotated[ + UdpProxySpec, + Field( + description="UdpProxySpec defines the desired state of UdpProxy", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="UdpProxyStatus defines the observed state of UdpProxy", + title="Status", + ), + ] = None + + +UdpProxyDeletedResourceEntry = ClusterRoleDeletedResourceEntry + + +class UdpProxyDeletedResources(RootModel[List[UdpProxyDeletedResourceEntry]]): + root: List[UdpProxyDeletedResourceEntry] + + +class UdpProxyList(BaseModel): + """ + UdpProxyList is a list of udpproxies + """ + + apiVersion: str + items: Optional[List[UdpProxy]] = None + kind: str + + +UdpProxyMetadata = ClusterRoleMetadata + + +class UdpProxySpec(BaseModel): + """ + UdpProxySpec defines the desired state of UdpProxy + """ + + bufferSize: Annotated[ + int, + Field( + description="The proxy will use a buffer of this size for all datagrams it receives and this must be sized\nto accommodate the largest datagrams expected", + ge=64, + le=65535, + title="Buffer Size", + ), + ] + destHost: Annotated[ + str, + Field( + description="The destination hostname or IP address to forward the datagrams to", + title="Destination Host", + ), + ] + destPort: Annotated[ + int, + Field( + description="The destination UDP port to forward the datagrams to", + ge=1, + le=65535, + title="Destination Port", + ), + ] + idleTimeout: Annotated[ + int, + Field( + description="The proxy will listen for responses from the destination and forward it back to the source\nof the datagram until there is no traffic at all for at least the idle timeout in seconds", + ge=1, + title="Idle Timeout", + ), + ] + proxyPort: Annotated[ + int, + Field( + description="The UDP port on which to listen for datagrams and then proxy to the destination", + ge=1, + le=65535, + title="Proxy Port", + ), + ] + + +class WorkflowDefinition(BaseModel): + """ + WorkflowDefinition is the Schema for the workflowdefinitions API + """ + + apiVersion: str + kind: str + metadata: WorkflowDefinitionMetadata + spec: Annotated[ + WorkflowDefinitionSpec, + Field( + description="WorkflowDefinitionSpec defines the desired state of FlowDefinition", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="WorkflowDefinitionStatus defines the observed state of FlowDefinition", + title="Status", + ), + ] = None + + +WorkflowDefinitionDeletedResourceEntry = ClusterRoleDeletedResourceEntry + + +class WorkflowDefinitionDeletedResources( + RootModel[List[WorkflowDefinitionDeletedResourceEntry]] +): + root: List[WorkflowDefinitionDeletedResourceEntry] + + +class WorkflowDefinitionList(BaseModel): + """ + WorkflowDefinitionList is a list of workflowdefinitions + """ + + apiVersion: str + items: Optional[List[WorkflowDefinition]] = None + kind: str + + +WorkflowDefinitionMetadata = ClusterRoleMetadata + + +class WorkflowDefinitionSpec(BaseModel): + """ + WorkflowDefinitionSpec defines the desired state of FlowDefinition + """ + + flowDefinitionResource: Annotated[ + Optional[WorkflowDefinitionSpecFlowDefinitionResource], + Field( + description="the resource type to be used for this flow, can only be set if Schema is not set" + ), + ] = None + flowDefinitionSchema: Annotated[ + Optional[WorkflowDefinitionSpecFlowDefinitionSchema], + Field( + description="the schema for the flow, can only be set if Resource is not set" + ), + ] = None + image: Annotated[ + str, + Field( + description='Container image containing the flow. For example "ghcr.io/nokia-eda/apps/operatingsystem:v1.0.0".', + title="Image", + ), + ] + imagePullSecrets: Annotated[ + Optional[List[str]], + Field( + description="Secrets to use to pull the image for this workflow.", + title="Image Pull Secrets", + ), + ] = None + + +class WorkflowDefinitionSpecFlowDefinitionResource(BaseModel): + """ + the resource type to be used for this flow, can only be set if Schema is not set + """ + + group: Annotated[Optional[str], Field(title="Group")] = None + kind: Annotated[str, Field(title="Kind")] + version: Annotated[str, Field(title="Version")] + + +class WorkflowDefinitionSpecFlowDefinitionSchema(BaseModel): + """ + the schema for the flow, can only be set if Resource is not set + """ + + jsonSchemaSpec: Annotated[ + Optional[str], + Field( + description="A string containing the JSON schema the workflow accepts as input.", + title="JSON Schema (Spec)", + ), + ] = None + jsonSchemaStatus: Annotated[ + Optional[str], + Field( + description="A string containing the JSON schema the workflow will populate as output.", + title="JSON Schema (Status)", + ), + ] = None diff --git a/pydantic_eda/apps/fabrics/v1alpha1/models.py b/pydantic_eda/apps/fabrics/v1alpha1/models.py new file mode 100644 index 0000000..f939673 --- /dev/null +++ b/pydantic_eda/apps/fabrics/v1alpha1/models.py @@ -0,0 +1,1190 @@ +# generated by datamodel-codegen: +# filename: fabrics.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class Fabric(BaseModel): + """ + Fabric is the Schema for the fabrics API + """ + + apiVersion: str + kind: str + metadata: FabricMetadata + spec: Annotated[ + FabricSpec, + Field( + description="The Fabric defines the desired state of a Fabric resource, enabling the automation and management of data center network fabrics. It includes configurations for IP address allocation pools, network topology roles (Leafs, Spines, SuperSpines, BorderLeafs), inter-switch links, and network protocols (underlay and overlay). The specification allows for detailed control over routing strategies, including ASN allocations for BGP-based protocols, and supports advanced features like BFD.", + title="Specification", + ), + ] + status: Annotated[ + Optional[FabricStatus], + Field( + description="FabricStatus defines the observed state of Fabric", + title="Status", + ), + ] = None + + +class FabricDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class FabricDeletedResources(RootModel[List[FabricDeletedResourceEntry]]): + root: List[FabricDeletedResourceEntry] + + +class FabricList(BaseModel): + """ + FabricList is a list of fabrics + """ + + apiVersion: str + items: Optional[List[Fabric]] = None + kind: str + + +class FabricMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class FabricSpec(BaseModel): + """ + The Fabric defines the desired state of a Fabric resource, enabling the automation and management of data center network fabrics. It includes configurations for IP address allocation pools, network topology roles (Leafs, Spines, SuperSpines, BorderLeafs), inter-switch links, and network protocols (underlay and overlay). The specification allows for detailed control over routing strategies, including ASN allocations for BGP-based protocols, and supports advanced features like BFD. + """ + + borderLeafs: Annotated[ + Optional[FabricSpecBorderLeafs], Field(title="Borderleafs") + ] = None + fabricSelector: Annotated[ + Optional[List[str]], + Field( + description="Selects Fabric resources when connecting multiple Fabrics together. Only one Fabric needs the selector, typically the upper layer (e.g., Superspine) selecting the lower layer (e.g., a pod fabric of leafs and spines). This helps build complete Fabrics in smaller instances of the Fabric resource. This instance selecting other fabrics must also select the InterSwitchLinks connecting itself to the selected Fabrics.", + title="Fabric Selector", + ), + ] = None + interSwitchLinks: Annotated[ + Optional[FabricSpecInterSwitchLinks], Field(title="InterSwitchLinks") + ] = None + leafs: Annotated[Optional[FabricSpecLeafs], Field(title="Leafs")] = None + overlayProtocol: Annotated[ + Optional[FabricSpecOverlayProtocol], + Field(description="Set the overlay protocol used", title="Overlay Protocol"), + ] = None + routeLeaking: Annotated[ + Optional[FabricSpecRouteLeaking], + Field( + description="Route leaking controlled by routing policies in and out of the DefaulRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.", + title="Route Leaking", + ), + ] = None + spines: Annotated[Optional[FabricSpecSpines], Field(title="Spines")] = None + superSpines: Annotated[ + Optional[FabricSpecSuperSpines], Field(title="Superspines") + ] = None + systemPoolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. If specified under the Leaf/Spine/Superspine/Borderleaf those will take precedence. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv4 Pool - System IP", + ), + ] = None + systemPoolIPV6: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. If specified under the Leaf/Spine/Superspine/Borderleaf those will take precedence. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv6 Pool - System IP", + ), + ] = None + underlayProtocol: Annotated[ + Optional[FabricSpecUnderlayProtocol], + Field(description="Set the underlay protocol used", title="Underlay Protocol"), + ] = None + + +class FabricSpecBorderLeafs(BaseModel): + asnPool: Annotated[ + Optional[str], + Field( + description="Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. This reference will take precedence over the spec.underlayProtocol.asnPool.", + title="Autonomous System Pool", + ), + ] = None + borderLeafNodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select Toponodes to configure as Borderleaf nodes.", + title="Borderleaf Node Selector", + ), + ] = None + routeLeaking: Annotated[ + Optional[FabricSpecBorderLeafsRouteLeaking], + Field( + description="Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.", + title="Route Leaking", + ), + ] = None + systemPoolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV4. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv4 Pool - System IP", + ), + ] = None + systemPoolIPV6: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV6. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv6 Pool - System IP", + ), + ] = None + + +class FabricSpecBorderLeafsRouteLeaking(BaseModel): + """ + Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence. + """ + + exportPolicy: Annotated[ + str, + Field( + description="Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.", + title="Export Policy", + ), + ] + importPolicy: Annotated[ + str, + Field( + description="Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.", + title="Import Policy", + ), + ] + + +class FabricSpecInterSwitchLinks(BaseModel): + linkSelector: Annotated[ + Optional[List[str]], + Field( + description="Selects TopoLinks to include in this Fabric, creating an ISL resource if both Nodes in the TopoLink are part of this Fabric or a selected Fabric.", + title="Link Selector", + ), + ] = None + poolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to DefaultInterfaces which are members of the ISLs. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack DefaultInterfaces.", + title="IPv4 Pool - InterSwitch Link IP", + ), + ] = None + poolIPV6: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to DefaultInterfaces which are members of the ISLs. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack DefaultInterfaces.", + title="IPv6 Pool - InterSwitch Link IP", + ), + ] = None + qos: Annotated[Optional[FabricSpecInterSwitchLinksQos], Field(title="QoS")] = None + unnumbered: Annotated[ + Optional[Literal["IPV6"]], + Field( + description="Enables unnumbered interfaces on the ISL; for IPv6, only link-local addresses are used unless a PoolIPV6 is also specified. DefaultInterfaces in the ISL are added to the DefaultBGPPeer dynamic neighbor list when using an eBGP underlay.", + title="Unnumbered", + ), + ] = None + vlanID: Annotated[ + Optional[int], + Field( + description="Configures the provided VLAN on the DefaultInterfaces which are members of the ISLs.", + ge=1, + le=4094, + title="VLAN ID - InterSwitch Link", + ), + ] = None + + +class FabricSpecInterSwitchLinksQos(BaseModel): + egressPolicy: Annotated[Optional[str], Field(title="Egress Policy")] = None + ingressPolicy: Annotated[Optional[str], Field(title="Ingress Policy")] = None + + +class FabricSpecLeafs(BaseModel): + asnPool: Annotated[ + Optional[str], + Field( + description="Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. This reference will take precedence over the spec.underlayProtocol.asnPool.", + title="Autonomous System Pool", + ), + ] = None + leafNodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select Toponodes to configure as Leaf nodes.", + title="Leaf Node Selector", + ), + ] = None + routeLeaking: Annotated[ + Optional[FabricSpecLeafsRouteLeaking], + Field( + description="Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.", + title="Route Leaking", + ), + ] = None + systemPoolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV4. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv4 Pool - System IP", + ), + ] = None + systemPoolIPV6: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV6. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv6 Pool - System IP", + ), + ] = None + + +FabricSpecLeafsRouteLeaking = FabricSpecBorderLeafsRouteLeaking + + +class FabricSpecOverlayProtocol(BaseModel): + """ + Set the overlay protocol used + """ + + bfd: Annotated[ + Optional[FabricSpecOverlayProtocolBfd], + Field( + description="Enable BFD on overlay protocol", title="Overlay Protocol BFD" + ), + ] = None + bgp: Annotated[ + Optional[FabricSpecOverlayProtocolBgp], + Field(description="Overlay specific BGP properties.", title="BGP"), + ] = None + protocol: Annotated[ + Literal["IBGP", "EBGP"], + Field( + description="List of routing protocols to used to advertise EVPN routes for overlay services. When EBGP is used, the BGP properties configured under the spec.underlayProtocol will be used.", + title="Protocol", + ), + ] + + +class FabricSpecOverlayProtocolBfd(BaseModel): + """ + Enable BFD on overlay protocol + """ + + desiredMinTransmitInt: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between transmission of BFD control packets.", + ge=10000, + le=100000000, + title="Transmit Interval", + ), + ] = 1000000 + detectionMultiplier: Annotated[ + Optional[int], + Field( + description="The number of packets that must be missed to declare this session as down.", + ge=3, + le=20, + title="Multiplier", + ), + ] = 3 + enabled: Annotated[ + Optional[bool], + Field(description="Enable Biforward Detection.", title="Enabled"), + ] = False + minEchoReceiveInterval: Annotated[ + Optional[int], + Field( + description="The minimum interval between echo packets the local node can receive in microseconds.", + ge=0, + le=100000000, + title="Minimum Echo Receive Interval", + ), + ] = 1000000 + requiredMinReceive: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between received BFD control packets that this system should support.", + ge=10000, + le=100000000, + title="Receive Interval", + ), + ] = 1000000 + + +class FabricSpecOverlayProtocolBgp(BaseModel): + """ + Overlay specific BGP properties. + """ + + autonomousSystem: Annotated[ + Optional[int], + Field( + description="Autonomous System used for iBGP peering session, when protocol is set to IBGP providing an autonomousSystem is required.", + title="Autonomous System", + ), + ] = None + clusterID: Annotated[ + Optional[str], + Field( + description="Sets the cluster ID used by DefaultRouteReflectors, when protocol is set to IBGP providing a clusterID is required.", + title="Cluster ID", + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy, when left empty or not specified the Fabric will automatically generate a policy for the specified protocols.", + title="Export Policy", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy, when left empty or not specified the Fabric will automatically generate a policy for the specified protocols.", + title="Import Policy", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Keychain to be used for authentication when overlay protocol is IBGP, ignored otherwise", + title="Keychain", + ), + ] = None + rrClientNodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select Toponodes to configure as DefaultRouteReflectorClients, these are typically Leaf or Borderleaf nodes. Used on conjunction with rrNodeSelector in order to configure the DefaultBGPPeers for both the DefaultRouteReflectors and DefaultRouteReflectorClients.", + title="Route Reflector Client Node Selector", + ), + ] = None + rrIPAddresses: Annotated[ + Optional[List[str]], + Field( + description="List of route reflector IP addresses not provisioned by this instance of a Fabric resource. Used with rrClientNodeSelector to configure the DefaultBGPPeers on the selected nodes to peer the list of external route reflector IPs.", + title="Route Reflector IP Addresses", + ), + ] = None + rrNodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select Toponodes to configure as DefaultRouteReflectors, these are typically Spine, Superspine or Borderleaf nodes. Used on conjunction with rrClientNodeSelector in order to configure the DefaultBGPPeers for both the DefaultRouteReflectors and DefaultRouteReflectorClients.", + title="Route Reflector Node Selector", + ), + ] = None + timers: Annotated[ + Optional[FabricSpecOverlayProtocolBgpTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class FabricSpecOverlayProtocolBgpTimers(BaseModel): + """ + Timer configurations + """ + + connectRetry: Annotated[ + Optional[int], + Field( + description="The time interval in seconds between successive attempts to establish a session with a peer.", + ge=1, + le=65535, + title="Connect Retry", + ), + ] = None + holdTime: Annotated[ + Optional[int], + Field( + description="The hold-time interval in seconds that the router proposes to the peer in its OPEN message.", + ge=0, + le=65535, + title="Hold Time", + ), + ] = None + keepAlive: Annotated[ + Optional[int], + Field( + description="The interval in seconds between successive keepalive messages sent to the peer.", + ge=0, + le=21845, + title="Keep Alive", + ), + ] = None + minimumAdvertisementInterval: Annotated[ + Optional[int], + Field( + description="The value assigned to the MinRouteAdvertisementIntervalTimer of RFC 4271, for both EBGP and IBGP sessions.", + ge=1, + le=255, + title="Minimum Advertisement Interval", + ), + ] = None + + +class FabricSpecRouteLeaking(BaseModel): + """ + Route leaking controlled by routing policies in and out of the DefaulRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence. + """ + + exportPolicy: Annotated[ + str, + Field( + description="Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.", + title="Export Policy", + ), + ] + importPolicy: Annotated[ + str, + Field( + description="Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.", + title="Import Policy", + ), + ] + + +class FabricSpecSpines(BaseModel): + asnPool: Annotated[ + Optional[str], + Field( + description="Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. This reference will take precedence over the spec.underlayProtocol.asnPool.", + title="Autonomous System Pool", + ), + ] = None + routeLeaking: Annotated[ + Optional[FabricSpecSpinesRouteLeaking], + Field( + description="Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.", + title="Route Leaking", + ), + ] = None + spineNodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select Toponodes to configure as Spine nodes.", + title="Spine Node Selector", + ), + ] = None + systemPoolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV4. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv4 Pool - System IP", + ), + ] = None + systemPoolIPV6: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV6. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv6 Pool - System IP", + ), + ] = None + + +FabricSpecSpinesRouteLeaking = FabricSpecBorderLeafsRouteLeaking + + +class FabricSpecSuperSpines(BaseModel): + asnPool: Annotated[ + Optional[str], + Field( + description="Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. This reference will take precedence over the spec.underlayProtocol.asnPool.", + title="Autonomous System Pool", + ), + ] = None + routeLeaking: Annotated[ + Optional[FabricSpecSuperSpinesRouteLeaking], + Field( + description="Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.", + title="Route Leaking", + ), + ] = None + superSpineNodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select Toponodes to configure as Superspine nodes.", + title="Superspine Node Selector", + ), + ] = None + systemPoolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV4. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv4 Pool - System IP", + ), + ] = None + systemPoolIPV6: Annotated[ + Optional[str], + Field( + description="Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV6. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.", + title="IPv6 Pool - System IP", + ), + ] = None + + +FabricSpecSuperSpinesRouteLeaking = FabricSpecBorderLeafsRouteLeaking + + +class FabricSpecUnderlayProtocol(BaseModel): + """ + Set the underlay protocol used + """ + + bfd: Annotated[ + Optional[FabricSpecUnderlayProtocolBfd], + Field( + description="Enable BFD on underlay protocol", title="Underlay Protocol BFD" + ), + ] = None + bgp: Annotated[ + FabricSpecUnderlayProtocolBgp, + Field(description="Underlay specific BGP properties.", title="BGP"), + ] + protocol: Annotated[ + List[Literal["EBGP"]], + Field( + description="List of routing protocols to used between peers of an ISL. Multiple protocols may be listed, if so multiple protocols will be used.", + title="Protocol", + ), + ] + + +class FabricSpecUnderlayProtocolBfd(BaseModel): + """ + Enable BFD on underlay protocol + """ + + desiredMinTransmitInt: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between transmission of BFD control packets.", + ge=10000, + le=100000000, + title="Transmit Interval", + ), + ] = 1000000 + detectionMultiplier: Annotated[ + Optional[int], + Field( + description="The number of packets that must be missed to declare this session as down.", + ge=3, + le=20, + title="Multiplier", + ), + ] = 3 + enabled: Annotated[ + Optional[bool], + Field(description="Enable Biforward Detection.", title="Enabled"), + ] = False + minEchoReceiveInterval: Annotated[ + Optional[int], + Field( + description="The minimum interval between echo packets the local node can receive in microseconds.", + ge=0, + le=100000000, + title="Minimum Echo Receive Interval", + ), + ] = 1000000 + requiredMinReceive: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between received BFD control packets that this system should support.", + ge=10000, + le=100000000, + title="Receive Interval", + ), + ] = 1000000 + + +class FabricSpecUnderlayProtocolBgp(BaseModel): + """ + Underlay specific BGP properties. + """ + + asnPool: Annotated[ + Optional[str], + Field( + description="Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. If specified under the Leaf/Spine/Superspine/Borderleaf those will take precedence.", + title="Autonomous System Pool", + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy, when left empty or not specified the Fabric will automatically generate a policy for the specified protocols.", + title="Export Policy", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy, when left empty or not specified the Fabric will automatically generate a policy for the specified protocols.", + title="Import Policy", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field(description="Keychain to be used for authentication", title="Keychain"), + ] = None + timers: Annotated[ + Optional[FabricSpecUnderlayProtocolBgpTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +FabricSpecUnderlayProtocolBgpTimers = FabricSpecOverlayProtocolBgpTimers + + +class FabricStatus(BaseModel): + """ + FabricStatus defines the observed state of Fabric + """ + + borderLeafNodes: Annotated[ + Optional[List[FabricStatusBorderLeafNode]], + Field( + description="List of border leaf nodes in the Fabric.", + title="Border Leaf Nodes", + ), + ] = None + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the Fabric. The health score of the Fabric is determined by the aggregate health score of the resources emited by the Fabric such as ISL, DefaultRouteReflectors etc.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + leafNodes: Annotated[ + Optional[List[FabricStatusLeafNode]], + Field(description="List of leaf nodes in the Fabric.", title="Leaf Nodes"), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the Fabric. The operational state of the fabric is determined by monitoring the operational state of the following resources (if applicable): DefaultRouters, ISLs.", + title="Operational State", + ), + ] = None + spineNodes: Annotated[ + Optional[List[FabricStatusSpineNode]], + Field(description="List of spine nodes in the Fabric.", title="Spine Nodes"), + ] = None + superSpineNodes: Annotated[ + Optional[List[FabricStatusSuperSpineNode]], + Field( + description="List of super spine nodes in the Fabric.", + title="Superspine Nodes", + ), + ] = None + + +class FabricStatusBorderLeafNode(BaseModel): + node: Annotated[ + Optional[str], Field(description="Name of the TopoNode.", title="Node") + ] = None + operatingSystem: Annotated[ + Optional[str], + Field( + description="Operating system running on the node.", + title="Operating System", + ), + ] = None + operatingSystemVersion: Annotated[ + Optional[str], + Field( + description="Operating system version running on the node.", + title="Operating System Version", + ), + ] = None + underlayAutonomousSystem: Annotated[ + Optional[int], + Field( + description="Underlay Autonomous System used for eBGP peering session, when protocol is set to eBGP this is required.", + title="Underlay Autonomous System", + ), + ] = None + + +FabricStatusLeafNode = FabricStatusBorderLeafNode + + +FabricStatusSpineNode = FabricStatusBorderLeafNode + + +FabricStatusSuperSpineNode = FabricStatusBorderLeafNode + + +class ISL(BaseModel): + """ + ISL is the Schema for the isls API + """ + + apiVersion: str + kind: str + metadata: ISLMetadata + spec: Annotated[ + ISLSpec, + Field( + description="The ISL enables the configuration and management of direct links between Nodes. This resource allows for specifying IPv4 and IPv6 allocation pools, enabling BFD for fast failure detection, and configuring VLAN IDs for the ISL. It also supports BGP peering between the endpoints, with options for setting autonomous systems, AFI/SAFI configurations, and import/export routing policies.", + title="Specification", + ), + ] + status: Annotated[ + Optional[ISLStatus], + Field( + description="ISLStatus defines the observed state of ISL", title="Status" + ), + ] = None + + +ISLDeletedResourceEntry = FabricDeletedResourceEntry + + +class ISLDeletedResources(RootModel[List[ISLDeletedResourceEntry]]): + root: List[ISLDeletedResourceEntry] + + +class ISLList(BaseModel): + """ + ISLList is a list of isls + """ + + apiVersion: str + items: Optional[List[ISL]] = None + kind: str + + +ISLMetadata = FabricMetadata + + +class ISLSpec(BaseModel): + """ + The ISL enables the configuration and management of direct links between Nodes. This resource allows for specifying IPv4 and IPv6 allocation pools, enabling BFD for fast failure detection, and configuring VLAN IDs for the ISL. It also supports BGP peering between the endpoints, with options for setting autonomous systems, AFI/SAFI configurations, and import/export routing policies. + """ + + bfd: Annotated[ + Optional[ISLSpecBfd], + Field( + description="Enable or disable BFD on the ISL. [default=false]", title="BFD" + ), + ] = None + bgp: Annotated[Optional[ISLSpecBgp], Field(title="BGP")] = None + localDefaultRouter: Annotated[ + str, + Field( + description="Reference to the DefautlRouter associated with the local Interface in which the ISL will be provisioned.", + title="Local Default Router", + ), + ] + localInterface: Annotated[ + str, Field(description="Reference to an Interface.", title="Local Interface") + ] + poolIPV4: Annotated[ + Optional[str], + Field( + description="Reference to an IPv4 allocation pool to use for ISL subnet allocations.", + title="IPv4 Allocation Pool", + ), + ] = None + poolIPV6: Annotated[ + Optional[str], + Field( + description="Reference to an IPv6 allocation pool to use for ISL subnet allocations.", + title="IPv6 Allocation Pool", + ), + ] = None + qos: Annotated[Optional[ISLSpecQos], Field(title="QoS")] = None + remoteDefaultRouter: Annotated[ + str, + Field( + description="Reference to the DefautlRouter associated with the remote Interface in which the ISL will be provisioned.", + title="Remote Default Router", + ), + ] + remoteInterface: Annotated[ + str, Field(description="Reference to an Interface", title="Remote Interface") + ] + unnumbered: Annotated[ + Optional[Literal["IPV6"]], + Field( + description="Enables the use of unnumbered interfaces on the ISL. For IPv6, no IP address are configured on the sub-interface and only the link local address will be used. If any allocation pool is specified for IPv6 that will take precedence and IPs will be assigned to the interfaces. When using eBGP for an underlay protocol, the DefaultInterfaces which are a part of the ISL will be added to the BGP dynamic neighbor list.", + title="Unnumbered", + ), + ] = None + vlanID: Annotated[ + Optional[int], + Field( + description="Single VLAN tag value between 1-4094.", + ge=1, + le=4094, + title="VLAN ID", + ), + ] = None + + +class ISLSpecBfd(BaseModel): + """ + Enable or disable BFD on the ISL. [default=false] + """ + + desiredMinTransmitInt: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between transmission of BFD control packets.", + ge=10000, + le=100000000, + title="Transmit Interval", + ), + ] = 1000000 + detectionMultiplier: Annotated[ + Optional[int], + Field( + description="The number of packets that must be missed to declare this session as down.", + ge=3, + le=20, + title="Multiplier", + ), + ] = 3 + enabled: Annotated[ + Optional[bool], + Field(description="Enable Biforward Detection.", title="Enabled"), + ] = False + minEchoReceiveInterval: Annotated[ + Optional[int], + Field( + description="The minimum interval between echo packets the local node can receive in microseconds.", + ge=0, + le=100000000, + title="Minimum Echo Receive Interval", + ), + ] = 1000000 + requiredMinReceive: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between received BFD control packets that this system should support.", + ge=10000, + le=100000000, + title="Receive Interval", + ), + ] = 1000000 + + +class ISLSpecBgp(BaseModel): + afiSAFI: Annotated[ + Optional[List[str]], + Field( + description="Which AFI and SAFI to advertise on the BGP peering session. Options: ipv4unicast, ipv6unicast, l2vpnevpn", + title="AFI SAFI", + ), + ] = None + bgpGroup: Annotated[ + Optional[str], + Field(description="Reference to a DefaultBgpGroup.", title="BGP Group"), + ] = None + enabled: Annotated[ + bool, + Field( + description="Enable or disable BGP peering between the two endpoints of the ISL. [default=false]", + title="Enabled", + ), + ] + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a RoutingPolicy to use when evaluating route exports from the DefaultRouter.", + title="Export Policy", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a RoutingPolicy to use when evaluating route imports into the DefaultRouter.", + title="Import Policy", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field(description="Keychain to be used for authentication", title="Keychain"), + ] = None + localInterfaceAS: Annotated[ + int, + Field( + description="The Autonomous System to configure on the Local Interface.", + ge=0, + le=4294967295, + title="Local Interface AS", + ), + ] + remoteInterfaceAS: Annotated[ + int, + Field( + description="The Autonomous System to configure on the Remote Interface.", + ge=0, + le=4294967295, + title="Remote Interface AS", + ), + ] + + +ISLSpecQos = FabricSpecInterSwitchLinksQos + + +class ISLStatus(BaseModel): + """ + ISLStatus defines the observed state of ISL + """ + + health: Annotated[ + Optional[int], + Field(description="Indicates the health score of the ISL", title="Health"), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed", + title="Last Change", + ), + ] = None + localInterface: Annotated[ + Optional[ISLStatusLocalInterface], + Field(description="Local Interface", title="Local Interface"), + ] = None + operationalState: Annotated[ + Optional[str], + Field(description="Operational state of the ISL", title="Operational State"), + ] = None + remoteInterface: Annotated[ + Optional[ISLStatusRemoteInterface], + Field(description="Remote Interface", title="Remote Interface"), + ] = None + + +class ISLStatusLocalInterface(BaseModel): + """ + Local Interface + """ + + IPv4Address: Annotated[ + Optional[str], + Field(description="Local Interface IPv4 address", title="IPv4 Address"), + ] = None + IPv6Address: Annotated[ + Optional[str], + Field(description="Local Interface IPv4 address", title="IPv6 Address"), + ] = None + defaultInterface: Annotated[ + Optional[str], + Field( + description="Reference to the DefaulInterface assocaited with the local interface", + title="Default Interface", + ), + ] = None + node: Annotated[ + Optional[str], + Field( + description="Reference to the TopoNode on which the local interface is configured", + title="Node", + ), + ] = None + + +class ISLStatusRemoteInterface(BaseModel): + """ + Remote Interface + """ + + IPv4Address: Annotated[ + Optional[str], + Field(description="Remote Interface IPv4 address", title="IPv4 Address"), + ] = None + IPv6Address: Annotated[ + Optional[str], + Field(description="Remote Interface IPv6 address", title="IPv6 Address"), + ] = None + defaultInterface: Annotated[ + Optional[str], + Field( + description="Reference to the DefaulInterface assocaited with the remote interface", + title="Default Interface", + ), + ] = None + node: Annotated[ + Optional[str], + Field( + description="Reference to the TopoNode on which the remote interface is configured", + title="Node", + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/filters/v1alpha1/models.py b/pydantic_eda/apps/filters/v1alpha1/models.py new file mode 100644 index 0000000..ae46018 --- /dev/null +++ b/pydantic_eda/apps/filters/v1alpha1/models.py @@ -0,0 +1,1596 @@ +# generated by datamodel-codegen: +# filename: filters.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ControlPlaneFilter(BaseModel): + """ + ControlPlaneFilter is the Schema for the controlplanefilters API + """ + + apiVersion: str + kind: str + metadata: ControlPlaneFilterMetadata + spec: Annotated[ + ControlPlaneFilterSpec, + Field( + description="ControlPlaneFilter allows for specifying a list of Nodes or Node selectors where the filter should be applied and managing filter entries in order.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="ControlPlaneFilterStatus defines the observed state of ControlPlaneFilter", + title="Status", + ), + ] = None + + +class ControlPlaneFilterDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class ControlPlaneFilterDeletedResources( + RootModel[List[ControlPlaneFilterDeletedResourceEntry]] +): + root: List[ControlPlaneFilterDeletedResourceEntry] + + +class ControlPlaneFilterList(BaseModel): + """ + ControlPlaneFilterList is a list of controlplanefilters + """ + + apiVersion: str + items: Optional[List[ControlPlaneFilter]] = None + kind: str + + +class ControlPlaneFilterMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class ControlPlaneFilterSpec(BaseModel): + """ + ControlPlaneFilter allows for specifying a list of Nodes or Node selectors where the filter should be applied and managing filter entries in order. + """ + + entries: Annotated[ + List[ControlPlaneFilterSpecEntry], + Field( + description="Specifies the list of filter entries, in order.", + title="Entries", + ), + ] + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select Toponodes on which to deploy the CPM filter.", + title="Node Selector", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field( + description="Reference to a list of TopoNodes on which to deploy the CPM filter.", + title="Nodes", + ), + ] = None + + +class ControlPlaneFilterSpecEntry(BaseModel): + ipEntry: Annotated[ + Optional[ControlPlaneFilterSpecEntryIpEntry], Field(title="IP Entry") + ] = None + macEntry: Annotated[ + Optional[ControlPlaneFilterSpecEntryMacEntry], Field(title="MAC Entry") + ] = None + type: Annotated[Literal["IPV4", "IPV6", "MAC", "Auto"], Field(title="Type")] + + +class ControlPlaneFilterSpecEntryIpEntry(BaseModel): + action: Annotated[ + Optional[Literal["Drop", "Accept", "RateLimit"]], + Field( + description="An action to take, either 'Accept','Drop', or 'RateLimit'.", + title="Action", + ), + ] = None + destinationPortName: Annotated[ + Optional[ + Literal[ + "ACAP", + "AFP-TCP", + "ARNS", + "ASF-RMCP", + "ASHARE", + "ATALK-RM", + "AURP", + "AUTH", + "BFD", + "BFD-ECHO", + "BFTP", + "BGMP", + "BGP", + "BOOTPC", + "BOOTPS", + "CCSO-NS", + "CHARGEN", + "CISCO-TDP", + "CITADEL", + "CLEARCASE", + "COMMERCE", + "COURIER", + "DAYTIME", + "DHCP-FAILOVER", + "DHCPV6-CLIENT", + "DHCPV6-SERVER", + "DICOM", + "DISCARD", + "DNSIX", + "DOMAIN", + "DSP", + "ECHO", + "EPP", + "ESRO", + "EXEC", + "FINGER", + "FTP", + "FTP-DATA", + "FTPS", + "FTPS-DATA", + "GODI", + "GOPHER", + "GTP-C", + "GTP-PRIME", + "GTP-U", + "HA-CLUSTER", + "HOSTNAME", + "HP-ALARM-MGR", + "HTTP", + "HTTP-ALT", + "HTTP-MGMT", + "HTTP-RPC", + "HTTPS", + "IEEE-MMS-SSL", + "IMAP", + "IMAP3", + "IMAPS", + "IPP", + "IPSEC", + "IPX", + "IRC", + "IRIS-BEEP", + "ISAKMP", + "ISAKMP-NAT", + "ISCSI", + "ISO-TSAP", + "KERBEROS", + "KERBEROS-ADM", + "KLOGIN", + "KPASSWD", + "KSHELL", + "L2TP", + "LDAP", + "LDAPS", + "LDP", + "LMP", + "LOGIN", + "LPD", + "LSP-PING", + "MAC-SERVER-ADM", + "MATIP-A", + "MATIP-B", + "MICRO-BFD", + "MICROSOFT-DS", + "MOBILE-IP", + "MONITOR", + "MPP", + "MS-EXCHANGE", + "MSDP", + "MSP", + "MSSQL-M", + "MSSQL-S", + "MULTIHOP-BFD", + "NAS", + "NCP", + "NETBIOS-DATA", + "NETBIOS-NS", + "NETBIOS-SS", + "NETNEWS", + "NETRJS-1", + "NETRJS-2", + "NETRJS-3", + "NETRJS-4", + "NETWALL", + "NEW-RWHO", + "NFS", + "NNTP", + "NNTPS", + "NTP", + "ODMR", + "OLSR", + "OPENVPN", + "PIM-AUTO-RP", + "PKIX-TIMESTAMP", + "POP2", + "POP3", + "POP3S", + "PPTP", + "PRINT-SRV", + "PTP-EVENT", + "PTP-GENERAL", + "QMTP", + "QOTD", + "RADIUS", + "RADIUS-ACCT", + "REMOTE-MAIL", + "REMOTEFS", + "REMOTECMD", + "RIP", + "RJE", + "RLP", + "RLZDB", + "RMC", + "RMONITOR", + "RPC2PORTMAP", + "RSYNC", + "RTELNET", + "RTSP", + "SGMP", + "SILC", + "SMUX", + "SNA-GW", + "SNMP", + "SNMP-TRAP", + "SNPP", + "SMTP", + "SQL-SVCS", + "SQL", + "SSH", + "SUBMISSION", + "SUNRPC", + "SVCLOC", + "SYSLOG", + "SYSTAT", + "TACACS", + "TALK", + "TCPMUX", + "TCPNETHASPSRV", + "TFTP", + "TIME", + "TIMED", + "UPS", + "XDMCP", + "XNS-CH", + "XNS-MAIL", + "XNS-TIME", + "Z3950", + ] + ], + Field( + description="Destination port to match by name.", + title="Destination Port Name", + ), + ] = None + destinationPortNumber: Annotated[ + Optional[int], + Field( + description="Destination port to match by numerical value.", + ge=0, + le=65535, + title="Destination Port Number", + ), + ] = None + destinationPortOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching destinationPort, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Destination Port Operator", + ), + ] = None + destinationPortRange: Annotated[ + Optional[str], + Field( + description="Range of destination ports to match, in the format n-m, e.g. 100-200, The start and end of the range must be port numbers.", + title="Destination Port Range", + ), + ] = None + destinationPrefix: Annotated[ + Optional[str], + Field(description="Destination prefix to match.", title="Destination Prefix"), + ] = None + firstFragment: Annotated[ + Optional[bool], + Field(description="Match the first fragment only.", title="First Fragment"), + ] = None + fragment: Annotated[ + Optional[bool], Field(description="Match any fragment.", title="Fragment") + ] = None + icmpCode: Annotated[ + Optional[List[int]], + Field( + description="Match a specific ICMP code, as a number between 0-255, e.g. 0.", + max_length=255, + min_length=0, + title="ICMP Code", + ), + ] = None + icmpTypeName: Annotated[ + Optional[ + Literal[ + "DestUnreachable", + "Echo", + "EchoReply", + "EchoRequest", + "McastRtrAdv", + "McastRtrSolicit", + "McastRtrTerm", + "MldDone", + "MldQuery", + "MldReport", + "MldV2", + "NeighborAdvertise", + "NeighborSolicit", + "NodeInfoQuery", + "NodeInfoResponse", + "PacketTooBig", + "ParamProblem", + "Redirect", + "RouterAdvertise", + "RouterRenumber", + "RouterSolicit", + "SourceQuench", + "TimeExceeded", + "Timestamp", + "TimestampReply", + ] + ], + Field( + description="Match a specific ICMP type by name, e.g. dest-unreachable.", + title="ICMP Type Name", + ), + ] = None + icmpTypeNumber: Annotated[ + Optional[int], + Field( + description="Match a specific ICMP type by number.", + ge=0, + le=255, + title="ICMP Type Number", + ), + ] = None + protocolName: Annotated[ + Optional[ + Literal[ + "AH", + "EGP", + "EIGRP", + "ESP", + "GGP", + "GRE", + "ICMP", + "ICMP6", + "IDRP", + "IGMP", + "IGP", + "IPV4", + "IPV6", + "IPV6-DEST-OPTS", + "IPV6-HOP", + "L2TP", + "MPLS-IN-IP", + "NO-NEXT-HDR", + "OSPF", + "PIM", + "ROHC", + "RSVP", + "SCTP", + "ST", + "TCP", + "UDP", + "VRRP", + ] + ], + Field( + description="Match a specific IP protocol name (specified in the type field of the IP header).", + title="Protocol Name", + ), + ] = None + protocolNumber: Annotated[ + Optional[int], + Field( + description="Match a specific IP protocol number (specified in the type field of the IP header).", + ge=0, + le=255, + title="Protocol Number", + ), + ] = None + rateLimit: Annotated[ + Optional[ControlPlaneFilterSpecEntryIpEntryRateLimit], + Field( + description="Rate limit to apply when the action is 'RateLimit'.", + title="Rate Limit", + ), + ] = None + sourcePortName: Annotated[ + Optional[ + Literal[ + "ACAP", + "AFP-TCP", + "ARNS", + "ASF-RMCP", + "ASHARE", + "ATALK-RM", + "AURP", + "AUTH", + "BFD", + "BFD-ECHO", + "BFTP", + "BGMP", + "BGP", + "BOOTPC", + "BOOTPS", + "CCSO-NS", + "CHARGEN", + "CISCO-TDP", + "CITADEL", + "CLEARCASE", + "COMMERCE", + "COURIER", + "DAYTIME", + "DHCP-FAILOVER", + "DHCPV6-CLIENT", + "DHCPV6-SERVER", + "DICOM", + "DISCARD", + "DNSIX", + "DOMAIN", + "DSP", + "ECHO", + "EPP", + "ESRO", + "EXEC", + "FINGER", + "FTP", + "FTP-DATA", + "FTPS", + "FTPS-DATA", + "GODI", + "GOPHER", + "GTP-C", + "GTP-PRIME", + "GTP-U", + "HA-CLUSTER", + "HOSTNAME", + "HP-ALARM-MGR", + "HTTP", + "HTTP-ALT", + "HTTP-MGMT", + "HTTP-RPC", + "HTTPS", + "IEEE-MMS-SSL", + "IMAP", + "IMAP3", + "IMAPS", + "IPP", + "IPSEC", + "IPX", + "IRC", + "IRIS-BEEP", + "ISAKMP", + "ISAKMP-NAT", + "ISCSI", + "ISO-TSAP", + "KERBEROS", + "KERBEROS-ADM", + "KLOGIN", + "KPASSWD", + "KSHELL", + "L2TP", + "LDAP", + "LDAPS", + "LDP", + "LMP", + "LOGIN", + "LPD", + "LSP-PING", + "MAC-SERVER-ADM", + "MATIP-A", + "MATIP-B", + "MICRO-BFD", + "MICROSOFT-DS", + "MOBILE-IP", + "MONITOR", + "MPP", + "MS-EXCHANGE", + "MSDP", + "MSP", + "MSSQL-M", + "MSSQL-S", + "MULTIHOP-BFD", + "NAS", + "NCP", + "NETBIOS-DATA", + "NETBIOS-NS", + "NETBIOS-SS", + "NETNEWS", + "NETRJS-1", + "NETRJS-2", + "NETRJS-3", + "NETRJS-4", + "NETWALL", + "NEW-RWHO", + "NFS", + "NNTP", + "NNTPS", + "NTP", + "ODMR", + "OLSR", + "OPENVPN", + "PIM-AUTO-RP", + "PKIX-TIMESTAMP", + "POP2", + "POP3", + "POP3S", + "PPTP", + "PRINT-SRV", + "PTP-EVENT", + "PTP-GENERAL", + "QMTP", + "QOTD", + "RADIUS", + "RADIUS-ACCT", + "REMOTE-MAIL", + "REMOTEFS", + "REMOTECMD", + "RIP", + "RJE", + "RLP", + "RLZDB", + "RMC", + "RMONITOR", + "RPC2PORTMAP", + "RSYNC", + "RTELNET", + "RTSP", + "SGMP", + "SILC", + "SMUX", + "SNA-GW", + "SNMP", + "SNMP-TRAP", + "SNPP", + "SMTP", + "SQL-SVCS", + "SQL", + "SSH", + "SUBMISSION", + "SUNRPC", + "SVCLOC", + "SYSLOG", + "SYSTAT", + "TACACS", + "TALK", + "TCPMUX", + "TCPNETHASPSRV", + "TFTP", + "TIME", + "TIMED", + "UPS", + "XDMCP", + "XNS-CH", + "XNS-MAIL", + "XNS-TIME", + "Z3950", + ] + ], + Field(description="Source port to match by name.", title="Source Port Name"), + ] = None + sourcePortNumber: Annotated[ + Optional[int], + Field( + description="Source port to match by numerical value.", + ge=0, + le=65535, + title="Source Port Number", + ), + ] = None + sourcePortOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching sourcePort, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Source Port Operator", + ), + ] = None + sourcePortRange: Annotated[ + Optional[str], + Field( + description="Range of source ports to match, in the format n-m, e.g. 100-200. The start and end of the range must be port numbers.", + title="Source Port Range", + ), + ] = None + sourcePrefix: Annotated[ + Optional[str], + Field(description="Source prefix to match.", title="Source Prefix"), + ] = None + tcpFlags: Annotated[ + Optional[str], + Field( + description="Match TCP flags, usable with !, &, | and the flags RST, SYN, and ACK.", + title="TCP Flags", + ), + ] = None + + +class ControlPlaneFilterSpecEntryIpEntryRateLimit(BaseModel): + """ + Rate limit to apply when the action is 'RateLimit'. + """ + + burstSize: Annotated[ + Optional[int], + Field(description="The maximum burst size in bytes.", title="Burst Size"), + ] = None + entrySpecificPolicer: Annotated[ + Optional[bool], + Field( + description="Controls policer instantiation: false for shared instance, true for per-entry instances", + title="Entry Specific Policer", + ), + ] = False + peakRate: Annotated[ + Optional[int], + Field(description="The peak rate in kilobytes per second.", title="Peak Rate"), + ] = None + scope: Annotated[ + Optional[Literal["Global", "Subinterface"]], + Field( + description="Determines how the policer is applied across subinterfaces. Global applies the policer across all subinterfaces, while Subinterface applies it individually to each subinterface.", + title="Scope", + ), + ] = "Global" + + +class ControlPlaneFilterSpecEntryMacEntry(BaseModel): + action: Annotated[ + Optional[Literal["Drop", "Accept", "RateLimit"]], + Field( + description="An action to take, either 'Accept','Drop', or 'RateLimit'.", + title="Action", + ), + ] = None + destinationMAC: Annotated[ + Optional[str], + Field( + description="Match an Ethernet frame if its destination MAC address logically anded with the mask equals this MAC address.", + title="Destination MAC", + ), + ] = None + destinationMACMask: Annotated[ + Optional[str], + Field( + description="Match an Ethernet frame if its destination MAC address logically anded with the mask equals the configured MAC address.", + title="Destination MAC Mask", + ), + ] = None + ethertype: Annotated[ + Optional[ + Literal[ + "ARP", + "AUTHENTICATION8021X", + "ETHOAM", + "FCOE", + "FCOEINITIALIZATION", + "FLOWCONTROL", + "IPV4", + "IPV6", + "LACP", + "LLDP", + "MACSEC", + "MPLSMULTICAST", + "MPLSUNICAST", + "PBB", + "PPPOEDISCOVERY", + "PPPOESESSION", + "PTP", + "ROCE", + ] + ], + Field( + description="An Ethernet frame matches this condition if its ethertype value (after 802.1Q VLAN tags) matches the specified value.", + title="Ethertype", + ), + ] = None + outerVLANIDOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching OuterVlanIdValue, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Outer VLAN ID Operator", + ), + ] = None + outerVLANIDRange: Annotated[ + Optional[str], + Field( + description="Range of Outer vlan IDs to match, in the format n-m, e.g. 100-200", + title="Outer VLAN ID Range", + ), + ] = None + outerVLANIDValue: Annotated[ + Optional[str], + Field( + description="Ethernet frame matching criteria based on the outermost VLAN ID found before the subinterface-defining VLAN tag (if any) is removed. A value of 'none' will match only untagged frames.", + title="Outer VLAN ID Value", + ), + ] = None + rateLimit: Annotated[ + Optional[ControlPlaneFilterSpecEntryMacEntryRateLimit], + Field( + description="Rate limit to apply when the action is 'RateLimit'.", + title="Rate Limit", + ), + ] = None + sourceMAC: Annotated[ + Optional[str], + Field( + description="Match an Ethernet frame if its source MAC address logically anded with the mask equals this MAC address.", + title="Source MAC", + ), + ] = None + sourceMACMask: Annotated[ + Optional[str], + Field( + description="Match an Ethernet frame if its source MAC address logically anded with the mask equals the configured MAC address.", + title="Source MAC Mask", + ), + ] = None + + +ControlPlaneFilterSpecEntryMacEntryRateLimit = ( + ControlPlaneFilterSpecEntryIpEntryRateLimit +) + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class Filter(BaseModel): + """ + Filter is the Schema for the filters API + """ + + apiVersion: str + kind: str + metadata: FilterMetadata + spec: Annotated[ + FilterSpec, + Field( + description="Filter allows for the creation and management of ordered filtering rules based on IP or MAC criteria. The resource supports various conditions and actions, enabling fine-grained control over network traffic by specifying rules for source and destination addresses, ports, and protocols.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="FilterStatus defines the observed state of Filter", + title="Status", + ), + ] = None + + +FilterDeletedResourceEntry = ControlPlaneFilterDeletedResourceEntry + + +class FilterDeletedResources(RootModel[List[FilterDeletedResourceEntry]]): + root: List[FilterDeletedResourceEntry] + + +class FilterList(BaseModel): + """ + FilterList is a list of filters + """ + + apiVersion: str + items: Optional[List[Filter]] = None + kind: str + + +FilterMetadata = ControlPlaneFilterMetadata + + +class FilterSpec(BaseModel): + """ + Filter allows for the creation and management of ordered filtering rules based on IP or MAC criteria. The resource supports various conditions and actions, enabling fine-grained control over network traffic by specifying rules for source and destination addresses, ports, and protocols. + """ + + entries: Annotated[ + List[FilterSpecEntry], + Field( + description="Specifies the list of filter entries, in order.", + title="Entries", + ), + ] + + +class FilterSpecEntry(BaseModel): + ipEntry: Annotated[Optional[FilterSpecEntryIpEntry], Field(title="IP Entry")] = None + macEntry: Annotated[Optional[FilterSpecEntryMacEntry], Field(title="MAC Entry")] = ( + None + ) + type: Annotated[Literal["IPV4", "IPV6", "MAC", "Auto"], Field(title="Type")] + + +class FilterSpecEntryIpEntry(BaseModel): + action: Annotated[ + Optional[Literal["Drop", "Accept", "RateLimit"]], + Field( + description="An action to take, either 'Accept','Drop', or 'RateLimit'.", + title="Action", + ), + ] = None + destinationPortName: Annotated[ + Optional[ + Literal[ + "ACAP", + "AFP-TCP", + "ARNS", + "ASF-RMCP", + "ASHARE", + "ATALK-RM", + "AURP", + "AUTH", + "BFD", + "BFD-ECHO", + "BFTP", + "BGMP", + "BGP", + "BOOTPC", + "BOOTPS", + "CCSO-NS", + "CHARGEN", + "CISCO-TDP", + "CITADEL", + "CLEARCASE", + "COMMERCE", + "COURIER", + "DAYTIME", + "DHCP-FAILOVER", + "DHCPV6-CLIENT", + "DHCPV6-SERVER", + "DICOM", + "DISCARD", + "DNSIX", + "DOMAIN", + "DSP", + "ECHO", + "EPP", + "ESRO", + "EXEC", + "FINGER", + "FTP", + "FTP-DATA", + "FTPS", + "FTPS-DATA", + "GODI", + "GOPHER", + "GTP-C", + "GTP-PRIME", + "GTP-U", + "HA-CLUSTER", + "HOSTNAME", + "HP-ALARM-MGR", + "HTTP", + "HTTP-ALT", + "HTTP-MGMT", + "HTTP-RPC", + "HTTPS", + "IEEE-MMS-SSL", + "IMAP", + "IMAP3", + "IMAPS", + "IPP", + "IPSEC", + "IPX", + "IRC", + "IRIS-BEEP", + "ISAKMP", + "ISAKMP-NAT", + "ISCSI", + "ISO-TSAP", + "KERBEROS", + "KERBEROS-ADM", + "KLOGIN", + "KPASSWD", + "KSHELL", + "L2TP", + "LDAP", + "LDAPS", + "LDP", + "LMP", + "LOGIN", + "LPD", + "LSP-PING", + "MAC-SERVER-ADM", + "MATIP-A", + "MATIP-B", + "MICRO-BFD", + "MICROSOFT-DS", + "MOBILE-IP", + "MONITOR", + "MPP", + "MS-EXCHANGE", + "MSDP", + "MSP", + "MSSQL-M", + "MSSQL-S", + "MULTIHOP-BFD", + "NAS", + "NCP", + "NETBIOS-DATA", + "NETBIOS-NS", + "NETBIOS-SS", + "NETNEWS", + "NETRJS-1", + "NETRJS-2", + "NETRJS-3", + "NETRJS-4", + "NETWALL", + "NEW-RWHO", + "NFS", + "NNTP", + "NNTPS", + "NTP", + "ODMR", + "OLSR", + "OPENVPN", + "PIM-AUTO-RP", + "PKIX-TIMESTAMP", + "POP2", + "POP3", + "POP3S", + "PPTP", + "PRINT-SRV", + "PTP-EVENT", + "PTP-GENERAL", + "QMTP", + "QOTD", + "RADIUS", + "RADIUS-ACCT", + "REMOTE-MAIL", + "REMOTEFS", + "REMOTECMD", + "RIP", + "RJE", + "RLP", + "RLZDB", + "RMC", + "RMONITOR", + "RPC2PORTMAP", + "RSYNC", + "RTELNET", + "RTSP", + "SGMP", + "SILC", + "SMUX", + "SNA-GW", + "SNMP", + "SNMP-TRAP", + "SNPP", + "SMTP", + "SQL-SVCS", + "SQL", + "SSH", + "SUBMISSION", + "SUNRPC", + "SVCLOC", + "SYSLOG", + "SYSTAT", + "TACACS", + "TALK", + "TCPMUX", + "TCPNETHASPSRV", + "TFTP", + "TIME", + "TIMED", + "UPS", + "XDMCP", + "XNS-CH", + "XNS-MAIL", + "XNS-TIME", + "Z3950", + ] + ], + Field( + description="Destination port to match by name.", + title="Destination Port Name", + ), + ] = None + destinationPortNumber: Annotated[ + Optional[int], + Field( + description="Destination port to match by numerical value.", + ge=0, + le=65535, + title="Destination Port Number", + ), + ] = None + destinationPortOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching destinationPort, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Destination Port Operator", + ), + ] = None + destinationPortRange: Annotated[ + Optional[str], + Field( + description="Range of destination ports to match, in the format n-m, e.g. 100-200, The start and end of the range must be port numbers.", + title="Destination Port Range", + ), + ] = None + destinationPrefix: Annotated[ + Optional[str], + Field(description="Destination prefix to match.", title="Destination Prefix"), + ] = None + firstFragment: Annotated[ + Optional[bool], + Field(description="Match the first fragment only.", title="First Fragment"), + ] = None + fragment: Annotated[ + Optional[bool], Field(description="Match any fragment.", title="Fragment") + ] = None + icmpCode: Annotated[ + Optional[List[int]], + Field( + description="Match a specific ICMP code, as a number between 0-255, e.g. 0.", + max_length=255, + min_length=0, + title="ICMP Code", + ), + ] = None + icmpTypeName: Annotated[ + Optional[ + Literal[ + "DestUnreachable", + "Echo", + "EchoReply", + "EchoRequest", + "McastRtrAdv", + "McastRtrSolicit", + "McastRtrTerm", + "MldDone", + "MldQuery", + "MldReport", + "MldV2", + "NeighborAdvertise", + "NeighborSolicit", + "NodeInfoQuery", + "NodeInfoResponse", + "PacketTooBig", + "ParamProblem", + "Redirect", + "RouterAdvertise", + "RouterRenumber", + "RouterSolicit", + "SourceQuench", + "TimeExceeded", + "Timestamp", + "TimestampReply", + ] + ], + Field( + description="Match a specific ICMP type by name, e.g. dest-unreachable.", + title="ICMP Type Name", + ), + ] = None + icmpTypeNumber: Annotated[ + Optional[int], + Field( + description="Match a specific ICMP type by number.", + ge=0, + le=255, + title="ICMP Type Number", + ), + ] = None + protocolName: Annotated[ + Optional[ + Literal[ + "AH", + "EGP", + "EIGRP", + "ESP", + "GGP", + "GRE", + "ICMP", + "ICMP6", + "IDRP", + "IGMP", + "IGP", + "IPV4", + "IPV6", + "IPV6-DEST-OPTS", + "IPV6-HOP", + "L2TP", + "MPLS-IN-IP", + "NO-NEXT-HDR", + "OSPF", + "PIM", + "ROHC", + "RSVP", + "SCTP", + "ST", + "TCP", + "UDP", + "VRRP", + ] + ], + Field( + description="Match a specific IP protocol name (specified in the type field of the IP header).", + title="Protocol Name", + ), + ] = None + protocolNumber: Annotated[ + Optional[int], + Field( + description="Match a specific IP protocol number (specified in the type field of the IP header).", + ge=0, + le=255, + title="Protocol Number", + ), + ] = None + rateLimit: Annotated[ + Optional[FilterSpecEntryIpEntryRateLimit], + Field( + description="Rate limit to apply when the action is 'RateLimit'.", + title="Rate Limit", + ), + ] = None + sourcePortName: Annotated[ + Optional[ + Literal[ + "ACAP", + "AFP-TCP", + "ARNS", + "ASF-RMCP", + "ASHARE", + "ATALK-RM", + "AURP", + "AUTH", + "BFD", + "BFD-ECHO", + "BFTP", + "BGMP", + "BGP", + "BOOTPC", + "BOOTPS", + "CCSO-NS", + "CHARGEN", + "CISCO-TDP", + "CITADEL", + "CLEARCASE", + "COMMERCE", + "COURIER", + "DAYTIME", + "DHCP-FAILOVER", + "DHCPV6-CLIENT", + "DHCPV6-SERVER", + "DICOM", + "DISCARD", + "DNSIX", + "DOMAIN", + "DSP", + "ECHO", + "EPP", + "ESRO", + "EXEC", + "FINGER", + "FTP", + "FTP-DATA", + "FTPS", + "FTPS-DATA", + "GODI", + "GOPHER", + "GTP-C", + "GTP-PRIME", + "GTP-U", + "HA-CLUSTER", + "HOSTNAME", + "HP-ALARM-MGR", + "HTTP", + "HTTP-ALT", + "HTTP-MGMT", + "HTTP-RPC", + "HTTPS", + "IEEE-MMS-SSL", + "IMAP", + "IMAP3", + "IMAPS", + "IPP", + "IPSEC", + "IPX", + "IRC", + "IRIS-BEEP", + "ISAKMP", + "ISAKMP-NAT", + "ISCSI", + "ISO-TSAP", + "KERBEROS", + "KERBEROS-ADM", + "KLOGIN", + "KPASSWD", + "KSHELL", + "L2TP", + "LDAP", + "LDAPS", + "LDP", + "LMP", + "LOGIN", + "LPD", + "LSP-PING", + "MAC-SERVER-ADM", + "MATIP-A", + "MATIP-B", + "MICRO-BFD", + "MICROSOFT-DS", + "MOBILE-IP", + "MONITOR", + "MPP", + "MS-EXCHANGE", + "MSDP", + "MSP", + "MSSQL-M", + "MSSQL-S", + "MULTIHOP-BFD", + "NAS", + "NCP", + "NETBIOS-DATA", + "NETBIOS-NS", + "NETBIOS-SS", + "NETNEWS", + "NETRJS-1", + "NETRJS-2", + "NETRJS-3", + "NETRJS-4", + "NETWALL", + "NEW-RWHO", + "NFS", + "NNTP", + "NNTPS", + "NTP", + "ODMR", + "OLSR", + "OPENVPN", + "PIM-AUTO-RP", + "PKIX-TIMESTAMP", + "POP2", + "POP3", + "POP3S", + "PPTP", + "PRINT-SRV", + "PTP-EVENT", + "PTP-GENERAL", + "QMTP", + "QOTD", + "RADIUS", + "RADIUS-ACCT", + "REMOTE-MAIL", + "REMOTEFS", + "REMOTECMD", + "RIP", + "RJE", + "RLP", + "RLZDB", + "RMC", + "RMONITOR", + "RPC2PORTMAP", + "RSYNC", + "RTELNET", + "RTSP", + "SGMP", + "SILC", + "SMUX", + "SNA-GW", + "SNMP", + "SNMP-TRAP", + "SNPP", + "SMTP", + "SQL-SVCS", + "SQL", + "SSH", + "SUBMISSION", + "SUNRPC", + "SVCLOC", + "SYSLOG", + "SYSTAT", + "TACACS", + "TALK", + "TCPMUX", + "TCPNETHASPSRV", + "TFTP", + "TIME", + "TIMED", + "UPS", + "XDMCP", + "XNS-CH", + "XNS-MAIL", + "XNS-TIME", + "Z3950", + ] + ], + Field(description="Source port to match by name.", title="Source Port Name"), + ] = None + sourcePortNumber: Annotated[ + Optional[int], + Field( + description="Source port to match by numerical value.", + ge=0, + le=65535, + title="Source Port Number", + ), + ] = None + sourcePortOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching sourcePort, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Source Port Operator", + ), + ] = None + sourcePortRange: Annotated[ + Optional[str], + Field( + description="Range of source ports to match, in the format n-m, e.g. 100-200. The start and end of the range must be port numbers.", + title="Source Port Range", + ), + ] = None + sourcePrefix: Annotated[ + Optional[str], + Field(description="Source prefix to match.", title="Source Prefix"), + ] = None + tcpFlags: Annotated[ + Optional[str], + Field( + description="Match TCP flags, usable with !, &, | and the flags RST, SYN, and ACK.", + title="TCP Flags", + ), + ] = None + + +FilterSpecEntryIpEntryRateLimit = ControlPlaneFilterSpecEntryIpEntryRateLimit + + +class FilterSpecEntryMacEntry(BaseModel): + action: Annotated[ + Optional[Literal["Drop", "Accept", "RateLimit"]], + Field( + description="An action to take, either 'Accept','Drop', or 'RateLimit'.", + title="Action", + ), + ] = None + destinationMAC: Annotated[ + Optional[str], + Field( + description="Match an Ethernet frame if its destination MAC address logically anded with the mask equals this MAC address.", + title="Destination MAC", + ), + ] = None + destinationMACMask: Annotated[ + Optional[str], + Field( + description="Match an Ethernet frame if its destination MAC address logically anded with the mask equals the configured MAC address.", + title="Destination MAC Mask", + ), + ] = None + ethertype: Annotated[ + Optional[ + Literal[ + "ARP", + "AUTHENTICATION8021X", + "ETHOAM", + "FCOE", + "FCOEINITIALIZATION", + "FLOWCONTROL", + "IPV4", + "IPV6", + "LACP", + "LLDP", + "MACSEC", + "MPLSMULTICAST", + "MPLSUNICAST", + "PBB", + "PPPOEDISCOVERY", + "PPPOESESSION", + "PTP", + "ROCE", + ] + ], + Field( + description="An Ethernet frame matches this condition if its ethertype value (after 802.1Q VLAN tags) matches the specified value.", + title="Ethertype", + ), + ] = None + outerVLANIDOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching OuterVlanIdValue, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Outer VLAN ID Operator", + ), + ] = None + outerVLANIDRange: Annotated[ + Optional[str], + Field( + description="Range of Outer vlan IDs to match, in the format n-m, e.g. 100-200", + title="Outer VLAN ID Range", + ), + ] = None + outerVLANIDValue: Annotated[ + Optional[str], + Field( + description="Ethernet frame matching criteria based on the outermost VLAN ID found before the subinterface-defining VLAN tag (if any) is removed. A value of 'none' will match only untagged frames.", + title="Outer VLAN ID Value", + ), + ] = None + rateLimit: Annotated[ + Optional[FilterSpecEntryMacEntryRateLimit], + Field( + description="Rate limit to apply when the action is 'RateLimit'.", + title="Rate Limit", + ), + ] = None + sourceMAC: Annotated[ + Optional[str], + Field( + description="Match an Ethernet frame if its source MAC address logically anded with the mask equals this MAC address.", + title="Source MAC", + ), + ] = None + sourceMACMask: Annotated[ + Optional[str], + Field( + description="Match an Ethernet frame if its source MAC address logically anded with the mask equals the configured MAC address.", + title="Source MAC Mask", + ), + ] = None + + +FilterSpecEntryMacEntryRateLimit = ControlPlaneFilterSpecEntryIpEntryRateLimit + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/interfaces/v1alpha1/models.py b/pydantic_eda/apps/interfaces/v1alpha1/models.py new file mode 100644 index 0000000..c635786 --- /dev/null +++ b/pydantic_eda/apps/interfaces/v1alpha1/models.py @@ -0,0 +1,820 @@ +# generated by datamodel-codegen: +# filename: interfaces.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class Breakout(BaseModel): + """ + Breakout is the Schema for the breakouts API + """ + + apiVersion: str + kind: str + metadata: BreakoutMetadata + spec: Annotated[ + BreakoutSpec, + Field( + description="Breakout allows for the configuration of interface breakouts on specified Nodes. This resource specifies the Nodes, parent Interfaces, the number of breakout channels, and the speed of each channel.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="BreakoutStatus defines the observed state of Breakout", + title="Status", + ), + ] = None + + +class BreakoutDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class BreakoutDeletedResources(RootModel[List[BreakoutDeletedResourceEntry]]): + root: List[BreakoutDeletedResourceEntry] + + +class BreakoutList(BaseModel): + """ + BreakoutList is a list of breakouts + """ + + apiVersion: str + items: Optional[List[Breakout]] = None + kind: str + + +class BreakoutMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class BreakoutSpec(BaseModel): + """ + Breakout allows for the configuration of interface breakouts on specified Nodes. This resource specifies the Nodes, parent Interfaces, the number of breakout channels, and the speed of each channel. + """ + + channels: Annotated[ + int, + Field( + description="The number of breakout channels to create.", + ge=1, + le=8, + title="Number of Channels", + ), + ] + interface: Annotated[ + Optional[List[str]], + Field( + description="A list of normalized parent interface/port.", + title="Nomalized Parent Interface", + ), + ] = None + node: Annotated[ + List[str], + Field( + description="Reference to a list of TopoNodes where the parent interfaces are to be broken out.", + title="Nodes", + ), + ] + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="TopoNode where the parent interfaces are to be broken out.", + title="TopoNode", + ), + ] = None + speed: Annotated[ + Literal["800G", "400G", "200G", "100G", "50G", "40G", "25G", "10G"], + Field(description="The speed of each breakout channel.", title="Speed"), + ] + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class Interface(BaseModel): + """ + Interface is the Schema for the interfaces API + """ + + apiVersion: str + kind: str + metadata: InterfaceMetadata + spec: Annotated[ + InterfaceSpec, + Field( + description="Interface allows for the configuration of various interface properties such as enabling/disabling the interface, setting descriptions, specifying interface types (e.g., LAG, interface, loopback), configuring VLAN encapsulation, and setting Ethernet or LAG-specific options.", + title="Specification", + ), + ] + status: Annotated[Optional[InterfaceStatus], Field(title="Status")] = None + + +InterfaceDeletedResourceEntry = BreakoutDeletedResourceEntry + + +class InterfaceDeletedResources(RootModel[List[InterfaceDeletedResourceEntry]]): + root: List[InterfaceDeletedResourceEntry] + + +class InterfaceList(BaseModel): + """ + InterfaceList is a list of interfaces + """ + + apiVersion: str + items: Optional[List[Interface]] = None + kind: str + + +InterfaceMetadata = BreakoutMetadata + + +class InterfaceSpec(BaseModel): + """ + Interface allows for the configuration of various interface properties such as enabling/disabling the interface, setting descriptions, specifying interface types (e.g., LAG, interface, loopback), configuring VLAN encapsulation, and setting Ethernet or LAG-specific options. + """ + + ddm: Annotated[ + Optional[bool], + Field(description="Enables reporting of DDM events.", title="DDM"), + ] = None + description: Annotated[ + Optional[str], + Field(description="Description of the interface.", title="Description"), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enable or disable the interface.", title="Enabled"), + ] = True + encapType: Annotated[ + Optional[Literal["null", "dot1q"]], + Field( + description='Enable or disable VLAN tagging on this interface. [default="null"]', + title="Encapsulation Type", + ), + ] = "null" + ethernet: Annotated[ + Optional[InterfaceSpecEthernet], + Field(description="Ethernet configuration options.", title="Ethernet"), + ] = None + lag: Annotated[ + Optional[InterfaceSpecLag], + Field(description="LAG configuration options.", title="LAG"), + ] = None + lldp: Annotated[ + Optional[bool], + Field( + description="Enable or disable LLDP on the members of the interface.", + title="Link Layer Discovery Protocol", + ), + ] = True + members: Annotated[ + List[InterfaceSpecMember], + Field( + description="List of members on which to apply properties, for single interface this would be a list of 1.", + title="Members", + ), + ] + mtu: Annotated[ + Optional[int], + Field( + description="MTU to apply on the interface(s).", + ge=1450, + le=9500, + title="MTU", + ), + ] = None + type: Annotated[ + Optional[Literal["lag", "interface", "loopback"]], + Field( + description="Type defines whether the interface is a Lag or Interface.", + title="Type", + ), + ] = "interface" + + +class InterfaceSpecEthernet(BaseModel): + """ + Ethernet configuration options. + """ + + fec: Annotated[ + Optional[Literal["disabled", "rs528", "rs544", "baser", "rs108"]], + Field( + description="Sets the Forward Error Correction (FEC) on the members of the interface.", + title="Forward Error Correction", + ), + ] = None + holdDownTimer: Annotated[ + Optional[int], + Field( + description="The hold-time down behavior is triggered with events that try to bring the ethernet interface down and can change quickly. It is not triggered with an admin-state disable event or interface disable due to other internal reasons. Units in milliseconds.", + ge=100, + le=86400000, + title="Hold Down Timer", + ), + ] = None + holdUpTimer: Annotated[ + Optional[int], + Field( + description="The hold-time up behavior is triggered with any event that tries to bring up the ethernet interface. While the hold-time up is running, the transceiver laser will be enabled, however the higher layers will not be notified that the interface is operationally up until the timer expires. Units in milliseconds.", + ge=100, + le=86400000, + title="Hold Up Timer", + ), + ] = None + reloadDelayTimer: Annotated[ + Optional[int], + Field( + description="After the system boots, the reload-delay timer in seconds keeps an interface shut down with the laser off for a configured amount of time until connectivity with the rest of network is established.", + ge=1, + le=86400, + title="Reload Delay Timer", + ), + ] = None + speed: Annotated[ + Optional[Literal["100G", "10G", "1G", "25G", "40G", "50G", "400G"]], + Field( + description="The speed of this interface, in human-readable format - e.g. 25G, 100G.", + title="Speed", + ), + ] = None + standbySignaling: Annotated[ + Optional[Literal["lacp", "power-off"]], + Field( + description="Indicates the standby-signaling used in the interface.", + title="Standby Signaling", + ), + ] = None + stormControl: Annotated[ + Optional[InterfaceSpecEthernetStormControl], + Field(description="Enables storm control.", title="Storm Control"), + ] = None + transparentL2CPProtocols: Annotated[ + Optional[List[Literal["LLDP", "LACP", "xSTP", "Dot1x", "PTP", "All"]]], + Field( + description="A list of L2CP protocols to tunnel. Options: LLDP, LACP, xSTP, Dot1x, PTP, All.", + title="Transparent L2CP Protocols", + ), + ] = None + + +class InterfaceSpecEthernetStormControl(BaseModel): + """ + Enables storm control. + """ + + broadcastRate: Annotated[ + Optional[int], + Field( + description="Sets the maximum rate allowed for ingress broadcast frames on the interface.", + ge=0, + le=100000000, + title="Broadcast Rate", + ), + ] = None + enabled: Annotated[ + Optional[bool], Field(description="Enables storm control.", title="Enabled") + ] = None + multicastRate: Annotated[ + Optional[int], + Field( + description="Sets the maximum rate allowed for ingress multicast frames on the interface.", + ge=0, + le=100000000, + title="Multicast Rate", + ), + ] = None + units: Annotated[ + Optional[Literal["kbps", "percentage"]], + Field(description="Set the units to be used for measurement.", title="Units"), + ] = None + unknownUnicastRate: Annotated[ + Optional[int], + Field( + description="Sets the maximum rate allowed for ingress unknown unicast frames on the interface.", + ge=0, + le=100000000, + title="Unknown Unicast Rate", + ), + ] = None + + +class InterfaceSpecLag(BaseModel): + """ + LAG configuration options. + """ + + lacp: Annotated[Optional[InterfaceSpecLagLacp], Field(title="LACP")] = None + minLinks: Annotated[ + Optional[int], + Field( + description="The min-link threshold specifies the minimum number of member links that must be active in order for the LAG to be operationally up. If the number of active links falls below this threshold, the entire LAG is brought operationally down.[default=1]", + ge=1, + le=64, + title="Minimum Links", + ), + ] = 1 + multihoming: Annotated[ + Optional[InterfaceSpecLagMultihoming], Field(title="Multi Homing") + ] = None + type: Annotated[ + Optional[Literal["lacp", "static"]], + Field( + description="This type defines whether whether it is a static or LACP LAG. [default=lacp]", + title="Type", + ), + ] = "lacp" + + +class InterfaceSpecLagLacp(BaseModel): + adminKey: Annotated[ + Optional[int], + Field( + description="Configure the LACP admin-key to be advertised by the local system.", + ge=1, + le=65535, + title="Admin Key", + ), + ] = None + interval: Annotated[ + Optional[Literal["fast", "slow"]], + Field( + description='Set the period between LACP messages, uses the lacp-period-type enumeration. [default="fast"]', + title="Interval", + ), + ] = "fast" + lacpFallback: Annotated[ + Optional[InterfaceSpecLagLacpLacpFallback], + Field( + description="LACP fallback allows one or more designated links of an LACP controlled LAG to go into forwarding mode if LACP is not yet operational after a configured timeout period. [default=disabled]", + title="Fallback", + ), + ] = None + mode: Annotated[ + Optional[Literal["active", "passive"]], + Field( + description='Active is to initiate the transmission of LACP PDUs. Passive is to wait for peer to initiate the transmission of LACP PDUs.[default="active"]', + title="Mode", + ), + ] = "active" + systemIdMac: Annotated[ + Optional[str], + Field( + description="The MAC address portion of the Node's System ID. This is combined with the system priority to construct the 8-octet system-id.", + title="System ID MAC", + ), + ] = None + systemPriority: Annotated[ + Optional[int], + Field( + description="System priority used by the Node on this LAG interface. Lower value is higher priority for determining which Node is the controlling system.[default=32768]", + ge=0, + le=65535, + title="System Priority", + ), + ] = 32768 + + +class InterfaceSpecLagLacpLacpFallback(BaseModel): + """ + LACP fallback allows one or more designated links of an LACP controlled LAG to go into forwarding mode if LACP is not yet operational after a configured timeout period. [default=disabled] + """ + + mode: Annotated[ + Optional[Literal["static"]], + Field(description="Specifies lacp-fallback mode if enabled.", title="Mode"), + ] = "static" + timeout: Annotated[ + Optional[int], + Field( + description="Specifies the LACP-fallback timeout interval in seconds. [default=60]", + ge=4, + le=3600, + title="Timeout", + ), + ] = 60 + + +class InterfaceSpecLagMultihoming(BaseModel): + esi: Annotated[ + Optional[str], + Field( + description="10 byte Ethernet Segment Identifier, if not set a type 0 ESI is generated. [default=auto]", + title="ESI", + ), + ] = "auto" + mode: Annotated[ + Optional[Literal["all-active", "single-active", "port-active"]], + Field( + description='"all-active": All interfaces are active.\n"single-active": In a single active MH LAG, the active and standby function is handled at the sub-interface layer within a network-instance. That is, the physical interfaces within the same LAG all remain operationally up, however each sub-interface associated with a network-instance has its operational state up or down based on whether it is selected to be the active or standby sub-interface.\n"port-active": When port active MH LAG is enabled, the active and standby function is handled at the interface level.', + title="Mode", + ), + ] = "all-active" + preferredActiveNode: Annotated[ + Optional[str], + Field( + description="To be used in single-active or port-active modes. This references the Node object and when set, the DF algorithm is configured to type preference and the selected Node is set with a higher preference value. All other Nodes have a lower value configured.", + title="Preferred Active Node", + ), + ] = None + reloadDelayTimer: Annotated[ + Optional[int], + Field( + description="After the system boots, the reload-delay timer in seconds keeps an interface shut down with the laser off for a configured amount of time until connectivity with the rest of network is established. [default=100]", + ge=1, + le=86400, + title="Reload Delay Timer", + ), + ] = 100 + revertive: Annotated[ + Optional[bool], + Field( + description="To be used in single-active or port-active modes. When true, if there is a switch of active interface in the LAG and the original interface comes back up, the LAG will switch back to using the original interface as active. [default=false]", + title="Revertive", + ), + ] = False + + +class InterfaceSpecMember(BaseModel): + aggregateId: Annotated[ + Optional[str], + Field( + description="When using a LAG, the aggregateId can be specified per set of interfaces on a node.\nLAG interface with which this interface is associated.", + title="Aggregate ID", + ), + ] = None + description: Annotated[ + Optional[str], + Field( + description="Description of the member, inherited from the interface if not provided.", + title="Description", + ), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enable or disable this member.", title="Enabled"), + ] = True + interface: Annotated[ + str, + Field( + description="Reference to an interface in the normalized format. Ex: SRL ethernet-1/1 would be ethernet-1-1. SROS port 2/1/1 would be ethernet-2-1.", + title="Interface", + ), + ] + lacpPortPriority: Annotated[ + Optional[int], + Field( + description="Configure the port priority for LACP. This value is used to determine which port should be activated with LACP fallback mode. Lower values are more preferred.[default=32768]", + ge=0, + le=65535, + title="LACP Port Priority", + ), + ] = 32768 + node: Annotated[str, Field(description="Node name.", title="Node Name")] + + +class InterfaceState(BaseModel): + """ + InterfaceState is the Schema for the interfacestates API + """ + + apiVersion: str + kind: str + metadata: InterfaceStateMetadata + spec: Annotated[InterfaceStateSpec, Field(title="Specification")] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="InterfaceStateStatus defines the observed state of Interface", + title="Status", + ), + ] = None + + +InterfaceStateDeletedResourceEntry = BreakoutDeletedResourceEntry + + +class InterfaceStateDeletedResources( + RootModel[List[InterfaceStateDeletedResourceEntry]] +): + root: List[InterfaceStateDeletedResourceEntry] + + +class InterfaceStateList(BaseModel): + """ + InterfaceStateList is a list of interfacestates + """ + + apiVersion: str + items: Optional[List[InterfaceState]] = None + kind: str + + +InterfaceStateMetadata = BreakoutMetadata + + +class InterfaceStateSpec(BaseModel): + enabled: Annotated[ + Optional[bool], Field(description="Enable or disable the interface.") + ] = None + lag: Annotated[Optional[InterfaceStateSpecLag], Field(title="Lag")] = None + members: Annotated[ + List[InterfaceStateSpecMember], + Field(description="List of members on which to monitor state for"), + ] + role: Annotated[ + Optional[Literal["isl", "edge", "loopback"]], + Field( + description='Role of this interface. This is used to calculate severity of alarms. [default="edge"]' + ), + ] = "edge" + + +class InterfaceStateSpecMember(BaseModel): + aggregateId: Annotated[ + Optional[str], + Field(description="LAG interface with which this interface is associated"), + ] = None + enabled: Annotated[ + Optional[bool], Field(description="Enable or disable this member.") + ] = None + interface: Annotated[str, Field(description="Normalized interface name")] + node: Annotated[ + str, Field(description="Reference to the TopoNode on which this member resides") + ] + nodeInterface: Annotated[ + str, + Field( + description='Node specific interface name, for example "ethernet-1/1", "1/1/c1/1"' + ), + ] + operatingSystem: Annotated[ + str, + Field( + description="The operating system of the TopoNode on which this member resides" + ), + ] + version: Annotated[ + str, + Field( + description="The version of the TopoNode on which this interface resides" + ), + ] + + +class InterfaceStatus(BaseModel): + enabled: Annotated[ + Optional[bool], + Field( + description="The administrative status of the Interface.", title="Enabled" + ), + ] = None + lag: Annotated[Optional[InterfaceStatusLag], Field(title="Lag")] = None + lastChange: Annotated[ + Optional[date], + Field( + description="Indicates when this Interface last changed state.", + title="Last Change", + ), + ] = None + members: Annotated[ + Optional[List[InterfaceStatusMember]], + Field(description="List of members in this Interface.", title="Members"), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Indicates the current operational state of the Interface.", + title="Operational State", + ), + ] = None + speed: Annotated[ + Optional[str], + Field( + description="Indicates the operational speed of the Interface in aggregate.", + title="Speed", + ), + ] = None + + +class InterfaceStatusLag(BaseModel): + adminKey: Annotated[Optional[int], Field(title="Admin Key")] = None + systemIdMac: Annotated[Optional[str], Field(title="System ID MAC")] = None + + +class InterfaceStatusMember(BaseModel): + enabled: Annotated[ + Optional[bool], + Field(description="The administrative status of this member.", title="Enabled"), + ] = None + interface: Annotated[ + Optional[str], + Field( + description="The name of the interface in normalized format.", + title="Interface", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="Indicates when this member last changed state.", + title="Last Change", + ), + ] = None + neighbors: Annotated[ + Optional[List[InterfaceStatusMemberNeighbor]], + Field( + description="List of discovered neighbors on this member.", + title="Neighbors", + ), + ] = None + node: Annotated[ + Optional[str], + Field( + description="The node on which the interface is configured.", title="Node" + ), + ] = None + nodeInterface: Annotated[ + str, + Field( + description='Node specific interface name, for example "ethernet-1/1", "1/1/c1/1".', + title="Node Interface", + ), + ] + operationalState: Annotated[ + Optional[str], + Field( + description="Indicates the current operational state of this member.", + title="Operational State", + ), + ] = None + speed: Annotated[ + Optional[str], + Field( + description="Indicates the operational speed of the member.", title="Speed" + ), + ] = None + + +class InterfaceStatusMemberNeighbor(BaseModel): + interface: Annotated[ + Optional[str], + Field( + description="The name of a neighbor interface of this member in node specific format.", + title="Interface", + ), + ] = None + node: Annotated[ + Optional[str], + Field( + description="The name of a neighbor node of this member in node specific format.", + title="Node", + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str + + +InterfaceStateSpecLag = InterfaceStatusLag diff --git a/pydantic_eda/apps/oam/v1alpha1/models.py b/pydantic_eda/apps/oam/v1alpha1/models.py new file mode 100644 index 0000000..7138637 --- /dev/null +++ b/pydantic_eda/apps/oam/v1alpha1/models.py @@ -0,0 +1,1381 @@ +# generated by datamodel-codegen: +# filename: oam.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Mirror(BaseModel): + """ + Mirror is the Schema for the mirrors API + """ + + apiVersion: str + kind: str + metadata: MirrorMetadata + spec: Annotated[ + MirrorSpec, + Field( + description="Mirror allows for the configuration of mirroring sources, including interfaces, subinterfaces, and filters, as well as the destination for the mirrored traffic, which can be either local or remote.", + title="Specification", + ), + ] + status: Annotated[ + Optional[MirrorStatus], + Field( + description="MirrorStatus defines the observed state of Mirror", + title="Status", + ), + ] = None + + +class MirrorDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class MirrorDeletedResources(RootModel[List[MirrorDeletedResourceEntry]]): + root: List[MirrorDeletedResourceEntry] + + +class MirrorList(BaseModel): + """ + MirrorList is a list of mirrors + """ + + apiVersion: str + items: Optional[List[Mirror]] = None + kind: str + + +class MirrorMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class MirrorSpec(BaseModel): + """ + Mirror allows for the configuration of mirroring sources, including interfaces, subinterfaces, and filters, as well as the destination for the mirrored traffic, which can be either local or remote. + """ + + localDestination: Annotated[ + Optional[MirrorSpecLocalDestination], + Field( + description="Local destination for the mirror, there can only be either a remote destination or local destination provisioned for a Mirror.", + title="Local Destination", + ), + ] = None + remoteDestination: Annotated[ + Optional[MirrorSpecRemoteDestination], + Field( + description="Remote destination for the mirror, there can only be either a remote destination or local destination provisioned for a Mirror.", + title="Remote Destination", + ), + ] = None + sources: Annotated[ + MirrorSpecSources, Field(description="Mirror sources.", title="Sources") + ] + + +class MirrorSpecLocalDestination(BaseModel): + """ + Local destination for the mirror, there can only be either a remote destination or local destination provisioned for a Mirror. + """ + + interface: Annotated[ + Optional[str], + Field( + description="Reference to an Interface resource to send the mirrored traffic to. This must be on the same Node as the source.", + title="Local Interface", + ), + ] = None + vlanID: Annotated[ + Optional[str], + Field( + description="Single value between 0-4094 support, or the special keyword untagged.", + title="VLAN ID", + ), + ] = None + + +class MirrorSpecRemoteDestination(BaseModel): + """ + Remote destination for the mirror, there can only be either a remote destination or local destination provisioned for a Mirror. + """ + + defaultRouter: Annotated[ + Optional[str], + Field( + description="Specifies the DefaultRouter to reach the remote destination of the mirror, a Router and DefaultRouter reference cannot be set at the same time.", + title="Default Router", + ), + ] = None + destinationIP: Annotated[ + Optional[str], + Field( + description="Remote destination IP address. When a remote destination is used for the mirror, the destinationIP is mandatory.", + title="Destination IP", + ), + ] = None + encapsulation: Annotated[ + Optional[Literal["L2OGRE", "L3OGRE"]], Field(title="Encapsulation") + ] = None + router: Annotated[ + Optional[str], + Field( + description="Specifies the Router to reach the remote destination of the mirror, a Router and DefaultRouter reference cannot be set at the same time.", + title="Router", + ), + ] = None + sourceIP: Annotated[ + Optional[str], + Field( + description="Source IP to use when sending a mirror to a remote destination. When a remote destination us used for the mirror, the sourceIP is mandatory.", + title="Source IP", + ), + ] = None + + +class MirrorSpecSources(BaseModel): + """ + Mirror sources. + """ + + direction: Annotated[ + Literal["Ingress", "Egress", "IngressEgress"], + Field( + description="The direction of the traffic being mirrored.", + title="Direction", + ), + ] + filters: Annotated[ + Optional[List[MirrorSpecSourcesFilter]], Field(title="Filters") + ] = None + interfaces: Annotated[ + Optional[MirrorSpecSourcesInterfaces], + Field( + description="Reference to an Interface resource to be mirrored. Traffic from the entire Interface will be mirrored for any selected Interfaces.", + title="Interfaces", + ), + ] = None + subinterfaces: Annotated[ + Optional[MirrorSpecSourcesSubinterfaces], Field(title="Subinterfaces") + ] = None + + +class MirrorSpecSourcesFilter(BaseModel): + filter: Annotated[ + Optional[MirrorSpecSourcesFilterFilter], + Field( + description="Emittes an MirrorFilter and uses the filter as a source for the Mirror.", + title="Filter", + ), + ] = None + subinterfaces: Annotated[ + Optional[MirrorSpecSourcesFilterSubinterfaces], + Field( + description="Subinterfaces on which to deploy the IPFilter to use as a source for the Mirror.", + title="Subinterfaces", + ), + ] = None + + +class MirrorSpecSourcesFilterFilter(BaseModel): + """ + Emittes an MirrorFilter and uses the filter as a source for the Mirror. + """ + + entries: Annotated[ + List[MirrorSpecSourcesFilterFilterEntry], + Field( + description="Specifies the list of filter entries, in order.", + title="Entries", + ), + ] + + +class MirrorSpecSourcesFilterFilterEntry(BaseModel): + ipEntry: Annotated[ + Optional[MirrorSpecSourcesFilterFilterEntryIpEntry], Field(title="IP Entry") + ] = None + type: Annotated[Literal["IPV4", "IPV6", "Auto"], Field(title="Type")] + + +class MirrorSpecSourcesFilterFilterEntryIpEntry(BaseModel): + action: Annotated[ + Optional[Literal["Drop", "Accept", "RateLimit"]], + Field( + description="An action to take, either 'Accept','Drop', or 'RateLimit'.", + title="Action", + ), + ] = None + destinationPortName: Annotated[ + Optional[ + Literal[ + "ACAP", + "AFP-TCP", + "ARNS", + "ASF-RMCP", + "ASHARE", + "ATALK-RM", + "AURP", + "AUTH", + "BFD", + "BFD-ECHO", + "BFTP", + "BGMP", + "BGP", + "BOOTPC", + "BOOTPS", + "CCSO-NS", + "CHARGEN", + "CISCO-TDP", + "CITADEL", + "CLEARCASE", + "COMMERCE", + "COURIER", + "DAYTIME", + "DHCP-FAILOVER", + "DHCPV6-CLIENT", + "DHCPV6-SERVER", + "DICOM", + "DISCARD", + "DNSIX", + "DOMAIN", + "DSP", + "ECHO", + "EPP", + "ESRO", + "EXEC", + "FINGER", + "FTP", + "FTP-DATA", + "FTPS", + "FTPS-DATA", + "GODI", + "GOPHER", + "GTP-C", + "GTP-PRIME", + "GTP-U", + "HA-CLUSTER", + "HOSTNAME", + "HP-ALARM-MGR", + "HTTP", + "HTTP-ALT", + "HTTP-MGMT", + "HTTP-RPC", + "HTTPS", + "IEEE-MMS-SSL", + "IMAP", + "IMAP3", + "IMAPS", + "IPP", + "IPSEC", + "IPX", + "IRC", + "IRIS-BEEP", + "ISAKMP", + "ISAKMP-NAT", + "ISCSI", + "ISO-TSAP", + "KERBEROS", + "KERBEROS-ADM", + "KLOGIN", + "KPASSWD", + "KSHELL", + "L2TP", + "LDAP", + "LDAPS", + "LDP", + "LMP", + "LOGIN", + "LPD", + "LSP-PING", + "MAC-SERVER-ADM", + "MATIP-A", + "MATIP-B", + "MICRO-BFD", + "MICROSOFT-DS", + "MOBILE-IP", + "MONITOR", + "MPP", + "MS-EXCHANGE", + "MSDP", + "MSP", + "MSSQL-M", + "MSSQL-S", + "MULTIHOP-BFD", + "NAS", + "NCP", + "NETBIOS-DATA", + "NETBIOS-NS", + "NETBIOS-SS", + "NETNEWS", + "NETRJS-1", + "NETRJS-2", + "NETRJS-3", + "NETRJS-4", + "NETWALL", + "NEW-RWHO", + "NFS", + "NNTP", + "NNTPS", + "NTP", + "ODMR", + "OLSR", + "OPENVPN", + "PIM-AUTO-RP", + "PKIX-TIMESTAMP", + "POP2", + "POP3", + "POP3S", + "PPTP", + "PRINT-SRV", + "PTP-EVENT", + "PTP-GENERAL", + "QMTP", + "QOTD", + "RADIUS", + "RADIUS-ACCT", + "REMOTE-MAIL", + "REMOTEFS", + "REMOTECMD", + "RIP", + "RJE", + "RLP", + "RLZDB", + "RMC", + "RMONITOR", + "RPC2PORTMAP", + "RSYNC", + "RTELNET", + "RTSP", + "SGMP", + "SILC", + "SMUX", + "SNA-GW", + "SNMP", + "SNMP-TRAP", + "SNPP", + "SMTP", + "SQL-SVCS", + "SQL", + "SSH", + "SUBMISSION", + "SUNRPC", + "SVCLOC", + "SYSLOG", + "SYSTAT", + "TACACS", + "TALK", + "TCPMUX", + "TCPNETHASPSRV", + "TFTP", + "TIME", + "TIMED", + "UPS", + "XDMCP", + "XNS-CH", + "XNS-MAIL", + "XNS-TIME", + "Z3950", + ] + ], + Field( + description="Destination port to match by name.", + title="Destination Port Name", + ), + ] = None + destinationPortNumber: Annotated[ + Optional[int], + Field( + description="Destination port to match by numerical value.", + ge=0, + le=65535, + title="Destination Port Number", + ), + ] = None + destinationPortOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching destinationPort, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Destination Port Operator", + ), + ] = None + destinationPortRange: Annotated[ + Optional[str], + Field( + description="Range of destination ports to match, in the format n-m, e.g. 100-200, The start and end of the range must be port numbers.", + title="Destination Port Range", + ), + ] = None + destinationPrefix: Annotated[ + Optional[str], + Field(description="Destination prefix to match.", title="Destination Prefix"), + ] = None + firstFragment: Annotated[ + Optional[bool], + Field(description="Match the first fragment only.", title="First Fragment"), + ] = None + fragment: Annotated[ + Optional[bool], Field(description="Match any fragment.", title="Fragment") + ] = None + icmpCode: Annotated[ + Optional[List[int]], + Field( + description="Match a specific ICMP code, as a number between 0-255, e.g. 0.", + max_length=255, + min_length=0, + title="ICMP Code", + ), + ] = None + icmpTypeName: Annotated[ + Optional[ + Literal[ + "DestUnreachable", + "Echo", + "EchoReply", + "EchoRequest", + "McastRtrAdv", + "McastRtrSolicit", + "McastRtrTerm", + "MldDone", + "MldQuery", + "MldReport", + "MldV2", + "NeighborAdvertise", + "NeighborSolicit", + "NodeInfoQuery", + "NodeInfoResponse", + "PacketTooBig", + "ParamProblem", + "Redirect", + "RouterAdvertise", + "RouterRenumber", + "RouterSolicit", + "SourceQuench", + "TimeExceeded", + "Timestamp", + "TimestampReply", + ] + ], + Field( + description="Match a specific ICMP type by name, e.g. dest-unreachable.", + title="ICMP Type Name", + ), + ] = None + icmpTypeNumber: Annotated[ + Optional[int], + Field( + description="Match a specific ICMP type by number.", + ge=0, + le=255, + title="ICMP Type Number", + ), + ] = None + protocolName: Annotated[ + Optional[ + Literal[ + "AH", + "EGP", + "EIGRP", + "ESP", + "GGP", + "GRE", + "ICMP", + "ICMP6", + "IDRP", + "IGMP", + "IGP", + "IPV4", + "IPV6", + "IPV6-DEST-OPTS", + "IPV6-HOP", + "L2TP", + "MPLS-IN-IP", + "NO-NEXT-HDR", + "OSPF", + "PIM", + "ROHC", + "RSVP", + "SCTP", + "ST", + "TCP", + "UDP", + "VRRP", + ] + ], + Field( + description="Match a specific IP protocol name (specified in the type field of the IP header).", + title="Protocol Name", + ), + ] = None + protocolNumber: Annotated[ + Optional[int], + Field( + description="Match a specific IP protocol number (specified in the type field of the IP header).", + ge=0, + le=255, + title="Protocol Number", + ), + ] = None + rateLimit: Annotated[ + Optional[MirrorSpecSourcesFilterFilterEntryIpEntryRateLimit], + Field( + description="Rate limit to apply when the action is 'RateLimit'.", + title="Rate Limit", + ), + ] = None + sourcePortName: Annotated[ + Optional[ + Literal[ + "ACAP", + "AFP-TCP", + "ARNS", + "ASF-RMCP", + "ASHARE", + "ATALK-RM", + "AURP", + "AUTH", + "BFD", + "BFD-ECHO", + "BFTP", + "BGMP", + "BGP", + "BOOTPC", + "BOOTPS", + "CCSO-NS", + "CHARGEN", + "CISCO-TDP", + "CITADEL", + "CLEARCASE", + "COMMERCE", + "COURIER", + "DAYTIME", + "DHCP-FAILOVER", + "DHCPV6-CLIENT", + "DHCPV6-SERVER", + "DICOM", + "DISCARD", + "DNSIX", + "DOMAIN", + "DSP", + "ECHO", + "EPP", + "ESRO", + "EXEC", + "FINGER", + "FTP", + "FTP-DATA", + "FTPS", + "FTPS-DATA", + "GODI", + "GOPHER", + "GTP-C", + "GTP-PRIME", + "GTP-U", + "HA-CLUSTER", + "HOSTNAME", + "HP-ALARM-MGR", + "HTTP", + "HTTP-ALT", + "HTTP-MGMT", + "HTTP-RPC", + "HTTPS", + "IEEE-MMS-SSL", + "IMAP", + "IMAP3", + "IMAPS", + "IPP", + "IPSEC", + "IPX", + "IRC", + "IRIS-BEEP", + "ISAKMP", + "ISAKMP-NAT", + "ISCSI", + "ISO-TSAP", + "KERBEROS", + "KERBEROS-ADM", + "KLOGIN", + "KPASSWD", + "KSHELL", + "L2TP", + "LDAP", + "LDAPS", + "LDP", + "LMP", + "LOGIN", + "LPD", + "LSP-PING", + "MAC-SERVER-ADM", + "MATIP-A", + "MATIP-B", + "MICRO-BFD", + "MICROSOFT-DS", + "MOBILE-IP", + "MONITOR", + "MPP", + "MS-EXCHANGE", + "MSDP", + "MSP", + "MSSQL-M", + "MSSQL-S", + "MULTIHOP-BFD", + "NAS", + "NCP", + "NETBIOS-DATA", + "NETBIOS-NS", + "NETBIOS-SS", + "NETNEWS", + "NETRJS-1", + "NETRJS-2", + "NETRJS-3", + "NETRJS-4", + "NETWALL", + "NEW-RWHO", + "NFS", + "NNTP", + "NNTPS", + "NTP", + "ODMR", + "OLSR", + "OPENVPN", + "PIM-AUTO-RP", + "PKIX-TIMESTAMP", + "POP2", + "POP3", + "POP3S", + "PPTP", + "PRINT-SRV", + "PTP-EVENT", + "PTP-GENERAL", + "QMTP", + "QOTD", + "RADIUS", + "RADIUS-ACCT", + "REMOTE-MAIL", + "REMOTEFS", + "REMOTECMD", + "RIP", + "RJE", + "RLP", + "RLZDB", + "RMC", + "RMONITOR", + "RPC2PORTMAP", + "RSYNC", + "RTELNET", + "RTSP", + "SGMP", + "SILC", + "SMUX", + "SNA-GW", + "SNMP", + "SNMP-TRAP", + "SNPP", + "SMTP", + "SQL-SVCS", + "SQL", + "SSH", + "SUBMISSION", + "SUNRPC", + "SVCLOC", + "SYSLOG", + "SYSTAT", + "TACACS", + "TALK", + "TCPMUX", + "TCPNETHASPSRV", + "TFTP", + "TIME", + "TIMED", + "UPS", + "XDMCP", + "XNS-CH", + "XNS-MAIL", + "XNS-TIME", + "Z3950", + ] + ], + Field(description="Source port to match by name.", title="Source Port Name"), + ] = None + sourcePortNumber: Annotated[ + Optional[int], + Field( + description="Source port to match by numerical value.", + ge=0, + le=65535, + title="Source Port Number", + ), + ] = None + sourcePortOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching sourcePort, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Source Port Operator", + ), + ] = None + sourcePortRange: Annotated[ + Optional[str], + Field( + description="Range of source ports to match, in the format n-m, e.g. 100-200. The start and end of the range must be port numbers.", + title="Source Port Range", + ), + ] = None + sourcePrefix: Annotated[ + Optional[str], + Field(description="Source prefix to match.", title="Source Prefix"), + ] = None + tcpFlags: Annotated[ + Optional[str], + Field( + description="Match TCP flags, usable with !, &, | and the flags RST, SYN, and ACK.", + title="TCP Flags", + ), + ] = None + + +class MirrorSpecSourcesFilterFilterEntryIpEntryRateLimit(BaseModel): + """ + Rate limit to apply when the action is 'RateLimit'. + """ + + burstSize: Annotated[ + Optional[int], + Field(description="The maximum burst size in bytes.", title="Burst Size"), + ] = None + entrySpecificPolicer: Annotated[ + Optional[bool], + Field( + description="Controls policer instantiation: false for shared instance, true for per-entry instances", + title="Entry Specific Policer", + ), + ] = False + peakRate: Annotated[ + Optional[int], + Field(description="The peak rate in kilobytes per second.", title="Peak Rate"), + ] = None + scope: Annotated[ + Optional[Literal["Global", "Subinterface"]], + Field( + description="Determines how the policer is applied across subinterfaces. Global applies the policer across all subinterfaces, while Subinterface applies it individually to each subinterface.", + title="Scope", + ), + ] = "Global" + + +class MirrorSpecSourcesFilterSubinterfaces(BaseModel): + """ + Subinterfaces on which to deploy the IPFilter to use as a source for the Mirror. + """ + + bridgeInterfaces: Annotated[ + Optional[List[str]], + Field( + description="List of BridgeInterfaces, all traffic from all BridgeInterfaces in the list will be used as sources to be mirrored. A combination of VLANs, BridgeInterfaces and subinterfaces can be configured as sources together.", + title="Bridge Interfaces", + ), + ] = None + subinterfaces: Annotated[ + Optional[List[MirrorSpecSourcesFilterSubinterfacesSubinterface]], + Field( + description="List of Interfaces and subinterface indices", + title="Subinterfaces", + ), + ] = None + vlans: Annotated[ + Optional[List[str]], + Field( + description="List of VLAN resources, all subinterfaces attached to the VLAN will be used as sources to be mirrored. A combination of VLANs, BridgeInterfaces and subinterfaces can be configured as sources together.", + title="VLAN", + ), + ] = None + + +class MirrorSpecSourcesFilterSubinterfacesSubinterface(BaseModel): + index: Annotated[ + Optional[int], + Field( + description="Index of the sub-interface. This is ignored on a node running SROS.", + title="Subinterface Index", + ), + ] = None + interfaceName: Annotated[ + str, + Field( + description="Reference to an Interface resource, the combination of the Interface and the specified subinterface index will build the subinterface to be used as a source of traffic to be mirrored. A combination of VLANs, BridgeInterfaces and subinterfaces can be configured as sources together.", + title="Interface Name", + ), + ] + vlan: Annotated[ + Optional[str], + Field( + description="Reference to the VLAN resource under which the sub-interface is configured. This is mandatory when the sub-interface is on a node running SROS and ignored for all other node operating systems.", + title="VLAN", + ), + ] = None + + +class MirrorSpecSourcesInterfaces(BaseModel): + """ + Reference to an Interface resource to be mirrored. Traffic from the entire Interface will be mirrored for any selected Interfaces. + """ + + interfaceSelector: Annotated[ + Optional[List[str]], + Field( + description="Select Interfaces using a label selector to be mirrored. Traffic from the entire Interface will be mirrored for any selected Interfaces. If both a label selector is used and a list of Interfaces is provided, a combination of all selected and provided interfaces will be mirrored.", + title="Interface Selector", + ), + ] = None + interfaces: Annotated[ + Optional[List[str]], + Field( + description="List of Interfaces to be mirrored. Traffic from the entire Interface will be mirrored for any selected Interfaces. If both a label selector is used and a list of Interfaces is provided, a combination of all selected and provided interfaces will be mirrored.", + title="Interfaces", + ), + ] = None + + +class MirrorSpecSourcesSubinterfaces(BaseModel): + bridgeInterfaces: Annotated[ + Optional[List[str]], + Field( + description="List of BridgeInterfaces, all traffic from all BridgeInterfaces in the list will be used as sources to be mirrored. A combination of VLANs, BridgeInterfaces and subinterfaces can be configured as sources together.", + title="Bridge Interfaces", + ), + ] = None + subinterfaces: Annotated[ + Optional[List[MirrorSpecSourcesSubinterfacesSubinterface]], + Field( + description="List of Interfaces and subinterface indices", + title="Subinterfaces", + ), + ] = None + vlans: Annotated[ + Optional[List[str]], + Field( + description="List of VLAN resources, all subinterfaces attached to the VLAN will be used as sources to be mirrored. A combination of VLANs, BridgeInterfaces and subinterfaces can be configured as sources together.", + title="VLAN", + ), + ] = None + + +MirrorSpecSourcesSubinterfacesSubinterface = ( + MirrorSpecSourcesFilterSubinterfacesSubinterface +) + + +class MirrorStatus(BaseModel): + """ + MirrorStatus defines the observed state of Mirror + """ + + lastChange: Annotated[ + Optional[date], + Field( + description="Indicates when this SubInterface last changed state.", + title="Last Change", + ), + ] = None + mirrorID: Annotated[ + Optional[str], + Field( + description="Mirror Identifier used as the name of the mirror.", + title="MirrorID", + ), + ] = None + numActiveInterfaces: Annotated[ + Optional[int], + Field( + description="Total number of active Interfaces used as sources of the mirror.", + title="Number of Active Interfaces", + ), + ] = None + numActiveSubinterfaces: Annotated[ + Optional[int], + Field( + description="Total number of active subinterfaces used as sources of the mirror.", + title="Number of Active Subinterfaces", + ), + ] = None + numActiveV4FilterSubinterfaces: Annotated[ + Optional[int], + Field( + description="Total number of active subinterfaces used as sources of the mirror derived from IPV4Filter associations.", + title="Number of Active V4 Filter Subinterfaces", + ), + ] = None + numActiveV6FilterSubinterfaces: Annotated[ + Optional[int], + Field( + description="Total number of active subinterfaces used as sources of the mirror derived from IPV6Filter associations.", + title="Number of Active V6 Filter Subinterfaces", + ), + ] = None + numActiveVLANSubinterfaces: Annotated[ + Optional[int], + Field( + description="Total number of active subinterfaces used as sources of the mirror derived from VLAN resource references.", + title="Number of Active VLAN Subinterfaces", + ), + ] = None + numberActiveBridgeInterfaces: Annotated[ + Optional[int], + Field( + description="Total number of active subinterfaces used as sources of the mirror derived from BridgeInterface resource references.", + title="Number of Active Bridge Interfaces", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Indicates the current operational state of the Mirror instance.", + title="Operational State", + ), + ] = None + subinterfaces: Annotated[ + Optional[List[MirrorStatusSubinterface]], + Field(description="List of members in this Interface.", title="Subinterfaces"), + ] = None + + +class MirrorStatusSubinterface(BaseModel): + configuredSource: Annotated[ + Literal[ + "VLAN", + "BridgeInterface", + "Subinterface", + "Interface", + "FilterV4", + "FilterV6", + ], + Field( + description="Indicates what is driving the particular subinterface to be selected as a mirror source.", + title="Configured Source", + ), + ] + interface: Annotated[ + str, Field(description="Node specific interface name.", title="Interface") + ] + node: Annotated[str, Field(description="Reference to Node object.", title="Node")] + operatingSystem: Annotated[ + str, + Field(description="Operating System of the Node.", title="Operating System"), + ] + subinterfaceIndex: Annotated[ + Optional[int], + Field( + description="Index allocated to the subinterface which is being mirrored. If an interface is used as a source, this will not be set.", + title="Subinterface Index", + ), + ] = None + vlanID: Annotated[ + Optional[str], + Field(description="vlan assigned to this subinterface.", title="VLAN ID"), + ] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Ping(BaseModel): + """ + Ping is the Schema for the pings API + """ + + apiVersion: str + kind: str + metadata: PingMetadata + spec: Annotated[ + PingSpec, + Field( + description="PingSpec defines the desired state of Ping", + title="Specification", + ), + ] + status: Annotated[ + Optional[PingStatus], + Field( + description="PingStatus defines the observed state of Ping", title="Status" + ), + ] = None + + +PingDeletedResourceEntry = MirrorDeletedResourceEntry + + +class PingDeletedResources(RootModel[List[PingDeletedResourceEntry]]): + root: List[PingDeletedResourceEntry] + + +class PingList(BaseModel): + """ + PingList is a list of pings + """ + + apiVersion: str + items: Optional[List[Ping]] = None + kind: str + + +PingMetadata = MirrorMetadata + + +class PingSpec(BaseModel): + """ + PingSpec defines the desired state of Ping + """ + + address: Annotated[Optional[str], Field(title="address")] = None + networkInstance: Annotated[Optional[str], Field(title="NetworkInstance")] = None + node: Annotated[Optional[str], Field(title="node")] = None + pingType: Annotated[Literal["isl", "node", "system"], Field(title="pingtype")] + pods: Annotated[Optional[List[str]], Field(title="Pods")] = None + roles: Annotated[Optional[List[str]], Field(title="roles")] = None + + +class PingStatus(BaseModel): + """ + PingStatus defines the observed state of Ping + """ + + id: Annotated[Optional[int], Field(description="Id", title="ID")] = None + result: Annotated[ + Literal[ + "OK", + "Failed", + "Terminated", + "WaitingForInput", + "Running", + "WaitingToStart", + "SubflowWaitingForInput", + ], + Field(description="Aggregate result of the Flow", title="Result"), + ] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class Threshold(BaseModel): + """ + Threshold is the Schema for the thresholds API + """ + + apiVersion: str + kind: str + metadata: ThresholdMetadata + spec: Annotated[ + ThresholdSpec, + Field( + description="A Threshold allows you to monitor a field in EDB and trigger severity-correct alarms based on the value of that field.\nBy using EDB as a source you are able to trigger thresholds on any published field from a TopoNode, or any other EDB source.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="ThresholdStatus defines the observed state of Threshold", + title="Status", + ), + ] = None + + +ThresholdDeletedResourceEntry = MirrorDeletedResourceEntry + + +class ThresholdDeletedResources(RootModel[List[ThresholdDeletedResourceEntry]]): + root: List[ThresholdDeletedResourceEntry] + + +class ThresholdList(BaseModel): + """ + ThresholdList is a list of thresholds + """ + + apiVersion: str + items: Optional[List[Threshold]] = None + kind: str + + +ThresholdMetadata = MirrorMetadata + + +class ThresholdSpec(BaseModel): + """ + A Threshold allows you to monitor a field in EDB and trigger severity-correct alarms based on the value of that field. + By using EDB as a source you are able to trigger thresholds on any published field from a TopoNode, or any other EDB source. + """ + + alarm: Annotated[ + Optional[ThresholdSpecAlarm], + Field(description="Alarm details for this threshold.", title="Thresholds"), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enable or disable this threshold.", title="Enabled"), + ] = True + field: Annotated[ + str, + Field( + description="Field to monitor for this threshold, for example `utilization`.", + title="Field", + ), + ] + generateOverlay: Annotated[ + Optional[bool], + Field( + description="Enable or disable generation of a topology overlay for this threshold.", + title="Generate Overlay", + ), + ] = False + name: Annotated[ + str, + Field( + description="The name of this threshold. This name will be used to generate the alarm name, so should follow CamelCase conventions, e.g. VolumeUtilization.", + title="Threshold Name", + ), + ] + path: Annotated[ + str, + Field( + description="Path to monitor for this threshold. This should be the full EDB path to the table containing the field you wish to trigger a threshold on.\nFor example, to monitor the utilization field of the component volume table, you would use `.namespace.node.normal.components_eda_nokia_com.v1.controlmodule.volume`, and set field to `utilization`.", + title="Path", + ), + ] + resource: Annotated[ + Optional[ThresholdSpecResource], + Field( + description="Which resource to associate with this threshold. This overrides the destination resource in alarms raised as a result of threshold breaches.\nBy default a resource will attempt to be derived based on the monitored path.", + title="Associated Resource", + ), + ] = None + thresholds: Annotated[ + ThresholdSpecThresholds, + Field( + description="Severities and their associated values.", title="Thresholds" + ), + ] + + +class ThresholdSpecAlarm(BaseModel): + """ + Alarm details for this threshold. + """ + + description: Annotated[ + Optional[str], + Field(description="The description of the alarm.", title="Description"), + ] = None + probableCause: Annotated[ + Optional[str], + Field(description="The probable cause of the alarm.", title="Probable Cause"), + ] = None + remedialAction: Annotated[ + Optional[str], + Field( + description="The remedial action for the alarm.", title="Remedial Action" + ), + ] = None + + +class ThresholdSpecResource(BaseModel): + """ + Which resource to associate with this threshold. This overrides the destination resource in alarms raised as a result of threshold breaches. + By default a resource will attempt to be derived based on the monitored path. + """ + + group: Annotated[ + str, Field(description="The group of the resource to monitor.", title="Group") + ] + kind: Annotated[ + str, Field(description="The kind of resource to monitor.", title="Kind") + ] + name: Annotated[ + str, Field(description="The name of the resource to monitor.", title="Name") + ] + + +class ThresholdSpecThresholds(BaseModel): + """ + Severities and their associated values. + """ + + criticalThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.", + title="Critical Threshold", + ), + ] = None + delta: Annotated[ + Optional[int], + Field( + description="The delta value for clearing a threshold.\nFor example, with a critical threshold of 90, direction of Rising and a delta of 5, the critical alarm will clear when the utilization drops below 85.", + title="Delta", + ), + ] = 5 + direction: Annotated[ + Literal["Rising", "Falling"], + Field( + description='Direction of the threshold: "Rising" or "Falling".', + title="Threshold Direction", + ), + ] + majorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.", + title="Major Threshold", + ), + ] = None + minorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a minor alarm.", + title="Minor Threshold", + ), + ] = None + warningThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a warning alarm.", + title="Warning Threshold", + ), + ] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/os/v1alpha1/models.py b/pydantic_eda/apps/os/v1alpha1/models.py new file mode 100644 index 0000000..f1d9da0 --- /dev/null +++ b/pydantic_eda/apps/os/v1alpha1/models.py @@ -0,0 +1,270 @@ +# generated by datamodel-codegen: +# filename: os.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional, Union +from pydantic import BaseModel, Field, RootModel +from enum import Enum + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class DeployImage(BaseModel): + """ + DeployImage is the Schema for the deployimages API + """ + + apiVersion: str + kind: str + metadata: DeployImageMetadata + spec: Annotated[ + DeployImageSpec, + Field( + description="DeployImageSpec defines the desired state of DeployImage", + title="Specification", + ), + ] + status: Annotated[ + Optional[DeployImageStatus], + Field( + description="DeployImageStatus defines the observed state of DeployImage", + title="Status", + ), + ] = None + + +class DeployImageDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class DeployImageDeletedResources(RootModel[List[DeployImageDeletedResourceEntry]]): + root: List[DeployImageDeletedResourceEntry] + + +class DeployImageList(BaseModel): + """ + DeployImageList is a list of deployimages + """ + + apiVersion: str + items: Optional[List[DeployImage]] = None + kind: str + + +class DeployImageMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class DeployImageSpec(BaseModel): + """ + DeployImageSpec defines the desired state of DeployImage + """ + + canaries: Annotated[Optional[List[str]], Field(title="canaries")] = None + checks: Annotated[Optional[DeployImageSpecChecks], Field(title="checks")] = None + drains: Annotated[Optional[DeployImageSpecDrains], Field(title="drains")] = None + nodeProfile: Annotated[Optional[str], Field(title="nodeProfile")] = None + nodeSelector: Annotated[Optional[List[str]], Field(title="nodeSelector")] = None + nodes: Annotated[Optional[List[str]], Field(title="nodes")] = None + prompt: Annotated[ + Optional[Union[List[str], DeployImageSpecPrompt]], Field(title="prompt") + ] = None + tranches: Annotated[ + Optional[List[DeployImageSpecTranch]], Field(title="tranches") + ] = None + type: Annotated[Literal["node", "nodeselector", "tranche"], Field(title="type")] + version: Annotated[Optional[str], Field(title="version")] = None + + +class DeployImageSpecChecks(BaseModel): + checks: Annotated[ + Union[List[str], DeployImageSpecChecksChecks], + Field( + description="Checks to run before (pre) and after (post) any image changes", + title="checks", + ), + ] + force: Annotated[ + bool, Field(description="Do not prompt for user input, even if checks fail") + ] + skip: Annotated[bool, Field(description="Do not run any checks")] + + +class DeployImageSpecChecksChecks(Enum): + """ + Checks to run before (pre) and after (post) any image changes + """ + + Interface = "Interface" + DefaultBGP = "DefaultBGP" + PingISL = "PingISL" + PingSystem = "PingSystem" + + +class DeployImageSpecDrains(BaseModel): + interfaceDisableSelectors: Annotated[ + Optional[List[str]], Field(title="InterfaceDisableSelectors") + ] = None + minimumWaitTime: Annotated[Optional[int], Field(title="minimumWaitTime")] = None + skip: Annotated[ + Optional[bool], Field(description="Do not run any drains", title="skip") + ] = None + + +class DeployImageSpecPrompt(Enum): + AfterPreChecks = "AfterPreChecks" + AfterPostChecks = "AfterPostChecks" + + +class DeployImageSpecTranch(BaseModel): + name: Annotated[Optional[str], Field(title="name")] = None + nodeSelector: Annotated[Optional[List[str]], Field(title="nodeSelector")] = None + + +class DeployImageStatus(BaseModel): + """ + DeployImageStatus defines the observed state of DeployImage + """ + + id: Annotated[Optional[int], Field(description="Id", title="ID")] = None + result: Annotated[ + Optional[str], Field(description="Aggregate result of the Flow", title="Result") + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/protocols/v1alpha1/models.py b/pydantic_eda/apps/protocols/v1alpha1/models.py new file mode 100644 index 0000000..b909ab1 --- /dev/null +++ b/pydantic_eda/apps/protocols/v1alpha1/models.py @@ -0,0 +1,3660 @@ +# generated by datamodel-codegen: +# filename: protocols.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AggregateRoute(BaseModel): + """ + AggregateRoute is the Schema for the aggregateroutes API + """ + + apiVersion: str + kind: str + metadata: AggregateRouteMetadata + spec: Annotated[ + AggregateRouteSpec, + Field( + description="The AggregateRoute enables the configuration of aggregated routes on a specified Router. This resource allows for the definition of destination prefixes, the selection of a router, and optionally, specific nodes where the aggregate routes should be configured. Advanced options include the ability to generate ICMP unreachable messages for packets matching the aggregate route, and the ability to block the advertisement of all contributing routes in dynamic protocols like BGP.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="AggregateRouteStatus defines the observed state of AggregateRoute", + title="Status", + ), + ] = None + + +class AggregateRouteDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class AggregateRouteDeletedResources( + RootModel[List[AggregateRouteDeletedResourceEntry]] +): + root: List[AggregateRouteDeletedResourceEntry] + + +class AggregateRouteList(BaseModel): + """ + AggregateRouteList is a list of aggregateroutes + """ + + apiVersion: str + items: Optional[List[AggregateRoute]] = None + kind: str + + +class AggregateRouteMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class AggregateRouteSpec(BaseModel): + """ + The AggregateRoute enables the configuration of aggregated routes on a specified Router. This resource allows for the definition of destination prefixes, the selection of a router, and optionally, specific nodes where the aggregate routes should be configured. Advanced options include the ability to generate ICMP unreachable messages for packets matching the aggregate route, and the ability to block the advertisement of all contributing routes in dynamic protocols like BGP. + """ + + aggregatorASN: Annotated[ + Optional[int], + Field(description="Specifies the aggregator's ASN.", title="Aggregator ASN"), + ] = None + aggregatorIP: Annotated[ + Optional[str], + Field( + description="Specifies the aggregator's IP address.", title="Aggregator IP" + ), + ] = None + generateICMP: Annotated[ + Optional[bool], + Field( + description="When set to true the router generares ICMP unreachable messages for packets matching the aggregate route (and not a more specific route).", + title="Generate ICMP", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of nodes on which to configure the aggregate routes. An AND operation is executed against the nodes in this list and the nodes on which the Router is configured to determine the Nodes on which to configure the aggregate routes.", + title="Nodes", + ), + ] = None + prefixes: Annotated[ + List[str], + Field( + description="List of destination prefixes for the aggregate routes.", + title="Prefixes", + ), + ] + router: Annotated[ + str, + Field( + description="Reference to a Router on which to configure the aggregate routes. If no Nodes are provided then the aggregate routes will be provisioned on all Nodes on which the Router is provisioned.", + title="Router", + ), + ] + summaryOnly: Annotated[ + Optional[bool], + Field( + description="When set to true the router blocks the advertisement of all contributing routes of this aggregate route in dynamic protocols such as BGP.", + title="Summary Only", + ), + ] = None + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class BGPGroup(BaseModel): + """ + BGPGroup is the Schema for the bgpgroups API + """ + + apiVersion: str + kind: str + metadata: BGPGroupMetadata + spec: Annotated[ + BGPGroupSpec, + Field( + description="The BGPGroup enables centralized management of BGP peer configurations. This resource allows setting a description, common BGP settings, and peer-specific configurations, simplifying the consistent application of policies across multiple peers. It also includes transport settings, such as local TCP address configuration, passive mode, and TCP MSS.", + title="Specification", + ), + ] + status: Annotated[ + Optional[BGPGroupStatus], + Field( + description="BGPGroupStatus defines the observed state of BGPGroup", + title="Status", + ), + ] = None + + +BGPGroupDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class BGPGroupDeletedResources(RootModel[List[BGPGroupDeletedResourceEntry]]): + root: List[BGPGroupDeletedResourceEntry] + + +class BGPGroupList(BaseModel): + """ + BGPGroupList is a list of bgpgroups + """ + + apiVersion: str + items: Optional[List[BGPGroup]] = None + kind: str + + +BGPGroupMetadata = AggregateRouteMetadata + + +class BGPGroupSpec(BaseModel): + """ + The BGPGroup enables centralized management of BGP peer configurations. This resource allows setting a description, common BGP settings, and peer-specific configurations, simplifying the consistent application of policies across multiple peers. It also includes transport settings, such as local TCP address configuration, passive mode, and TCP MSS. + """ + + asPathOptions: Annotated[ + Optional[BGPGroupSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + client: Annotated[ + Optional[bool], + Field( + description="When set to true, all configured and dynamic BGP peers are considered RR clients.", + title="Route Reflector Client", + ), + ] = None + clusterID: Annotated[ + Optional[str], + Field( + description="Enables route reflect client and sets the cluster ID.", + title="Cluster ID", + ), + ] = None + description: Annotated[ + Optional[str], + Field( + description="Sets the description on the BGP group.", title="Description" + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + ipv4Unicast: Annotated[ + Optional[BGPGroupSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[BGPGroupSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + localAS: Annotated[ + Optional[BGPGroupSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + localPreference: Annotated[ + Optional[int], + Field( + description="Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.", + ge=0, + le=4294967295, + title="Local Preference", + ), + ] = None + multiHopMaxHop: Annotated[ + Optional[int], + Field( + description="Enable multihop for eBGP peers and sets the maximum number of hops allowed.", + ge=1, + le=255, + title="Multihop Max Hop Count", + ), + ] = None + nextHopSelf: Annotated[ + Optional[bool], + Field( + description="When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.", + title="Next Hop Self", + ), + ] = None + peerAS: Annotated[ + Optional[BGPGroupSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[BGPGroupSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[BGPGroupSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class BGPGroupSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[BGPGroupSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +class BGPGroupSpecAsPathOptionsRemovePrivateAS(BaseModel): + """ + Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers. + """ + + ignorePeerAS: Annotated[ + bool, + Field( + description="If set to true then do not delete or replace a private AS number that is the same as the peer AS number.", + title="Ignore Peer AS", + ), + ] + leadingOnly: Annotated[ + bool, + Field( + description="If set to true then only delete or replace private AS numbers that appear before the first occurrence of a non-private ASN in the sequence of most recent ASNs in the AS path.", + title="Leading Only", + ), + ] + removePrivateASMode: Annotated[ + Literal["DISABLED", "REPLACE", "DELETE"], + Field( + description="The method by which private AS numbers are removed from the advertised AS_PATH attribute.", + title="Remove Private AS Mode", + ), + ] + + +class BGPGroupSpecIpv4Unicast(BaseModel): + """ + Parameters relating to the IPv4 unicast AFI/SAFI. + """ + + advertiseIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.", + title="Advertise IPv6 Next Hops", + ), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enables the IPv4 unicast AFISAFI.", title="Enabled"), + ] = None + maxReceivedRoutes: Annotated[ + Optional[int], + Field( + description="Maximum number of IPv4 Unicast routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.", + ge=1, + le=4294967295, + title="Max Received Routes", + ), + ] = None + receiveIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.", + title="Receive IPv6 Next Hops", + ), + ] = None + + +class BGPGroupSpecIpv6Unicast(BaseModel): + """ + Parameters relating to the IPv6 unicast AFI/SAFI. + """ + + enabled: Annotated[ + Optional[bool], + Field(description="Enables the IPv6 unicast AFISAFI", title="Enabled"), + ] = None + maxReceivedRoutes: Annotated[ + Optional[int], + Field( + description="Maximum number of IPv6 Unicast routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.", + ge=1, + le=4294967295, + title="Max Received Routes", + ), + ] = None + + +class BGPGroupSpecLocalAS(BaseModel): + """ + The local autonomous system number advertised to peers. + """ + + autonomousSystem: Annotated[ + int, + Field( + description="Local Autonomous System number.", + ge=1, + le=4294967295, + title="Local Autonomous System", + ), + ] + prependGlobalAS: Annotated[ + Optional[bool], + Field( + description="When set to true, the global ASN value is prepended to the AS path in outbound routes towards each BGP peer.", + title="Prepend Global Autonomous System", + ), + ] = None + prependLocalAS: Annotated[ + Optional[bool], + Field( + description="When set to true, the local AS value is prepended to the AS path of inbound routes from each EBGP peer.", + title="Prepend Local Autonomous System", + ), + ] = None + + +class BGPGroupSpecPeerAS(BaseModel): + """ + The autonomous system number expected from peers. + """ + + autonomousSystem: Annotated[ + int, + Field( + description="Local Autonomous System number.", + ge=1, + le=4294967295, + title="Peer Autonomous System", + ), + ] + + +class BGPGroupSpecSendDefaultRoute(BaseModel): + """ + Options for controlling the generation of default routes towards BGP peers. + """ + + addressFamily: Annotated[ + List[Literal["IPV4-UNICAST", "IPV6-UNICAST"]], + Field( + description="Enables the sending of a synthetically generated default IPv4 or IPV6 route to each peer.", + title="Address Families", + ), + ] + exportPolicy: Annotated[ + Optional[str], + Field( + description="Reference to a Policy that should be applied to the advertised default routes, in order to set their attributes to non-default values.", + title="Export Policy", + ), + ] = None + + +class BGPGroupSpecTimers(BaseModel): + """ + Timer configurations + """ + + connectRetry: Annotated[ + Optional[int], + Field( + description="The time interval in seconds between successive attempts to establish a session with a peer.", + ge=1, + le=65535, + title="Connect Retry", + ), + ] = None + holdTime: Annotated[ + Optional[int], + Field( + description="The hold-time interval in seconds that the router proposes to the peer in its OPEN message.", + ge=0, + le=65535, + title="Hold Time", + ), + ] = None + keepAlive: Annotated[ + Optional[int], + Field( + description="The interval in seconds between successive keepalive messages sent to the peer.", + ge=0, + le=21845, + title="Keep Alive", + ), + ] = None + minimumAdvertisementInterval: Annotated[ + Optional[int], + Field( + description="The value assigned to the MinRouteAdvertisementIntervalTimer of RFC 4271, for both EBGP and IBGP sessions.", + ge=1, + le=255, + title="Minimum Advertisement Interval", + ), + ] = None + + +class BGPGroupStatus(BaseModel): + """ + BGPGroupStatus defines the observed state of BGPGroup + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the BGP group.", title="Health" + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + numPeers: Annotated[ + Optional[int], + Field( + description="Number of configured BGP peers within the BGP Group.", + title="Number of Peers", + ), + ] = None + numPeersOperDown: Annotated[ + Optional[int], + Field( + description="Number of configured BGP peers which have an Operational State of down within the BGP Group.", + title="Number of Peers Operational Down", + ), + ] = None + numPeersUnknown: Annotated[ + Optional[int], + Field( + description="Number of configured BGP peers within the BGP Group which cannot be reached by npp.", + title="Number of unknown BGP Peers", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the BGP group.", title="Operational State" + ), + ] = None + + +class BGPPeer(BaseModel): + """ + BGPPeer is the Schema for the bgppeers API + """ + + apiVersion: str + kind: str + metadata: BGPPeerMetadata + spec: Annotated[ + BGPPeerSpec, + Field( + description="BGPPeer enables the configuration of BGP sessions. It allows specifying a description, an interface reference (either RoutedInterface or IrbInterface), and the peer IP address. The resource also supports dynamic neighbors, common BGP settings, and peer-specific configurations.", + title="Specification", + ), + ] + status: Annotated[ + Optional[BGPPeerStatus], + Field( + description="BGPPeerStatus defines the observed state of BGPPeer", + title="Status", + ), + ] = None + + +BGPPeerDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class BGPPeerDeletedResources(RootModel[List[BGPPeerDeletedResourceEntry]]): + root: List[BGPPeerDeletedResourceEntry] + + +class BGPPeerList(BaseModel): + """ + BGPPeerList is a list of bgppeers + """ + + apiVersion: str + items: Optional[List[BGPPeer]] = None + kind: str + + +BGPPeerMetadata = AggregateRouteMetadata + + +class BGPPeerSpec(BaseModel): + """ + BGPPeer enables the configuration of BGP sessions. It allows specifying a description, an interface reference (either RoutedInterface or IrbInterface), and the peer IP address. The resource also supports dynamic neighbors, common BGP settings, and peer-specific configurations. + """ + + asPathOptions: Annotated[ + Optional[BGPPeerSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + client: Annotated[ + Optional[bool], + Field( + description="When set to true, all configured and dynamic BGP peers are considered RR clients.", + title="Route Reflector Client", + ), + ] = None + clusterID: Annotated[ + Optional[str], + Field( + description="Enables route reflect client and sets the cluster ID.", + title="Cluster ID", + ), + ] = None + description: Annotated[ + Optional[str], + Field(description="Sets the description on the BGP peer", title="Description"), + ] = None + dynamicNeighbor: Annotated[ + Optional[bool], + Field( + description="When set to true the Interface is added to the dynamic-neighbor list for dynamic peering.", + title="Dynamic Neighbor", + ), + ] = False + dynamicNeighborAllowedPeerAS: Annotated[ + Optional[List[int]], + Field( + description="The autonomous system numbers allowed from peers if dynamic peering is enabled.", + title="Dynamic Neighbor Allowed Peer AS", + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + group: Annotated[ + str, + Field( + description="Reference to a BGPGroup. When present this BGP peer will be added to the BGP group", + title="Group", + ), + ] + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to a RoutedInterface or IrbInterface resource whose IP will be used as a source IP for the BGP session.", + title="Interface Reference", + ), + ] + interfaceKind: Annotated[ + Literal["ROUTEDINTERFACE", "IRBINTERFACE"], + Field( + description="InterfaceReference type defines whether the provided Reference is a RoutedInterface or IrbInterface.", + title="Interface Reference Type", + ), + ] + ipv4Unicast: Annotated[ + Optional[BGPPeerSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[BGPPeerSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + localAS: Annotated[ + Optional[BGPPeerSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + localPreference: Annotated[ + Optional[int], + Field( + description="Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.", + ge=0, + le=4294967295, + title="Local Preference", + ), + ] = None + multiHopMaxHop: Annotated[ + Optional[int], + Field( + description="Enable multihop for eBGP peers and sets the maximum number of hops allowed.", + ge=1, + le=255, + title="Multihop Max Hop Count", + ), + ] = None + nextHopSelf: Annotated[ + Optional[bool], + Field( + description="When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.", + title="Next Hop Self", + ), + ] = None + node: Annotated[ + Optional[str], + Field( + description="Node on which to configure the BGP peer. This node must be one of the nodes on which the IRBInterface is configured. When left blank or if the node is not part of the IRBInterface, the peer will not be deployed. Ignored for RoutedInterfaces.", + title="Node", + ), + ] = None + peerAS: Annotated[ + Optional[BGPPeerSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + peerIP: Annotated[ + Optional[str], + Field( + description="Peer IP to which the peering session will be established.", + title="Peer IP", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[BGPPeerSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[BGPPeerSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class BGPPeerSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[BGPPeerSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +BGPPeerSpecAsPathOptionsRemovePrivateAS = BGPGroupSpecAsPathOptionsRemovePrivateAS + + +BGPPeerSpecIpv4Unicast = BGPGroupSpecIpv4Unicast + + +BGPPeerSpecIpv6Unicast = BGPGroupSpecIpv6Unicast + + +BGPPeerSpecLocalAS = BGPGroupSpecLocalAS + + +BGPPeerSpecPeerAS = BGPGroupSpecPeerAS + + +BGPPeerSpecSendDefaultRoute = BGPGroupSpecSendDefaultRoute + + +BGPPeerSpecTimers = BGPGroupSpecTimers + + +class BGPPeerState(BaseModel): + """ + BGPPeerState is the Schema for the bgppeerstates API + """ + + apiVersion: str + kind: str + metadata: BGPPeerStateMetadata + spec: Annotated[ + BGPPeerStateSpec, + Field( + description="BGPPeerStateSpec defines the desired state of BGPPeerState", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="BGPPeerStateStatus defines the observed state of BGPPeerState", + title="Status", + ), + ] = None + + +BGPPeerStateDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class BGPPeerStateDeletedResources(RootModel[List[BGPPeerStateDeletedResourceEntry]]): + root: List[BGPPeerStateDeletedResourceEntry] + + +class BGPPeerStateList(BaseModel): + """ + BGPPeerStateList is a list of bgppeerstates + """ + + apiVersion: str + items: Optional[List[BGPPeerState]] = None + kind: str + + +BGPPeerStateMetadata = AggregateRouteMetadata + + +class BGPPeerStateSpec(BaseModel): + """ + BGPPeerStateSpec defines the desired state of BGPPeerState + """ + + afiSAFI: Annotated[ + Optional[List[str]], + Field(description="List of configured AFI-SAFI on the BGP peer"), + ] = None + defaultNetworkInstance: Annotated[ + bool, Field(description="Denotes if the router is a DefaultRouter or Router") + ] + dynamicNeighbor: Annotated[ + bool, + Field( + description="When set to true the PeerDefaultInterface is added to the dynamic-neighbor list for dynamic peering." + ), + ] + group: Annotated[Optional[str], Field(description="Reference to a BGPGroup")] = None + networkInstanceName: Annotated[ + str, + Field( + description="The name of the network-instance or VPRN in which the BGP peer is configured" + ), + ] + node: Annotated[ + Optional[str], + Field(description="The Node on which the BGP peer configuration resides"), + ] = None + nodeInterface: Annotated[ + Optional[str], + Field( + description="Node interface of the default interface which is configured to peer as a dynamic neighbor" + ), + ] = None + operatingSystem: Annotated[ + Optional[str], Field(description="Operating System of the Node") + ] = None + peerIP: Annotated[Optional[str], Field(description="The IP of the BGP peer")] = None + router: Annotated[ + str, Field(description="Router to which the BGP peer is attached") + ] + subInterfaceIndex: Annotated[ + Optional[int], + Field( + description="Sub interface index of the default interface which is configured to peer as a dynamic neighbor" + ), + ] = None + + +class BGPPeerStatus(BaseModel): + """ + BGPPeerStatus defines the observed state of BGPPeer + """ + + enabled: Annotated[ + Optional[bool], + Field( + description="Indicated whether the BGP Peer is administratively enabled.", + title="Enabled", + ), + ] = None + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the BGP peer.", title="Health" + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + lastEvent: Annotated[ + Optional[str], + Field(description="Last event of the BGP peer.", title="Last Event"), + ] = None + lastState: Annotated[ + Optional[str], + Field(description="Last state of the BGP peer.", title="Last State"), + ] = None + negotiatedHoldTime: Annotated[ + Optional[int], + Field( + description="Hold time negotiated with the BGP peer.", + title="Negotiated Hold Time", + ), + ] = None + negotiatedKeepaliveInterval: Annotated[ + Optional[int], + Field( + description="Keepalive interval negotiated with the BGP peer.", + title="Negotiated Keepalive Interval", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the BGP peer", title="Operational State" + ), + ] = None + peerAS: Annotated[ + Optional[int], Field(description="Peer AS of the BGP peer.", title="Peer AS") + ] = None + sessionState: Annotated[ + Optional[str], + Field(description="The state of the BGP session.", title="Session State"), + ] = None + underMaintenance: Annotated[ + Optional[bool], + Field( + description="Indicates if the BGP peer is under maintenance.", + title="Under Maintenance", + ), + ] = None + + +class DefaultAggregateRoute(BaseModel): + """ + DefaultAggregateRoute is the Schema for the defaultaggregateroutes API + """ + + apiVersion: str + kind: str + metadata: DefaultAggregateRouteMetadata + spec: Annotated[ + DefaultAggregateRouteSpec, + Field( + description="DefaultAggregateRoute allows the configuration of aggregate routes on a DefaultRouter. It includes specifying destination prefixes, the DefaultRouter, and settings for generating ICMP unreachable messages or blocking route advertisement. Additionally, it configures the aggregator’s IP address and ASN for efficient route management.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="DefaultAggregateRouteStatus defines the observed state of DefaultAggregateRoute", + title="Status", + ), + ] = None + + +DefaultAggregateRouteDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class DefaultAggregateRouteDeletedResources( + RootModel[List[DefaultAggregateRouteDeletedResourceEntry]] +): + root: List[DefaultAggregateRouteDeletedResourceEntry] + + +class DefaultAggregateRouteList(BaseModel): + """ + DefaultAggregateRouteList is a list of defaultaggregateroutes + """ + + apiVersion: str + items: Optional[List[DefaultAggregateRoute]] = None + kind: str + + +DefaultAggregateRouteMetadata = AggregateRouteMetadata + + +class DefaultAggregateRouteSpec(BaseModel): + """ + DefaultAggregateRoute allows the configuration of aggregate routes on a DefaultRouter. It includes specifying destination prefixes, the DefaultRouter, and settings for generating ICMP unreachable messages or blocking route advertisement. Additionally, it configures the aggregator’s IP address and ASN for efficient route management. + """ + + aggregatorASN: Annotated[ + Optional[int], + Field(description="Specifies the aggregator's ASN.", title="Aggregator ASN"), + ] = None + aggregatorIP: Annotated[ + Optional[str], + Field( + description="Specifies the aggregator's IP address.", title="Aggregator IP" + ), + ] = None + defaultRouter: Annotated[ + str, + Field( + description="Reference to a Default Router on which to configure the aggregate routes. If no Nodes are provided then the aggregate routes will be provisioned on all Nodes on which the Router is provisioned.", + title="DefaultRouter", + ), + ] + generateICMP: Annotated[ + Optional[bool], + Field( + description="When set to true the router generares ICMP unreachable messages for packets matching the aggregate route (and not a more specific route).", + title="Generate ICMP", + ), + ] = None + prefixes: Annotated[ + List[str], + Field( + description="List of destination prefixes for the aggregate routes.", + title="Prefixes", + ), + ] + summaryOnly: Annotated[ + Optional[bool], + Field( + description="When set to true the router blocks the advertisement of all contributing routes of this aggregate route in dynamic protocols such as BGP.", + title="Summary Only", + ), + ] = None + + +class DefaultBGPGroup(BaseModel): + """ + DefaultBGPGroup is the Schema for the defaultbgpgroups API + """ + + apiVersion: str + kind: str + metadata: DefaultBGPGroupMetadata + spec: Annotated[ + DefaultBGPGroupSpec, + Field( + description="The DefaultBGPGroup enables centralized management of BGP peer configurations within a DefaultRouter. This resource allows setting a description, common BGP settings, and peer-specific configurations, simplifying the consistent application of policies across multiple peers. It also includes transport settings, such as local TCP address configuration, passive mode, and TCP MSS. type DefaultBGPGroupSpec struct {", + title="Specification", + ), + ] + status: Annotated[ + Optional[DefaultBGPGroupStatus], + Field( + description="DefaultBGPGroupStatus defines the observed state of DefaultBGPGroup.", + title="Status", + ), + ] = None + + +DefaultBGPGroupDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class DefaultBGPGroupDeletedResources( + RootModel[List[DefaultBGPGroupDeletedResourceEntry]] +): + root: List[DefaultBGPGroupDeletedResourceEntry] + + +class DefaultBGPGroupList(BaseModel): + """ + DefaultBGPGroupList is a list of defaultbgpgroups + """ + + apiVersion: str + items: Optional[List[DefaultBGPGroup]] = None + kind: str + + +DefaultBGPGroupMetadata = AggregateRouteMetadata + + +class DefaultBGPGroupSpec(BaseModel): + """ + The DefaultBGPGroup enables centralized management of BGP peer configurations within a DefaultRouter. This resource allows setting a description, common BGP settings, and peer-specific configurations, simplifying the consistent application of policies across multiple peers. It also includes transport settings, such as local TCP address configuration, passive mode, and TCP MSS. type DefaultBGPGroupSpec struct { + """ + + asPathOptions: Annotated[ + Optional[DefaultBGPGroupSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + client: Annotated[ + Optional[bool], + Field( + description="When set to true, all configured and dynamic BGP peers are considered RR clients.", + title="Route Reflector Client", + ), + ] = None + clusterID: Annotated[ + Optional[str], + Field( + description="Enables route reflect client and sets the cluster ID.", + title="Cluster ID", + ), + ] = None + description: Annotated[ + Optional[str], + Field( + description="Sets the description on the BGP group.", title="Description" + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + ipv4Unicast: Annotated[ + Optional[DefaultBGPGroupSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[DefaultBGPGroupSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + l2VPNEVPN: Annotated[ + Optional[DefaultBGPGroupSpecL2VPNEVPN], + Field( + description="Parameters relating to the EVPN AFI/SAFI.", + title="L2VPN EVPN Settings", + ), + ] = None + localAS: Annotated[ + Optional[DefaultBGPGroupSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + localPreference: Annotated[ + Optional[int], + Field( + description="Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.", + ge=0, + le=4294967295, + title="Local Preference", + ), + ] = None + multiHopMaxHop: Annotated[ + Optional[int], + Field( + description="Enable multihop for eBGP peers and sets the maximum number of hops allowed.", + ge=1, + le=255, + title="Multihop Max Hop Count", + ), + ] = None + nextHopSelf: Annotated[ + Optional[bool], + Field( + description="When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.", + title="Next Hop Self", + ), + ] = None + peerAS: Annotated[ + Optional[DefaultBGPGroupSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[DefaultBGPGroupSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[DefaultBGPGroupSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class DefaultBGPGroupSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[DefaultBGPGroupSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +DefaultBGPGroupSpecAsPathOptionsRemovePrivateAS = ( + BGPGroupSpecAsPathOptionsRemovePrivateAS +) + + +DefaultBGPGroupSpecIpv4Unicast = BGPGroupSpecIpv4Unicast + + +DefaultBGPGroupSpecIpv6Unicast = BGPGroupSpecIpv6Unicast + + +class DefaultBGPGroupSpecL2VPNEVPN(BaseModel): + """ + Parameters relating to the EVPN AFI/SAFI. + """ + + advertiseIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables advertisement of EVPN routes with IPv6 next-hops to peers.", + title="Advertise IPv6 Next Hops", + ), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enables the L2VPN EVPN AFISAFI.", title="Enabled"), + ] = None + maxReceivedRoutes: Annotated[ + Optional[int], + Field( + description="Maximum number of EVPN routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.", + ge=1, + le=4294967295, + title="Max Received Routes", + ), + ] = None + + +DefaultBGPGroupSpecLocalAS = BGPGroupSpecLocalAS + + +DefaultBGPGroupSpecPeerAS = BGPGroupSpecPeerAS + + +DefaultBGPGroupSpecSendDefaultRoute = BGPGroupSpecSendDefaultRoute + + +DefaultBGPGroupSpecTimers = BGPGroupSpecTimers + + +class DefaultBGPGroupStatus(BaseModel): + """ + DefaultBGPGroupStatus defines the observed state of DefaultBGPGroup. + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the BGP group.", title="Health" + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + numPeers: Annotated[ + Optional[int], + Field( + description="Number of configured BGP peers within the BGP Group.", + title="Number of Peers", + ), + ] = None + numPeersOperDown: Annotated[ + Optional[int], + Field( + description="Number of configured BGP peers which have an Operational State of down within the BGP Group.", + title="Number of Peers Operational Down", + ), + ] = None + numPeersUnknown: Annotated[ + Optional[int], + Field( + description="Number of configured BGP peers within the BGP Group which cannot be reached by npp.", + title="Number of unknown BGP Peers", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the BGP group.", title="Operational State" + ), + ] = None + + +class DefaultBGPPeer(BaseModel): + """ + DefaultBGPPeer is the Schema for the defaultbgppeers API + """ + + apiVersion: str + kind: str + metadata: DefaultBGPPeerMetadata + spec: Annotated[ + DefaultBGPPeerSpec, + Field( + description="DefaultBGPPeer enables the configuration of BGP sessions within a DefaultRouter. It allows specifying a description, a DefaultInterface reference, and the peer IP address. The resource also supports dynamic neighbors, common BGP settings, and peer-specific configurations.", + title="Specification", + ), + ] + status: Annotated[ + Optional[DefaultBGPPeerStatus], + Field( + description="DefaultBGPPeerStatus defines the observed state of DefaultBGPPeer", + title="Status", + ), + ] = None + + +DefaultBGPPeerDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class DefaultBGPPeerDeletedResources( + RootModel[List[DefaultBGPPeerDeletedResourceEntry]] +): + root: List[DefaultBGPPeerDeletedResourceEntry] + + +class DefaultBGPPeerList(BaseModel): + """ + DefaultBGPPeerList is a list of defaultbgppeers + """ + + apiVersion: str + items: Optional[List[DefaultBGPPeer]] = None + kind: str + + +DefaultBGPPeerMetadata = AggregateRouteMetadata + + +class DefaultBGPPeerSpec(BaseModel): + """ + DefaultBGPPeer enables the configuration of BGP sessions within a DefaultRouter. It allows specifying a description, a DefaultInterface reference, and the peer IP address. The resource also supports dynamic neighbors, common BGP settings, and peer-specific configurations. + """ + + asPathOptions: Annotated[ + Optional[DefaultBGPPeerSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + client: Annotated[ + Optional[bool], + Field( + description="When set to true, all configured and dynamic BGP peers are considered RR clients.", + title="Route Reflector Client", + ), + ] = None + clusterID: Annotated[ + Optional[str], + Field( + description="Enables route reflect client and sets the cluster ID.", + title="Cluster ID", + ), + ] = None + description: Annotated[ + Optional[str], + Field(description="Sets the description on the BGP peer.", title="Description"), + ] = None + dynamicNeighbor: Annotated[ + Optional[bool], + Field( + description="When set to true the DefaultInterface is added to the dynamic-neighbor list for dynamic peering.", + title="Dynamic Neighbor", + ), + ] = False + dynamicNeighborAllowedPeerAS: Annotated[ + Optional[List[int]], + Field( + description="The autonomous system numbers allowed from peers if dynamic peering is enabled.", + title="Dynamic Neighbor Allowed Peer AS", + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + group: Annotated[ + str, Field(description="Reference to a DefaultBGPGroup.", title="Group") + ] + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to either a DefaultInterface or SystemInterface whose IP will be used as a source IP for the BGP session.", + title="Interface", + ), + ] + interfaceKind: Annotated[ + Literal["DEFAULTINTERFACE", "SYSTEMINTERFACE"], + Field( + description="Reference to a the Kind of interface whose IP will be used as a source IP for the BGP session.", + title="Interface Kind", + ), + ] + ipv4Unicast: Annotated[ + Optional[DefaultBGPPeerSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[DefaultBGPPeerSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + l2VPNEVPN: Annotated[ + Optional[DefaultBGPPeerSpecL2VPNEVPN], + Field( + description="Parameters relating to the EVPN AFI/SAFI.", title="L2VPN EVPN" + ), + ] = None + localAS: Annotated[ + Optional[DefaultBGPPeerSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + localPreference: Annotated[ + Optional[int], + Field( + description="Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.", + ge=0, + le=4294967295, + title="Local Preference", + ), + ] = None + multiHopMaxHop: Annotated[ + Optional[int], + Field( + description="Enable multihop for eBGP peers and sets the maximum number of hops allowed.", + ge=1, + le=255, + title="Multihop Max Hop Count", + ), + ] = None + nextHopSelf: Annotated[ + Optional[bool], + Field( + description="When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.", + title="Next Hop Self", + ), + ] = None + peerAS: Annotated[ + Optional[DefaultBGPPeerSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + peerIP: Annotated[ + Optional[str], + Field( + description="Peer IP to which the peering session will be established. There cannot be both a PeerIp and PeerDefaultInterface property set.", + title="Peer IP", + ), + ] = None + peerInterface: Annotated[ + Optional[str], + Field( + description="Reference to a DefaultInterface or SystemInterface resource to which the peering session will be established. There cannot be both a PeerIp and PeerDefaultInterface property set.", + title="Peer DefaultInterface", + ), + ] = None + peerInterfaceKind: Annotated[ + Optional[Literal["DEFAULTINTERFACE", "SYSTEMINTERFACE"]], + Field( + description="Reference to a the Kind of interface to which to peer to.", + title="Peer DefaultInterface Kind", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[DefaultBGPPeerSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[DefaultBGPPeerSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class DefaultBGPPeerSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[DefaultBGPPeerSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +DefaultBGPPeerSpecAsPathOptionsRemovePrivateAS = ( + BGPGroupSpecAsPathOptionsRemovePrivateAS +) + + +DefaultBGPPeerSpecIpv4Unicast = BGPGroupSpecIpv4Unicast + + +DefaultBGPPeerSpecIpv6Unicast = BGPGroupSpecIpv6Unicast + + +DefaultBGPPeerSpecL2VPNEVPN = DefaultBGPGroupSpecL2VPNEVPN + + +DefaultBGPPeerSpecLocalAS = BGPGroupSpecLocalAS + + +DefaultBGPPeerSpecPeerAS = BGPGroupSpecPeerAS + + +DefaultBGPPeerSpecSendDefaultRoute = BGPGroupSpecSendDefaultRoute + + +DefaultBGPPeerSpecTimers = BGPGroupSpecTimers + + +class DefaultBGPPeerStatus(BaseModel): + """ + DefaultBGPPeerStatus defines the observed state of DefaultBGPPeer + """ + + enabled: Annotated[ + Optional[bool], + Field( + description="Indicated whether the BGP Peer is administratively enabled.", + title="Enabled", + ), + ] = None + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the BGP peer.", title="Health" + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + lastEvent: Annotated[ + Optional[str], + Field(description="Last event of the BGP peer.", title="Last Event"), + ] = None + lastState: Annotated[ + Optional[str], + Field(description="Last state of the BGP peer.", title="Last State"), + ] = None + negotiatedHoldTime: Annotated[ + Optional[int], + Field( + description="Hold time negotiated with the BGP peer.", + title="Negotiated Hold Time", + ), + ] = None + negotiatedKeepaliveInterval: Annotated[ + Optional[int], + Field( + description="Keepalive interval negotiated with the BGP peer.", + title="Negotiated Keepalive Interval", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the BGP peer", title="Operational State" + ), + ] = None + peerAS: Annotated[ + Optional[int], Field(description="Peer AS of the BGP peer.", title="Peer AS") + ] = None + sessionState: Annotated[ + Optional[str], + Field(description="The state of the BGP session.", title="Session State"), + ] = None + underMaintenance: Annotated[ + Optional[bool], + Field( + description="Indicates if the BGP peer is under maintenance.", + title="Under Maintenance", + ), + ] = None + + +class DefaultRouteReflector(BaseModel): + """ + DefaultRouteReflector is the Schema for the defaultroutereflectors API + """ + + apiVersion: str + kind: str + metadata: DefaultRouteReflectorMetadata + spec: Annotated[ + DefaultRouteReflectorSpec, + Field( + description="DefaultRouteReflector enables the configuration of iBGP sessions to RouteReflectorClients. It includes settings for the DefaultInterface, BGP group, client selectors, and the Cluster ID. Additionally, it allows for the configuration of L2VPN EVPN settings and applies common BGP configuration settings to manage routing efficiently within the network.", + title="Specification", + ), + ] + status: Annotated[ + Optional[DefaultRouteReflectorStatus], + Field( + description="DefaultRouteReflectorStatus defines the observed state of DefaultRouteReflector", + title="Status", + ), + ] = None + + +class DefaultRouteReflectorClient(BaseModel): + """ + DefaultRouteReflectorClient is the Schema for the defaultroutereflectorclients API + """ + + apiVersion: str + kind: str + metadata: DefaultRouteReflectorClientMetadata + spec: Annotated[ + DefaultRouteReflectorClientSpec, + Field( + description="DefaultRouteReflectorClient enables the configuration of iBGP sessions from a client to RouteReflectors. It includes settings for the DefaultInterface, BGP group, client selectors, and a list of Route Reflector IPs. Additionally, it allows for the configuration of L2VPN EVPN settings and applies common BGP configuration settings to manage routing efficiently within the network.", + title="Specification", + ), + ] + status: Annotated[ + Optional[DefaultRouteReflectorClientStatus], + Field( + description="DefaultRouteReflectorClientStatus defines the observed state of DefaultRouteReflectorClient", + title="Status", + ), + ] = None + + +DefaultRouteReflectorClientDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class DefaultRouteReflectorClientDeletedResources( + RootModel[List[DefaultRouteReflectorClientDeletedResourceEntry]] +): + root: List[DefaultRouteReflectorClientDeletedResourceEntry] + + +class DefaultRouteReflectorClientList(BaseModel): + """ + DefaultRouteReflectorClientList is a list of defaultroutereflectorclients + """ + + apiVersion: str + items: Optional[List[DefaultRouteReflectorClient]] = None + kind: str + + +DefaultRouteReflectorClientMetadata = AggregateRouteMetadata + + +class DefaultRouteReflectorClientSpec(BaseModel): + """ + DefaultRouteReflectorClient enables the configuration of iBGP sessions from a client to RouteReflectors. It includes settings for the DefaultInterface, BGP group, client selectors, and a list of Route Reflector IPs. Additionally, it allows for the configuration of L2VPN EVPN settings and applies common BGP configuration settings to manage routing efficiently within the network. + """ + + asPathOptions: Annotated[ + Optional[DefaultRouteReflectorClientSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + defaultBgpClientGroup: Annotated[ + str, + Field( + description="Reference to Default Bgp Group.", + title="Default BGP Client Group", + ), + ] + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to either a DefaultInterface or SystemInterface from which the session to the RR will be done from.", + title="Interface", + ), + ] + interfaceKind: Annotated[ + Literal["DEFAULTINTERFACE", "SYSTEMINTERFACE"], + Field( + description="Reference to a the Kind of interface from which the session to the RR will be done from.", + title="Interface Kind", + ), + ] + ipv4Unicast: Annotated[ + Optional[DefaultRouteReflectorClientSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[DefaultRouteReflectorClientSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + l2VPNEVPN: Annotated[ + Optional[DefaultRouteReflectorClientSpecL2VPNEVPN], + Field( + description="Parameters relating to the EVPN AFI/SAFI.", title="L2VPN EVPN" + ), + ] = None + localAS: Annotated[ + Optional[DefaultRouteReflectorClientSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + peerAS: Annotated[ + Optional[DefaultRouteReflectorClientSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + routeReflectorIPs: Annotated[ + Optional[List[str]], + Field( + description="List of the peering IPs on the RRs to which peering session is established.", + title="Route Reflector IPs", + ), + ] = None + routeReflectorSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select the RouteReflectors to which the iBGP sessions are established.", + title="Route Reflector Selector", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[DefaultRouteReflectorClientSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[DefaultRouteReflectorClientSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class DefaultRouteReflectorClientSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[DefaultRouteReflectorClientSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +DefaultRouteReflectorClientSpecAsPathOptionsRemovePrivateAS = ( + BGPGroupSpecAsPathOptionsRemovePrivateAS +) + + +DefaultRouteReflectorClientSpecIpv4Unicast = BGPGroupSpecIpv4Unicast + + +DefaultRouteReflectorClientSpecIpv6Unicast = BGPGroupSpecIpv6Unicast + + +DefaultRouteReflectorClientSpecL2VPNEVPN = DefaultBGPGroupSpecL2VPNEVPN + + +DefaultRouteReflectorClientSpecLocalAS = BGPGroupSpecLocalAS + + +DefaultRouteReflectorClientSpecPeerAS = BGPGroupSpecPeerAS + + +DefaultRouteReflectorClientSpecSendDefaultRoute = BGPGroupSpecSendDefaultRoute + + +DefaultRouteReflectorClientSpecTimers = BGPGroupSpecTimers + + +class DefaultRouteReflectorClientStatus(BaseModel): + """ + DefaultRouteReflectorClientStatus defines the observed state of DefaultRouteReflectorClient + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the DefaultRouteReflectorClient.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + numRouteReflectorClientBGPPeers: Annotated[ + Optional[int], + Field( + description="Total number of configured route reflector peers on the route reflector client.", + title="Number of Route Reflector Client BGP Peers", + ), + ] = None + numRouteReflectorClientBGPPeersOperDown: Annotated[ + Optional[int], + Field( + description="Total number of configured route reflector peers on the route reflector client that are operationally down.", + title="Number of Oper Down Route Reflector Client BGP Peers", + ), + ] = None + operDownRouteReflectorClientPeers: Annotated[ + Optional[List[str]], + Field( + description="List of route reflector BGPPeers which are operationally down.", + title="Oper Down Route Reflector Client Peers", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the DefaultRouteReflectorClient.", + title="Operational State", + ), + ] = None + + +DefaultRouteReflectorDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class DefaultRouteReflectorDeletedResources( + RootModel[List[DefaultRouteReflectorDeletedResourceEntry]] +): + root: List[DefaultRouteReflectorDeletedResourceEntry] + + +class DefaultRouteReflectorList(BaseModel): + """ + DefaultRouteReflectorList is a list of defaultroutereflectors + """ + + apiVersion: str + items: Optional[List[DefaultRouteReflector]] = None + kind: str + + +DefaultRouteReflectorMetadata = AggregateRouteMetadata + + +class DefaultRouteReflectorSpec(BaseModel): + """ + DefaultRouteReflector enables the configuration of iBGP sessions to RouteReflectorClients. It includes settings for the DefaultInterface, BGP group, client selectors, and the Cluster ID. Additionally, it allows for the configuration of L2VPN EVPN settings and applies common BGP configuration settings to manage routing efficiently within the network. + """ + + asPathOptions: Annotated[ + Optional[DefaultRouteReflectorSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + clientIPs: Annotated[ + Optional[List[str]], + Field( + description="List of RR client IPs to which the iBGP sessions are established.", + title="Client IPs", + ), + ] = None + clientSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select the RouteReflectorClients to which the iBGP sessions are established.", + title="Client Selector", + ), + ] = None + clusterID: Annotated[ + str, + Field( + description="Sets the cluster ID for route reflectors.", title="Cluster ID" + ), + ] + defaultBGPRRGroup: Annotated[ + str, + Field( + description="Reference to a DefaultBGPGroup.", title="Default BGP RR Group" + ), + ] + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to either a DefaultInterface or SystemInterface from which the session to the client will be done from.", + title="Interface Reference", + ), + ] + interfaceKind: Annotated[ + Literal["DEFAULTINTERFACE", "SYSTEMINTERFACE"], + Field( + description="Reference to a the Kind of interface from which the session to the client will be done from.", + title="Interface Kind", + ), + ] + ipv4Unicast: Annotated[ + Optional[DefaultRouteReflectorSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[DefaultRouteReflectorSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + l2VPNEVPN: Annotated[ + Optional[DefaultRouteReflectorSpecL2VPNEVPN], + Field( + description="Parameters relating to the EVPN AFI/SAFI.", title="L2VPN EVPN" + ), + ] = None + localAS: Annotated[ + Optional[DefaultRouteReflectorSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + peerAS: Annotated[ + Optional[DefaultRouteReflectorSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[DefaultRouteReflectorSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[DefaultRouteReflectorSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class DefaultRouteReflectorSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[DefaultRouteReflectorSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +DefaultRouteReflectorSpecAsPathOptionsRemovePrivateAS = ( + BGPGroupSpecAsPathOptionsRemovePrivateAS +) + + +DefaultRouteReflectorSpecIpv4Unicast = BGPGroupSpecIpv4Unicast + + +DefaultRouteReflectorSpecIpv6Unicast = BGPGroupSpecIpv6Unicast + + +DefaultRouteReflectorSpecL2VPNEVPN = DefaultBGPGroupSpecL2VPNEVPN + + +DefaultRouteReflectorSpecLocalAS = BGPGroupSpecLocalAS + + +DefaultRouteReflectorSpecPeerAS = BGPGroupSpecPeerAS + + +DefaultRouteReflectorSpecSendDefaultRoute = BGPGroupSpecSendDefaultRoute + + +DefaultRouteReflectorSpecTimers = BGPGroupSpecTimers + + +class DefaultRouteReflectorStatus(BaseModel): + """ + DefaultRouteReflectorStatus defines the observed state of DefaultRouteReflector + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the Route Reflector.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + numRouteReflectorBGPPeers: Annotated[ + Optional[int], + Field( + description="Total number of configured route reflector client peers on the route reflector.", + title="Number of Route Reflector BGP Peers", + ), + ] = None + numRouteReflectorBGPPeersOperDown: Annotated[ + Optional[int], + Field( + description="Total number of configured route reflector client peers on the route reflector that are operationally down.", + title="Number of Oper Down Route Reflector BGP Peers", + ), + ] = None + operDownRouteReflectorPeers: Annotated[ + Optional[List[str]], + Field( + description="List of route reflector BGPPeers which are operationally down.", + title="Oper Down Route Reflector Peers", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the Route Reflector.", + title="Operational State", + ), + ] = None + + +class DefaultStaticRoute(BaseModel): + """ + DefaultStaticRoute is the Schema for the defaultstaticroutes API + """ + + apiVersion: str + kind: str + metadata: DefaultStaticRouteMetadata + spec: Annotated[ + DefaultStaticRouteSpec, + Field( + description="DefaultStaticRoute enables the configuration of static routes within a DefaultRouter. It allows specifying destination prefixes, route preference, and a nexthop group. This resource facilitates precise control over routing behavior, including options for BFD, route resolution, and blackholing traffic.", + title="Specification", + ), + ] + status: Annotated[ + Optional[DefaultStaticRouteStatus], + Field( + description="DefaultStaticRouteStatus defines the observed state of default static route", + title="Status", + ), + ] = None + + +DefaultStaticRouteDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class DefaultStaticRouteDeletedResources( + RootModel[List[DefaultStaticRouteDeletedResourceEntry]] +): + root: List[DefaultStaticRouteDeletedResourceEntry] + + +class DefaultStaticRouteList(BaseModel): + """ + DefaultStaticRouteList is a list of defaultstaticroutes + """ + + apiVersion: str + items: Optional[List[DefaultStaticRoute]] = None + kind: str + + +DefaultStaticRouteMetadata = AggregateRouteMetadata + + +class DefaultStaticRouteSpec(BaseModel): + """ + DefaultStaticRoute enables the configuration of static routes within a DefaultRouter. It allows specifying destination prefixes, route preference, and a nexthop group. This resource facilitates precise control over routing behavior, including options for BFD, route resolution, and blackholing traffic. + """ + + defaultRouter: Annotated[ + str, + Field( + description="Reference to a DefaultRouter on which to configure the static routes.", + title="Default Router", + ), + ] + nexthopGroup: Annotated[ + DefaultStaticRouteSpecNexthopGroup, + Field( + description="Group of nexthops for the list of prefixes.", + title="Nexthop Group", + ), + ] + preference: Annotated[ + Optional[int], + Field(description="Defines the route preference.", title="Preference"), + ] = None + prefixes: Annotated[ + List[str], + Field( + description="List of destination prefixes and mask to use for the static routes.", + title="Prefixes", + ), + ] + + +class DefaultStaticRouteSpecNexthopGroup(BaseModel): + """ + Group of nexthops for the list of prefixes. + """ + + bfd: Annotated[ + Optional[DefaultStaticRouteSpecNexthopGroupBfd], + Field( + description="Enables BFD to the next-hops in the group. Local and Remote discriminator parameters have been deprecated at this level. Use Nexthop to set these parameters.", + title="BFD", + ), + ] = None + blackhole: Annotated[ + Optional[bool], + Field( + description="If set to true all traffic destined to the prefixes will be blackholed. If enabled, next-hops are ignored and this takes precedence.", + title="Blackhole", + ), + ] = False + nexthops: Annotated[ + Optional[List[DefaultStaticRouteSpecNexthopGroupNexthop]], + Field(description="Ordered list of nexthops.", title="Nexthops"), + ] = None + resolve: Annotated[ + Optional[bool], + Field( + description="If set to true the next-hops can be destinations which are resolved in the route table.", + title="Resolve", + ), + ] = False + + +class DefaultStaticRouteSpecNexthopGroupBfd(BaseModel): + """ + Enables BFD to the next-hops in the group. Local and Remote discriminator parameters have been deprecated at this level. Use Nexthop to set these parameters. + """ + + enabled: Annotated[ + Optional[bool], + Field( + description="Defines whether BFD should be enabled towards the nexthops.", + title="Enabled", + ), + ] = False + localAddress: Annotated[ + Optional[str], + Field( + description="Defines the local address to use when establishing the BFD session with the nexthop.", + title="Local Address", + ), + ] = None + localDiscriminator: Annotated[ + Optional[int], + Field( + description="Defines the local discriminator.", title="Local Discriminator" + ), + ] = None + remoteDiscriminator: Annotated[ + Optional[int], + Field( + description="Defines the remote discriminator.", + title="Remote Discriminator", + ), + ] = None + + +class DefaultStaticRouteSpecNexthopGroupNexthop(BaseModel): + bfd: Annotated[ + Optional[DefaultStaticRouteSpecNexthopGroupNexthopBfd], + Field( + description="Enables BFD to the next-hops in the group. This overrides the configuration at the group.", + title="BFD", + ), + ] = None + ipPrefix: Annotated[str, Field(description="Address to use.", title="IP Prefix")] + resolve: Annotated[ + Optional[bool], + Field( + description="If set to true the next-hops can be destinations which are resolved in the route table. This overrides the configuration at the group.", + title="Resolve", + ), + ] = False + + +class DefaultStaticRouteSpecNexthopGroupNexthopBfd(BaseModel): + """ + Enables BFD to the next-hops in the group. This overrides the configuration at the group. + """ + + enabled: Annotated[ + Optional[bool], + Field( + description="Defines whether BFD should be enabled towards the nexthops.", + title="Enabled", + ), + ] = False + localAddress: Annotated[ + Optional[str], + Field( + description="Defines the local address to use when establishing the BFD session with the nexthop.", + title="Local Address", + ), + ] = None + localDiscriminator: Annotated[ + Optional[int], + Field( + description="Defines the local discriminator.", title="Local Discriminator" + ), + ] = None + remoteDiscriminator: Annotated[ + Optional[int], + Field( + description="Defines the remote discriminator.", + title="Remote Discriminator", + ), + ] = None + + +class DefaultStaticRouteStatus(BaseModel): + """ + DefaultStaticRouteStatus defines the observed state of default static route + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the static routes.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the static routes.", + title="Operational State", + ), + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class RouteReflector(BaseModel): + """ + RouteReflector is the Schema for the routereflectors API + """ + + apiVersion: str + kind: str + metadata: RouteReflectorMetadata + spec: Annotated[ + RouteReflectorSpec, + Field( + description="RouteReflector enables the configuration of iBGP sessions with RouteReflectorClients. It includes settings for selecting Interfaces, client selectors for IPv4 and IPv6, and the option to specify a BGP group and cluster ID.", + title="Specification", + ), + ] + status: Annotated[ + Optional[RouteReflectorStatus], + Field( + description="RouteReflectorStatus defines the observed state of RouteReflector", + title="Status", + ), + ] = None + + +class RouteReflectorClient(BaseModel): + """ + RouteReflectorClient is the Schema for the routereflectorclients API + """ + + apiVersion: str + kind: str + metadata: RouteReflectorClientMetadata + spec: Annotated[ + RouteReflectorClientSpec, + Field( + description="RouteReflectorClient manages the configuration of iBGP sessions between a client and RouteReflectors. This resource allows you to specify the Interface for BGP sessions, set selectors for RouteReflectors, and configure common BGP settings.", + title="Specification", + ), + ] + status: Annotated[ + Optional[RouteReflectorClientStatus], + Field( + description="RouteReflectorClientStatus defines the observed state of RouteReflectorClient", + title="Status", + ), + ] = None + + +RouteReflectorClientDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class RouteReflectorClientDeletedResources( + RootModel[List[RouteReflectorClientDeletedResourceEntry]] +): + root: List[RouteReflectorClientDeletedResourceEntry] + + +class RouteReflectorClientList(BaseModel): + """ + RouteReflectorClientList is a list of routereflectorclients + """ + + apiVersion: str + items: Optional[List[RouteReflectorClient]] = None + kind: str + + +RouteReflectorClientMetadata = AggregateRouteMetadata + + +class RouteReflectorClientSpec(BaseModel): + """ + RouteReflectorClient manages the configuration of iBGP sessions between a client and RouteReflectors. This resource allows you to specify the Interface for BGP sessions, set selectors for RouteReflectors, and configure common BGP settings. + """ + + asPathOptions: Annotated[ + Optional[RouteReflectorClientSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + bgpGroup: Annotated[ + str, Field(description="Reference to BgpGroup.", title="BGP Group") + ] + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to a RoutedInterface or IrbInterface resource whose IP will be used as a source IP for the BGP session.", + title="Interface Reference", + ), + ] + interfaceKind: Annotated[ + Literal["ROUTEDINTERFACE", "IRBINTERFACE"], + Field( + description="InterfaceReference type defines whether the provided Reference is a RoutedInterface or IrbInterface.", + title="Interface Reference Type", + ), + ] + ipv4RouteReflectorSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select the RouteReflectors to which the iBGP sessions are established for IPv4.", + title="IPv4 Route Reflector Selector", + ), + ] = None + ipv4Unicast: Annotated[ + Optional[RouteReflectorClientSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6RouteReflectorSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select the RouteReflectors to which the iBGP sessions are established for IPv6.", + title="IPv6 Route Reflector Selector", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[RouteReflectorClientSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + localAS: Annotated[ + Optional[RouteReflectorClientSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + peerAS: Annotated[ + Optional[RouteReflectorClientSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + routeReflectorIPs: Annotated[ + Optional[List[str]], + Field( + description="List of the peering IPs on the RRs to which peering session is established.", + title="Route Reflector IPs", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[RouteReflectorClientSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[RouteReflectorClientSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class RouteReflectorClientSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[RouteReflectorClientSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +RouteReflectorClientSpecAsPathOptionsRemovePrivateAS = ( + BGPGroupSpecAsPathOptionsRemovePrivateAS +) + + +RouteReflectorClientSpecIpv4Unicast = BGPGroupSpecIpv4Unicast + + +RouteReflectorClientSpecIpv6Unicast = BGPGroupSpecIpv6Unicast + + +RouteReflectorClientSpecLocalAS = BGPGroupSpecLocalAS + + +RouteReflectorClientSpecPeerAS = BGPGroupSpecPeerAS + + +RouteReflectorClientSpecSendDefaultRoute = BGPGroupSpecSendDefaultRoute + + +RouteReflectorClientSpecTimers = BGPGroupSpecTimers + + +class RouteReflectorClientState(BaseModel): + """ + RouteReflectorClientState is the Schema for the routereflectorclientstates API + """ + + apiVersion: str + kind: str + metadata: RouteReflectorClientStateMetadata + spec: Annotated[ + RouteReflectorClientStateSpec, + Field( + description="RouteReflectorClientStateSpec defines the desired state of RouteReflectorClientState", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="RouteReflectorClientStateStatus defines the observed state of RouteReflectorClientState", + title="Status", + ), + ] = None + + +RouteReflectorClientStateDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class RouteReflectorClientStateDeletedResources( + RootModel[List[RouteReflectorClientStateDeletedResourceEntry]] +): + root: List[RouteReflectorClientStateDeletedResourceEntry] + + +class RouteReflectorClientStateList(BaseModel): + """ + RouteReflectorClientStateList is a list of routereflectorclientstates + """ + + apiVersion: str + items: Optional[List[RouteReflectorClientState]] = None + kind: str + + +RouteReflectorClientStateMetadata = AggregateRouteMetadata + + +class RouteReflectorClientStateSpec(BaseModel): + """ + RouteReflectorClientStateSpec defines the desired state of RouteReflectorClientState + """ + + defaultRouteReflectorClient: Annotated[ + Optional[bool], + Field( + description="Denotes if the route reflector client is a DefaultRouteReflectorClient or RouteReflectorClient" + ), + ] = None + routeReflectorClientBGPPeers: Annotated[ + Optional[List[str]], + Field( + description="A list of BGPPeers configured on the route reflector client to peer with route reflectors" + ), + ] = None + + +class RouteReflectorClientStatus(BaseModel): + """ + RouteReflectorClientStatus defines the observed state of RouteReflectorClient + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the RouteReflectorClient.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + numRouteReflectorClientBGPPeers: Annotated[ + Optional[int], + Field( + description="Total number of configured route reflector peers on the route reflector client.", + title="Number of Route Reflector Client BGP Peers", + ), + ] = None + numRouteReflectorClientBGPPeersOperDown: Annotated[ + Optional[int], + Field( + description="Total number of configured route reflector peers on the route reflector client that are operationally down.", + title="Number of Oper Down Route Reflector Client BGP Peers", + ), + ] = None + operDownRouteReflectorClientPeers: Annotated[ + Optional[List[str]], + Field( + description="List of route reflector BGPPeers which are operationally down.", + title="Oper Down Route Reflector Client Peers", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the RouteReflectorClient.", + title="Operational State", + ), + ] = None + + +RouteReflectorDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class RouteReflectorDeletedResources( + RootModel[List[RouteReflectorDeletedResourceEntry]] +): + root: List[RouteReflectorDeletedResourceEntry] + + +class RouteReflectorList(BaseModel): + """ + RouteReflectorList is a list of routereflectors + """ + + apiVersion: str + items: Optional[List[RouteReflector]] = None + kind: str + + +RouteReflectorMetadata = AggregateRouteMetadata + + +class RouteReflectorSpec(BaseModel): + """ + RouteReflector enables the configuration of iBGP sessions with RouteReflectorClients. It includes settings for selecting Interfaces, client selectors for IPv4 and IPv6, and the option to specify a BGP group and cluster ID. + """ + + asPathOptions: Annotated[ + Optional[RouteReflectorSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + bgpGroup: Annotated[ + str, Field(description="Reference to BgpGroup", title="BGP Group") + ] + clientIPs: Annotated[ + Optional[List[str]], + Field( + description="List of RR client IPs to which the iBGP sessions are established.", + title="Client IPs", + ), + ] = None + clusterID: Annotated[ + str, + Field( + description="Sets the cluster ID for route reflectors.", title="Cluster ID" + ), + ] + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to a RoutedInterface or IrbInterface resource whose IP will be used as a source IP for the BGP session.", + title="Interface Reference", + ), + ] + interfaceKind: Annotated[ + Literal["ROUTEDINTERFACE", "IRBINTERFACE"], + Field( + description="InterfaceReference type defines whether the provided Reference is a RoutedInterface or IrbInterface.", + title="Interface Reference Type", + ), + ] + ipv4ClientSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select the RouteReflectorClients to which the iBGP sessions are established for IPv4.", + title="IPv4 Client Selector", + ), + ] = None + ipv4Unicast: Annotated[ + Optional[RouteReflectorSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6ClientSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector used to select the RouteReflectorClients to which the iBGP sessions are established for IPv6.", + title="IPv6 Client Selector", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[RouteReflectorSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + localAS: Annotated[ + Optional[RouteReflectorSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + peerAS: Annotated[ + Optional[RouteReflectorSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[RouteReflectorSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[RouteReflectorSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class RouteReflectorSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[RouteReflectorSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +RouteReflectorSpecAsPathOptionsRemovePrivateAS = ( + BGPGroupSpecAsPathOptionsRemovePrivateAS +) + + +RouteReflectorSpecIpv4Unicast = BGPGroupSpecIpv4Unicast + + +RouteReflectorSpecIpv6Unicast = BGPGroupSpecIpv6Unicast + + +RouteReflectorSpecLocalAS = BGPGroupSpecLocalAS + + +RouteReflectorSpecPeerAS = BGPGroupSpecPeerAS + + +RouteReflectorSpecSendDefaultRoute = BGPGroupSpecSendDefaultRoute + + +RouteReflectorSpecTimers = BGPGroupSpecTimers + + +class RouteReflectorState(BaseModel): + """ + RouteReflectorState is the Schema for the routereflectorstates API + """ + + apiVersion: str + kind: str + metadata: RouteReflectorStateMetadata + spec: Annotated[ + RouteReflectorStateSpec, + Field( + description="RouteReflectorStateSpec defines the desired state of RouteReflectorState", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="RouteReflectorStateStatus defines the observed state of RouteReflectorState", + title="Status", + ), + ] = None + + +RouteReflectorStateDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class RouteReflectorStateDeletedResources( + RootModel[List[RouteReflectorStateDeletedResourceEntry]] +): + root: List[RouteReflectorStateDeletedResourceEntry] + + +class RouteReflectorStateList(BaseModel): + """ + RouteReflectorStateList is a list of routereflectorstates + """ + + apiVersion: str + items: Optional[List[RouteReflectorState]] = None + kind: str + + +RouteReflectorStateMetadata = AggregateRouteMetadata + + +class RouteReflectorStateSpec(BaseModel): + """ + RouteReflectorStateSpec defines the desired state of RouteReflectorState + """ + + defaultRouteReflector: Annotated[ + Optional[bool], + Field( + description="Denotes if the route reflector is a DefaultRouteReflector or RouteReflector" + ), + ] = None + routeReflectorBGPPeers: Annotated[ + Optional[List[str]], + Field( + description="A list of BGPPeers configured on the route reflector to peer with clients" + ), + ] = None + + +class RouteReflectorStatus(BaseModel): + """ + RouteReflectorStatus defines the observed state of RouteReflector + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the RouteReflector.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + numRouteReflectorBGPPeers: Annotated[ + Optional[int], + Field( + description="Total number of configured route reflector client peers on the route reflector.", + title="Number of Route Reflector BGP Peers", + ), + ] = None + numRouteReflectorBGPPeersOperDown: Annotated[ + Optional[int], + Field( + description="Total number of configured route reflector client peers on the route reflector that are operationally down.", + title="Number of Oper Down Route Reflector BGP Peers", + ), + ] = None + operDownRouteReflectorPeers: Annotated[ + Optional[List[str]], + Field( + description="List of route reflector BGPPeers which are operationally down.", + title="Oper Down Route Reflector Peers", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the RouteReflector.", + title="Operational State", + ), + ] = None + + +class StaticRoute(BaseModel): + """ + StaticRoute is the Schema for the staticroutes API + """ + + apiVersion: str + kind: str + metadata: StaticRouteMetadata + spec: Annotated[ + StaticRouteSpec, + Field( + description="StaticRoute allows for the specification of destination prefixes, route preferences, and the associated Router. It also supports configuring nexthop groups and specifying the nodes where the static routes should be provisioned.", + title="Specification", + ), + ] + status: Annotated[ + Optional[StaticRouteStatus], + Field( + description="StaticRouteStatus defines the observed state of Static Route", + title="Status", + ), + ] = None + + +StaticRouteDeletedResourceEntry = AggregateRouteDeletedResourceEntry + + +class StaticRouteDeletedResources(RootModel[List[StaticRouteDeletedResourceEntry]]): + root: List[StaticRouteDeletedResourceEntry] + + +class StaticRouteList(BaseModel): + """ + StaticRouteList is a list of staticroutes + """ + + apiVersion: str + items: Optional[List[StaticRoute]] = None + kind: str + + +StaticRouteMetadata = AggregateRouteMetadata + + +class StaticRouteSpec(BaseModel): + """ + StaticRoute allows for the specification of destination prefixes, route preferences, and the associated Router. It also supports configuring nexthop groups and specifying the nodes where the static routes should be provisioned. + """ + + nexthopGroup: Annotated[ + StaticRouteSpecNexthopGroup, + Field( + description="Group of nexthops for the list of prefixes.", + title="Nexthop Group", + ), + ] + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of nodes on which to configure the static routes. An AND operation is executed against the nodes in this list and the nodes on which the Router is configured to determine the Nodes on which to configure the static routes.", + title="Nodes", + ), + ] = None + preference: Annotated[ + Optional[int], + Field(description="Defines the route preference.", title="Preference"), + ] = None + prefixes: Annotated[ + List[str], + Field( + description="List of destination prefixes and mask to use for the static routes.", + title="Prefixes", + ), + ] + router: Annotated[ + str, + Field( + description="Reference to a Router on which to configure the static routes. If no Nodes are provided then the static routes will be provisioned on all Nodes on which the Router is provisioned.", + title="Router", + ), + ] + + +class StaticRouteSpecNexthopGroup(BaseModel): + """ + Group of nexthops for the list of prefixes. + """ + + bfd: Annotated[ + Optional[StaticRouteSpecNexthopGroupBfd], + Field( + description="Enables BFD to the next-hops in the group. Local and Remote discriminator parameters have been deprecated at this level. Use Nexthop to set these parameters.", + title="BFD", + ), + ] = None + blackhole: Annotated[ + Optional[bool], + Field( + description="If set to true all traffic destined to the prefixes will be blackholed. If enabled, next-hops are ignored and this takes precedence.", + title="Blackhole", + ), + ] = False + nexthops: Annotated[ + Optional[List[StaticRouteSpecNexthopGroupNexthop]], + Field(description="Ordered list of nexthops.", title="Nexthops"), + ] = None + resolve: Annotated[ + Optional[bool], + Field( + description="If set to true the next-hops can be destinations which are resolved in the route table.", + title="Resolve", + ), + ] = False + + +StaticRouteSpecNexthopGroupBfd = DefaultStaticRouteSpecNexthopGroupBfd + + +class StaticRouteSpecNexthopGroupNexthop(BaseModel): + bfd: Annotated[ + Optional[StaticRouteSpecNexthopGroupNexthopBfd], + Field( + description="Enables BFD to the next-hops in the group. This overrides the configuration at the group.", + title="BFD", + ), + ] = None + ipPrefix: Annotated[str, Field(description="Address to use.", title="IP Prefix")] + resolve: Annotated[ + Optional[bool], + Field( + description="If set to true the next-hops can be destinations which are resolved in the route table. This overrides the configuration at the group.", + title="Resolve", + ), + ] = False + + +StaticRouteSpecNexthopGroupNexthopBfd = DefaultStaticRouteSpecNexthopGroupNexthopBfd + + +class StaticRouteStatus(BaseModel): + """ + StaticRouteStatus defines the observed state of Static Route + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the static routes.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of Nodes on which the static routes are configured.", + title="Nodes", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the static routes.", + title="Operational State", + ), + ] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/qos/v1alpha1/models.py b/pydantic_eda/apps/qos/v1alpha1/models.py new file mode 100644 index 0000000..0addef0 --- /dev/null +++ b/pydantic_eda/apps/qos/v1alpha1/models.py @@ -0,0 +1,1848 @@ +# generated by datamodel-codegen: +# filename: qos.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class EgressPolicy(BaseModel): + """ + EgressPolicy is the Schema for the egresspolicys API + """ + + apiVersion: str + kind: str + metadata: EgressPolicyMetadata + spec: Annotated[ + EgressPolicySpec, + Field( + description="EgressPolicySpec defines the desired state of EgressPolicy", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="EgressPolicyStatus defines the observed state of EgressPolicy", + title="Status", + ), + ] = None + + +class EgressPolicyDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class EgressPolicyDeletedResources(RootModel[List[EgressPolicyDeletedResourceEntry]]): + root: List[EgressPolicyDeletedResourceEntry] + + +class EgressPolicyList(BaseModel): + """ + EgressPolicyList is a list of egresspolicys + """ + + apiVersion: str + items: Optional[List[EgressPolicy]] = None + kind: str + + +class EgressPolicyMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class EgressPolicySpec(BaseModel): + """ + EgressPolicySpec defines the desired state of EgressPolicy + """ + + dot1pRewritePolicy: Annotated[ + Optional[EgressPolicySpecDot1pRewritePolicy], + Field( + description="Dot1pRewritePolicy enables the configuration of rewrite policies for Dot1p values. It includes mappings of forwarding classes to Dot1p values, with options for drop probability-specific overrides within each forwarding class.", + title="Dot1p Rewrite Policy", + ), + ] = None + dscpRewritePolicy: Annotated[ + Optional[EgressPolicySpecDscpRewritePolicy], + Field( + description="DSCPRewritePolicy enables the configuration of rewrite policies for Differentiated Services Code Point (DSCP) values. It includes mappings of forwarding classes to DSCP values, with options for drop probability-specific overrides within each forwarding class. If a DSCPRewritePolicy is not specified, the DSCP value of the packet is unchanged. If a DSCP policy is specific and ECN is enabled on any of the queues, the DSCP policy will be applied to all ECN capable packets.", + title="DSCP Rewrite Policy", + ), + ] = None + forwardingClassToQueueMapping: Annotated[ + Optional[List[EgressPolicySpecForwardingClassToQueueMappingItem]], + Field( + description="Forwarding class to queue mapping policy.", + title="Forwarding Class to Queue Mapping", + ), + ] = None + pfcDeadlockAvoidance: Annotated[ + Optional[EgressPolicySpecPfcDeadlockAvoidance], + Field( + description="Parameters related to avoid a deadlock related to pfc on outgoing interface.", + title="Deadlock Avoidance", + ), + ] = None + queueManagement: Annotated[ + Optional[List[EgressPolicySpecQueueManagementItem]], + Field( + description="Queue management policy for egress queues.", + title="Queue Management", + ), + ] = None + + +class EgressPolicySpecDot1pRewritePolicy(BaseModel): + """ + Dot1pRewritePolicy enables the configuration of rewrite policies for Dot1p values. It includes mappings of forwarding classes to Dot1p values, with options for drop probability-specific overrides within each forwarding class. + """ + + dot1pMap: Annotated[ + List[EgressPolicySpecDot1pRewritePolicyDot1pMapItem], + Field(description="Map of forwarding classes to PCP values", title="Map"), + ] + + +class EgressPolicySpecDot1pRewritePolicyDot1pMapItem(BaseModel): + dropProbability: Annotated[ + Optional[ + List[EgressPolicySpecDot1pRewritePolicyDot1pMapItemDropProbabilityItem] + ], + Field( + description="Drop probability specific overrides within the forwarding class", + title="Drop Probability", + ), + ] = None + forwardingClasses: Annotated[ + List[str], + Field( + description="The forwarding class matched to apply the rewrite policy", + title="Forwarding Class", + ), + ] + pcpValue: Annotated[ + Optional[int], + Field( + description="The PCP value to be used for all packets associated with the forwarding class, except those with a drop-probability-specific or profile-specific override", + ge=0, + le=7, + title="PCP Value", + ), + ] = None + + +class EgressPolicySpecDot1pRewritePolicyDot1pMapItemDropProbabilityItem(BaseModel): + level: Annotated[ + Optional[Literal["High", "Medium", "Low"]], + Field( + description="A drop probability level within the forwarding class for which a different remarking is desired", + title="Level", + ), + ] = None + pcpValue: Annotated[ + Optional[int], + Field( + description="The PCP value to be used for packets associated with the forwarding class and the specific drop probability. This overrides the general PCP value.", + ge=0, + le=7, + title="PCP Value", + ), + ] = None + + +class EgressPolicySpecDscpRewritePolicy(BaseModel): + """ + DSCPRewritePolicy enables the configuration of rewrite policies for Differentiated Services Code Point (DSCP) values. It includes mappings of forwarding classes to DSCP values, with options for drop probability-specific overrides within each forwarding class. If a DSCPRewritePolicy is not specified, the DSCP value of the packet is unchanged. If a DSCP policy is specific and ECN is enabled on any of the queues, the DSCP policy will be applied to all ECN capable packets. + """ + + dscpMap: Annotated[ + List[EgressPolicySpecDscpRewritePolicyDscpMapItem], + Field(description="Map of forwarding classes to DSCP values.", title="Map"), + ] + + +class EgressPolicySpecDscpRewritePolicyDscpMapItem(BaseModel): + dropProbability: Annotated[ + Optional[List[EgressPolicySpecDscpRewritePolicyDscpMapItemDropProbabilityItem]], + Field( + description="A drop probability within the forwarding class for which a different remarking is desired.", + title="Drop Probability", + ), + ] = None + dscp: Annotated[ + Optional[int], + Field( + description="The DSCP value to be used for all packets associated with the forwarding class, except those with a drop-probability-specific or profile-specific override.", + ge=0, + le=63, + title="DSCP", + ), + ] = None + forwardingClasses: Annotated[ + List[str], + Field( + description="The forwarding class matched to apply the rewrite policy.", + title="Forwarding Class", + ), + ] + + +class EgressPolicySpecDscpRewritePolicyDscpMapItemDropProbabilityItem(BaseModel): + dscp: Annotated[ + Optional[int], + Field( + description="The DSCP value to be used for packets associated with the forwarding class and the specific drop probability. This overrides the general DSCP value.", + ge=0, + le=63, + title="DSCP", + ), + ] = None + level: Annotated[ + Optional[Literal["High", "Medium", "Low"]], + Field( + description="A drop probability level within the forwarding class for which a different remarking is desired.", + title="Level", + ), + ] = None + + +class EgressPolicySpecForwardingClassToQueueMappingItem(BaseModel): + forwardingClasses: Annotated[ + List[str], + Field( + description="The forwarding classes to which the mapping applies, these are references to ForwardingClass resources.", + min_length=1, + title="Forwarding Classes", + ), + ] + queue: Annotated[ + str, + Field( + description="The queue to which the forwarding classes are mapped, this is a reference to a Queue resource.", + title="Queue", + ), + ] + queueGroup: Annotated[ + Optional[str], + Field( + description="The queue-group name for queue to forwarding class mapping.", + title="Queue Group", + ), + ] = None + + +class EgressPolicySpecPfcDeadlockAvoidance(BaseModel): + """ + Parameters related to avoid a deadlock related to pfc on outgoing interface. + """ + + deadlockAvoidance: Annotated[ + bool, + Field( + description="Parameters related to avoid a deadlock related to pfc on outgoing interface", + title="Deadlock Avoidance", + ), + ] + deadlockDetectionTimer: Annotated[ + int, + Field( + description="Number of milliseconds during which outgoing interface is receiving pfc-pause-frames before triggering recovery-timer.", + title="Deadlock Detection Timer", + ), + ] + deadlockRecoveryTimer: Annotated[ + int, + Field( + description="Number of milliseconds during which the pfc-pause-frames will be ignored.", + title="Deadlock Recovery Timer", + ), + ] + + +class EgressPolicySpecQueueManagementItem(BaseModel): + queues: Annotated[ + List[EgressPolicySpecQueueManagementItemQueue], + Field(description="List of queues.", title="Queues"), + ] + slopePolicyWeight: Annotated[ + Optional[int], + Field( + description="The average queue size is calculated using both the previous average and the current queue size: average = (previous average)(1 - 2^(-n)) + (current size)(2^(-n)), where n is a user-configurable weight factor. A higher n gives more importance to the previous average, smoothing peaks and lows in the queue. Lower n makes the average closer to the current queue size. If this leaf is absent, the default value is used.", + ge=0, + le=15, + title="Slope Policy Weight", + ), + ] = 0 + wredSlopPolicies: Annotated[ + Optional[List[EgressPolicySpecQueueManagementItemWredSlopPolicy]], + Field( + description="Slope policy to apply to the set of queues.", + title="Slope Policy", + ), + ] = None + + +class EgressPolicySpecQueueManagementItemQueue(BaseModel): + committedBurstSize: Annotated[ + Optional[int], + Field(description="Committed Burst Size.", title="Committed Burst Size"), + ] = None + maximumBurstSize: Annotated[ + int, + Field( + description="Maximum amount of shared buffer memory available to the queue in bytes.", + ge=0, + le=4294967295, + title="Maximum Burst Size", + ), + ] + pfcPauseFramePriority: Annotated[ + Optional[int], + Field( + description="The pfc-priority received in pfc-pause-frame.", + title="PFC Priority", + ), + ] = None + queue: Annotated[ + str, Field(description="Reference to a Queue resource.", title="Queue") + ] + schedulerPeakRatePercent: Annotated[ + Optional[int], + Field( + description="The peak rate percent used by the scheduler for the queue.", + ge=1, + le=100, + title="Scheduler Peak Rate Percent", + ), + ] = None + schedulerPriorityLevel: Annotated[ + Optional[int], + Field( + description="The priority level at this Port Scheduler Policy.", + ge=1, + le=8, + title="Scheduler Priority Level", + ), + ] = None + schedulerWeight: Annotated[ + Optional[int], + Field( + description="The weight factor used for the WRR scheduler. If any of the queues have a configured weight the set of queues will use a WRR scheduler and thus all queues must have a weight configured. If no weights are set then the queues are scheduled in strict priority from lowest to higher queue ID.", + ge=0, + le=255, + title="Scheduler Weight", + ), + ] = None + + +class EgressPolicySpecQueueManagementItemWredSlopPolicy(BaseModel): + drop: Annotated[ + bool, + Field( + description="When set to true, and if the ECN field in the packet indicates that the endpoints are not ECN-capable, and the WRED algorithm determines that the packet should be dropped based on the drop probability, the packet will be dropped", + title="Drop", + ), + ] + dropProbability: Annotated[ + Literal["High", "Medium", "Low", "All"], Field(title="Drop Probability") + ] + ecn: Annotated[ + bool, + Field( + description="When set to true and the queue length is between the thresholds and the ECN field indicates ECN-capable endpoints, the CE bits are set to 1, and the packet is transmitted based on WRED. If false, such packets are discarded.", + title="ECN", + ), + ] + maxDropProbabilityPercent: Annotated[ + Optional[int], + Field( + description="If the queue depth is between min and max threshold then this the probability with which packets are dropped or marked.", + title="Max Drop Probability Percent", + ), + ] = None + maxThreshold: Annotated[ + Optional[int], + Field( + description="The maximum threshold parameter for a RED-managed queue in bytes. When the average queue length exceeds the max value, all packets are dropped (or marked if ECN is enabled). Mutually exclusive with min-threshold-percent and max-threshold-percent.", + title="Max Threshold", + ), + ] = None + maxThresholdPercent: Annotated[ + Optional[int], + Field( + description="The maximum threshold parameter for a RED-managed queue in percent. When the average queue length exceeds the max value, all packets are dropped (or marked if ECN is enabled). Mutually exclusive with min-threshold and max-threshold.", + title="Max Threshold Percent", + ), + ] = None + minThreshold: Annotated[ + Optional[int], + Field( + description="The mininum threshold parameter for a RED-managed queue in bytes. When the average queue length is less than min, all packets are admitted to the queue. Mututally exclusive with min-threshold-percent and max-threshold-percent.", + title="Min Threshold", + ), + ] = None + minThresholdPercent: Annotated[ + Optional[int], + Field( + description="The mininum threshold parameter for a RED-managed queue in percent. When the average queue length is less than min, all packets are admitted to the queue. Mutually exclusive with min-threshold and max-threshold.", + title="Min Threshold Percent", + ), + ] = None + trafficType: Annotated[ + Literal["Tcp", "NonTcp", "All"], + Field( + description="The traffic type to which the WRED slope applies.", + title="Traffic Type", + ), + ] + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class ForwardingClass(BaseModel): + """ + ForwardingClass is the Schema for the forwardingclasss API + """ + + apiVersion: str + kind: str + metadata: ForwardingClassMetadata + spec: Annotated[ + Dict[str, Any], + Field( + description="The ForwaringClass is used as a placeholder for to allow multiple other resources to reference the same forwarding class.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="ForwardingClassStatus defines the observed state of ForwardingClass", + title="Status", + ), + ] = None + + +ForwardingClassDeletedResourceEntry = EgressPolicyDeletedResourceEntry + + +class ForwardingClassDeletedResources( + RootModel[List[ForwardingClassDeletedResourceEntry]] +): + root: List[ForwardingClassDeletedResourceEntry] + + +class ForwardingClassList(BaseModel): + """ + ForwardingClassList is a list of forwardingclasss + """ + + apiVersion: str + items: Optional[List[ForwardingClass]] = None + kind: str + + +ForwardingClassMetadata = EgressPolicyMetadata + + +class IngressPolicy(BaseModel): + """ + IngressPolicy is the Schema for the ingresspolicys API + """ + + apiVersion: str + kind: str + metadata: IngressPolicyMetadata + spec: Annotated[ + IngressPolicySpec, + Field( + description="IngressPolicySpec defines the desired state of IngressPolicy", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="IngressPolicyStatus defines the observed state of IngressPolicy", + title="Status", + ), + ] = None + + +IngressPolicyDeletedResourceEntry = EgressPolicyDeletedResourceEntry + + +class IngressPolicyDeletedResources(RootModel[List[IngressPolicyDeletedResourceEntry]]): + root: List[IngressPolicyDeletedResourceEntry] + + +class IngressPolicyList(BaseModel): + """ + IngressPolicyList is a list of ingresspolicys + """ + + apiVersion: str + items: Optional[List[IngressPolicy]] = None + kind: str + + +IngressPolicyMetadata = EgressPolicyMetadata + + +class IngressPolicySpec(BaseModel): + """ + IngressPolicySpec defines the desired state of IngressPolicy + """ + + classifier: Annotated[ + Optional[IngressPolicySpecClassifier], + Field( + description="Classifier manages the configuration of traffic classification policies in a network. It includes various entry types like IPv4, IPv6, Dot1p, and DSCP policies. Each entry specifies how traffic should be classified and what actions should be taken on the matched packets.", + title="Classifiers", + ), + ] = None + forwardingClassToQueueMapping: Annotated[ + Optional[List[IngressPolicySpecForwardingClassToQueueMappingItem]], + Field( + description="Forwarding class to queue mapping policy.", + title="Forwarding Class to Queue Mapping", + ), + ] = None + policers: Annotated[ + Optional[List[IngressPolicySpecPolicer]], + Field( + description="Ordered list of policers where the first policer is evaluated first before proceeding to the next.", + title="Policers", + ), + ] = None + queueManagement: Annotated[ + Optional[List[IngressPolicySpecQueueManagementItem]], + Field( + description="Queue management policy for egress queues.", + title="Queue Management", + ), + ] = None + + +class IngressPolicySpecClassifier(BaseModel): + """ + Classifier manages the configuration of traffic classification policies in a network. It includes various entry types like IPv4, IPv6, Dot1p, and DSCP policies. Each entry specifies how traffic should be classified and what actions should be taken on the matched packets. + """ + + entries: Annotated[ + List[IngressPolicySpecClassifierEntry], + Field( + description="Specifies the list of filter entries, in order.\nA classifier containing multiple entry types may result in multiple classifiers being created on the target node.\nIPV4 and IPV6 entries will create multifield classifier policies.", + title="Entries", + ), + ] + + +class IngressPolicySpecClassifierEntry(BaseModel): + dot1pPolicyEntry: Annotated[ + Optional[IngressPolicySpecClassifierEntryDot1pPolicyEntry], + Field( + description="A Dot1p policy entry - only a single Dot1p entry is allowed per classifier resource.", + title="Dot1p Policy Entry", + ), + ] = None + dscpPolicyEntry: Annotated[ + Optional[IngressPolicySpecClassifierEntryDscpPolicyEntry], + Field( + description="A DSCP policy entry - only a single DSCP entry is allowed per classifier resource.", + title="DSCP Policy Entry", + ), + ] = None + ipEntry: Annotated[ + Optional[IngressPolicySpecClassifierEntryIpEntry], + Field( + description="An IPv4 or IPv6 multifield classifier entry.", title="IP Entry" + ), + ] = None + type: Annotated[ + Literal["IPV4", "IPV6", "DOT1P", "DSCP", "AUTO"], + Field( + description="Type of the entry which can be IPV4, IPV6, Dot1pPolicy, DSCPPolicy, or Auto.", + title="Type", + ), + ] + + +class IngressPolicySpecClassifierEntryDot1pPolicyEntry(BaseModel): + """ + A Dot1p policy entry - only a single Dot1p entry is allowed per classifier resource. + """ + + directToPFCQueue: Annotated[ + Optional[bool], + Field( + description="In addition to creating a Dot1p PCP value to Forwarding Class mapping, this will map the PCP values directly to the PFC queue specified in the Forwarding Class to Queue mapping.", + title="Direct to PFC Queue", + ), + ] = None + dropProbabilityLevel: Annotated[ + Optional[Literal["High", "Medium", "Low"]], + Field( + description="Assign matching packets to the specified drop probability level.", + title="Drop Probability Level", + ), + ] = "Low" + forwardingClass: Annotated[ + Optional[str], + Field( + description="Reference to a ForwardingClass resource to which the value is mapped.", + title="Forwarding Class", + ), + ] = None + pcpValues: Annotated[ + List[IngressPolicySpecClassifierEntryDot1pPolicyEntryPcpValue], + Field( + description="List of PCP values or ranges used to match packets to classify into Forwarding Classes.", + min_length=1, + title="PCP Values", + ), + ] + + +class IngressPolicySpecClassifierEntryDot1pPolicyEntryPcpValue(BaseModel): + rangeEnd: Annotated[ + Optional[int], + Field( + description="Optional end of PCP range (inclusive) which would start from the Value to the RangeEnd.", + ge=0, + le=7, + title="PCP Range End", + ), + ] = None + value: Annotated[ + int, + Field( + description="Single PCP value or start of range.", + ge=0, + le=7, + title="PCP Value", + ), + ] + + +class IngressPolicySpecClassifierEntryDscpPolicyEntry(BaseModel): + """ + A DSCP policy entry - only a single DSCP entry is allowed per classifier resource. + """ + + dropProbabilityLevel: Annotated[ + Optional[Literal["High", "Medium", "Low"]], + Field( + description="Assign matching packets to the specified drop probability level.", + title="Drop Probability Level", + ), + ] = "Low" + dscpValues: Annotated[ + List[IngressPolicySpecClassifierEntryDscpPolicyEntryDscpValue], + Field( + description="List of DSCP values or ranges used to match packets to classify into Forwarding Classes.", + min_length=1, + title="DSCP Values", + ), + ] + forwardingClass: Annotated[ + Optional[str], + Field( + description="Reference to a ForwardingClass resource to which the value is mapped.", + title="Forwarding Class", + ), + ] = None + + +class IngressPolicySpecClassifierEntryDscpPolicyEntryDscpValue(BaseModel): + rangeEnd: Annotated[ + Optional[int], + Field( + description="Optional end of DSCP range (inclusive) which would start from the Value to the RangeEnd.", + ge=0, + le=63, + title="DSCP Range End", + ), + ] = None + value: Annotated[ + int, + Field( + description="Single DSCP value or start of range.", + ge=0, + le=63, + title="DSCP Value", + ), + ] + + +class IngressPolicySpecClassifierEntryIpEntry(BaseModel): + """ + An IPv4 or IPv6 multifield classifier entry. + """ + + action: Annotated[ + IngressPolicySpecClassifierEntryIpEntryAction, + Field(description="An action to take on the matched packets.", title="Action"), + ] + destinationPortName: Annotated[ + Optional[ + Literal[ + "ACAP", + "AFP-TCP", + "ARNS", + "ASF-RMCP", + "ASHARE", + "ATALK-RM", + "AURP", + "AUTH", + "BFD", + "BFD-ECHO", + "BFTP", + "BGMP", + "BGP", + "BOOTPC", + "BOOTPS", + "CCSO-NS", + "CHARGEN", + "CISCO-TDP", + "CITADEL", + "CLEARCASE", + "COMMERCE", + "COURIER", + "DAYTIME", + "DHCP-FAILOVER", + "DHCPV6-CLIENT", + "DHCPV6-SERVER", + "DICOM", + "DISCARD", + "DNSIX", + "DOMAIN", + "DSP", + "ECHO", + "EPP", + "ESRO", + "EXEC", + "FINGER", + "FTP", + "FTP-DATA", + "FTPS", + "FTPS-DATA", + "GODI", + "GOPHER", + "GTP-C", + "GTP-PRIME", + "GTP-U", + "HA-CLUSTER", + "HOSTNAME", + "HP-ALARM-MGR", + "HTTP", + "HTTP-ALT", + "HTTP-MGMT", + "HTTP-RPC", + "HTTPS", + "IEEE-MMS-SSL", + "IMAP", + "IMAP3", + "IMAPS", + "IPP", + "IPSEC", + "IPX", + "IRC", + "IRIS-BEEP", + "ISAKMP", + "ISAKMP-NAT", + "ISCSI", + "ISO-TSAP", + "KERBEROS", + "KERBEROS-ADM", + "KLOGIN", + "KPASSWD", + "KSHELL", + "L2TP", + "LDAP", + "LDAPS", + "LDP", + "LMP", + "LOGIN", + "LPD", + "LSP-PING", + "MAC-SERVER-ADM", + "MATIP-A", + "MATIP-B", + "MICRO-BFD", + "MICROSOFT-DS", + "MOBILE-IP", + "MONITOR", + "MPP", + "MS-EXCHANGE", + "MSDP", + "MSP", + "MSSQL-M", + "MSSQL-S", + "MULTIHOP-BFD", + "NAS", + "NCP", + "NETBIOS-DATA", + "NETBIOS-NS", + "NETBIOS-SS", + "NETNEWS", + "NETRJS-1", + "NETRJS-2", + "NETRJS-3", + "NETRJS-4", + "NETWALL", + "NEW-RWHO", + "NFS", + "NNTP", + "NNTPS", + "NTP", + "ODMR", + "OLSR", + "OPENVPN", + "PIM-AUTO-RP", + "PKIX-TIMESTAMP", + "POP2", + "POP3", + "POP3S", + "PPTP", + "PRINT-SRV", + "PTP-EVENT", + "PTP-GENERAL", + "QMTP", + "QOTD", + "RADIUS", + "RADIUS-ACCT", + "REMOTE-MAIL", + "REMOTEFS", + "REMOTECMD", + "RIP", + "RJE", + "RLP", + "RLZDB", + "RMC", + "RMONITOR", + "RPC2PORTMAP", + "RSYNC", + "RTELNET", + "RTSP", + "SGMP", + "SILC", + "SMUX", + "SNA-GW", + "SNMP", + "SNMP-TRAP", + "SNPP", + "SMTP", + "SQL-SVCS", + "SQL", + "SSH", + "SUBMISSION", + "SUNRPC", + "SVCLOC", + "SYSLOG", + "SYSTAT", + "TACACS", + "TALK", + "TCPMUX", + "TCPNETHASPSRV", + "TFTP", + "TIME", + "TIMED", + "UPS", + "XDMCP", + "XNS-CH", + "XNS-MAIL", + "XNS-TIME", + "Z3950", + ] + ], + Field( + description="Destination port to match by name.", + title="Destination Port Name", + ), + ] = None + destinationPortNumber: Annotated[ + Optional[int], + Field( + description="Destination port to match by numerical value.", + ge=0, + le=65535, + title="Destination Port Number", + ), + ] = None + destinationPortOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching destinationPort, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Destination Port Operator", + ), + ] = None + destinationPortRange: Annotated[ + Optional[str], + Field( + description="Range of destination ports to match, in the format n-m, e.g. 100-200, The start and end of the range must be port numbers.", + title="Destination Port Range", + ), + ] = None + destinationPrefix: Annotated[ + Optional[str], + Field(description="Destination prefix to match.", title="Destination Prefix"), + ] = None + firstFragment: Annotated[ + Optional[bool], + Field(description="Match the first fragment only.", title="First Fragment"), + ] = None + fragment: Annotated[ + Optional[bool], Field(description="Match any fragment.", title="Fragment") + ] = None + icmpCode: Annotated[ + Optional[List[int]], + Field( + description="Match a specific ICMP code, as a number between 0-255, e.g. 0.", + max_length=255, + min_length=0, + title="ICMP Code", + ), + ] = None + icmpTypeName: Annotated[ + Optional[ + Literal[ + "DestUnreachable", + "Echo", + "EchoReply", + "EchoRequest", + "McastRtrAdv", + "McastRtrSolicit", + "McastRtrTerm", + "MldDone", + "MldQuery", + "MldReport", + "MldV2", + "NeighborAdvertise", + "NeighborSolicit", + "NodeInfoQuery", + "NodeInfoResponse", + "PacketTooBig", + "ParamProblem", + "Redirect", + "RouterAdvertise", + "RouterRenumber", + "RouterSolicit", + "SourceQuench", + "TimeExceeded", + "Timestamp", + "TimestampReply", + ] + ], + Field( + description="Match a specific ICMP type by name, e.g. dest-unreachable.", + title="ICMP Type Name", + ), + ] = None + icmpTypeNumber: Annotated[ + Optional[int], + Field( + description="Match a specific ICMP type by number.", + ge=0, + le=255, + title="ICMP Type Number", + ), + ] = None + protocolName: Annotated[ + Optional[ + Literal[ + "AH", + "EGP", + "EIGRP", + "ESP", + "GGP", + "GRE", + "ICMP", + "ICMP6", + "IDRP", + "IGMP", + "IGP", + "IPV4", + "IPV6", + "IPV6-DEST-OPTS", + "IPV6-HOP", + "L2TP", + "MPLS-IN-IP", + "NO-NEXT-HDR", + "OSPF", + "PIM", + "ROHC", + "RSVP", + "SCTP", + "ST", + "TCP", + "UDP", + "VRRP", + ] + ], + Field( + description="Match a specific IP protocol name (specified in the type field of the IP header).", + title="Protocol Name", + ), + ] = None + protocolNumber: Annotated[ + Optional[int], + Field( + description="Match a specific IP protocol number (specified in the type field of the IP header).", + ge=0, + le=255, + title="Protocol Number", + ), + ] = None + sourcePortName: Annotated[ + Optional[ + Literal[ + "ACAP", + "AFP-TCP", + "ARNS", + "ASF-RMCP", + "ASHARE", + "ATALK-RM", + "AURP", + "AUTH", + "BFD", + "BFD-ECHO", + "BFTP", + "BGMP", + "BGP", + "BOOTPC", + "BOOTPS", + "CCSO-NS", + "CHARGEN", + "CISCO-TDP", + "CITADEL", + "CLEARCASE", + "COMMERCE", + "COURIER", + "DAYTIME", + "DHCP-FAILOVER", + "DHCPV6-CLIENT", + "DHCPV6-SERVER", + "DICOM", + "DISCARD", + "DNSIX", + "DOMAIN", + "DSP", + "ECHO", + "EPP", + "ESRO", + "EXEC", + "FINGER", + "FTP", + "FTP-DATA", + "FTPS", + "FTPS-DATA", + "GODI", + "GOPHER", + "GTP-C", + "GTP-PRIME", + "GTP-U", + "HA-CLUSTER", + "HOSTNAME", + "HP-ALARM-MGR", + "HTTP", + "HTTP-ALT", + "HTTP-MGMT", + "HTTP-RPC", + "HTTPS", + "IEEE-MMS-SSL", + "IMAP", + "IMAP3", + "IMAPS", + "IPP", + "IPSEC", + "IPX", + "IRC", + "IRIS-BEEP", + "ISAKMP", + "ISAKMP-NAT", + "ISCSI", + "ISO-TSAP", + "KERBEROS", + "KERBEROS-ADM", + "KLOGIN", + "KPASSWD", + "KSHELL", + "L2TP", + "LDAP", + "LDAPS", + "LDP", + "LMP", + "LOGIN", + "LPD", + "LSP-PING", + "MAC-SERVER-ADM", + "MATIP-A", + "MATIP-B", + "MICRO-BFD", + "MICROSOFT-DS", + "MOBILE-IP", + "MONITOR", + "MPP", + "MS-EXCHANGE", + "MSDP", + "MSP", + "MSSQL-M", + "MSSQL-S", + "MULTIHOP-BFD", + "NAS", + "NCP", + "NETBIOS-DATA", + "NETBIOS-NS", + "NETBIOS-SS", + "NETNEWS", + "NETRJS-1", + "NETRJS-2", + "NETRJS-3", + "NETRJS-4", + "NETWALL", + "NEW-RWHO", + "NFS", + "NNTP", + "NNTPS", + "NTP", + "ODMR", + "OLSR", + "OPENVPN", + "PIM-AUTO-RP", + "PKIX-TIMESTAMP", + "POP2", + "POP3", + "POP3S", + "PPTP", + "PRINT-SRV", + "PTP-EVENT", + "PTP-GENERAL", + "QMTP", + "QOTD", + "RADIUS", + "RADIUS-ACCT", + "REMOTE-MAIL", + "REMOTEFS", + "REMOTECMD", + "RIP", + "RJE", + "RLP", + "RLZDB", + "RMC", + "RMONITOR", + "RPC2PORTMAP", + "RSYNC", + "RTELNET", + "RTSP", + "SGMP", + "SILC", + "SMUX", + "SNA-GW", + "SNMP", + "SNMP-TRAP", + "SNPP", + "SMTP", + "SQL-SVCS", + "SQL", + "SSH", + "SUBMISSION", + "SUNRPC", + "SVCLOC", + "SYSLOG", + "SYSTAT", + "TACACS", + "TALK", + "TCPMUX", + "TCPNETHASPSRV", + "TFTP", + "TIME", + "TIMED", + "UPS", + "XDMCP", + "XNS-CH", + "XNS-MAIL", + "XNS-TIME", + "Z3950", + ] + ], + Field(description="Source port to match by name.", title="Source Port Name"), + ] = None + sourcePortNumber: Annotated[ + Optional[int], + Field( + description="Source port to match by numerical value.", + ge=0, + le=65535, + title="Source Port Number", + ), + ] = None + sourcePortOperator: Annotated[ + Optional[Literal["Equals", "GreaterOrEquals", "LessOrEquals"]], + Field( + description="Operator to use when matching sourcePort, either Equals, GreaterOrEquals, or LessOrEquals.", + title="Source Port Operator", + ), + ] = None + sourcePortRange: Annotated[ + Optional[str], + Field( + description="Range of source ports to match, in the format n-m, e.g. 100-200. The start and end of the range must be port numbers.", + title="Source Port Range", + ), + ] = None + sourcePrefix: Annotated[ + Optional[str], + Field(description="Source prefix to match.", title="Source Prefix"), + ] = None + tcpFlags: Annotated[ + Optional[str], + Field( + description="Match TCP flags, usable with !, &, | and the flags RST, SYN, and ACK.", + title="TCP Flags", + ), + ] = None + + +class IngressPolicySpecClassifierEntryIpEntryAction(BaseModel): + """ + An action to take on the matched packets. + """ + + dropProbabilityLevel: Annotated[ + Optional[Literal["High", "Medium", "Low"]], + Field( + description="Assign matching packets to the specified drop probability level.", + title="Drop Probability Level", + ), + ] = "Low" + dscpRewriteValue: Annotated[ + Optional[int], + Field( + description="Rewrite actions associated with packets that match the classifier entry.", + ge=0, + le=63, + title="DSCP Rewrite Value", + ), + ] = None + forwardingClass: Annotated[ + Optional[str], + Field( + description="Reference to a ForwardingClass resource to which the value is mapped.", + title="Forwarding Class", + ), + ] = None + + +class IngressPolicySpecForwardingClassToQueueMappingItem(BaseModel): + forwardingClasses: Annotated[ + List[str], + Field( + description="The forwarding classes to which the mapping applies, these are references to ForwardingClass resources.", + min_length=1, + title="Forwarding Classes", + ), + ] + queue: Annotated[ + str, + Field( + description="The queue to which the forwarding classes are mapped, this is a reference to a Queue resource.", + title="Queue", + ), + ] + + +class IngressPolicySpecPolicer(BaseModel): + committedBurstSize: Annotated[ + Optional[int], + Field( + description="Maximum CIR bucket depth in bytes.", + ge=0, + le=4294967295, + title="Committed Burst Size", + ), + ] = None + committedRate: Annotated[ + Optional[int], + Field( + description="The committed information rate (CIR) of the policer, defined in kilobits (1024 bits) per second.", + title="Committed Rate", + ), + ] = None + committedRatePercent: Annotated[ + Optional[int], + Field( + description="The committed information rate (CIR) of the policer, defined as a percentage of the Interface speed on which it is applied.", + ge=0, + le=100, + title="Committed Rate Percentage", + ), + ] = None + exceedAction: Annotated[ + Optional[IngressPolicySpecPolicerExceedAction], + Field( + description="Applies a drop-probability to packets that the policer has determined are exceeding (yellow).", + title="Exceed Action", + ), + ] = None + forwardingClasses: Annotated[ + Optional[List[IngressPolicySpecPolicerForwardingClass]], + Field( + description="The list of forwarding classes with traffic to be sent to the policer. Unless specified all traffic is matched for this policer.", + title="Forwarding Class", + ), + ] = None + maximumBurstSize: Annotated[ + Optional[int], + Field( + description="Maximum PIR bucket depth in bytes.", + ge=0, + le=4294967295, + title="Maximum Burst Size", + ), + ] = None + minInterfaceSpeed: Annotated[ + Optional[int], + Field( + description="Minimum interface speed (kbps) to calculate PeakRate and CommittedRate for devices where configuration is not supported in percentage.", + title="Minimum Interface Speed", + ), + ] = None + peakRate: Annotated[ + Optional[int], + Field( + description="The peak information rate (PIR) of the policer, defined in kilobits (1024 bits) per second.", + title="Peak Rate", + ), + ] = None + peakRatePercent: Annotated[ + Optional[int], + Field( + description="The peak information rate (PIR) of the policer, defined as a percentage of the Interface speed on which it is applied.", + ge=0, + le=100, + title="Peak Rate Percentage", + ), + ] = None + violateAction: Annotated[ + Optional[IngressPolicySpecPolicerViolateAction], + Field( + description="Applies a drop-probability to packets that the policer has determined are exceeding (red).", + title="Violate Action", + ), + ] = None + + +class IngressPolicySpecPolicerExceedAction(BaseModel): + """ + Applies a drop-probability to packets that the policer has determined are exceeding (yellow). + """ + + dropProbabilityLevel: Annotated[ + Optional[Literal["High", "Medium", "Low"]], + Field(title="Drop Probability Level"), + ] = "Medium" + + +class IngressPolicySpecPolicerForwardingClass(BaseModel): + forwardingClasses: Annotated[ + Optional[List[str]], + Field( + description="The forwarding class of the packets on which to apply the Policer. To match all traffic set this to 'ALL'.", + title="Forwarding Class", + ), + ] = None + forwardingTypes: Annotated[ + List[ + Literal[ + "Broadcast", + "Unicast", + "Multicast", + "UnknownMulticast", + "UnknownUnicast", + "All", + ] + ], + Field(title="Forwarding Type"), + ] + + +class IngressPolicySpecPolicerViolateAction(BaseModel): + """ + Applies a drop-probability to packets that the policer has determined are exceeding (red). + """ + + dropProbabilityLevel: Annotated[ + Optional[Literal["High", "Medium", "Low", "All"]], + Field(title="Drop Probability Level"), + ] = "High" + + +class IngressPolicySpecQueueManagementItem(BaseModel): + pfcReservedBufferPercent: Annotated[ + Optional[int], + Field( + description="Percentage of the linecard buffer reserved for accomodating incoming traffic while upstream node reacts to generated PFC-pause frames. Note: this percentage must be common across all EgressPolicies and QueuesSets used on the same linecard.", + ge=0, + le=100, + title="PFC Reserved Linecard Buffer Percent", + ), + ] = None + queues: Annotated[ + List[IngressPolicySpecQueueManagementItemQueue], + Field(description="List of queues.", title="Queues"), + ] + + +class IngressPolicySpecQueueManagementItemQueue(BaseModel): + committedBurstSize: Annotated[ + Optional[int], + Field(description="Committed Burst Size.", title="Committed Burst Size"), + ] = None + maximumBurstSize: Annotated[ + Optional[int], + Field( + description="Maximum amount of shared buffer memory available to the queue in bytes.", + ge=0, + le=4294967295, + title="Maximum Burst Size", + ), + ] = None + pfcOffThreshold: Annotated[ + Optional[int], + Field( + description="PFC off threshold.", ge=0, le=100, title="PFC Off Threshold" + ), + ] = None + pfcOnThreshold: Annotated[ + Optional[int], + Field(description="PFC on threshold.", ge=0, le=100, title="PFC On Threshold"), + ] = None + pfcPauseFramePriority: Annotated[ + Optional[int], + Field( + description="PFC priorities indicated in generated pfc-pause-frame if congestion occurs in a given pfc-queue.", + title="PFC Priority", + ), + ] = None + pfcReservedShareBufferPercent: Annotated[ + Optional[int], + Field( + description="Maximum level the pfc-queue can take from pfc-reserved buffer configured per given forwarding-complex.", + ge=0, + le=100, + title="PFC Reserved Buffer", + ), + ] = None + queue: Annotated[ + str, Field(description="Reference to a Queue resource.", title="Queue") + ] + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class PolicyAttachment(BaseModel): + """ + PolicyAttachment is the Schema for the policyattachments API + """ + + apiVersion: str + kind: str + metadata: PolicyAttachmentMetadata + spec: Annotated[ + PolicyAttachmentSpec, + Field( + description="PolicyAttachmentSpec defines the desired state of PolicyAttachment", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="PolicyAttachmentStatus defines the observed state of PolicyAttachment", + title="Status", + ), + ] = None + + +PolicyAttachmentDeletedResourceEntry = EgressPolicyDeletedResourceEntry + + +class PolicyAttachmentDeletedResources( + RootModel[List[PolicyAttachmentDeletedResourceEntry]] +): + root: List[PolicyAttachmentDeletedResourceEntry] + + +class PolicyAttachmentList(BaseModel): + """ + PolicyAttachmentList is a list of policyattachments + """ + + apiVersion: str + items: Optional[List[PolicyAttachment]] = None + kind: str + + +PolicyAttachmentMetadata = EgressPolicyMetadata + + +class PolicyAttachmentSpec(BaseModel): + """ + PolicyAttachmentSpec defines the desired state of PolicyAttachment + """ + + attachments: Annotated[ + List[PolicyAttachmentSpecAttachment], + Field( + description="Specifies a list of Interfaces and subinterfaces on which to deploy the policies.", + title="Interfaces", + ), + ] + egressPolicy: Annotated[ + Optional[str], + Field( + description="Specifies an EgressPolicy to deploy on the specified Node.", + title="Egress Policy", + ), + ] = None + ingressPolicy: Annotated[ + Optional[str], + Field( + description="Specifies the IngressPolicy to deploy on the specified Node.", + title="Ingress Policy", + ), + ] = None + + +class PolicyAttachmentSpecAttachment(BaseModel): + interface: Annotated[ + Optional[str], + Field( + description="Specifies the Interface on which to deploy the policies.", + title="Interface", + ), + ] = None + interfaceType: Annotated[ + Optional[Literal["ACCESS", "NETWORK"]], + Field( + description="Used for platforms that differentiate between access/service interfaces and network interface. These platforms may require different classifiers depending on whether they are applied on access/service interfaces or network interfaces. Specifies whether the classifier should be configured as a service Egress classifier or network Egress classifier", + title="Interface Type", + ), + ] = None + subInterfaceIndex: Annotated[ + Optional[int], + Field( + description="Specifies the SubInterfaceIndex on which to deploy the policies.", + title="SubInterface Index", + ), + ] = None + + +class PolicyDeployment(BaseModel): + """ + PolicyDeployment is the Schema for the policydeployments API + """ + + apiVersion: str + kind: str + metadata: PolicyDeploymentMetadata + spec: Annotated[ + PolicyDeploymentSpec, + Field( + description="PolicyDeploymentSpec defines the desired state of PolicyDeployment", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="PolicyDeploymentStatus defines the observed state of PolicyDeployment", + title="Status", + ), + ] = None + + +PolicyDeploymentDeletedResourceEntry = EgressPolicyDeletedResourceEntry + + +class PolicyDeploymentDeletedResources( + RootModel[List[PolicyDeploymentDeletedResourceEntry]] +): + root: List[PolicyDeploymentDeletedResourceEntry] + + +class PolicyDeploymentList(BaseModel): + """ + PolicyDeploymentList is a list of policydeployments + """ + + apiVersion: str + items: Optional[List[PolicyDeployment]] = None + kind: str + + +PolicyDeploymentMetadata = EgressPolicyMetadata + + +class PolicyDeploymentSpec(BaseModel): + """ + PolicyDeploymentSpec defines the desired state of PolicyDeployment + """ + + egressPolicy: Annotated[ + Optional[str], + Field( + description="Specifies an EgressPolicy to deploy on the specified Node.", + title="Egress Policy", + ), + ] = None + ingressPolicy: Annotated[ + Optional[str], + Field( + description="Specifies the IngressPolicy to deploy on the specified Node.", + title="Ingress Policy", + ), + ] = None + interfaceSelector: Annotated[ + Optional[str], + Field( + description="Specifies a label selector to filter the interfaces on which to deploy the policies.", + title="Interface Selector", + ), + ] = None + interfaceType: Annotated[ + Optional[Literal["ACCESS", "NETWORK"]], + Field( + description="Used for platforms that differentiate between access/service interfaces and network interface. These platforms may require different classifiers depending on whether they are applied on access/service interfaces or network interfaces. Specifies whether the classifier should be configured as a service Egress classifier or network Egress classifier", + title="Interface Type", + ), + ] = None + interfaces: Annotated[ + Optional[List[str]], + Field( + description="Specifies a list of Interfaces on which to deploy the policies.", + title="Interfaces", + ), + ] = None + node: Annotated[ + Optional[str], + Field(description="Specifies a Node to deploy the policies on.", title="Node"), + ] = None + nodeSelector: Annotated[ + Optional[str], + Field( + description="Specifies a label selector to filter the nodes on which to deploy the policies.", + title="Node Selector", + ), + ] = None + + +class Queue(BaseModel): + """ + Queue is the Schema for the queues API + """ + + apiVersion: str + kind: str + metadata: QueueMetadata + spec: Annotated[ + QueueSpec, + Field( + description="The Queue resource is used to define the properties of a queue, which can then be referenced by other resources.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="QueueStatus defines the observed state of Queue", + title="Status", + ), + ] = None + + +QueueDeletedResourceEntry = EgressPolicyDeletedResourceEntry + + +class QueueDeletedResources(RootModel[List[QueueDeletedResourceEntry]]): + root: List[QueueDeletedResourceEntry] + + +class QueueList(BaseModel): + """ + QueueList is a list of queues + """ + + apiVersion: str + items: Optional[List[Queue]] = None + kind: str + + +QueueMetadata = EgressPolicyMetadata + + +class QueueSpec(BaseModel): + """ + The Queue resource is used to define the properties of a queue, which can then be referenced by other resources. + """ + + queueID: Annotated[ + Optional[int], + Field( + description="The ID of the queue on which to apply the properties. This is mandatory for usage of queus on SROS and is ignored on other operating systems.", + title="Queue ID", + ), + ] = None + queueType: Annotated[ + Literal["Normal", "Pfc"], + Field( + description="QueueType specifies whether this is a normal queue or a PFC queue", + title="Queue Type", + ), + ] + trafficType: Annotated[ + Literal["Unicast", "Multicast"], + Field( + description="The traffic type of the queue, either unicast or multicast.", + title="Traffic Type", + ), + ] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/routing/v1alpha1/models.py b/pydantic_eda/apps/routing/v1alpha1/models.py new file mode 100644 index 0000000..3f4f5f1 --- /dev/null +++ b/pydantic_eda/apps/routing/v1alpha1/models.py @@ -0,0 +1,972 @@ +# generated by datamodel-codegen: +# filename: routing.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class DefaultInterface(BaseModel): + """ + DefaultInterface is the Schema for the defaultinterfaces API + """ + + apiVersion: str + kind: str + metadata: DefaultInterfaceMetadata + spec: Annotated[ + DefaultInterfaceSpec, + Field( + description="DefaultInterface enables the configuration of default interfaces, including Interface references, DefaultRouter, VLAN IDs, IP MTU settings, and options for IPv4 and IPv6 addresses. It also supports unnumbered interfaces and BFD (Bidirectional Forwarding Detection) configuration.", + title="Specification", + ), + ] + status: Annotated[ + Optional[DefaultInterfaceStatus], + Field( + description="DefaultInterfaceStatus defines the observed state of DefaultInterface", + title="Status", + ), + ] = None + + +class DefaultInterfaceDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class DefaultInterfaceDeletedResources( + RootModel[List[DefaultInterfaceDeletedResourceEntry]] +): + root: List[DefaultInterfaceDeletedResourceEntry] + + +class DefaultInterfaceList(BaseModel): + """ + DefaultInterfaceList is a list of defaultinterfaces + """ + + apiVersion: str + items: Optional[List[DefaultInterface]] = None + kind: str + + +class DefaultInterfaceMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class DefaultInterfaceSpec(BaseModel): + """ + DefaultInterface enables the configuration of default interfaces, including Interface references, DefaultRouter, VLAN IDs, IP MTU settings, and options for IPv4 and IPv6 addresses. It also supports unnumbered interfaces and BFD (Bidirectional Forwarding Detection) configuration. + """ + + bfd: Annotated[ + Optional[DefaultInterfaceSpecBfd], + Field( + description="Enable or disable BFD on this DefaultInterface.", + title="BFD Configuration", + ), + ] = None + defaultRouter: Annotated[ + str, Field(description="Reference to a DefaultRouter.", title="Default Router") + ] + interface: Annotated[ + str, + Field( + description="Reference to an Interface to use for attachment.", + title="Interface Reference", + ), + ] + ipMTU: Annotated[ + Optional[int], + Field( + description="Set the IP MTU for the DefaultInterface.", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = None + ipv4Addresses: Annotated[ + Optional[List[DefaultInterfaceSpecIpv4Address]], + Field( + description="List of IPv4 addresses in ip/mask form, e.g., 192.168.0.1/24.", + title="IPv4 Addresses", + ), + ] = None + ipv6Addresses: Annotated[ + Optional[List[DefaultInterfaceSpecIpv6Address]], + Field( + description="List of IPv6 addresses in ip/mask form, e.g., fc00::1/120.", + title="IPv6 Addresses", + ), + ] = None + unnumbered: Annotated[ + Optional[Literal["IPV6"]], + Field( + description="Enables the use of unnumbered interfaces on the ISL. For IPv6, no IP address are configured on the sub-interface and only the link local address will be used. If any allocation pool is specified for IPv6 that will take precedence and IPs will be assigned to the interfaces. When using eBGP for an underlay protocol, the DefaultInterfaces which are a part of the ISL will be added to the BGP dynamic neighbor list.", + title="Unnumbered", + ), + ] = None + vlanID: Annotated[ + Optional[int], + Field( + description="VLAN to use with this DefaultInterface.", + ge=1, + le=4094, + title="VLAN ID", + ), + ] = None + + +class DefaultInterfaceSpecBfd(BaseModel): + """ + Enable or disable BFD on this DefaultInterface. + """ + + desiredMinTransmitInt: Annotated[ + int, + Field( + description="The minimum interval in microseconds between transmission of BFD control packets[default=1000000].", + ge=10000, + le=100000000, + title="Transmit Interval", + ), + ] + detectionMultiplier: Annotated[ + int, + Field( + description="The number of packets that must be missed to declare this session as down. [default=3]", + ge=3, + le=20, + title="Multiplier", + ), + ] + enabled: Annotated[ + bool, + Field( + description="Enable Biforward Detection[default=false].", title="Enabled" + ), + ] + minEchoReceiveInterval: Annotated[ + int, + Field( + description="The minimum interval between echo packets the local node can receive in microseconds", + ge=0, + le=100000000, + title="Minimum Echo Receive Interval", + ), + ] + requiredMinReceive: Annotated[ + int, + Field( + description="The minimum interval in microseconds between received BFD control packets that this system should support.[default=1000000].", + ge=10000, + le=100000000, + title="Receive Interval", + ), + ] + + +class DefaultInterfaceSpecIpv4Address(BaseModel): + ipPrefix: Annotated[ + str, Field(description="Address and mask to use", title="IP Prefix") + ] + primary: Annotated[ + Optional[bool], + Field( + description="Indicates which address to use as primary for broadcast", + title="Primary", + ), + ] = None + + +DefaultInterfaceSpecIpv6Address = DefaultInterfaceSpecIpv4Address + + +class DefaultInterfaceStatus(BaseModel): + """ + DefaultInterfaceStatus defines the observed state of DefaultInterface + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the DefaultInterface.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="Indicates when this Interface last changed state.", + title="Last Change", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Indicates the current operational state of the DefaultInterface.", + title="Operational State", + ), + ] = None + + +class DefaultRouter(BaseModel): + """ + DefaultRouter is the Schema for the defaultrouters API + """ + + apiVersion: str + kind: str + metadata: DefaultRouterMetadata + spec: Annotated[ + DefaultRouterSpec, + Field( + description="DefaultRouter enables the configuration of default routing instances on a specified Node, including options for BGP configuration, import and export policies, and router IDs.", + title="Specification", + ), + ] + status: Annotated[ + Optional[DefaultRouterStatus], + Field( + description="DefaultRouterStatus defines the observed state of DefaultRouter", + title="Status", + ), + ] = None + + +DefaultRouterDeletedResourceEntry = DefaultInterfaceDeletedResourceEntry + + +class DefaultRouterDeletedResources(RootModel[List[DefaultRouterDeletedResourceEntry]]): + root: List[DefaultRouterDeletedResourceEntry] + + +class DefaultRouterList(BaseModel): + """ + DefaultRouterList is a list of defaultrouters + """ + + apiVersion: str + items: Optional[List[DefaultRouter]] = None + kind: str + + +DefaultRouterMetadata = DefaultInterfaceMetadata + + +class DefaultRouterSpec(BaseModel): + """ + DefaultRouter enables the configuration of default routing instances on a specified Node, including options for BGP configuration, import and export policies, and router IDs. + """ + + bgp: Annotated[ + Optional[DefaultRouterSpecBgp], + Field(description="BGP configuration.", title="BGP Configuration"), + ] = None + description: Annotated[ + Optional[str], + Field( + description="Sets the description on the Default router.", + title="Description", + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.", + title="Export Policy", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.", + title="Import Policy", + ), + ] = None + node: Annotated[ + str, + Field( + description="Reference to a TopoNode on which to configure the default routing instance.", + title="Node", + ), + ] + routeLeaking: Annotated[ + Optional[DefaultRouterSpecRouteLeaking], + Field( + description="Route leaking controlled by routing policies in and out of the DefaultRouter.", + title="Route Leaking", + ), + ] = None + routerID: Annotated[ + str, Field(description="Router ID in dotted quad notation.", title="Router ID") + ] + + +class DefaultRouterSpecBgp(BaseModel): + """ + BGP configuration. + """ + + autonomousSystem: Annotated[ + Optional[int], + Field( + description="Autonomous System number for BGP.", + ge=1, + le=4294967295, + title="Autonomous System", + ), + ] = None + ebgpPreference: Annotated[ + Optional[int], + Field( + description="Preference to be set for eBGP.", + ge=1, + le=255, + title="eBGP Preference", + ), + ] = 170 + enabled: Annotated[ + Optional[bool], + Field(description="Enables BGP in the default VRF.", title="Enable BGP"), + ] = False + ibgpPreference: Annotated[ + Optional[int], + Field( + description="Preference to be set for iBGP.", + ge=1, + le=255, + title="iBGP Preference", + ), + ] = 170 + ipv4Unicast: Annotated[ + Optional[DefaultRouterSpecBgpIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[DefaultRouterSpecBgpIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field(description="Keychain to be used for authentication", title="Keychain"), + ] = None + l2VPNEVPN: Annotated[ + Optional[DefaultRouterSpecBgpL2VPNEVPN], + Field( + description="Parameters relating to the EVPN AFI/SAFI.", title="L2VPN EVPN" + ), + ] = None + minWaitToAdvertise: Annotated[ + Optional[int], + Field( + description="Minimum wait time before advertising routes post BGP restart.", + ge=0, + le=3600, + title="Min Wait To Advertise Time", + ), + ] = 0 + rapidWithdrawl: Annotated[ + Optional[bool], + Field( + description="Enable rapid withdrawal in BGP.", + title="Enable Rapid Withdrawal", + ), + ] = False + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + waitForFibInstall: Annotated[ + Optional[bool], + Field( + description="Wait for FIB installation before advertising routes.", + title="Wait for FIB Installation", + ), + ] = False + + +class DefaultRouterSpecBgpIpv4Unicast(BaseModel): + """ + Parameters relating to the IPv4 unicast AFI/SAFI. + """ + + advertiseIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.", + title="Advertise IPv6 Next Hops", + ), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enables the IPv4 unicast AFISAFI.", title="Enabled"), + ] = None + multipath: Annotated[ + Optional[DefaultRouterSpecBgpIpv4UnicastMultipath], + Field(description="Enable multipath.", title="Multipath"), + ] = None + rapidUpdate: Annotated[ + Optional[bool], Field(description="Enables rapid update.", title="Rapid Update") + ] = None + receiveIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.", + title="Receive IPv6 Next Hops", + ), + ] = None + + +class DefaultRouterSpecBgpIpv4UnicastMultipath(BaseModel): + """ + Enable multipath. + """ + + allowMultipleAS: Annotated[ + bool, + Field( + description="When set to true, BGP is allowed to build a multipath set using BGP routes with different neighbor AS (most recent AS in the AS_PATH), When set to false, BGP is only allowed to use non-best paths for ECMP if they meet the multipath criteria and they have the same neighbor AS as the best path.", + title="Allow Multiple Autonomous Systems Per Path", + ), + ] + maxAllowedPaths: Annotated[ + int, + Field( + description="The maximum number of BGP ECMP next-hops for BGP routes with an NLRI belonging to the address family of this configuration context.", + ge=1, + le=256, + title="Maximum Number of Paths", + ), + ] + + +class DefaultRouterSpecBgpIpv6Unicast(BaseModel): + """ + Parameters relating to the IPv6 unicast AFI/SAFI. + """ + + enabled: Annotated[ + Optional[bool], + Field(description="Enables the IPv6 unicast AFISAFI", title="Enabled"), + ] = None + multipath: Annotated[ + Optional[DefaultRouterSpecBgpIpv6UnicastMultipath], + Field(description="Enable multipath", title="Multipath"), + ] = None + rapidUpdate: Annotated[ + Optional[bool], Field(description="Enables rapid update.", title="Rapid Update") + ] = None + + +class DefaultRouterSpecBgpIpv6UnicastMultipath(BaseModel): + """ + Enable multipath + """ + + allowMultipleAS: Annotated[ + bool, + Field( + description="When set to true, BGP is allowed to build a multipath set using BGP routes with different neighbor AS (most recent AS in the AS_PATH), When set to false, BGP is only allowed to use non-best paths for ECMP if they meet the multipath criteria and they have the same neighbor AS as the best path.", + title="Allow Multiple Autonomous Systems Per Path", + ), + ] + maxAllowedPaths: Annotated[ + int, + Field( + description="The maximum number of BGP ECMP next-hops for BGP routes with an NLRI belonging to the address family of this configuration context.", + ge=1, + le=256, + title="Maximum Number of Paths", + ), + ] + + +class DefaultRouterSpecBgpL2VPNEVPN(BaseModel): + """ + Parameters relating to the EVPN AFI/SAFI. + """ + + advertiseIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables advertisement of EVPN routes with IPv6 next-hops to peers.", + title="Advertise IPv6 Next Hops", + ), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enables the L2VPN EVPN AFISAFI.", title="Enabled"), + ] = None + interASVPN: Annotated[ + Optional[bool], + Field(description="Enable inter-AS VPN for EVPN.", title="EVPN InterAS VPN"), + ] = False + multipath: Annotated[ + Optional[DefaultRouterSpecBgpL2VPNEVPNMultipath], + Field(description="Enable multipath", title="Multipath"), + ] = None + rapidUpdate: Annotated[ + Optional[bool], Field(description="Enables rapid update.", title="Rapid Update") + ] = None + + +DefaultRouterSpecBgpL2VPNEVPNMultipath = DefaultRouterSpecBgpIpv6UnicastMultipath + + +class DefaultRouterSpecRouteLeaking(BaseModel): + """ + Route leaking controlled by routing policies in and out of the DefaultRouter. + """ + + exportPolicy: Annotated[ + str, + Field( + description="Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.", + title="Export Policy", + ), + ] + importPolicy: Annotated[ + str, + Field( + description="Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.", + title="Import Policy", + ), + ] + + +class DefaultRouterStatus(BaseModel): + """ + DefaultRouterStatus defines the observed state of DefaultRouter + """ + + health: Annotated[ + Optional[int], + Field(description="Indicates the health score of the Router.", title="Health"), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the Router.", title="Operational State" + ), + ] = None + + +class Drain(BaseModel): + """ + Drain is the Schema for the drains API + """ + + apiVersion: str + kind: str + metadata: DrainMetadata + spec: Annotated[ + DrainSpec, + Field( + description="Drain allows for the controlled disabling or draining of specific DefaultRouters, either by selecting them through labels or directly referencing them, ensuring traffic is safely rerouted or dropped before the routers are decommissioned.", + title="Specification", + ), + ] + status: Annotated[ + Optional[DrainStatus], + Field( + description="DrainStatus defines the observed state of Drain.", + title="Status", + ), + ] = None + + +DrainDeletedResourceEntry = DefaultInterfaceDeletedResourceEntry + + +class DrainDeletedResources(RootModel[List[DrainDeletedResourceEntry]]): + root: List[DrainDeletedResourceEntry] + + +class DrainList(BaseModel): + """ + DrainList is a list of drains + """ + + apiVersion: str + items: Optional[List[Drain]] = None + kind: str + + +DrainMetadata = DefaultInterfaceMetadata + + +class DrainSpec(BaseModel): + """ + Drain allows for the controlled disabling or draining of specific DefaultRouters, either by selecting them through labels or directly referencing them, ensuring traffic is safely rerouted or dropped before the routers are decommissioned. + """ + + defaultRouterSelector: Annotated[ + Optional[List[str]], + Field( + description="Selector to use when selecting DefaultRouters to drain.", + title="Default Router Selector", + ), + ] = None + defaultRouters: Annotated[ + Optional[List[str]], + Field( + description="Reference to DefaultRouters to drain.", title="Default Routers" + ), + ] = None + enabled: Annotated[ + Optional[bool], Field(description="Enable this Drain.", title="Enabled") + ] = True + + +class DrainStatus(BaseModel): + """ + DrainStatus defines the observed state of Drain. + """ + + defaultRouters: Annotated[ + Optional[List[str]], + Field( + description="List of DefaultRouters this Drain has been applied to", + title="Default Routers", + ), + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class SystemInterface(BaseModel): + """ + SystemInterface is the Schema for the systeminterfaces API + """ + + apiVersion: str + kind: str + metadata: SystemInterfaceMetadata + spec: Annotated[ + SystemInterfaceSpec, + Field( + description="SystemInterfaceSpec defines the desired state of SystemInterface", + title="Specification", + ), + ] + status: Annotated[ + Optional[SystemInterfaceStatus], + Field( + description="SystemInterfaceStatus defines the observed state of SystemInterface", + title="Status", + ), + ] = None + + +SystemInterfaceDeletedResourceEntry = DefaultInterfaceDeletedResourceEntry + + +class SystemInterfaceDeletedResources( + RootModel[List[SystemInterfaceDeletedResourceEntry]] +): + root: List[SystemInterfaceDeletedResourceEntry] + + +class SystemInterfaceList(BaseModel): + """ + SystemInterfaceList is a list of systeminterfaces + """ + + apiVersion: str + items: Optional[List[SystemInterface]] = None + kind: str + + +SystemInterfaceMetadata = DefaultInterfaceMetadata + + +class SystemInterfaceSpec(BaseModel): + """ + SystemInterfaceSpec defines the desired state of SystemInterface + """ + + bfd: Annotated[ + Optional[SystemInterfaceSpecBfd], + Field( + description="Enable or disable BFD on this SystemInterface.", + title="BFD Configuration", + ), + ] = None + defaultRouter: Annotated[ + str, Field(description="Reference to a DefaultRouter.", title="Default Router") + ] + ipv4Address: Annotated[ + Optional[str], + Field( + description="IPv4 address in ip/mask form, e.g., 192.168.0.1/32.", + title="IPv4 Address", + ), + ] = None + ipv6Address: Annotated[ + Optional[str], + Field( + description="IPv6 address in ip/mask form, e.g., fc00::1/128.", + title="IPv6 Address", + ), + ] = None + + +class SystemInterfaceSpecBfd(BaseModel): + """ + Enable or disable BFD on this SystemInterface. + """ + + desiredMinTransmitInt: Annotated[ + int, + Field( + description="The minimum interval in microseconds between transmission of BFD control packets[default=1000000].", + ge=10000, + le=100000000, + title="Transmit Interval", + ), + ] + detectionMultiplier: Annotated[ + int, + Field( + description="The number of packets that must be missed to declare this session as down. [default=3]", + ge=3, + le=20, + title="Multiplier", + ), + ] + enabled: Annotated[ + bool, + Field( + description="Enable Biforward Detection[default=false].", title="Enabled" + ), + ] + minEchoReceiveInterval: Annotated[ + int, + Field( + description="The minimum interval between echo packets the local node can receive in microseconds", + ge=0, + le=100000000, + title="Minimum Echo Receive Interval", + ), + ] + requiredMinReceive: Annotated[ + int, + Field( + description="The minimum interval in microseconds between received BFD control packets that this system should support.[default=1000000].", + ge=10000, + le=100000000, + title="Receive Interval", + ), + ] + + +class SystemInterfaceStatus(BaseModel): + """ + SystemInterfaceStatus defines the observed state of SystemInterface + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the SystemInterface.", + title="Health", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="Indicates when this Interface last changed state.", + title="Last Change", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Indicates the current operational state of the SystemInterface.", + title="Operational State", + ), + ] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/routingpolicies/v1alpha1/models.py b/pydantic_eda/apps/routingpolicies/v1alpha1/models.py new file mode 100644 index 0000000..18ee088 --- /dev/null +++ b/pydantic_eda/apps/routingpolicies/v1alpha1/models.py @@ -0,0 +1,529 @@ +# generated by datamodel-codegen: +# filename: routingpolicies.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class CommunitySet(BaseModel): + """ + CommunitySet is the Schema for the communitysets API + """ + + apiVersion: str + kind: str + metadata: CommunitySetMetadata + spec: Annotated[ + CommunitySetSpec, + Field( + description="CommunitySetSpec defines the desired state of CommunitySet", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="CommunitySetStatus defines the observed state of CommunitySet", + title="Status", + ), + ] = None + + +class CommunitySetDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class CommunitySetDeletedResources(RootModel[List[CommunitySetDeletedResourceEntry]]): + root: List[CommunitySetDeletedResourceEntry] + + +class CommunitySetList(BaseModel): + """ + CommunitySetList is a list of communitysets + """ + + apiVersion: str + items: Optional[List[CommunitySet]] = None + kind: str + + +class CommunitySetMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class CommunitySetSpec(BaseModel): + """ + CommunitySetSpec defines the desired state of CommunitySet + """ + + expressionMatch: Annotated[ + Optional[str], + Field( + description="Options that determine the matching criteria that applies to the list of community members.", + title="Expression Match", + ), + ] = None + members: Annotated[ + Optional[List[str]], + Field( + description="A standard BGP community value, regular expression or well-known name or else a large BGP community value or regular expression.", + title="Community Set Members", + ), + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Policy(BaseModel): + """ + Policy is the Schema for the policys API + """ + + apiVersion: str + kind: str + metadata: PolicyMetadata + spec: Annotated[ + PolicySpec, + Field( + description="Policy defines a set of rules and actions to manage network traffic or routing behavior, with statements that include matching conditions and actions, such as accepting or rejecting routes, or modifying route attributes like BGP parameters.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="PolicyStatus defines the observed state of Policy.", + title="Status", + ), + ] = None + + +PolicyDeletedResourceEntry = CommunitySetDeletedResourceEntry + + +class PolicyDeletedResources(RootModel[List[PolicyDeletedResourceEntry]]): + root: List[PolicyDeletedResourceEntry] + + +class PolicyList(BaseModel): + """ + PolicyList is a list of policys + """ + + apiVersion: str + items: Optional[List[Policy]] = None + kind: str + + +PolicyMetadata = CommunitySetMetadata + + +class PolicySpec(BaseModel): + """ + Policy defines a set of rules and actions to manage network traffic or routing behavior, with statements that include matching conditions and actions, such as accepting or rejecting routes, or modifying route attributes like BGP parameters. + """ + + defaultAction: Annotated[ + Optional[PolicySpecDefaultAction], + Field( + description="The default action to apply if no other actions are defined.", + title="Default Action", + ), + ] = None + statement: Annotated[ + Optional[List[PolicySpecStatementItem]], + Field(description="List of policy statements.", title="Statements"), + ] = None + + +class PolicySpecDefaultAction(BaseModel): + """ + The default action to apply if no other actions are defined. + """ + + bgp: Annotated[ + Optional[PolicySpecDefaultActionBgp], + Field(description="Actions related to the BGP protocol.", title="BGP"), + ] = None + policyResult: Annotated[ + Optional[Literal["accept", "reject"]], + Field(description="Final disposition for the route.", title="Policy Result"), + ] = None + + +class PolicySpecDefaultActionBgp(BaseModel): + """ + Actions related to the BGP protocol. + """ + + asPathPrepend: Annotated[ + Optional[int], + Field( + description="AS number to prepend to the AS Path attributes.", + ge=1, + le=4294967295, + title="AS Path Prepend", + ), + ] = None + asPathRemove: Annotated[ + Optional[bool], + Field( + description="Clear the AS path to make it empty.", title="AS Path Remove" + ), + ] = None + asPathReplace: Annotated[ + Optional[List[int]], + Field( + description="Replace the existing AS path with a new AS_SEQUENCE containing the listed AS numbers.", + title="AS Path Replace", + ), + ] = None + localPreference: Annotated[ + Optional[int], + Field( + description="Set a new LOCAL_PREF value for matching BGP routes.", + ge=0, + le=4294967295, + title="Set Local Preference", + ), + ] = None + setOrigin: Annotated[ + Optional[Literal["egp", "igp", "incomplete"]], + Field( + description="Set a new ORIGIN attribute for matching BGP routes.", + title="Set Origin", + ), + ] = None + + +class PolicySpecStatementItem(BaseModel): + action: Annotated[ + Optional[PolicySpecStatementItemAction], + Field( + description="Actions for routes that match the policy statement.", + title="Action", + ), + ] = None + match: Annotated[ + Optional[PolicySpecStatementItemMatch], + Field(description="Match conditions of the policy statement.", title="Match"), + ] = None + name: Annotated[ + str, Field(description="Name of the policy statement.", title="Name") + ] + + +class PolicySpecStatementItemAction(BaseModel): + """ + Actions for routes that match the policy statement. + """ + + bgp: Annotated[ + Optional[PolicySpecStatementItemActionBgp], + Field(description="Actions related to the BGP protocol.", title="BGP"), + ] = None + policyResult: Annotated[ + Optional[Literal["accept", "reject"]], + Field(description="Final disposition for the route.", title="Policy Result"), + ] = None + + +PolicySpecStatementItemActionBgp = PolicySpecDefaultActionBgp + + +class PolicySpecStatementItemMatch(BaseModel): + """ + Match conditions of the policy statement. + """ + + bgp: Annotated[ + Optional[PolicySpecStatementItemMatchBgp], + Field( + description="Configuration for BGP-specific policy match criteria.", + title="BGP", + ), + ] = None + family: Annotated[ + Optional[List[str]], + Field( + description="Address families that the route belongs to.", title="Family" + ), + ] = None + prefixSet: Annotated[ + Optional[str], + Field(description="Reference to a PrefixSet resource.", title="Prefix Set"), + ] = None + protocol: Annotated[ + Optional[ + Literal[ + "AGGREGATE", + "ARP_ND", + "BGP", + "BGP_EVPN", + "DHCP", + "GRIBI", + "HOST", + "ISIS", + "LOCAL", + "LINUX", + "NDK1", + "NDK2", + "OSPFV2", + "OSPFV3", + "STATIC", + ] + ], + Field(description="The route protocol type to match.", title="Protocol"), + ] = None + + +class PolicySpecStatementItemMatchBgp(BaseModel): + """ + Configuration for BGP-specific policy match criteria. + """ + + communitySet: Annotated[ + Optional[str], + Field( + description="Match conditions for BGP communities.", title="BGP Community" + ), + ] = None + evpnRouteType: Annotated[ + Optional[List[int]], + Field( + description="Match conditions for EVPN route types.", + title="EVPN Route Type", + ), + ] = None + + +class PrefixSet(BaseModel): + """ + PrefixSet is the Schema for the prefixsets API + """ + + apiVersion: str + kind: str + metadata: PrefixSetMetadata + spec: Annotated[ + PrefixSetSpec, + Field( + description="PrefixSet defines a collection of IP prefixes, which may include specific CIDR blocks or a range of prefixes. This set is typically used for matching routes or implementing routing policies.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="PrefixSetStatus defines the observed state of PrefixSet.", + title="Status", + ), + ] = None + + +PrefixSetDeletedResourceEntry = CommunitySetDeletedResourceEntry + + +class PrefixSetDeletedResources(RootModel[List[PrefixSetDeletedResourceEntry]]): + root: List[PrefixSetDeletedResourceEntry] + + +class PrefixSetList(BaseModel): + """ + PrefixSetList is a list of prefixsets + """ + + apiVersion: str + items: Optional[List[PrefixSet]] = None + kind: str + + +PrefixSetMetadata = CommunitySetMetadata + + +class PrefixSetSpec(BaseModel): + """ + PrefixSet defines a collection of IP prefixes, which may include specific CIDR blocks or a range of prefixes. This set is typically used for matching routes or implementing routing policies. + """ + + prefix: Annotated[ + List[PrefixSetSpecPrefixItem], + Field( + description="List of IPv4 or IPv6 prefixes in CIDR notation.", + title="Prefixes", + ), + ] + + +class PrefixSetSpecPrefixItem(BaseModel): + endRange: Annotated[ + Optional[int], + Field( + description="The end range when using a range to match prefixes.", + ge=0, + le=128, + title="End Range", + ), + ] = None + exact: Annotated[ + Optional[bool], + Field( + description="Indicates if it is an exact match. Ignores the StartRange and EndRange if this param is set.", + title="Exact", + ), + ] = None + prefix: Annotated[ + str, + Field( + description="The IPv4 or IPv6 prefix in CIDR notation with mask.", + title="Prefix", + ), + ] + startRange: Annotated[ + Optional[int], + Field( + description="If specifying a range, this is the start of the range.", + ge=0, + le=128, + title="Start Range", + ), + ] = None + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/security/v1alpha1/models.py b/pydantic_eda/apps/security/v1alpha1/models.py new file mode 100644 index 0000000..a696fa2 --- /dev/null +++ b/pydantic_eda/apps/security/v1alpha1/models.py @@ -0,0 +1,268 @@ +# generated by datamodel-codegen: +# filename: security.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Keychain(BaseModel): + """ + Keychain is the Schema for the keychains API + """ + + apiVersion: str + kind: str + metadata: KeychainMetadata + spec: Annotated[ + KeychainSpec, + Field( + description="KeychainSpec defines the desired state of Keychain", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="KeychainStatus defines the observed state of Keychain", + title="Status", + ), + ] = None + + +class KeychainDeletedResources(RootModel[List[KeychainDeletedResourceEntry]]): + root: List[KeychainDeletedResourceEntry] + + +class KeychainDeployment(BaseModel): + """ + KeychainDeployment is the Schema for the keychaindeployments API + """ + + apiVersion: str + kind: str + metadata: KeychainDeploymentMetadata + spec: Annotated[ + KeychainDeploymentSpec, + Field( + description="KeychainDeploymentSpec defines the desired state of KeychainDeployment", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="KeychainDeploymentStatus defines the observed state of KeychainDeployment", + title="Status", + ), + ] = None + + +class KeychainDeploymentDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class KeychainDeploymentDeletedResources( + RootModel[List[KeychainDeploymentDeletedResourceEntry]] +): + root: List[KeychainDeploymentDeletedResourceEntry] + + +class KeychainDeploymentList(BaseModel): + """ + KeychainDeploymentList is a list of keychaindeployments + """ + + apiVersion: str + items: Optional[List[KeychainDeployment]] = None + kind: str + + +class KeychainDeploymentMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class KeychainDeploymentSpec(BaseModel): + """ + KeychainDeploymentSpec defines the desired state of KeychainDeployment + """ + + keychain: Annotated[ + str, Field(description="Reference to a Keychain", title="Keychain") + ] + node: Annotated[ + str, + Field( + description="Reference to a Node on which to push the BgpGroup", + title="Node", + ), + ] + + +class KeychainList(BaseModel): + """ + KeychainList is a list of keychains + """ + + apiVersion: str + items: Optional[List[Keychain]] = None + kind: str + + +KeychainMetadata = KeychainDeploymentMetadata + + +class KeychainSpec(BaseModel): + """ + KeychainSpec defines the desired state of Keychain + """ + + key: Annotated[KeychainSpecKey, Field(title="Key")] + + +class KeychainSpecKey(BaseModel): + algorithm: Annotated[Literal["MD5"], Field(title="Algorithm")] + authenticationKey: Annotated[str, Field(title="Authentication Key")] + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str + + +KeychainDeletedResourceEntry = KeychainDeploymentDeletedResourceEntry diff --git a/pydantic_eda/apps/services/v1alpha1/models.py b/pydantic_eda/apps/services/v1alpha1/models.py new file mode 100644 index 0000000..c907714 --- /dev/null +++ b/pydantic_eda/apps/services/v1alpha1/models.py @@ -0,0 +1,5137 @@ +# generated by datamodel-codegen: +# filename: services.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class BridgeDomain(BaseModel): + """ + BridgeDomain is the Schema for the bridgedomains API + """ + + apiVersion: str + kind: str + metadata: BridgeDomainMetadata + spec: Annotated[ + BridgeDomainSpec, + Field( + description="The BridgeDomain enables the configuration and management of Layer 2 virtual networks. It includes settings for VNI, EVI, route targets for import and export, and tunnel index allocation. Additionally, the specification allows for advanced features such as MAC address table limits, aging, Proxy ARP and detection of MAC and IP duplication.", + title="Specification", + ), + ] + status: Annotated[ + Optional[BridgeDomainStatus], + Field( + description="BridgeDomainStatus defines the observed state of BridgeDomain", + title="Status", + ), + ] = None + + +class BridgeDomainDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class BridgeDomainDeletedResources(RootModel[List[BridgeDomainDeletedResourceEntry]]): + root: List[BridgeDomainDeletedResourceEntry] + + +class BridgeDomainList(BaseModel): + """ + BridgeDomainList is a list of bridgedomains + """ + + apiVersion: str + items: Optional[List[BridgeDomain]] = None + kind: str + + +class BridgeDomainMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class BridgeDomainSpec(BaseModel): + """ + The BridgeDomain enables the configuration and management of Layer 2 virtual networks. It includes settings for VNI, EVI, route targets for import and export, and tunnel index allocation. Additionally, the specification allows for advanced features such as MAC address table limits, aging, Proxy ARP and detection of MAC and IP duplication. + """ + + description: Annotated[ + Optional[str], + Field(description="The description of the BridgeDomain.", title="Description"), + ] = None + evi: Annotated[ + Optional[int], + Field( + description="EVI to use for this BridgeDomain, can be optionally left blank to have it automatically allocated using the EVI Pool.", + ge=1, + le=65535, + title="EVI", + ), + ] = None + eviPool: Annotated[ + Optional[str], + Field( + description="Reference to an EVI pool to use for allocations if EVI is left blank.", + title="EVI Allocation Pool", + ), + ] = "evi-pool" + exportTarget: Annotated[ + Optional[str], + Field( + description="Export route target in 'target:N:N' format, if not specified, the default value taken as \"target:1:\".", + pattern="^target.*$", + title="Export Target", + ), + ] = None + importTarget: Annotated[ + Optional[str], + Field( + description="Import route target in 'target:N:N' format, if not specified, the default value taken as \"target:1:\".", + pattern="^target.*$", + title="Import Target", + ), + ] = None + l2proxyARPND: Annotated[ + Optional[BridgeDomainSpecL2proxyARPND], + Field( + description="Enables / Disabled Proxy ARP / Proxy ND.", + title="L2 Proxy ARP/ND", + ), + ] = None + macAging: Annotated[ + Optional[int], + Field( + description="Configurable aging time for dynamically learned mac addresses.", + ge=60, + le=86400, + title="MAC Aging", + ), + ] = 300 + macDuplicationDetection: Annotated[ + Optional[BridgeDomainSpecMacDuplicationDetection], + Field( + description="Enable or disable MAC duplication detection and resolution mechanisms.", + title="MAC Duplication Detection", + ), + ] = None + macLimit: Annotated[ + Optional[int], + Field( + description="Sets the maximum number of MAC entries accepted in the bridge table.", + title="MAC Limit", + ), + ] = None + tunnelIndexPool: Annotated[ + Optional[str], + Field( + description="Reference to a tunnel index pool to use for allocations.", + title="Tunnel Index Allocation Pool", + ), + ] = "tunnel-index-pool" + type: Annotated[ + Optional[Literal["SIMPLE", "EVPNVXLAN"]], + Field( + description="Select the type of BridgeDomain. Simple doesn't include any overlay control plane or dataplane properties (EVPN/VXLAN). EVPNVXLAN includes the properties needed to provision this BridgeDomain over an IP Fabric.", + title="Type", + ), + ] = "EVPNVXLAN" + vni: Annotated[ + Optional[int], + Field( + description="VNI to use for this BridgeDomain, can be optionally left blank to have it allocated using the VNI Pool.", + ge=1, + le=16777215, + title="VNI", + ), + ] = None + vniPool: Annotated[ + Optional[str], + Field( + description="Reference to a VNI pool to use for allocations if VNI is left blank.", + title="VNI Allocation Pool", + ), + ] = "vni-pool" + + +class BridgeDomainSpecL2proxyARPND(BaseModel): + """ + Enables / Disabled Proxy ARP / Proxy ND. + """ + + dynamicLearning: Annotated[ + Optional[BridgeDomainSpecL2proxyARPNDDynamicLearning], + Field(title="Dynamic Learning"), + ] = None + ipDuplication: Annotated[ + Optional[BridgeDomainSpecL2proxyARPNDIpDuplication], + Field(title="L2 Proxy ARP/ND IP Duplication Detection"), + ] = None + proxyARP: Annotated[ + Optional[bool], Field(description="Enables proxy ARP.", title="Proxy ARP") + ] = False + proxyND: Annotated[ + Optional[bool], Field(description="Enables proxy ND.", title="Proxy ND") + ] = False + tableSize: Annotated[ + Optional[int], + Field( + description="Maximum number of entries allowed in the proxy table of the bridge domain.", + ge=1, + le=8192, + title="L2 Proxy ARP/ND Table Size", + ), + ] = 250 + + +class BridgeDomainSpecL2proxyARPNDDynamicLearning(BaseModel): + ageTime: Annotated[ + Optional[int], + Field( + description="Aging timer value for the proxy entries in seconds. If not set, this indicates that the entries are never flushed.", + ge=60, + le=86400, + title="Age Time", + ), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enables or disables Dynamic Learning.", title="Enabled"), + ] = False + sendRefresh: Annotated[ + Optional[int], + Field( + description="The interval determines the frequency at which the system generates three ARP Requests or Neighbor Solicitations with the intent to refresh the proxy entry. The refresh is sent within the age-time window.", + ge=120, + le=86400, + title="Send Refresh Interval", + ), + ] = None + + +class BridgeDomainSpecL2proxyARPNDIpDuplication(BaseModel): + enabled: Annotated[ + Optional[bool], + Field(description="Enables or disables IP Duplication.", title="Enabled"), + ] = False + holdDownTime: Annotated[ + Optional[int], + Field( + description="Time to wait in minutes from the moment an IP is declared duplicate to the time the IP is removed from the proxy ARP/ND table.", + ge=2, + le=60, + title="Hold Down Time", + ), + ] = 9 + monitoringWindow: Annotated[ + Optional[int], + Field( + description="Monitoring window for detecting duplication on a given IP address in the proxy ARP/ND table.", + ge=1, + le=15, + title="Monitoring Window", + ), + ] = 3 + numMoves: Annotated[ + Optional[int], + Field( + description="Number of moves in the proxy ARP/ND table that an IP is allowed within the monitoring-window.", + ge=3, + le=10, + title="Number of Moves", + ), + ] = 5 + + +class BridgeDomainSpecMacDuplicationDetection(BaseModel): + """ + Enable or disable MAC duplication detection and resolution mechanisms. + """ + + action: Annotated[ + Optional[Literal["Blackhole", "OperDown", "StopLearning"]], + Field( + description="Action to take on the subinterface upon detecting at least one mac addresses as duplicate on the subinterface.", + title="Action", + ), + ] = "StopLearning" + enabled: Annotated[ + Optional[bool], + Field( + description="Enables or disables Mac Duplication Detection.", + title="Enabled", + ), + ] = False + holdDownTime: Annotated[ + Optional[int], + Field( + description="Time to wait in minutes from the moment a mac is declared duplicate to the mac is flushed from the bridge table.", + ge=2, + le=60, + title="Hold Down Time", + ), + ] = 9 + monitoringWindow: Annotated[ + Optional[int], + Field( + description="Monitoring window in minutes for detecting duplication on a given mac address.", + ge=1, + le=15, + title="Monitoring Window", + ), + ] = 3 + numMoves: Annotated[ + Optional[int], + Field( + description="Number of moves a mac is allowed within the monitoring-window, before it is declared duplicate.", + ge=3, + title="Number of Moves", + ), + ] = 5 + + +class BridgeDomainStatus(BaseModel): + """ + BridgeDomainStatus defines the observed state of BridgeDomain + """ + + evi: Annotated[ + Optional[int], + Field(description="EVI in use for this bridge domain.", title="EVI"), + ] = None + exportTarget: Annotated[ + Optional[str], + Field( + description="Export route target for this bridge domain.", + title="Export Target", + ), + ] = None + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the VNET.", title="Health Score" + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + importTarget: Annotated[ + Optional[str], + Field( + description="Import route target for this bridge domain.", + title="Import Target", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field( + description="Nodes which have the BridgeDomain configured (min 1 sub-interface).", + title="Nodes", + ), + ] = None + numNodes: Annotated[ + Optional[int], + Field( + description="Number of nodes which have the BridgeDomain configured (min 1 sub-interface).", + title="Number of Nodes", + ), + ] = None + numSubInterfaces: Annotated[ + Optional[int], + Field( + description="Number of sub-interfaces attached to the BridgeDomain.", + title="Number of Sub-Interfaces", + ), + ] = None + numSubInterfacesOperDown: Annotated[ + Optional[int], + Field( + description="Number of oper-down sub-interfaces attached to the BridgeDomain.", + title="Number of Operational Down Sub-Interfaces", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field(description="Operational state of the VNET.", title="Operational State"), + ] = None + tunnelIndex: Annotated[ + Optional[int], + Field(description="Vxlan tunnel index in use.", title="Tunnel Index"), + ] = None + vni: Annotated[ + Optional[int], + Field(description="VNI in use for this bridge domain.", title="VNI"), + ] = None + + +class BridgeInterface(BaseModel): + """ + BridgeInterface is the Schema for the bridgeinterfaces API + """ + + apiVersion: str + kind: str + metadata: BridgeInterfaceMetadata + spec: Annotated[ + BridgeInterfaceSpec, + Field( + description="The BridgeInterface enables the attachment of network interfaces to a Bridge Domain. It includes settings for VLAN ID allocation, interface attachment, and actions on ingress and egress traffic. The specification supports integration with other network resources, such as Bridge Domains and Interfaces, and provides advanced features like MAC Duplication Detection with configurable actions.", + title="Specification", + ), + ] + status: Annotated[Optional[BridgeInterfaceStatus], Field(title="Status")] = None + + +BridgeInterfaceDeletedResourceEntry = BridgeDomainDeletedResourceEntry + + +class BridgeInterfaceDeletedResources( + RootModel[List[BridgeInterfaceDeletedResourceEntry]] +): + root: List[BridgeInterfaceDeletedResourceEntry] + + +class BridgeInterfaceList(BaseModel): + """ + BridgeInterfaceList is a list of bridgeinterfaces + """ + + apiVersion: str + items: Optional[List[BridgeInterface]] = None + kind: str + + +BridgeInterfaceMetadata = BridgeDomainMetadata + + +class BridgeInterfaceSpec(BaseModel): + """ + The BridgeInterface enables the attachment of network interfaces to a Bridge Domain. It includes settings for VLAN ID allocation, interface attachment, and actions on ingress and egress traffic. The specification supports integration with other network resources, such as Bridge Domains and Interfaces, and provides advanced features like MAC Duplication Detection with configurable actions. + """ + + bridgeDomain: Annotated[ + str, + Field( + description="Reference to a BridgeDomain in which to attach the BridgeInterface.", + title="Bridge Domain", + ), + ] + description: Annotated[ + Optional[str], + Field( + description="The description of the BridgeInterface.", title="Description" + ), + ] = None + egress: Annotated[ + Optional[BridgeInterfaceSpecEgress], + Field( + description="Manages actions on traffic at Egress.", title="Egress Actions" + ), + ] = None + ingress: Annotated[ + Optional[BridgeInterfaceSpecIngress], + Field( + description="Manages actions on traffic at Ingress.", + title="Ingress Actions", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to an Interface resource to attach this BridgeInterface.", + title="Interface", + ), + ] + l2MTU: Annotated[ + Optional[int], + Field( + description="L2 MTU specifies the maximum sized Ethernet frame that can be transmitted on the subinterface. If a frame exceeds this size it is discarded. If the l2-mtu of the subinterface exceeds the port-mtu of the associated interface, the subinterface will remain operationally down.", + ge=1450, + le=9500, + title="L2 MTU", + ), + ] = None + macDuplicationDetectionAction: Annotated[ + Optional[ + Literal["Blackhole", "OperDown", "StopLearning", "UseBridgeDomainAction"] + ], + Field( + description="Override for Mac Duplication Detection action if enabled in the associated BridgeDomain.", + title="MAC Duplication Detection Action", + ), + ] = None + splitHorizonGroup: Annotated[ + Optional[str], + Field( + description="Split Horizon Group to be used for this BridgeInterface. The subinterface within this BridgeInterface will be a member of this Split Horizon Group.", + title="Split Horizon Group", + ), + ] = None + uplink: Annotated[ + Optional[BridgeInterfaceSpecUplink], + Field( + description="The Uplink between your access breakout switch and your leaf switch.", + title="Uplink", + ), + ] = None + vlanID: Annotated[ + str, + Field( + description="Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.", + title="VLAN ID", + ), + ] + + +class BridgeInterfaceSpecEgress(BaseModel): + """ + Manages actions on traffic at Egress. + """ + + filters: Annotated[ + Optional[List[str]], + Field( + description="List of Filter references to use at egress.", title="Filters" + ), + ] = None + qosPolicy: Annotated[ + Optional[List[str]], + Field( + description="List of QoS Egress policy references to use at egress.", + title="QoS Egress Policy", + ), + ] = None + + +class BridgeInterfaceSpecIngress(BaseModel): + """ + Manages actions on traffic at Ingress. + """ + + filters: Annotated[ + Optional[List[str]], + Field( + description="List of Filter references to use at ingress.", title="Filters" + ), + ] = None + qosPolicy: Annotated[ + Optional[List[str]], + Field( + description="List of QoS Ingress policy references to use at ingress.", + title="QoS Ingress Policy", + ), + ] = None + + +class BridgeInterfaceSpecUplink(BaseModel): + """ + The Uplink between your access breakout switch and your leaf switch. + """ + + egress: Annotated[ + Optional[BridgeInterfaceSpecUplinkEgress], + Field( + description="Manages actions on traffic at Egress of the Local enpoint of the Uplink.", + title="Egress", + ), + ] = None + ingress: Annotated[ + Optional[BridgeInterfaceSpecUplinkIngress], + Field( + description="Manages actions on traffic at Ingress of the Local enpoint of the Uplink.", + title="Ingress", + ), + ] = None + uplinkSelector: Annotated[ + Optional[List[str]], + Field( + description="Selects TopoLinks which connect a leaf switch to a breakout switch. This is the uplink between your access breakout switch and your leaf switch. There can only be a single TopoLink between the access breakout switch and the leaf switch, if more than one TopoLink is present between two devices the transaction will fail.", + title="Uplink Selector", + ), + ] = None + uplinkVLANID: Annotated[ + Optional[str], + Field( + description="The VLAN ID to be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.", + title="Uplink VLAN ID", + ), + ] = "pool" + uplinkVLANPool: Annotated[ + Optional[str], + Field( + description="A VLAN from this pool will be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.", + title="Uplink VLAN Pool", + ), + ] = None + + +class BridgeInterfaceSpecUplinkEgress(BaseModel): + """ + Manages actions on traffic at Egress of the Local enpoint of the Uplink. + """ + + filters: Annotated[ + Optional[List[str]], + Field( + description="List of Filter references to use at egress.", title="Filters" + ), + ] = None + qosPolicy: Annotated[ + Optional[List[str]], + Field( + description="List of QoS Egress policy references to use at egress.", + title="QoS Egress Policy", + ), + ] = None + + +class BridgeInterfaceSpecUplinkIngress(BaseModel): + """ + Manages actions on traffic at Ingress of the Local enpoint of the Uplink. + """ + + filters: Annotated[ + Optional[List[str]], + Field( + description="List of Filter references to use at ingress.", title="Filters" + ), + ] = None + qosPolicy: Annotated[ + Optional[List[str]], + Field( + description="List of QoS Ingress policy references to use at ingress.", + title="QoS Ingress Policy", + ), + ] = None + + +class BridgeInterfaceStatus(BaseModel): + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the BridgeInterface.", + title="Health Score", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the BridgeInterface.", + title="Operational State", + ), + ] = None + subInterfaces: Annotated[ + Optional[List[BridgeInterfaceStatusSubInterface]], + Field( + description="Sub-interfaces status within the BridgeInterface.", + title="Sub-Interfaces Status", + ), + ] = None + + +class BridgeInterfaceStatusSubInterface(BaseModel): + enabled: Annotated[ + Optional[bool], + Field( + description="The administrative status of the SubInterface.", + title="Enabled", + ), + ] = None + interface: Annotated[ + str, Field(description="Normalized interface name.", title="Interface") + ] + interfaceResource: Annotated[ + str, Field(description="Eda interface resource.", title="Interface Resource") + ] + lastChange: Annotated[ + Optional[str], + Field( + description="Indicates when this SubInterface last changed state.", + title="Last Change", + ), + ] = None + node: Annotated[str, Field(description="Reference to Node object.", title="Node")] + nodeInterface: Annotated[ + str, Field(description="Node specific interface name.", title="Node Interface") + ] + operatingSystem: Annotated[ + Optional[str], + Field(description="Operating System of the Node.", title="Operating System"), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Indicates the current operational state of the SubInterface.", + title="Operational State", + ), + ] = None + subInterfaceIndex: Annotated[ + Optional[int], + Field( + description="Index allocated to the subinterface on the associated interface for the given VLAN.", + title="Sub Interface Index", + ), + ] = None + vlanID: Annotated[ + Optional[str], + Field(description="vlan assigned to this subinterface.", title="VLAN ID"), + ] = None + + +class DHCPRelay(BaseModel): + """ + DHCPRelay is the Schema for the dhcprelays API + """ + + apiVersion: str + kind: str + metadata: DHCPRelayMetadata + spec: Annotated[ + DHCPRelaySpec, + Field( + description="The DHCPRelay enables the forwarding of DHCP requests and responses between clients and servers across different networks. This resource allows for the configuration of various DHCP relay sub-options, such as CircuitID, RemoteID, and ClientLinkLayerAddress, to provide detailed client information. It also includes settings for specifying the router to reach the DHCP server, the list of DHCP servers to forward requests to, and selectors for Routed and IRB interfaces where the relay will be configured. Additionally, the GI Address option can be set to derive the Gateway IP address from the selected interface, ensuring correct routing of DHCP messages.", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="DHCPRelayStatus defines the observed state of DHCPRelay", + title="Status", + ), + ] = None + + +DHCPRelayDeletedResourceEntry = BridgeDomainDeletedResourceEntry + + +class DHCPRelayDeletedResources(RootModel[List[DHCPRelayDeletedResourceEntry]]): + root: List[DHCPRelayDeletedResourceEntry] + + +class DHCPRelayList(BaseModel): + """ + DHCPRelayList is a list of dhcprelays + """ + + apiVersion: str + items: Optional[List[DHCPRelay]] = None + kind: str + + +DHCPRelayMetadata = BridgeDomainMetadata + + +class DHCPRelaySpec(BaseModel): + """ + The DHCPRelay enables the forwarding of DHCP requests and responses between clients and servers across different networks. This resource allows for the configuration of various DHCP relay sub-options, such as CircuitID, RemoteID, and ClientLinkLayerAddress, to provide detailed client information. It also includes settings for specifying the router to reach the DHCP server, the list of DHCP servers to forward requests to, and selectors for Routed and IRB interfaces where the relay will be configured. Additionally, the GI Address option can be set to derive the Gateway IP address from the selected interface, ensuring correct routing of DHCP messages. + """ + + giAddress: Annotated[ + Optional[bool], + Field( + description="Set GI Address to the IP derived from the IRBInterface or RoutedInterface on which the DHCP relay is configured.", + title="Use GI Address", + ), + ] = None + irbInterfaceSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector to select the IRBInterface on which to configure the DHCP relay.", + title="IRB Interface Selector", + ), + ] = None + routedInterfaceSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector to select the RoutedInterface on which to configure the DHCP relay.", + title="Routed Interface Selector", + ), + ] = None + router: Annotated[ + Optional[str], + Field( + description="Router to be used to reach the DHCP server, if not specified the Router under which the source IRBInterface or RoutedInterface resides will be used.", + title="Router", + ), + ] = None + servers: Annotated[ + List[str], + Field( + description="List of servers to send the DHCP relayed packet to. These can be IP addresses or FQDN.", + min_length=1, + title="Servers", + ), + ] + subOptions: Annotated[ + Optional[List[str]], + Field( + description="DHCP Relay sub-options; available options are CircuitID, RemoteID, and ClientLinkLayerAddress.", + title="Sub Options", + ), + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class IRBInterface(BaseModel): + """ + IRBInterface is the Schema for the irbinterfaces API + """ + + apiVersion: str + kind: str + metadata: IRBInterfaceMetadata + spec: Annotated[ + IRBInterfaceSpec, + Field( + description="The IRBInterface enables the configuration and management of Layer 3 interfaces associated with a BridgeDomain. This resource allows for the specification of various parameters, including IP MTU, learning of unsolicited ARPs, IPv4 and IPv6 addresses, and unnumbered interface settings. It also supports advanced features such as BFD configuration, Virtual IP discovery, and ARP/ND-related settings like Proxy ARP/ND and EVPN route advertisement.", + title="Specification", + ), + ] + status: Annotated[ + Optional[IRBInterfaceStatus], + Field( + description="IRBInterfaceStatus defines the observed state of IRBInterface", + title="Status", + ), + ] = None + + +IRBInterfaceDeletedResourceEntry = BridgeDomainDeletedResourceEntry + + +class IRBInterfaceDeletedResources(RootModel[List[IRBInterfaceDeletedResourceEntry]]): + root: List[IRBInterfaceDeletedResourceEntry] + + +class IRBInterfaceList(BaseModel): + """ + IRBInterfaceList is a list of irbinterfaces + """ + + apiVersion: str + items: Optional[List[IRBInterface]] = None + kind: str + + +IRBInterfaceMetadata = BridgeDomainMetadata + + +class IRBInterfaceSpec(BaseModel): + """ + The IRBInterface enables the configuration and management of Layer 3 interfaces associated with a BridgeDomain. This resource allows for the specification of various parameters, including IP MTU, learning of unsolicited ARPs, IPv4 and IPv6 addresses, and unnumbered interface settings. It also supports advanced features such as BFD configuration, Virtual IP discovery, and ARP/ND-related settings like Proxy ARP/ND and EVPN route advertisement. + """ + + anycastGatewayMAC: Annotated[ + Optional[str], + Field( + description="The gateway MAC to use on the anycast address, if left empty the node will automatically assign one.", + title="Anycast GW MAC", + ), + ] = None + arpTimeout: Annotated[ + Optional[int], + Field( + description="Duration of time that dynamic ARP entries remain in the ARP cache before they expire.", + title="ARP Timeout", + ), + ] = 14400 + bfd: Annotated[ + Optional[IRBInterfaceSpecBfd], + Field(description="Enable BFD on the IRBInterface.", title="BFD Configuration"), + ] = None + bridgeDomain: Annotated[ + str, Field(description="Reference to a BridgeDomain.", title="Bridge Domain") + ] + description: Annotated[ + Optional[str], + Field(description="The description of the IRBInterface.", title="Description"), + ] = None + egress: Annotated[ + Optional[IRBInterfaceSpecEgress], + Field( + description="Manages actions on traffic at Egress.", title="Egress Actions" + ), + ] = None + evpnRouteAdvertisementType: Annotated[ + Optional[IRBInterfaceSpecEvpnRouteAdvertisementType], + Field( + description="Controls the type of ARP/ND entries to advertise.", + title="EVPN Route Advertisement Type", + ), + ] = None + hostRoutePopulate: Annotated[ + Optional[IRBInterfaceSpecHostRoutePopulate], + Field( + description="Configures host route population based on ARP entries.", + title="Host Route Population", + ), + ] = None + ingress: Annotated[ + Optional[IRBInterfaceSpecIngress], + Field( + description="Manages actions on traffic at Ingress.", + title="Ingress Actions", + ), + ] = None + ipAddresses: Annotated[ + Optional[List[IRBInterfaceSpecIpAddress]], Field(title="IP Addresses") + ] = None + ipMTU: Annotated[ + Optional[int], + Field( + description="IP MTU for the IRBInterface [default=1500].", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = 1500 + ipv6RouterAdvertisement: Annotated[ + Optional[IRBInterfaceSpecIpv6RouterAdvertisement], + Field(title="IPv6 Router Advertisement"), + ] = None + l3ProxyARPND: Annotated[ + Optional[IRBInterfaceSpecL3ProxyARPND], + Field( + description="L3 Proxy ARP and ND configuration.", title="L3 Proxy ARP/ND" + ), + ] = None + learnUnsolicited: Annotated[ + Optional[Literal["BOTH", "GLOBAL", "LINK-LOCAL", "NONE"]], + Field( + description="Enable or disable learning of unsolicited ARPs.", + title="Learn Unsolicited ARPs", + ), + ] = "NONE" + router: Annotated[str, Field(description="Reference to a Router.", title="Router")] + unnumbered: Annotated[ + Optional[Literal["IPV6"]], + Field( + description="Enables the use of unnumbered interfaces on the IRBInterface. If IPv6 is specified, no IP address are configured on the sub-interface and only the link local address will be used. If any IP addresses are specified for either IPv4 or IPv6 that will take precedence and IPs will be assigned to the interfaces.(Deprecated, Use IPv6RouterAdvertisement)", + title="Unnumbered", + ), + ] = None + virtualIPDiscovery: Annotated[ + Optional[List[IRBInterfaceSpecVirtualIPDiscoveryItem]], + Field( + description="Configuration for Virtual IP discovery on the interface.", + title="Virtual IP Discovery", + ), + ] = None + + +class IRBInterfaceSpecBfd(BaseModel): + """ + Enable BFD on the IRBInterface. + """ + + desiredMinTransmitInt: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between transmission of BFD control packets.", + ge=10000, + le=100000000, + title="Transmit Interval", + ), + ] = 1000000 + detectionMultiplier: Annotated[ + Optional[int], + Field( + description="The number of packets that must be missed to declare this session as down.", + ge=3, + le=20, + title="Multiplier", + ), + ] = 3 + enabled: Annotated[ + bool, Field(description="Enables Biforward Detection.", title="Enabled") + ] + minEchoReceiveInterval: Annotated[ + Optional[int], + Field( + description="The minimum interval between echo packets the local node can receive.", + ge=250000, + le=100000000, + title="Minimum Echo Receive Interval", + ), + ] = 1000000 + requiredMinReceive: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between received BFD control packets that this system should support.", + ge=10000, + le=100000000, + title="Receive Interval", + ), + ] = 1000000 + + +IRBInterfaceSpecEgress = BridgeInterfaceSpecEgress + + +class IRBInterfaceSpecEvpnRouteAdvertisementType(BaseModel): + """ + Controls the type of ARP/ND entries to advertise. + """ + + arpDynamic: Annotated[ + Optional[bool], + Field( + description="Advertise dynamic ARP entries.", title="Advertise Dynamic ARP" + ), + ] = False + arpStatic: Annotated[ + Optional[bool], + Field( + description="Advertise static ARP entries.", title="Advertise Static ARP" + ), + ] = False + ndDynamic: Annotated[ + Optional[bool], + Field( + description="Advertise dynamic ND entries.", title="Advertise Dynamic ND" + ), + ] = False + ndStatic: Annotated[ + Optional[bool], + Field(description="Advertise static ND entries.", title="Advertise Static ND"), + ] = False + + +class IRBInterfaceSpecHostRoutePopulate(BaseModel): + """ + Configures host route population based on ARP entries. + """ + + dynamic: Annotated[ + Optional[bool], + Field( + description="Create host routes out of dynamic ARP entries.", + title="Dynamic ARP Entries", + ), + ] = True + evpn: Annotated[ + Optional[bool], + Field( + description="Create host routes out of EVPN learned ARP entries.", + title="EVPN Learned ARP Entries", + ), + ] = False + static: Annotated[ + Optional[bool], + Field( + description="Create host routes out of static ARP entries.", + title="Static ARP Entries", + ), + ] = True + + +IRBInterfaceSpecIngress = BridgeInterfaceSpecIngress + + +class IRBInterfaceSpecIpAddress(BaseModel): + ipv4Address: Annotated[ + Optional[IRBInterfaceSpecIpAddressIpv4Address], + Field( + description="IPv4 address in IP/mask form, e.g., 192.168.0.1/24.", + title="IPv4 Addresses", + ), + ] = None + ipv6Address: Annotated[ + Optional[IRBInterfaceSpecIpAddressIpv6Address], + Field( + description="IPv6 address in IP/mask form, e.g., fc00::1/120.", + title="IPv6 Addresses", + ), + ] = None + node: Annotated[ + Optional[str], + Field( + description="Reference to a TopoNode resource, if not specified the IP address will be assigned to all nodes on which the IRB is deployed. If specified the IP address will be assigned to the specified node.", + title="Node", + ), + ] = None + + +class IRBInterfaceSpecIpAddressIpv4Address(BaseModel): + """ + IPv4 address in IP/mask form, e.g., 192.168.0.1/24. + """ + + ipPrefix: Annotated[ + str, Field(description="Address and mask to use", title="IP Prefix") + ] + primary: Annotated[ + Optional[bool], + Field( + description="Indicates which address to use as primary for broadcast", + title="Primary", + ), + ] = None + + +class IRBInterfaceSpecIpAddressIpv6Address(BaseModel): + """ + IPv6 address in IP/mask form, e.g., fc00::1/120. + """ + + ipPrefix: Annotated[ + str, Field(description="Address and mask to use", title="IP Prefix") + ] + primary: Annotated[ + Optional[bool], + Field( + description="Indicates which address to use as primary for broadcast", + title="Primary", + ), + ] = None + + +class IRBInterfaceSpecIpv6RouterAdvertisement(BaseModel): + currentHopLimit: Annotated[ + int, + Field( + description="The current hop limit to advertise in the router advertisement messages.", + ge=0, + le=255, + title="Current Hop Limit", + ), + ] + enabled: Annotated[ + bool, + Field( + description="Enable or disable IPv6 router advertisements.", + title="Enable Router Advertisements", + ), + ] + ipMTU: Annotated[ + Optional[int], + Field( + description="The IP MTU to advertise in the router advertisement messages.", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = None + managedConfigurationFlag: Annotated[ + bool, + Field( + description="Enable DHCPv6 for address configuration (M-bit).", + title="Managed Configuration Flag", + ), + ] + maxAdvertisementInterval: Annotated[ + int, + Field( + description="Maximum time between router advertisements (in seconds).", + ge=4, + le=1800, + title="Maximum Advertisement Interval", + ), + ] + minAdvertisementInterval: Annotated[ + int, + Field( + description="Minimum time between router advertisements (in seconds).", + ge=3, + le=1350, + title="Minimum Advertisement Interval", + ), + ] + otherConfigurationFlag: Annotated[ + bool, + Field( + description="Enable DHCPv6 for other configuration (O-bit).", + title="Other Configuration Flag", + ), + ] + prefixes: Annotated[ + Optional[List[IRBInterfaceSpecIpv6RouterAdvertisementPrefix]], + Field( + description="IPv6 prefixes to advertise in router advertisements.", + title="Prefixes", + ), + ] = None + reachableTime: Annotated[ + Optional[int], + Field( + description="Time in milliseconds for Neighbor Unreachability Detection.", + ge=0, + le=3600000, + title="Reachable Time", + ), + ] = 0 + retransmitTime: Annotated[ + int, + Field( + description="Time in milliseconds between retransmitted NS messages.", + ge=0, + le=1800000, + title="Retransmit Time", + ), + ] + routerLifetime: Annotated[ + int, + Field( + description="Router lifetime in seconds for default gateway.", + ge=0, + le=9000, + title="Router Lifetime", + ), + ] + + +class IRBInterfaceSpecIpv6RouterAdvertisementPrefix(BaseModel): + """ + IPv6Prefix defines the configuration for an IPv6 prefix advertisement. + """ + + autonomousFlag: Annotated[ + Optional[bool], + Field( + description="When this is set in the prefix information option hosts can use the prefix for stateless address autoconfiguration (SLAAC).", + title="Autonomous Flag", + ), + ] = True + onLinkFlag: Annotated[ + Optional[bool], + Field( + description="When this is set in the prefix information option hosts can use the prefix for on-link determination.", + title="On-Link Flag", + ), + ] = True + preferredLifetime: Annotated[ + Optional[int], + Field( + description="The length of time in seconds (relative to the time the packet is sent) that addresses generated from the prefix via stateless address autoconfiguration remain preferred.", + ge=0, + le=4294967295, + title="Preferred Lifetime", + ), + ] = 604800 + prefix: Annotated[ + str, + Field( + description="An IPv6 global unicast address prefix.", title="IPv6 Prefix" + ), + ] + validLifetime: Annotated[ + Optional[int], + Field( + description="The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for the purpose of on-link determination.", + ge=0, + le=4294967295, + title="Valid Lifetime", + ), + ] = 2592000 + + +class IRBInterfaceSpecL3ProxyARPND(BaseModel): + """ + L3 Proxy ARP and ND configuration. + """ + + proxyARP: Annotated[ + Optional[bool], + Field( + description="Select whether Proxy ARP should be enabled.", + title="Proxy ARP Enabled", + ), + ] = False + proxyND: Annotated[ + Optional[bool], + Field( + description="Select whether Proxy ND should be enabled.", + title="Proxy ND Enabled", + ), + ] = False + + +class IRBInterfaceSpecVirtualIPDiscoveryItem(BaseModel): + address: Annotated[str, Field(description="Virtual IP Address.", title="Address")] + allowedMAC: Annotated[ + Optional[List[str]], + Field( + description="List of allowed MAC addresses for a discovered virtual IP address.", + title="Allowed MAC Addresses", + ), + ] = None + bridgeInterfaceToProbe: Annotated[ + Optional[List[str]], + Field( + description="List of BridgeInterfaces on the associated MAC-VRF to which the ARP probes are sent. If left blank, the probes are sent on all BridgeInterfaces associated with the BridgeDomain.", + title="Bridge Interfaces to Probe", + ), + ] = None + probeInterval: Annotated[ + Optional[int], + Field( + description="ARP probe interval in seconds.", + ge=0, + le=86400, + title="Probe Interval", + ), + ] = 0 + vlanToProbe: Annotated[ + Optional[List[str]], + Field( + description="List of VLANs on the associated BridgeDomain to which the ARP probes are sent. If left blank, the probes are sent on all VLANs associated with the BridgeDomain.", + title="VLANs to Probe", + ), + ] = None + + +class IRBInterfaceStatus(BaseModel): + """ + IRBInterfaceStatus defines the observed state of IRBInterface + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the VNET.", title="Health Score" + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Explains the reason for the health score.", + title="Health Score Reason", + ), + ] = None + interfaces: Annotated[ + Optional[List[IRBInterfaceStatusInterface]], + Field( + description="Details of the interfaces associated with the IRB.", + title="Interface Statuses", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field(description="Timestamp of the last state change.", title="Last Change"), + ] = None + operationalState: Annotated[ + Optional[str], + Field(description="Operational state of the VNET.", title="Operational State"), + ] = None + + +class IRBInterfaceStatusInterface(BaseModel): + enabled: Annotated[ + Optional[bool], + Field( + description="Administrative status of the SubInterface.", title="Enabled" + ), + ] = None + ipv4Addresses: Annotated[ + Optional[List[IRBInterfaceStatusInterfaceIpv4Address]], + Field(description="List of IPv4 addresses", title="IPv4 Addresses"), + ] = None + ipv6Addresses: Annotated[ + Optional[List[IRBInterfaceStatusInterfaceIpv6Address]], + Field(description="List of IPv6 addresses", title="IPv6 Addresses"), + ] = None + lastChange: Annotated[ + Optional[str], + Field( + description="Timestamp of when this SubInterface last changed state.", + title="Last Change", + ), + ] = None + node: Annotated[str, Field(description="Reference to Node object.", title="Node")] + nodeInterface: Annotated[ + str, Field(description="Node specific interface name.", title="Node Interface") + ] + operatingSystem: Annotated[ + Optional[str], + Field(description="Operating System of the Node.", title="Operating System"), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Current operational state of the SubInterface.", + title="Operational State", + ), + ] = None + + +class IRBInterfaceStatusInterfaceIpv4Address(BaseModel): + ipPrefix: Annotated[ + str, Field(description="Address and mask to use", title="IP Prefix") + ] + primary: Annotated[ + Optional[bool], + Field( + description="Indicates which address to use as primary for broadcast", + title="Primary", + ), + ] = None + + +IRBInterfaceStatusInterfaceIpv6Address = IRBInterfaceStatusInterfaceIpv4Address + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class RoutedInterface(BaseModel): + """ + RoutedInterface is the Schema for the routedinterfaces API + """ + + apiVersion: str + kind: str + metadata: RoutedInterfaceMetadata + spec: Annotated[ + RoutedInterfaceSpec, + Field( + description="The RoutedInterface enables the configuration and management of Layer 3 interfaces for routing traffic between different networks. This resource allows for specifying an underlying Interface and Router, configuring VLAN IDs, and setting the IP MTU. It also supports the learning of unsolicited ARPs, defining both IPv4 and IPv6 addresses, and enabling unnumbered interfaces. Advanced features such as BFD configuration, Proxy ARP/ND, and ARP timeout settings are included to ensure robust and efficient routing.", + title="Specification", + ), + ] + status: Annotated[ + Optional[RoutedInterfaceStatus], + Field( + description="RoutedInterfaceStatus defines the observed state of RoutedInterface", + title="Status", + ), + ] = None + + +RoutedInterfaceDeletedResourceEntry = BridgeDomainDeletedResourceEntry + + +class RoutedInterfaceDeletedResources( + RootModel[List[RoutedInterfaceDeletedResourceEntry]] +): + root: List[RoutedInterfaceDeletedResourceEntry] + + +class RoutedInterfaceList(BaseModel): + """ + RoutedInterfaceList is a list of routedinterfaces + """ + + apiVersion: str + items: Optional[List[RoutedInterface]] = None + kind: str + + +RoutedInterfaceMetadata = BridgeDomainMetadata + + +class RoutedInterfaceSpec(BaseModel): + """ + The RoutedInterface enables the configuration and management of Layer 3 interfaces for routing traffic between different networks. This resource allows for specifying an underlying Interface and Router, configuring VLAN IDs, and setting the IP MTU. It also supports the learning of unsolicited ARPs, defining both IPv4 and IPv6 addresses, and enabling unnumbered interfaces. Advanced features such as BFD configuration, Proxy ARP/ND, and ARP timeout settings are included to ensure robust and efficient routing. + """ + + arpTimeout: Annotated[ + Optional[int], + Field( + description="Duration of time that dynamic ARP entries remain in the ARP cache before they expire.", + title="ARP Timeout", + ), + ] = 14400 + bfd: Annotated[ + Optional[RoutedInterfaceSpecBfd], + Field( + description="Enables BFD on the RoutedInterface.", title="BFD Configuration" + ), + ] = None + description: Annotated[ + Optional[str], + Field( + description="The description of the RoutedInterface.", title="Description" + ), + ] = None + egress: Annotated[ + Optional[RoutedInterfaceSpecEgress], + Field( + description="Manages actions on traffic at Egress.", title="Egress Actions" + ), + ] = None + ingress: Annotated[ + Optional[RoutedInterfaceSpecIngress], + Field( + description="Manages actions on traffic at Ingress.", + title="Ingress Actions", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to an Interface to use for attachment.", + title="Interface", + ), + ] + ipMTU: Annotated[ + Optional[int], + Field( + description="IP MTU for the RoutedInterface.", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = 1500 + ipv4Addresses: Annotated[ + Optional[List[RoutedInterfaceSpecIpv4Address]], + Field( + description="List of IPv4 addresses in IP/mask form, e.g., 192.168.0.1/24.", + title="IPv4 Addresses", + ), + ] = None + ipv6Addresses: Annotated[ + Optional[List[RoutedInterfaceSpecIpv6Address]], + Field( + description="List of IPv6 addresses in IP/mask form, e.g., fc00::1/120.", + title="IPv6 Addresses", + ), + ] = None + ipv6RouterAdvertisement: Annotated[ + Optional[RoutedInterfaceSpecIpv6RouterAdvertisement], + Field(title="IPv6 Router Advertisement"), + ] = None + l3ProxyARPND: Annotated[ + Optional[RoutedInterfaceSpecL3ProxyARPND], + Field( + description="L3 Proxy ARP and ND configuration.", title="L3 Proxy ARP/ND" + ), + ] = None + learnUnsolicited: Annotated[ + Optional[Literal["BOTH", "GLOBAL", "LINK-LOCAL", "NONE"]], + Field( + description="Enable or disable learning of unsolicited ARPs.", + title="Learn Unsolicited ARPs", + ), + ] = "NONE" + router: Annotated[str, Field(description="Reference to a Router.", title="Router")] + unnumbered: Annotated[ + Optional[Literal["IPV6"]], + Field( + description="Enables the use of unnumbered interfaces on the IRBInterface. If IPv6 is specified, no IP address are configured on the sub-interface and only the link local address will be used. If any IP addresses are specified for either IPv4 or IPv6 that will take precedence and IPs will be assigned to the interfaces. (Deprecated, Use IPv6RouterAdvertisement)", + title="Unnumbered", + ), + ] = None + vlanID: Annotated[ + Optional[str], + Field( + description="Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.", + title="VLAN ID", + ), + ] = "pool" + vlanPool: Annotated[ + Optional[str], + Field( + description="Reference to a VLAN pool to use for allocations.", + title="VLAN Pool", + ), + ] = "vlan-pool" + + +class RoutedInterfaceSpecBfd(BaseModel): + """ + Enables BFD on the RoutedInterface. + """ + + desiredMinTransmitInt: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between transmission of BFD control packets.", + ge=10000, + le=100000000, + title="Transmit Interval", + ), + ] = 1000000 + detectionMultiplier: Annotated[ + Optional[int], + Field( + description="The number of packets that must be missed to declare this session as down.", + ge=3, + le=20, + title="Multiplier", + ), + ] = 3 + enabled: Annotated[ + bool, Field(description="Enables Biforward Detection.", title="Enabled") + ] + minEchoReceiveInterval: Annotated[ + Optional[int], + Field( + description="The minimum interval between echo packets the local node can receive.", + ge=250000, + le=100000000, + title="Minimum Echo Receive Interval", + ), + ] = 1000000 + requiredMinReceive: Annotated[ + Optional[int], + Field( + description="The minimum interval in microseconds between received BFD control packets that this system should support.", + ge=10000, + le=100000000, + title="Receive Interval", + ), + ] = 1000000 + + +RoutedInterfaceSpecEgress = BridgeInterfaceSpecEgress + + +RoutedInterfaceSpecIngress = BridgeInterfaceSpecIngress + + +RoutedInterfaceSpecIpv4Address = IRBInterfaceStatusInterfaceIpv4Address + + +RoutedInterfaceSpecIpv6Address = IRBInterfaceStatusInterfaceIpv4Address + + +class RoutedInterfaceSpecIpv6RouterAdvertisement(BaseModel): + currentHopLimit: Annotated[ + int, + Field( + description="The current hop limit to advertise in the router advertisement messages.", + ge=0, + le=255, + title="Current Hop Limit", + ), + ] + enabled: Annotated[ + bool, + Field( + description="Enable or disable IPv6 router advertisements.", + title="Enable Router Advertisements", + ), + ] + ipMTU: Annotated[ + Optional[int], + Field( + description="The IP MTU to advertise in the router advertisement messages.", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = None + managedConfigurationFlag: Annotated[ + bool, + Field( + description="Enable DHCPv6 for address configuration (M-bit).", + title="Managed Configuration Flag", + ), + ] + maxAdvertisementInterval: Annotated[ + int, + Field( + description="Maximum time between router advertisements (in seconds).", + ge=4, + le=1800, + title="Maximum Advertisement Interval", + ), + ] + minAdvertisementInterval: Annotated[ + int, + Field( + description="Minimum time between router advertisements (in seconds).", + ge=3, + le=1350, + title="Minimum Advertisement Interval", + ), + ] + otherConfigurationFlag: Annotated[ + bool, + Field( + description="Enable DHCPv6 for other configuration (O-bit).", + title="Other Configuration Flag", + ), + ] + prefixes: Annotated[ + Optional[List[RoutedInterfaceSpecIpv6RouterAdvertisementPrefix]], + Field( + description="IPv6 prefixes to advertise in router advertisements.", + title="Prefixes", + ), + ] = None + reachableTime: Annotated[ + Optional[int], + Field( + description="Time in milliseconds for Neighbor Unreachability Detection.", + ge=0, + le=3600000, + title="Reachable Time", + ), + ] = 0 + retransmitTime: Annotated[ + int, + Field( + description="Time in milliseconds between retransmitted NS messages.", + ge=0, + le=1800000, + title="Retransmit Time", + ), + ] + routerLifetime: Annotated[ + int, + Field( + description="Router lifetime in seconds for default gateway.", + ge=0, + le=9000, + title="Router Lifetime", + ), + ] + + +RoutedInterfaceSpecIpv6RouterAdvertisementPrefix = ( + IRBInterfaceSpecIpv6RouterAdvertisementPrefix +) + + +RoutedInterfaceSpecL3ProxyARPND = IRBInterfaceSpecL3ProxyARPND + + +class RoutedInterfaceStatus(BaseModel): + """ + RoutedInterfaceStatus defines the observed state of RoutedInterface + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the RoutedInterface.", + title="Health Score", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + interfaces: Annotated[ + Optional[List[RoutedInterfaceStatusInterface]], + Field( + description="Sub-interface status within the RoutedInterface.", + title="Sub-Interfaces Status", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the RoutedInterface.", + title="Operational State", + ), + ] = None + + +RoutedInterfaceStatusInterface = BridgeInterfaceStatusSubInterface + + +class Router(BaseModel): + """ + Router is the Schema for the routers API + """ + + apiVersion: str + kind: str + metadata: RouterMetadata + spec: Annotated[ + RouterSpec, + Field( + description="The Router enables the configuration and management of routing functions within a network. This resource allows for setting a unique Router ID, configuring VNIs and EVIs with options for automatic allocation, and defining import and export route targets. It also includes advanced configuration options such as BGP settings, including autonomous system numbers, AFI/SAFI options, and route advertisement preferences. Node selectors can be used to constrain the deployment of the router to specific nodes within the network.", + title="Specification", + ), + ] + status: Annotated[ + Optional[RouterStatus], + Field( + description="RouterStatus defines the observed state of Router", + title="Status", + ), + ] = None + + +RouterDeletedResourceEntry = BridgeDomainDeletedResourceEntry + + +class RouterDeletedResources(RootModel[List[RouterDeletedResourceEntry]]): + root: List[RouterDeletedResourceEntry] + + +class RouterList(BaseModel): + """ + RouterList is a list of routers + """ + + apiVersion: str + items: Optional[List[Router]] = None + kind: str + + +RouterMetadata = BridgeDomainMetadata + + +class RouterSpec(BaseModel): + """ + The Router enables the configuration and management of routing functions within a network. This resource allows for setting a unique Router ID, configuring VNIs and EVIs with options for automatic allocation, and defining import and export route targets. It also includes advanced configuration options such as BGP settings, including autonomous system numbers, AFI/SAFI options, and route advertisement preferences. Node selectors can be used to constrain the deployment of the router to specific nodes within the network. + """ + + bgp: Annotated[ + Optional[RouterSpecBgp], + Field(description="BGP configuration.", title="BGP Configuration"), + ] = None + description: Annotated[ + Optional[str], + Field(description="The description of the Router.", title="Description"), + ] = None + evi: Annotated[ + Optional[int], + Field( + description="EVI for the Router; leave blank for auto-allocation from EVI pool.", + ge=1, + le=65535, + title="EVI", + ), + ] = None + eviPool: Annotated[ + Optional[str], + Field( + description="Reference to EVI pool for auto-allocation.", + title="EVI Allocation Pool", + ), + ] = "evi-pool" + exportTarget: Annotated[ + Optional[str], + Field( + description="Export route target in 'target:N:N' format, if not specified, the default value taken as \"target:1:\".", + pattern="^target.*$", + title="Export Target", + ), + ] = None + importTarget: Annotated[ + Optional[str], + Field( + description="Import route target in 'target:N:N' format, if not specified, the default value taken as \"target:1:\".", + pattern="^target.*$", + title="Import Target", + ), + ] = None + ipLoadBalancing: Annotated[ + Optional[RouterSpecIpLoadBalancing], + Field( + description="IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.", + title="Prefix", + ), + ] = None + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Node selectors for deployment constraints. If Nodes are selected, the Router will only be deployed on the Nodes selected, if left blank it will be deployed on all Nodes for which there are IRB or RoutedInterfaces referencing this Router.", + title="Node Selector", + ), + ] = None + routeLeaking: Annotated[ + Optional[RouterSpecRouteLeaking], + Field( + description="Route leaking controlled by routing policies in and out of the DefaultRouter.", + title="Route Leaking", + ), + ] = None + routerID: Annotated[ + Optional[str], Field(description="Router ID.", title="Router ID") + ] = None + tunnelIndexPool: Annotated[ + Optional[str], + Field( + description="Reference to tunnel index allocation pool.", + title="Tunnel Index Pool", + ), + ] = "tunnel-index-pool" + type: Annotated[ + Optional[Literal["SIMPLE", "EVPNVXLAN"]], + Field( + description="Select the type of Router. Simple doesn't include any overlay control plane or dataplane properties (EVPN/VXLAN). EVPNVXLAN includes the properties needed to provision this Router over an IP Fabric.", + title="Type", + ), + ] = "EVPNVXLAN" + vni: Annotated[ + Optional[int], + Field( + description="VNI for the Router; leave blank for auto-allocation from VNI pool.", + ge=1, + le=16777215, + title="VNI", + ), + ] = None + vniPool: Annotated[ + Optional[str], + Field( + description="Reference to VNI pool for auto-allocation.", + title="VNI Allocation Pool", + ), + ] = "vni-pool" + + +class RouterSpecBgp(BaseModel): + """ + BGP configuration. + """ + + autonomousSystem: Annotated[ + Optional[int], + Field( + description="Autonomous System number for BGP.", + ge=1, + le=4294967295, + title="Autonomous System", + ), + ] = None + ebgpPreference: Annotated[ + Optional[int], + Field( + description="Preference to be set for eBGP [default=170].", + ge=1, + le=255, + title="eBGP Preference", + ), + ] = 170 + enabled: Annotated[ + Optional[bool], Field(description="Enable or disable BGP.", title="Enable BGP") + ] = False + ibgpPreference: Annotated[ + Optional[int], + Field( + description="Preference to be set for iBGP [default=170].", + ge=1, + le=255, + title="iBGP Preference", + ), + ] = 170 + ipAliasNexthops: Annotated[ + Optional[List[RouterSpecBgpIpAliasNexthop]], + Field(description="IP aliasing configuration.", title="IP Alias Nexthops"), + ] = None + ipv4Unicast: Annotated[ + Optional[RouterSpecBgpIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[RouterSpecBgpIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field(description="Keychain to be used for authentication", title="Keychain"), + ] = None + minWaitToAdvertise: Annotated[ + Optional[int], + Field( + description="Minimum wait time before advertising routes post BGP restart.", + ge=0, + le=3600, + title="Min Wait To Advertise Time", + ), + ] = 0 + rapidWithdrawl: Annotated[ + Optional[bool], + Field( + description="Enable rapid withdrawal in BGP.", + title="Enable Rapid Withdrawal", + ), + ] = True + waitForFIBInstall: Annotated[ + Optional[bool], + Field( + description="Wait for FIB installation before advertising routes.", + title="Wait for FIB Installation", + ), + ] = False + + +class RouterSpecBgpIpAliasNexthop(BaseModel): + esi: Annotated[ + Optional[str], + Field( + description="10 byte Ethernet Segment Identifier, if not set a type 0 ESI is generated.", + title="ESI", + ), + ] = "auto" + nextHop: Annotated[ + str, + Field( + description="The nexthop IP address to track for the IP alias.", + title="IP Alias Address", + ), + ] + preferredActiveNode: Annotated[ + Optional[str], + Field( + description="When not set the ES is used in an all active mode. This references the ToppNode object and when set, the DF algorithm is configured to type preference and the selected Node is set with a higher preference value. All other Nodes have a lower value configured.", + title="Preferred Active Node", + ), + ] = None + + +class RouterSpecBgpIpv4Unicast(BaseModel): + """ + Parameters relating to the IPv4 unicast AFI/SAFI. + """ + + advertiseIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.", + title="Advertise IPv6 Next Hops", + ), + ] = None + enabled: Annotated[ + bool, Field(description="Enables the IPv4 unicast AFISAFI.", title="Enabled") + ] + multipath: Annotated[ + Optional[RouterSpecBgpIpv4UnicastMultipath], + Field(description="Enable multipath.", title="Multipath"), + ] = None + receiveIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.", + title="Receive IPv6 Next Hops", + ), + ] = None + + +class RouterSpecBgpIpv4UnicastMultipath(BaseModel): + """ + Enable multipath. + """ + + allowMultipleAS: Annotated[ + bool, + Field( + description="When set to true, BGP is allowed to build a multipath set using BGP routes with different neighbor AS (most recent AS in the AS_PATH), When set to false, BGP is only allowed to use non-best paths for ECMP if they meet the multipath criteria and they have the same neighbor AS as the best path.", + title="Allow Multiple Autonomous Systems Per Path", + ), + ] + maxAllowedPaths: Annotated[ + int, + Field( + description="The maximum number of BGP ECMP next-hops for BGP routes with an NLRI belonging to the address family of this configuration context.", + ge=1, + le=256, + title="Maximum Number of Paths", + ), + ] + + +class RouterSpecBgpIpv6Unicast(BaseModel): + """ + Parameters relating to the IPv6 unicast AFI/SAFI. + """ + + enabled: Annotated[ + bool, Field(description="Enables the IPv6 unicast AFISAFI", title="Enabled") + ] + multipath: Annotated[ + Optional[RouterSpecBgpIpv6UnicastMultipath], + Field(description="Enable multipath", title="Multipath"), + ] = None + + +class RouterSpecBgpIpv6UnicastMultipath(BaseModel): + """ + Enable multipath + """ + + allowMultipleAS: Annotated[ + bool, + Field( + description="When set to true, BGP is allowed to build a multipath set using BGP routes with different neighbor AS (most recent AS in the AS_PATH), When set to false, BGP is only allowed to use non-best paths for ECMP if they meet the multipath criteria and they have the same neighbor AS as the best path.", + title="Allow Multiple Autonomous Systems Per Path", + ), + ] + maxAllowedPaths: Annotated[ + int, + Field( + description="The maximum number of BGP ECMP next-hops for BGP routes with an NLRI belonging to the address family of this configuration context.", + ge=1, + le=256, + title="Maximum Number of Paths", + ), + ] + + +class RouterSpecIpLoadBalancing(BaseModel): + """ + IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming. + """ + + prefix: Annotated[ + Optional[List[RouterSpecIpLoadBalancingPrefixItem]], + Field( + description="IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.", + title="Prefix", + ), + ] = None + + +class RouterSpecIpLoadBalancingPrefixItem(BaseModel): + hashBucketsPerPath: Annotated[ + int, + Field( + description="The number of times each next-hop is repeated in the fill pattern if there are max-paths ECMP next-hops.", + ge=1, + le=32, + title="Max Paths", + ), + ] + maxECMP: Annotated[ + int, + Field( + description="The maximum number of ECMP next-hops per route associated with the resilient-hash prefix.", + ge=1, + le=64, + title="Max ECMP", + ), + ] + prefix: Annotated[ + str, + Field( + description="IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.", + title="Prefix", + ), + ] + + +class RouterSpecRouteLeaking(BaseModel): + """ + Route leaking controlled by routing policies in and out of the DefaultRouter. + """ + + exportPolicy: Annotated[ + Optional[str], + Field( + description="Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.", + title="Export Policy", + ), + ] = None + importPolicy: Annotated[ + Optional[str], + Field( + description="Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.", + title="Import Policy", + ), + ] = None + + +class RouterStatus(BaseModel): + """ + RouterStatus defines the observed state of Router + """ + + bgpPeers: Annotated[ + Optional[List[str]], + Field( + description="List of BGPPeers attached to the router.", title="BGP Peers" + ), + ] = None + evi: Annotated[ + Optional[int], Field(description="EVI in use for this Router.", title="EVI") + ] = None + exportTarget: Annotated[ + Optional[str], + Field( + description="Export route target for this Router.", title="Export Target" + ), + ] = None + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the Router.", + title="Health Score", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Explains the reason for the health score.", + title="Health Score Reason", + ), + ] = None + importTarget: Annotated[ + Optional[str], + Field( + description="Import route target for this Router.", title="Import Target" + ), + ] = None + irbInterfaces: Annotated[ + Optional[List[str]], + Field( + description="List of IRBInterfaces attached to the router.", + title="IRB Interfaces", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field(description="Timestamp of the last state change.", title="Last Change"), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of nodes on which the Router is deployed.", title="Nodes" + ), + ] = None + numNodes: Annotated[ + Optional[int], + Field( + description="Number of nodes on which the Router is configured.", + title="Number of Nodes", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the Router.", title="Operational State" + ), + ] = None + routedInterfaces: Annotated[ + Optional[List[str]], + Field( + description="List of RoutedInterfaces attached to the router.", + title="Routed Interfaces", + ), + ] = None + tunnelIndex: Annotated[ + Optional[int], + Field(description="Vxlan tunnel index in use.", title="Tunnel Index"), + ] = None + vni: Annotated[ + Optional[int], Field(description="VNI in use for this Router.", title="VNI") + ] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str + + +class VLAN(BaseModel): + """ + VLAN is the Schema for the vlans API + """ + + apiVersion: str + kind: str + metadata: VLANMetadata + spec: Annotated[ + VLANSpec, + Field( + description="The VLAN enables the configuration and management of VLAN and their association with BridgeDomains. This resource allows for specifying the associated BridgeDomain, selecting interfaces based on label selectors, and configuring VLAN IDs with options for auto-allocation from a VLAN pool. It also supports advanced configurations such as ingress and egress traffic management, and overrides for MAC Duplication Detection actions when enabled in the associated BridgeDomain.", + title="Specification", + ), + ] + status: Annotated[Optional[VLANStatus], Field(title="Status")] = None + + +VLANDeletedResourceEntry = BridgeDomainDeletedResourceEntry + + +class VLANDeletedResources(RootModel[List[VLANDeletedResourceEntry]]): + root: List[VLANDeletedResourceEntry] + + +class VLANList(BaseModel): + """ + VLANList is a list of vlans + """ + + apiVersion: str + items: Optional[List[VLAN]] = None + kind: str + + +VLANMetadata = BridgeDomainMetadata + + +class VLANSpec(BaseModel): + """ + The VLAN enables the configuration and management of VLAN and their association with BridgeDomains. This resource allows for specifying the associated BridgeDomain, selecting interfaces based on label selectors, and configuring VLAN IDs with options for auto-allocation from a VLAN pool. It also supports advanced configurations such as ingress and egress traffic management, and overrides for MAC Duplication Detection actions when enabled in the associated BridgeDomain. + """ + + bridgeDomain: Annotated[ + str, + Field( + description="Reference to a BridgeDomain or SimpleBridgeDomain.", + title="Bridge Domain", + ), + ] + description: Annotated[ + Optional[str], + Field(description="The description of the VLAN.", title="Description"), + ] = None + egress: Annotated[ + Optional[VLANSpecEgress], + Field(description="Manages actions on traffic at Egress.", title="Egress"), + ] = None + ingress: Annotated[ + Optional[VLANSpecIngress], + Field(description="Manages actions on traffic at Ingress.", title="Ingress"), + ] = None + interfaceSelector: Annotated[ + List[str], + Field( + description="Interfaces to use for attachment to this VLAN based on the label selector. Selects Interfaces based on their associated labels.", + title="Interface Selector", + ), + ] + l2MTU: Annotated[ + Optional[int], + Field( + description="L2 MTU specifies the maximum sized Ethernet frame that can be transmitted on the subinterface. If a frame exceeds this size it is discarded. If the l2-mtu of the subinterface exceeds the port-mtu of the associated interface, the subinterface will remain operationally down.", + ge=1450, + le=9500, + title="L2 MTU", + ), + ] = None + macDuplicationDetectionAction: Annotated[ + Optional[ + Literal["Blackhole", "OperDown", "StopLearning", "UseBridgeDomainAction"] + ], + Field( + description="If Mac Duplication Detection is enabled on the associated Bridge Domain, this property will override the MDD action set in the BridgeDomain.", + title="MAC Duplication Detection Action", + ), + ] = None + splitHorizonGroup: Annotated[ + Optional[str], + Field( + description="Name of the Split Horizon Group to be used for this VLAN. All subinterfaces within this VLAN will be members of this Split Horizon Group.", + title="Split Horizon Group", + ), + ] = None + uplink: Annotated[ + Optional[VLANSpecUplink], + Field( + description="The Uplink between your access breakout switch and your leaf switch.", + title="Uplink", + ), + ] = None + vlanID: Annotated[ + Optional[str], + Field( + description="Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.", + title="VLAN ID", + ), + ] = "pool" + vlanPool: Annotated[ + Optional[str], + Field( + description='Reference to a VLAN pool to use for allocations. [default="vlan-pool"]', + title="VLAN Pool", + ), + ] = None + + +VLANSpecEgress = BridgeInterfaceSpecEgress + + +VLANSpecIngress = BridgeInterfaceSpecIngress + + +class VLANSpecUplink(BaseModel): + """ + The Uplink between your access breakout switch and your leaf switch. + """ + + egress: Annotated[ + Optional[VLANSpecUplinkEgress], + Field( + description="Manages actions on traffic at Egress of the Local enpoint of the Uplink.", + title="Egress", + ), + ] = None + ingress: Annotated[ + Optional[VLANSpecUplinkIngress], + Field( + description="Manages actions on traffic at Ingress of the Local enpoint of the Uplink.", + title="Ingress", + ), + ] = None + uplinkSelector: Annotated[ + Optional[List[str]], + Field( + description="Selects TopoLinks which connect a leaf switch to a breakout switch. This is the uplink between your access breakout switch and your leaf switch. There can only be a single TopoLink between the access breakout switch and the leaf switch, if more than one TopoLink is present between two devices the transaction will fail.", + title="Uplink Selector", + ), + ] = None + uplinkVLANID: Annotated[ + Optional[str], + Field( + description="The VLAN ID to be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.", + title="Uplink VLAN ID", + ), + ] = "pool" + uplinkVLANPool: Annotated[ + Optional[str], + Field( + description="A VLAN from this pool will be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.", + title="Uplink VLAN Pool", + ), + ] = None + + +VLANSpecUplinkEgress = BridgeInterfaceSpecUplinkEgress + + +VLANSpecUplinkIngress = BridgeInterfaceSpecUplinkIngress + + +class VLANStatus(BaseModel): + health: Annotated[ + Optional[int], + Field(description="Indicates the health score of the VNET.", title="Health"), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + numSubInterfaces: Annotated[ + Optional[int], + Field( + description="Total number of sub-interfaces configured by the VNET.", + title="Number of Sub Interfaces", + ), + ] = None + numSubInterfacesOperDown: Annotated[ + Optional[int], + Field( + description="Total number of sub-interfaces configured by the VNET which are oper-down.", + title="Number of Sub Interfaces Oper Down", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field(description="Operational state of the VNET.", title="Operational State"), + ] = None + subInterfaces: Annotated[ + Optional[List[VLANStatusSubInterface]], + Field(description="List of members in this Interface.", title="Sub Interfaces"), + ] = None + + +VLANStatusSubInterface = BridgeInterfaceStatusSubInterface + + +class VirtualNetwork(BaseModel): + """ + VirtualNetwork is the Schema for the virtualnetworks API + """ + + apiVersion: str + kind: str + metadata: VirtualNetworkMetadata + spec: Annotated[ + VirtualNetworkSpec, + Field( + description="VirtualNetworkSpec defines the desired state of VirtualNetwork", + title="Specification", + ), + ] + status: Annotated[Optional[VirtualNetworkStatus], Field(title="Status")] = None + + +VirtualNetworkDeletedResourceEntry = BridgeDomainDeletedResourceEntry + + +class VirtualNetworkDeletedResources( + RootModel[List[VirtualNetworkDeletedResourceEntry]] +): + root: List[VirtualNetworkDeletedResourceEntry] + + +class VirtualNetworkList(BaseModel): + """ + VirtualNetworkList is a list of virtualnetworks + """ + + apiVersion: str + items: Optional[List[VirtualNetwork]] = None + kind: str + + +VirtualNetworkMetadata = BridgeDomainMetadata + + +class VirtualNetworkSpec(BaseModel): + """ + VirtualNetworkSpec defines the desired state of VirtualNetwork + """ + + bridgeDomains: Annotated[ + Optional[List[VirtualNetworkSpecBridgeDomain]], + Field( + description="List of Subnets. [emits=BridgeDomain]", title="Bridge Domains" + ), + ] = None + bridgeInterfaces: Annotated[ + Optional[List[VirtualNetworkSpecBridgeInterface]], + Field( + description="List of BridgeInterfaces. [emits=BridgeInterface]", + title="Bridge Interfaces", + ), + ] = None + irbInterfaces: Annotated[ + Optional[List[VirtualNetworkSpecIrbInterface]], + Field( + description="List of IRBInterfaces. [emits=IRBInterface]", + title="IRB Interfaces", + ), + ] = None + protocols: Annotated[ + Optional[VirtualNetworkSpecProtocols], + Field(description="Protocols to configure.", title="Protocols"), + ] = None + routedInterfaces: Annotated[ + Optional[List[VirtualNetworkSpecRoutedInterface]], + Field( + description="List of RoutedInterface. [emits=RoutedInterface]", + title="Routed Interfaces", + ), + ] = None + routers: Annotated[ + Optional[List[VirtualNetworkSpecRouter]], + Field(description="List of Routers.[emits=Router]", title="Routers"), + ] = None + vlans: Annotated[ + Optional[List[VirtualNetworkSpecVlan]], + Field(description="List of VLANs. [emits=VLAN]", title="VLAN"), + ] = None + + +class VirtualNetworkSpecBridgeDomain(BaseModel): + name: Annotated[ + str, + Field(description="The name of the BridgeDomain.", title="Bridge Domain Name"), + ] + spec: Annotated[ + VirtualNetworkSpecBridgeDomainSpec, + Field( + description="Specification of the BridgeDomain", title="Bridge Domain Spec" + ), + ] + + +class VirtualNetworkSpecBridgeDomainSpec(BaseModel): + """ + Specification of the BridgeDomain + """ + + description: Annotated[ + Optional[str], + Field(description="The description of the BridgeDomain.", title="Description"), + ] = None + evi: Annotated[ + Optional[int], + Field( + description="EVI to use for this BridgeDomain, can be optionally left blank to have it automatically allocated using the EVI Pool.", + ge=1, + le=65535, + title="EVI", + ), + ] = None + eviPool: Annotated[ + Optional[str], + Field( + description="Reference to an EVI pool to use for allocations if EVI is left blank.", + title="EVI Allocation Pool", + ), + ] = "evi-pool" + exportTarget: Annotated[ + Optional[str], + Field( + description="Export route target in 'target:N:N' format, if not specified, the default value taken as \"target:1:\".", + pattern="^target.*$", + title="Export Target", + ), + ] = None + importTarget: Annotated[ + Optional[str], + Field( + description="Import route target in 'target:N:N' format, if not specified, the default value taken as \"target:1:\".", + pattern="^target.*$", + title="Import Target", + ), + ] = None + l2proxyARPND: Annotated[ + Optional[VirtualNetworkSpecBridgeDomainSpecL2proxyARPND], + Field( + description="Enables / Disabled Proxy ARP / Proxy ND.", + title="L2 Proxy ARP/ND", + ), + ] = None + macAging: Annotated[ + Optional[int], + Field( + description="Configurable aging time for dynamically learned mac addresses.", + ge=60, + le=86400, + title="MAC Aging", + ), + ] = 300 + macDuplicationDetection: Annotated[ + Optional[VirtualNetworkSpecBridgeDomainSpecMacDuplicationDetection], + Field( + description="Enable or disable MAC duplication detection and resolution mechanisms.", + title="MAC Duplication Detection", + ), + ] = None + macLimit: Annotated[ + Optional[int], + Field( + description="Sets the maximum number of MAC entries accepted in the bridge table.", + title="MAC Limit", + ), + ] = None + tunnelIndexPool: Annotated[ + Optional[str], + Field( + description="Reference to a tunnel index pool to use for allocations.", + title="Tunnel Index Allocation Pool", + ), + ] = "tunnel-index-pool" + type: Annotated[ + Optional[Literal["SIMPLE", "EVPNVXLAN"]], + Field( + description="Select the type of BridgeDomain. Simple doesn't include any overlay control plane or dataplane properties (EVPN/VXLAN). EVPNVXLAN includes the properties needed to provision this BridgeDomain over an IP Fabric.", + title="Type", + ), + ] = "EVPNVXLAN" + vni: Annotated[ + Optional[int], + Field( + description="VNI to use for this BridgeDomain, can be optionally left blank to have it allocated using the VNI Pool.", + ge=1, + le=16777215, + title="VNI", + ), + ] = None + vniPool: Annotated[ + Optional[str], + Field( + description="Reference to a VNI pool to use for allocations if VNI is left blank.", + title="VNI Allocation Pool", + ), + ] = "vni-pool" + + +class VirtualNetworkSpecBridgeDomainSpecL2proxyARPND(BaseModel): + """ + Enables / Disabled Proxy ARP / Proxy ND. + """ + + dynamicLearning: Annotated[ + Optional[VirtualNetworkSpecBridgeDomainSpecL2proxyARPNDDynamicLearning], + Field(title="Dynamic Learning"), + ] = None + ipDuplication: Annotated[ + Optional[VirtualNetworkSpecBridgeDomainSpecL2proxyARPNDIpDuplication], + Field(title="L2 Proxy ARP/ND IP Duplication Detection"), + ] = None + proxyARP: Annotated[ + Optional[bool], Field(description="Enables proxy ARP.", title="Proxy ARP") + ] = False + proxyND: Annotated[ + Optional[bool], Field(description="Enables proxy ND.", title="Proxy ND") + ] = False + tableSize: Annotated[ + Optional[int], + Field( + description="Maximum number of entries allowed in the proxy table of the bridge domain.", + ge=1, + le=8192, + title="L2 Proxy ARP/ND Table Size", + ), + ] = 250 + + +VirtualNetworkSpecBridgeDomainSpecL2proxyARPNDDynamicLearning = ( + BridgeDomainSpecL2proxyARPNDDynamicLearning +) + + +VirtualNetworkSpecBridgeDomainSpecL2proxyARPNDIpDuplication = ( + BridgeDomainSpecL2proxyARPNDIpDuplication +) + + +VirtualNetworkSpecBridgeDomainSpecMacDuplicationDetection = ( + BridgeDomainSpecMacDuplicationDetection +) + + +class VirtualNetworkSpecBridgeInterface(BaseModel): + name: Annotated[ + str, + Field( + description="The name of the BridgeInterface.", + title="Bridge Interface Name", + ), + ] + spec: Annotated[ + VirtualNetworkSpecBridgeInterfaceSpec, + Field( + description="Specification of the BridgeInterface", + title="Bridge Interface Spec", + ), + ] + + +class VirtualNetworkSpecBridgeInterfaceSpec(BaseModel): + """ + Specification of the BridgeInterface + """ + + bridgeDomain: Annotated[ + str, + Field( + description="Reference to a BridgeDomain in which to attach the BridgeInterface.", + title="Bridge Domain", + ), + ] + description: Annotated[ + Optional[str], + Field( + description="The description of the BridgeInterface.", title="Description" + ), + ] = None + egress: Annotated[ + Optional[VirtualNetworkSpecBridgeInterfaceSpecEgress], + Field( + description="Manages actions on traffic at Egress.", title="Egress Actions" + ), + ] = None + ingress: Annotated[ + Optional[VirtualNetworkSpecBridgeInterfaceSpecIngress], + Field( + description="Manages actions on traffic at Ingress.", + title="Ingress Actions", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to an Interface resource to attach this BridgeInterface.", + title="Interface", + ), + ] + l2MTU: Annotated[ + Optional[int], + Field( + description="L2 MTU specifies the maximum sized Ethernet frame that can be transmitted on the subinterface. If a frame exceeds this size it is discarded. If the l2-mtu of the subinterface exceeds the port-mtu of the associated interface, the subinterface will remain operationally down.", + ge=1450, + le=9500, + title="L2 MTU", + ), + ] = None + macDuplicationDetectionAction: Annotated[ + Optional[ + Literal["Blackhole", "OperDown", "StopLearning", "UseBridgeDomainAction"] + ], + Field( + description="Override for Mac Duplication Detection action if enabled in the associated BridgeDomain.", + title="MAC Duplication Detection Action", + ), + ] = None + splitHorizonGroup: Annotated[ + Optional[str], + Field( + description="Split Horizon Group to be used for this BridgeInterface. The subinterface within this BridgeInterface will be a member of this Split Horizon Group.", + title="Split Horizon Group", + ), + ] = None + uplink: Annotated[ + Optional[VirtualNetworkSpecBridgeInterfaceSpecUplink], + Field( + description="The Uplink between your access breakout switch and your leaf switch.", + title="Uplink", + ), + ] = None + vlanID: Annotated[ + str, + Field( + description="Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.", + title="VLAN ID", + ), + ] + + +VirtualNetworkSpecBridgeInterfaceSpecEgress = BridgeInterfaceSpecEgress + + +VirtualNetworkSpecBridgeInterfaceSpecIngress = BridgeInterfaceSpecIngress + + +class VirtualNetworkSpecBridgeInterfaceSpecUplink(BaseModel): + """ + The Uplink between your access breakout switch and your leaf switch. + """ + + egress: Annotated[ + Optional[VirtualNetworkSpecBridgeInterfaceSpecUplinkEgress], + Field( + description="Manages actions on traffic at Egress of the Local enpoint of the Uplink.", + title="Egress", + ), + ] = None + ingress: Annotated[ + Optional[VirtualNetworkSpecBridgeInterfaceSpecUplinkIngress], + Field( + description="Manages actions on traffic at Ingress of the Local enpoint of the Uplink.", + title="Ingress", + ), + ] = None + uplinkSelector: Annotated[ + Optional[List[str]], + Field( + description="Selects TopoLinks which connect a leaf switch to a breakout switch. This is the uplink between your access breakout switch and your leaf switch. There can only be a single TopoLink between the access breakout switch and the leaf switch, if more than one TopoLink is present between two devices the transaction will fail.", + title="Uplink Selector", + ), + ] = None + uplinkVLANID: Annotated[ + Optional[str], + Field( + description="The VLAN ID to be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.", + title="Uplink VLAN ID", + ), + ] = "pool" + uplinkVLANPool: Annotated[ + Optional[str], + Field( + description="A VLAN from this pool will be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.", + title="Uplink VLAN Pool", + ), + ] = None + + +VirtualNetworkSpecBridgeInterfaceSpecUplinkEgress = BridgeInterfaceSpecUplinkEgress + + +VirtualNetworkSpecBridgeInterfaceSpecUplinkIngress = BridgeInterfaceSpecUplinkIngress + + +class VirtualNetworkSpecIrbInterface(BaseModel): + name: Annotated[ + str, + Field(description="The name of the IrbInterface.", title="IRB Interface Name"), + ] + spec: Annotated[ + VirtualNetworkSpecIrbInterfaceSpec, + Field( + description="Specification of the IrbInterface", title="IRB Interface Spec" + ), + ] + + +class VirtualNetworkSpecIrbInterfaceSpec(BaseModel): + """ + Specification of the IrbInterface + """ + + anycastGatewayMAC: Annotated[ + Optional[str], + Field( + description="The gateway MAC to use on the anycast address, if left empty the node will automatically assign one.", + title="Anycast GW MAC", + ), + ] = None + arpTimeout: Annotated[ + Optional[int], + Field( + description="Duration of time that dynamic ARP entries remain in the ARP cache before they expire.", + title="ARP Timeout", + ), + ] = 14400 + bfd: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecBfd], + Field(description="Enable BFD on the IRBInterface.", title="BFD Configuration"), + ] = None + bridgeDomain: Annotated[ + str, Field(description="Reference to a BridgeDomain.", title="Bridge Domain") + ] + description: Annotated[ + Optional[str], + Field(description="The description of the IRBInterface.", title="Description"), + ] = None + egress: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecEgress], + Field( + description="Manages actions on traffic at Egress.", title="Egress Actions" + ), + ] = None + evpnRouteAdvertisementType: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecEvpnRouteAdvertisementType], + Field( + description="Controls the type of ARP/ND entries to advertise.", + title="EVPN Route Advertisement Type", + ), + ] = None + hostRoutePopulate: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecHostRoutePopulate], + Field( + description="Configures host route population based on ARP entries.", + title="Host Route Population", + ), + ] = None + ingress: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecIngress], + Field( + description="Manages actions on traffic at Ingress.", + title="Ingress Actions", + ), + ] = None + ipAddresses: Annotated[ + Optional[List[VirtualNetworkSpecIrbInterfaceSpecIpAddress]], + Field(title="IP Addresses"), + ] = None + ipMTU: Annotated[ + Optional[int], + Field( + description="IP MTU for the IRBInterface [default=1500].", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = 1500 + ipv6RouterAdvertisement: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecIpv6RouterAdvertisement], + Field(title="IPv6 Router Advertisement"), + ] = None + l3ProxyARPND: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecL3ProxyARPND], + Field( + description="L3 Proxy ARP and ND configuration.", title="L3 Proxy ARP/ND" + ), + ] = None + learnUnsolicited: Annotated[ + Optional[Literal["BOTH", "GLOBAL", "LINK-LOCAL", "NONE"]], + Field( + description="Enable or disable learning of unsolicited ARPs.", + title="Learn Unsolicited ARPs", + ), + ] = "NONE" + router: Annotated[str, Field(description="Reference to a Router.", title="Router")] + unnumbered: Annotated[ + Optional[Literal["IPV6"]], + Field( + description="Enables the use of unnumbered interfaces on the IRBInterface. If IPv6 is specified, no IP address are configured on the sub-interface and only the link local address will be used. If any IP addresses are specified for either IPv4 or IPv6 that will take precedence and IPs will be assigned to the interfaces.(Deprecated, Use IPv6RouterAdvertisement)", + title="Unnumbered", + ), + ] = None + virtualIPDiscovery: Annotated[ + Optional[List[VirtualNetworkSpecIrbInterfaceSpecVirtualIPDiscoveryItem]], + Field( + description="Configuration for Virtual IP discovery on the interface.", + title="Virtual IP Discovery", + ), + ] = None + + +VirtualNetworkSpecIrbInterfaceSpecBfd = IRBInterfaceSpecBfd + + +VirtualNetworkSpecIrbInterfaceSpecEgress = BridgeInterfaceSpecEgress + + +VirtualNetworkSpecIrbInterfaceSpecEvpnRouteAdvertisementType = ( + IRBInterfaceSpecEvpnRouteAdvertisementType +) + + +VirtualNetworkSpecIrbInterfaceSpecHostRoutePopulate = IRBInterfaceSpecHostRoutePopulate + + +VirtualNetworkSpecIrbInterfaceSpecIngress = BridgeInterfaceSpecIngress + + +class VirtualNetworkSpecIrbInterfaceSpecIpAddress(BaseModel): + ipv4Address: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecIpAddressIpv4Address], + Field( + description="IPv4 address in IP/mask form, e.g., 192.168.0.1/24.", + title="IPv4 Addresses", + ), + ] = None + ipv6Address: Annotated[ + Optional[VirtualNetworkSpecIrbInterfaceSpecIpAddressIpv6Address], + Field( + description="IPv6 address in IP/mask form, e.g., fc00::1/120.", + title="IPv6 Addresses", + ), + ] = None + node: Annotated[ + Optional[str], + Field( + description="Reference to a TopoNode resource, if not specified the IP address will be assigned to all nodes on which the IRB is deployed. If specified the IP address will be assigned to the specified node.", + title="Node", + ), + ] = None + + +VirtualNetworkSpecIrbInterfaceSpecIpAddressIpv4Address = ( + IRBInterfaceSpecIpAddressIpv4Address +) + + +VirtualNetworkSpecIrbInterfaceSpecIpAddressIpv6Address = ( + IRBInterfaceSpecIpAddressIpv6Address +) + + +class VirtualNetworkSpecIrbInterfaceSpecIpv6RouterAdvertisement(BaseModel): + currentHopLimit: Annotated[ + int, + Field( + description="The current hop limit to advertise in the router advertisement messages.", + ge=0, + le=255, + title="Current Hop Limit", + ), + ] + enabled: Annotated[ + bool, + Field( + description="Enable or disable IPv6 router advertisements.", + title="Enable Router Advertisements", + ), + ] + ipMTU: Annotated[ + Optional[int], + Field( + description="The IP MTU to advertise in the router advertisement messages.", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = None + managedConfigurationFlag: Annotated[ + bool, + Field( + description="Enable DHCPv6 for address configuration (M-bit).", + title="Managed Configuration Flag", + ), + ] + maxAdvertisementInterval: Annotated[ + int, + Field( + description="Maximum time between router advertisements (in seconds).", + ge=4, + le=1800, + title="Maximum Advertisement Interval", + ), + ] + minAdvertisementInterval: Annotated[ + int, + Field( + description="Minimum time between router advertisements (in seconds).", + ge=3, + le=1350, + title="Minimum Advertisement Interval", + ), + ] + otherConfigurationFlag: Annotated[ + bool, + Field( + description="Enable DHCPv6 for other configuration (O-bit).", + title="Other Configuration Flag", + ), + ] + prefixes: Annotated[ + Optional[List[VirtualNetworkSpecIrbInterfaceSpecIpv6RouterAdvertisementPrefix]], + Field( + description="IPv6 prefixes to advertise in router advertisements.", + title="Prefixes", + ), + ] = None + reachableTime: Annotated[ + Optional[int], + Field( + description="Time in milliseconds for Neighbor Unreachability Detection.", + ge=0, + le=3600000, + title="Reachable Time", + ), + ] = 0 + retransmitTime: Annotated[ + int, + Field( + description="Time in milliseconds between retransmitted NS messages.", + ge=0, + le=1800000, + title="Retransmit Time", + ), + ] + routerLifetime: Annotated[ + int, + Field( + description="Router lifetime in seconds for default gateway.", + ge=0, + le=9000, + title="Router Lifetime", + ), + ] + + +VirtualNetworkSpecIrbInterfaceSpecIpv6RouterAdvertisementPrefix = ( + IRBInterfaceSpecIpv6RouterAdvertisementPrefix +) + + +VirtualNetworkSpecIrbInterfaceSpecL3ProxyARPND = IRBInterfaceSpecL3ProxyARPND + + +VirtualNetworkSpecIrbInterfaceSpecVirtualIPDiscoveryItem = ( + IRBInterfaceSpecVirtualIPDiscoveryItem +) + + +class VirtualNetworkSpecProtocols(BaseModel): + """ + Protocols to configure. + """ + + bgp: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgp], + Field(description="BGP Protocol.", title="BGP"), + ] = None + routingPolicies: Annotated[ + Optional[VirtualNetworkSpecProtocolsRoutingPolicies], + Field(description="Routing Policies.", title="Routing Policies"), + ] = None + staticRoutes: Annotated[ + Optional[List[VirtualNetworkSpecProtocolsStaticRoute]], + Field( + description="List of Static Routes within this VirtualNetwork. [emits=StaticRoute]", + title="Static Routes", + ), + ] = None + + +class VirtualNetworkSpecProtocolsBgp(BaseModel): + """ + BGP Protocol. + """ + + bgpGroups: Annotated[ + Optional[List[VirtualNetworkSpecProtocolsBgpBgpGroup]], + Field(description="List of BgpGroups. [emits=BGPGroup]", title="BGP Groups"), + ] = None + bgpPeers: Annotated[ + Optional[List[VirtualNetworkSpecProtocolsBgpBgpPeer]], + Field(description="List of BgpPeers [emits=BGPPeer]", title="BGP Peers"), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpGroup(BaseModel): + name: Annotated[ + str, Field(description="The name of the BgpGroup.", title="BGP Group Name") + ] + spec: Annotated[ + VirtualNetworkSpecProtocolsBgpBgpGroupSpec, + Field(description="Specification of the BgpGroup", title="BGP Group Spec"), + ] + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpec(BaseModel): + """ + Specification of the BgpGroup + """ + + asPathOptions: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpGroupSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + client: Annotated[ + Optional[bool], + Field( + description="When set to true, all configured and dynamic BGP peers are considered RR clients.", + title="Route Reflector Client", + ), + ] = None + clusterID: Annotated[ + Optional[str], + Field( + description="Enables route reflect client and sets the cluster ID.", + title="Cluster ID", + ), + ] = None + description: Annotated[ + Optional[str], + Field( + description="Sets the description on the BGP group.", title="Description" + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + ipv4Unicast: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpGroupSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpGroupSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + localAS: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpGroupSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + localPreference: Annotated[ + Optional[int], + Field( + description="Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.", + ge=0, + le=4294967295, + title="Local Preference", + ), + ] = None + multiHopMaxHop: Annotated[ + Optional[int], + Field( + description="Enable multihop for eBGP peers and sets the maximum number of hops allowed.", + ge=1, + le=255, + title="Multihop Max Hop Count", + ), + ] = None + nextHopSelf: Annotated[ + Optional[bool], + Field( + description="When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.", + title="Next Hop Self", + ), + ] = None + peerAS: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpGroupSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpGroupSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpGroupSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[ + VirtualNetworkSpecProtocolsBgpBgpGroupSpecAsPathOptionsRemovePrivateAS + ], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpecAsPathOptionsRemovePrivateAS(BaseModel): + """ + Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers. + """ + + ignorePeerAS: Annotated[ + bool, + Field( + description="If set to true then do not delete or replace a private AS number that is the same as the peer AS number.", + title="Ignore Peer AS", + ), + ] + leadingOnly: Annotated[ + bool, + Field( + description="If set to true then only delete or replace private AS numbers that appear before the first occurrence of a non-private ASN in the sequence of most recent ASNs in the AS path.", + title="Leading Only", + ), + ] + removePrivateASMode: Annotated[ + Literal["DISABLED", "REPLACE", "DELETE"], + Field( + description="The method by which private AS numbers are removed from the advertised AS_PATH attribute.", + title="Remove Private AS Mode", + ), + ] + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpecIpv4Unicast(BaseModel): + """ + Parameters relating to the IPv4 unicast AFI/SAFI. + """ + + advertiseIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.", + title="Advertise IPv6 Next Hops", + ), + ] = None + enabled: Annotated[ + Optional[bool], + Field(description="Enables the IPv4 unicast AFISAFI.", title="Enabled"), + ] = None + maxReceivedRoutes: Annotated[ + Optional[int], + Field( + description="Maximum number of IPv4 Unicast routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.", + ge=1, + le=4294967295, + title="Max Received Routes", + ), + ] = None + receiveIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.", + title="Receive IPv6 Next Hops", + ), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpecIpv6Unicast(BaseModel): + """ + Parameters relating to the IPv6 unicast AFI/SAFI. + """ + + enabled: Annotated[ + Optional[bool], + Field(description="Enables the IPv6 unicast AFISAFI", title="Enabled"), + ] = None + maxReceivedRoutes: Annotated[ + Optional[int], + Field( + description="Maximum number of IPv6 Unicast routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.", + ge=1, + le=4294967295, + title="Max Received Routes", + ), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpecLocalAS(BaseModel): + """ + The local autonomous system number advertised to peers. + """ + + autonomousSystem: Annotated[ + int, + Field( + description="Local Autonomous System number.", + ge=1, + le=4294967295, + title="Local Autonomous System", + ), + ] + prependGlobalAS: Annotated[ + Optional[bool], + Field( + description="When set to true, the global ASN value is prepended to the AS path in outbound routes towards each BGP peer.", + title="Prepend Global Autonomous System", + ), + ] = None + prependLocalAS: Annotated[ + Optional[bool], + Field( + description="When set to true, the local AS value is prepended to the AS path of inbound routes from each EBGP peer.", + title="Prepend Local Autonomous System", + ), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpecPeerAS(BaseModel): + """ + The autonomous system number expected from peers. + """ + + autonomousSystem: Annotated[ + int, + Field( + description="Local Autonomous System number.", + ge=1, + le=4294967295, + title="Peer Autonomous System", + ), + ] + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpecSendDefaultRoute(BaseModel): + """ + Options for controlling the generation of default routes towards BGP peers. + """ + + addressFamily: Annotated[ + List[Literal["IPV4-UNICAST", "IPV6-UNICAST"]], + Field( + description="Enables the sending of a synthetically generated default IPv4 or IPV6 route to each peer.", + title="Address Families", + ), + ] + exportPolicy: Annotated[ + Optional[str], + Field( + description="Reference to a Policy that should be applied to the advertised default routes, in order to set their attributes to non-default values.", + title="Export Policy", + ), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpGroupSpecTimers(BaseModel): + """ + Timer configurations + """ + + connectRetry: Annotated[ + Optional[int], + Field( + description="The time interval in seconds between successive attempts to establish a session with a peer.", + ge=1, + le=65535, + title="Connect Retry", + ), + ] = None + holdTime: Annotated[ + Optional[int], + Field( + description="The hold-time interval in seconds that the router proposes to the peer in its OPEN message.", + ge=0, + le=65535, + title="Hold Time", + ), + ] = None + keepAlive: Annotated[ + Optional[int], + Field( + description="The interval in seconds between successive keepalive messages sent to the peer.", + ge=0, + le=21845, + title="Keep Alive", + ), + ] = None + minimumAdvertisementInterval: Annotated[ + Optional[int], + Field( + description="The value assigned to the MinRouteAdvertisementIntervalTimer of RFC 4271, for both EBGP and IBGP sessions.", + ge=1, + le=255, + title="Minimum Advertisement Interval", + ), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpPeer(BaseModel): + name: Annotated[ + str, Field(description="The name of the BgpPeer.", title="BGP Peer Name") + ] + spec: Annotated[ + VirtualNetworkSpecProtocolsBgpBgpPeerSpec, + Field(description="Specification of the BgpPeer", title="BGP Peer Spec"), + ] + + +class VirtualNetworkSpecProtocolsBgpBgpPeerSpec(BaseModel): + """ + Specification of the BgpPeer + """ + + asPathOptions: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpPeerSpecAsPathOptions], + Field(description="AS Path Options", title="AS Path Options"), + ] = None + bfd: Annotated[ + Optional[bool], + Field( + description="Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.", + title="BFD", + ), + ] = None + client: Annotated[ + Optional[bool], + Field( + description="When set to true, all configured and dynamic BGP peers are considered RR clients.", + title="Route Reflector Client", + ), + ] = None + clusterID: Annotated[ + Optional[str], + Field( + description="Enables route reflect client and sets the cluster ID.", + title="Cluster ID", + ), + ] = None + description: Annotated[ + Optional[str], + Field(description="Sets the description on the BGP peer", title="Description"), + ] = None + dynamicNeighbor: Annotated[ + Optional[bool], + Field( + description="When set to true the Interface is added to the dynamic-neighbor list for dynamic peering.", + title="Dynamic Neighbor", + ), + ] = False + dynamicNeighborAllowedPeerAS: Annotated[ + Optional[List[int]], + Field( + description="The autonomous system numbers allowed from peers if dynamic peering is enabled.", + title="Dynamic Neighbor Allowed Peer AS", + ), + ] = None + exportPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes advertised to peers.", + title="Export Policy", + ), + ] = None + grStaleRouteTime: Annotated[ + Optional[int], + Field( + description="Enables Graceful Restart on the peer and sets the stale route time.", + ge=1, + le=3600, + title="GR Stale Route Time", + ), + ] = None + group: Annotated[ + str, + Field( + description="Reference to a BGPGroup. When present this BGP peer will be added to the BGP group", + title="Group", + ), + ] + importPolicy: Annotated[ + Optional[List[str]], + Field( + description="Reference to a Policy CR that will be used to filter routes received from peers.", + title="Import Policy", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to a RoutedInterface or IrbInterface resource whose IP will be used as a source IP for the BGP session.", + title="Interface Reference", + ), + ] + interfaceKind: Annotated[ + Literal["ROUTEDINTERFACE", "IRBINTERFACE"], + Field( + description="InterfaceReference type defines whether the provided Reference is a RoutedInterface or IrbInterface.", + title="Interface Reference Type", + ), + ] + ipv4Unicast: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpPeerSpecIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpPeerSpecIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field( + description="Reference to a Keychain resource that will be used for authentication with the BGP peer.", + title="Keychain", + ), + ] = None + localAS: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpPeerSpecLocalAS], + Field( + description="The local autonomous system number advertised to peers.", + title="Local AS", + ), + ] = None + localPreference: Annotated[ + Optional[int], + Field( + description="Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.", + ge=0, + le=4294967295, + title="Local Preference", + ), + ] = None + multiHopMaxHop: Annotated[ + Optional[int], + Field( + description="Enable multihop for eBGP peers and sets the maximum number of hops allowed.", + ge=1, + le=255, + title="Multihop Max Hop Count", + ), + ] = None + nextHopSelf: Annotated[ + Optional[bool], + Field( + description="When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.", + title="Next Hop Self", + ), + ] = None + node: Annotated[ + Optional[str], + Field( + description="Node on which to configure the BGP peer. This node must be one of the nodes on which the IRBInterface is configured. When left blank or if the node is not part of the IRBInterface, the peer will not be deployed. Ignored for RoutedInterfaces.", + title="Node", + ), + ] = None + peerAS: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpPeerSpecPeerAS], + Field( + description="The autonomous system number expected from peers.", + title="Peer AS", + ), + ] = None + peerIP: Annotated[ + Optional[str], + Field( + description="Peer IP to which the peering session will be established.", + title="Peer IP", + ), + ] = None + sendCommunityLarge: Annotated[ + Optional[bool], + Field( + description="When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Large", + ), + ] = None + sendCommunityStandard: Annotated[ + Optional[bool], + Field( + description="When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.", + title="Send Community Standard", + ), + ] = None + sendDefaultRoute: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpPeerSpecSendDefaultRoute], + Field( + description="Options for controlling the generation of default routes towards BGP peers.", + title="Send Default Route", + ), + ] = None + timers: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpPeerSpecTimers], + Field(description="Timer configurations", title="Timers"), + ] = None + + +class VirtualNetworkSpecProtocolsBgpBgpPeerSpecAsPathOptions(BaseModel): + """ + AS Path Options + """ + + allowOwnAS: Annotated[ + int, + Field( + description="The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.", + ge=0, + le=255, + title="Allow Own AS", + ), + ] + removePrivateAS: Annotated[ + Optional[VirtualNetworkSpecProtocolsBgpBgpPeerSpecAsPathOptionsRemovePrivateAS], + Field( + description="Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.", + title="Remove Private AS", + ), + ] = None + + +VirtualNetworkSpecProtocolsBgpBgpPeerSpecAsPathOptionsRemovePrivateAS = ( + VirtualNetworkSpecProtocolsBgpBgpGroupSpecAsPathOptionsRemovePrivateAS +) + + +VirtualNetworkSpecProtocolsBgpBgpPeerSpecIpv4Unicast = ( + VirtualNetworkSpecProtocolsBgpBgpGroupSpecIpv4Unicast +) + + +VirtualNetworkSpecProtocolsBgpBgpPeerSpecIpv6Unicast = ( + VirtualNetworkSpecProtocolsBgpBgpGroupSpecIpv6Unicast +) + + +VirtualNetworkSpecProtocolsBgpBgpPeerSpecLocalAS = ( + VirtualNetworkSpecProtocolsBgpBgpGroupSpecLocalAS +) + + +VirtualNetworkSpecProtocolsBgpBgpPeerSpecPeerAS = ( + VirtualNetworkSpecProtocolsBgpBgpGroupSpecPeerAS +) + + +VirtualNetworkSpecProtocolsBgpBgpPeerSpecSendDefaultRoute = ( + VirtualNetworkSpecProtocolsBgpBgpGroupSpecSendDefaultRoute +) + + +VirtualNetworkSpecProtocolsBgpBgpPeerSpecTimers = ( + VirtualNetworkSpecProtocolsBgpBgpGroupSpecTimers +) + + +class VirtualNetworkSpecProtocolsRoutingPolicies(BaseModel): + """ + Routing Policies. + """ + + policies: Annotated[ + Optional[List[VirtualNetworkSpecProtocolsRoutingPoliciesPolicy]], + Field(description="List of Policies. [emits=Policy]", title="Policies"), + ] = None + prefixSets: Annotated[ + Optional[List[VirtualNetworkSpecProtocolsRoutingPoliciesPrefixSet]], + Field(description="List of PrefixSet [emits=PrefixSet]", title="Prefix Sets"), + ] = None + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPolicy(BaseModel): + name: Annotated[str, Field(description="Name of the Policy.", title="Policy Name")] + spec: Annotated[ + Optional[VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpec], + Field(description="A policy", title="Policy Spec"), + ] = None + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpec(BaseModel): + """ + A policy + """ + + defaultAction: Annotated[ + Optional[VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecDefaultAction], + Field( + description="The default action to apply if no other actions are defined.", + title="Default Action", + ), + ] = None + statement: Annotated[ + Optional[ + List[VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItem] + ], + Field(description="List of policy statements.", title="Statements"), + ] = None + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecDefaultAction(BaseModel): + """ + The default action to apply if no other actions are defined. + """ + + bgp: Annotated[ + Optional[VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecDefaultActionBgp], + Field(description="Actions related to the BGP protocol.", title="BGP"), + ] = None + policyResult: Annotated[ + Optional[Literal["accept", "reject"]], + Field(description="Final disposition for the route.", title="Policy Result"), + ] = None + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecDefaultActionBgp(BaseModel): + """ + Actions related to the BGP protocol. + """ + + asPathPrepend: Annotated[ + Optional[int], + Field( + description="AS number to prepend to the AS Path attributes.", + ge=1, + le=4294967295, + title="AS Path Prepend", + ), + ] = None + asPathRemove: Annotated[ + Optional[bool], + Field( + description="Clear the AS path to make it empty.", title="AS Path Remove" + ), + ] = None + asPathReplace: Annotated[ + Optional[List[int]], + Field( + description="Replace the existing AS path with a new AS_SEQUENCE containing the listed AS numbers.", + title="AS Path Replace", + ), + ] = None + localPreference: Annotated[ + Optional[int], + Field( + description="Set a new LOCAL_PREF value for matching BGP routes.", + ge=0, + le=4294967295, + title="Set Local Preference", + ), + ] = None + setOrigin: Annotated[ + Optional[Literal["egp", "igp", "incomplete"]], + Field( + description="Set a new ORIGIN attribute for matching BGP routes.", + title="Set Origin", + ), + ] = None + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItem(BaseModel): + action: Annotated[ + Optional[ + VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItemAction + ], + Field( + description="Actions for routes that match the policy statement.", + title="Action", + ), + ] = None + match: Annotated[ + Optional[ + VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItemMatch + ], + Field(description="Match conditions of the policy statement.", title="Match"), + ] = None + name: Annotated[ + str, Field(description="Name of the policy statement.", title="Name") + ] + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItemAction( + BaseModel +): + """ + Actions for routes that match the policy statement. + """ + + bgp: Annotated[ + Optional[ + VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItemActionBgp + ], + Field(description="Actions related to the BGP protocol.", title="BGP"), + ] = None + policyResult: Annotated[ + Optional[Literal["accept", "reject"]], + Field(description="Final disposition for the route.", title="Policy Result"), + ] = None + + +VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItemActionBgp = ( + VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecDefaultActionBgp +) + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItemMatch(BaseModel): + """ + Match conditions of the policy statement. + """ + + bgp: Annotated[ + Optional[ + VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItemMatchBgp + ], + Field( + description="Configuration for BGP-specific policy match criteria.", + title="BGP", + ), + ] = None + family: Annotated[ + Optional[List[str]], + Field( + description="Address families that the route belongs to.", title="Family" + ), + ] = None + prefixSet: Annotated[ + Optional[str], + Field(description="Reference to a PrefixSet resource.", title="Prefix Set"), + ] = None + protocol: Annotated[ + Optional[ + Literal[ + "AGGREGATE", + "ARP_ND", + "BGP", + "BGP_EVPN", + "DHCP", + "GRIBI", + "HOST", + "ISIS", + "LOCAL", + "LINUX", + "NDK1", + "NDK2", + "OSPFV2", + "OSPFV3", + "STATIC", + ] + ], + Field(description="The route protocol type to match.", title="Protocol"), + ] = None + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPolicySpecStatementItemMatchBgp( + BaseModel +): + """ + Configuration for BGP-specific policy match criteria. + """ + + communitySet: Annotated[ + Optional[str], + Field( + description="Match conditions for BGP communities.", title="BGP Community" + ), + ] = None + evpnRouteType: Annotated[ + Optional[List[int]], + Field( + description="Match conditions for EVPN route types.", + title="EVPN Route Type", + ), + ] = None + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPrefixSet(BaseModel): + name: Annotated[ + str, Field(description="Name of the PrefixSet.", title="Prefix Set Name") + ] + spec: Annotated[ + Optional[VirtualNetworkSpecProtocolsRoutingPoliciesPrefixSetSpec], + Field(description="A PrefixSets", title="Prefix Set Spec"), + ] = None + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPrefixSetSpec(BaseModel): + """ + A PrefixSets + """ + + prefix: Annotated[ + List[VirtualNetworkSpecProtocolsRoutingPoliciesPrefixSetSpecPrefixItem], + Field( + description="List of IPv4 or IPv6 prefixes in CIDR notation.", + title="Prefixes", + ), + ] + + +class VirtualNetworkSpecProtocolsRoutingPoliciesPrefixSetSpecPrefixItem(BaseModel): + endRange: Annotated[ + Optional[int], + Field( + description="The end range when using a range to match prefixes.", + ge=0, + le=128, + title="End Range", + ), + ] = None + exact: Annotated[ + Optional[bool], + Field( + description="Indicates if it is an exact match. Ignores the StartRange and EndRange if this param is set.", + title="Exact", + ), + ] = None + prefix: Annotated[ + str, + Field( + description="The IPv4 or IPv6 prefix in CIDR notation with mask.", + title="Prefix", + ), + ] + startRange: Annotated[ + Optional[int], + Field( + description="If specifying a range, this is the start of the range.", + ge=0, + le=128, + title="Start Range", + ), + ] = None + + +class VirtualNetworkSpecProtocolsStaticRoute(BaseModel): + name: Annotated[ + str, Field(description="Name of the StaticRoute.", title="Static Route Name") + ] + spec: Annotated[ + Optional[VirtualNetworkSpecProtocolsStaticRouteSpec], + Field(description="A StaticRoutes", title="Static Route Spec"), + ] = None + + +class VirtualNetworkSpecProtocolsStaticRouteSpec(BaseModel): + """ + A StaticRoutes + """ + + nexthopGroup: Annotated[ + VirtualNetworkSpecProtocolsStaticRouteSpecNexthopGroup, + Field( + description="Group of nexthops for the list of prefixes.", + title="Nexthop Group", + ), + ] + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of nodes on which to configure the static routes. An AND operation is executed against the nodes in this list and the nodes on which the Router is configured to determine the Nodes on which to configure the static routes.", + title="Nodes", + ), + ] = None + preference: Annotated[ + Optional[int], + Field(description="Defines the route preference.", title="Preference"), + ] = None + prefixes: Annotated[ + List[str], + Field( + description="List of destination prefixes and mask to use for the static routes.", + title="Prefixes", + ), + ] + router: Annotated[ + str, + Field( + description="Reference to a Router on which to configure the static routes. If no Nodes are provided then the static routes will be provisioned on all Nodes on which the Router is provisioned.", + title="Router", + ), + ] + + +class VirtualNetworkSpecProtocolsStaticRouteSpecNexthopGroup(BaseModel): + """ + Group of nexthops for the list of prefixes. + """ + + bfd: Annotated[ + Optional[VirtualNetworkSpecProtocolsStaticRouteSpecNexthopGroupBfd], + Field( + description="Enables BFD to the next-hops in the group. Local and Remote discriminator parameters have been deprecated at this level. Use Nexthop to set these parameters.", + title="BFD", + ), + ] = None + blackhole: Annotated[ + Optional[bool], + Field( + description="If set to true all traffic destined to the prefixes will be blackholed. If enabled, next-hops are ignored and this takes precedence.", + title="Blackhole", + ), + ] = False + nexthops: Annotated[ + Optional[List[VirtualNetworkSpecProtocolsStaticRouteSpecNexthopGroupNexthop]], + Field(description="Ordered list of nexthops.", title="Nexthops"), + ] = None + resolve: Annotated[ + Optional[bool], + Field( + description="If set to true the next-hops can be destinations which are resolved in the route table.", + title="Resolve", + ), + ] = False + + +class VirtualNetworkSpecProtocolsStaticRouteSpecNexthopGroupBfd(BaseModel): + """ + Enables BFD to the next-hops in the group. Local and Remote discriminator parameters have been deprecated at this level. Use Nexthop to set these parameters. + """ + + enabled: Annotated[ + Optional[bool], + Field( + description="Defines whether BFD should be enabled towards the nexthops.", + title="Enabled", + ), + ] = False + localAddress: Annotated[ + Optional[str], + Field( + description="Defines the local address to use when establishing the BFD session with the nexthop.", + title="Local Address", + ), + ] = None + localDiscriminator: Annotated[ + Optional[int], + Field( + description="Defines the local discriminator.", title="Local Discriminator" + ), + ] = None + remoteDiscriminator: Annotated[ + Optional[int], + Field( + description="Defines the remote discriminator.", + title="Remote Discriminator", + ), + ] = None + + +class VirtualNetworkSpecProtocolsStaticRouteSpecNexthopGroupNexthop(BaseModel): + bfd: Annotated[ + Optional[VirtualNetworkSpecProtocolsStaticRouteSpecNexthopGroupNexthopBfd], + Field( + description="Enables BFD to the next-hops in the group. This overrides the configuration at the group.", + title="BFD", + ), + ] = None + ipPrefix: Annotated[str, Field(description="Address to use.", title="IP Prefix")] + resolve: Annotated[ + Optional[bool], + Field( + description="If set to true the next-hops can be destinations which are resolved in the route table. This overrides the configuration at the group.", + title="Resolve", + ), + ] = False + + +class VirtualNetworkSpecProtocolsStaticRouteSpecNexthopGroupNexthopBfd(BaseModel): + """ + Enables BFD to the next-hops in the group. This overrides the configuration at the group. + """ + + enabled: Annotated[ + Optional[bool], + Field( + description="Defines whether BFD should be enabled towards the nexthops.", + title="Enabled", + ), + ] = False + localAddress: Annotated[ + Optional[str], + Field( + description="Defines the local address to use when establishing the BFD session with the nexthop.", + title="Local Address", + ), + ] = None + localDiscriminator: Annotated[ + Optional[int], + Field( + description="Defines the local discriminator.", title="Local Discriminator" + ), + ] = None + remoteDiscriminator: Annotated[ + Optional[int], + Field( + description="Defines the remote discriminator.", + title="Remote Discriminator", + ), + ] = None + + +class VirtualNetworkSpecRoutedInterface(BaseModel): + name: Annotated[ + str, + Field( + description="The name of the RoutedInterface.", + title="Routed Interface Name", + ), + ] + spec: Annotated[ + VirtualNetworkSpecRoutedInterfaceSpec, + Field( + description="Specification of the RoutedInterface", + title="Routed Interface Spec", + ), + ] + + +class VirtualNetworkSpecRoutedInterfaceSpec(BaseModel): + """ + Specification of the RoutedInterface + """ + + arpTimeout: Annotated[ + Optional[int], + Field( + description="Duration of time that dynamic ARP entries remain in the ARP cache before they expire.", + title="ARP Timeout", + ), + ] = 14400 + bfd: Annotated[ + Optional[VirtualNetworkSpecRoutedInterfaceSpecBfd], + Field( + description="Enables BFD on the RoutedInterface.", title="BFD Configuration" + ), + ] = None + description: Annotated[ + Optional[str], + Field( + description="The description of the RoutedInterface.", title="Description" + ), + ] = None + egress: Annotated[ + Optional[VirtualNetworkSpecRoutedInterfaceSpecEgress], + Field( + description="Manages actions on traffic at Egress.", title="Egress Actions" + ), + ] = None + ingress: Annotated[ + Optional[VirtualNetworkSpecRoutedInterfaceSpecIngress], + Field( + description="Manages actions on traffic at Ingress.", + title="Ingress Actions", + ), + ] = None + interface: Annotated[ + str, + Field( + description="Reference to an Interface to use for attachment.", + title="Interface", + ), + ] + ipMTU: Annotated[ + Optional[int], + Field( + description="IP MTU for the RoutedInterface.", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = 1500 + ipv4Addresses: Annotated[ + Optional[List[VirtualNetworkSpecRoutedInterfaceSpecIpv4Address]], + Field( + description="List of IPv4 addresses in IP/mask form, e.g., 192.168.0.1/24.", + title="IPv4 Addresses", + ), + ] = None + ipv6Addresses: Annotated[ + Optional[List[VirtualNetworkSpecRoutedInterfaceSpecIpv6Address]], + Field( + description="List of IPv6 addresses in IP/mask form, e.g., fc00::1/120.", + title="IPv6 Addresses", + ), + ] = None + ipv6RouterAdvertisement: Annotated[ + Optional[VirtualNetworkSpecRoutedInterfaceSpecIpv6RouterAdvertisement], + Field(title="IPv6 Router Advertisement"), + ] = None + l3ProxyARPND: Annotated[ + Optional[VirtualNetworkSpecRoutedInterfaceSpecL3ProxyARPND], + Field( + description="L3 Proxy ARP and ND configuration.", title="L3 Proxy ARP/ND" + ), + ] = None + learnUnsolicited: Annotated[ + Optional[Literal["BOTH", "GLOBAL", "LINK-LOCAL", "NONE"]], + Field( + description="Enable or disable learning of unsolicited ARPs.", + title="Learn Unsolicited ARPs", + ), + ] = "NONE" + router: Annotated[str, Field(description="Reference to a Router.", title="Router")] + unnumbered: Annotated[ + Optional[Literal["IPV6"]], + Field( + description="Enables the use of unnumbered interfaces on the IRBInterface. If IPv6 is specified, no IP address are configured on the sub-interface and only the link local address will be used. If any IP addresses are specified for either IPv4 or IPv6 that will take precedence and IPs will be assigned to the interfaces. (Deprecated, Use IPv6RouterAdvertisement)", + title="Unnumbered", + ), + ] = None + vlanID: Annotated[ + Optional[str], + Field( + description="Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.", + title="VLAN ID", + ), + ] = "pool" + vlanPool: Annotated[ + Optional[str], + Field( + description="Reference to a VLAN pool to use for allocations.", + title="VLAN Pool", + ), + ] = "vlan-pool" + + +VirtualNetworkSpecRoutedInterfaceSpecBfd = RoutedInterfaceSpecBfd + + +VirtualNetworkSpecRoutedInterfaceSpecEgress = BridgeInterfaceSpecEgress + + +VirtualNetworkSpecRoutedInterfaceSpecIngress = BridgeInterfaceSpecIngress + + +VirtualNetworkSpecRoutedInterfaceSpecIpv4Address = ( + IRBInterfaceStatusInterfaceIpv4Address +) + + +VirtualNetworkSpecRoutedInterfaceSpecIpv6Address = ( + IRBInterfaceStatusInterfaceIpv4Address +) + + +class VirtualNetworkSpecRoutedInterfaceSpecIpv6RouterAdvertisement(BaseModel): + currentHopLimit: Annotated[ + int, + Field( + description="The current hop limit to advertise in the router advertisement messages.", + ge=0, + le=255, + title="Current Hop Limit", + ), + ] + enabled: Annotated[ + bool, + Field( + description="Enable or disable IPv6 router advertisements.", + title="Enable Router Advertisements", + ), + ] + ipMTU: Annotated[ + Optional[int], + Field( + description="The IP MTU to advertise in the router advertisement messages.", + ge=1280, + le=9486, + title="IP MTU", + ), + ] = None + managedConfigurationFlag: Annotated[ + bool, + Field( + description="Enable DHCPv6 for address configuration (M-bit).", + title="Managed Configuration Flag", + ), + ] + maxAdvertisementInterval: Annotated[ + int, + Field( + description="Maximum time between router advertisements (in seconds).", + ge=4, + le=1800, + title="Maximum Advertisement Interval", + ), + ] + minAdvertisementInterval: Annotated[ + int, + Field( + description="Minimum time between router advertisements (in seconds).", + ge=3, + le=1350, + title="Minimum Advertisement Interval", + ), + ] + otherConfigurationFlag: Annotated[ + bool, + Field( + description="Enable DHCPv6 for other configuration (O-bit).", + title="Other Configuration Flag", + ), + ] + prefixes: Annotated[ + Optional[ + List[VirtualNetworkSpecRoutedInterfaceSpecIpv6RouterAdvertisementPrefix] + ], + Field( + description="IPv6 prefixes to advertise in router advertisements.", + title="Prefixes", + ), + ] = None + reachableTime: Annotated[ + Optional[int], + Field( + description="Time in milliseconds for Neighbor Unreachability Detection.", + ge=0, + le=3600000, + title="Reachable Time", + ), + ] = 0 + retransmitTime: Annotated[ + int, + Field( + description="Time in milliseconds between retransmitted NS messages.", + ge=0, + le=1800000, + title="Retransmit Time", + ), + ] + routerLifetime: Annotated[ + int, + Field( + description="Router lifetime in seconds for default gateway.", + ge=0, + le=9000, + title="Router Lifetime", + ), + ] + + +VirtualNetworkSpecRoutedInterfaceSpecIpv6RouterAdvertisementPrefix = ( + IRBInterfaceSpecIpv6RouterAdvertisementPrefix +) + + +VirtualNetworkSpecRoutedInterfaceSpecL3ProxyARPND = IRBInterfaceSpecL3ProxyARPND + + +class VirtualNetworkSpecRouter(BaseModel): + name: Annotated[ + str, Field(description="The name of the Router.", title="Router Name") + ] + spec: Annotated[ + VirtualNetworkSpecRouterSpec, + Field(description="Specification of the Router", title="Router Spec"), + ] + + +class VirtualNetworkSpecRouterSpec(BaseModel): + """ + Specification of the Router + """ + + bgp: Annotated[ + Optional[VirtualNetworkSpecRouterSpecBgp], + Field(description="BGP configuration.", title="BGP Configuration"), + ] = None + description: Annotated[ + Optional[str], + Field(description="The description of the Router.", title="Description"), + ] = None + evi: Annotated[ + Optional[int], + Field( + description="EVI for the Router; leave blank for auto-allocation from EVI pool.", + ge=1, + le=65535, + title="EVI", + ), + ] = None + eviPool: Annotated[ + Optional[str], + Field( + description="Reference to EVI pool for auto-allocation.", + title="EVI Allocation Pool", + ), + ] = "evi-pool" + exportTarget: Annotated[ + Optional[str], + Field( + description="Export route target in 'target:N:N' format, if not specified, the default value taken as \"target:1:\".", + pattern="^target.*$", + title="Export Target", + ), + ] = None + importTarget: Annotated[ + Optional[str], + Field( + description="Import route target in 'target:N:N' format, if not specified, the default value taken as \"target:1:\".", + pattern="^target.*$", + title="Import Target", + ), + ] = None + ipLoadBalancing: Annotated[ + Optional[VirtualNetworkSpecRouterSpecIpLoadBalancing], + Field( + description="IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.", + title="Prefix", + ), + ] = None + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Node selectors for deployment constraints. If Nodes are selected, the Router will only be deployed on the Nodes selected, if left blank it will be deployed on all Nodes for which there are IRB or RoutedInterfaces referencing this Router.", + title="Node Selector", + ), + ] = None + routeLeaking: Annotated[ + Optional[VirtualNetworkSpecRouterSpecRouteLeaking], + Field( + description="Route leaking controlled by routing policies in and out of the DefaultRouter.", + title="Route Leaking", + ), + ] = None + routerID: Annotated[ + Optional[str], Field(description="Router ID.", title="Router ID") + ] = None + tunnelIndexPool: Annotated[ + Optional[str], + Field( + description="Reference to tunnel index allocation pool.", + title="Tunnel Index Pool", + ), + ] = "tunnel-index-pool" + type: Annotated[ + Optional[Literal["SIMPLE", "EVPNVXLAN"]], + Field( + description="Select the type of Router. Simple doesn't include any overlay control plane or dataplane properties (EVPN/VXLAN). EVPNVXLAN includes the properties needed to provision this Router over an IP Fabric.", + title="Type", + ), + ] = "EVPNVXLAN" + vni: Annotated[ + Optional[int], + Field( + description="VNI for the Router; leave blank for auto-allocation from VNI pool.", + ge=1, + le=16777215, + title="VNI", + ), + ] = None + vniPool: Annotated[ + Optional[str], + Field( + description="Reference to VNI pool for auto-allocation.", + title="VNI Allocation Pool", + ), + ] = "vni-pool" + + +class VirtualNetworkSpecRouterSpecBgp(BaseModel): + """ + BGP configuration. + """ + + autonomousSystem: Annotated[ + Optional[int], + Field( + description="Autonomous System number for BGP.", + ge=1, + le=4294967295, + title="Autonomous System", + ), + ] = None + ebgpPreference: Annotated[ + Optional[int], + Field( + description="Preference to be set for eBGP [default=170].", + ge=1, + le=255, + title="eBGP Preference", + ), + ] = 170 + enabled: Annotated[ + Optional[bool], Field(description="Enable or disable BGP.", title="Enable BGP") + ] = False + ibgpPreference: Annotated[ + Optional[int], + Field( + description="Preference to be set for iBGP [default=170].", + ge=1, + le=255, + title="iBGP Preference", + ), + ] = 170 + ipAliasNexthops: Annotated[ + Optional[List[VirtualNetworkSpecRouterSpecBgpIpAliasNexthop]], + Field(description="IP aliasing configuration.", title="IP Alias Nexthops"), + ] = None + ipv4Unicast: Annotated[ + Optional[VirtualNetworkSpecRouterSpecBgpIpv4Unicast], + Field( + description="Parameters relating to the IPv4 unicast AFI/SAFI.", + title="IPv4 Unicast", + ), + ] = None + ipv6Unicast: Annotated[ + Optional[VirtualNetworkSpecRouterSpecBgpIpv6Unicast], + Field( + description="Parameters relating to the IPv6 unicast AFI/SAFI.", + title="IPv6 Unicast", + ), + ] = None + keychain: Annotated[ + Optional[str], + Field(description="Keychain to be used for authentication", title="Keychain"), + ] = None + minWaitToAdvertise: Annotated[ + Optional[int], + Field( + description="Minimum wait time before advertising routes post BGP restart.", + ge=0, + le=3600, + title="Min Wait To Advertise Time", + ), + ] = 0 + rapidWithdrawl: Annotated[ + Optional[bool], + Field( + description="Enable rapid withdrawal in BGP.", + title="Enable Rapid Withdrawal", + ), + ] = True + waitForFIBInstall: Annotated[ + Optional[bool], + Field( + description="Wait for FIB installation before advertising routes.", + title="Wait for FIB Installation", + ), + ] = False + + +VirtualNetworkSpecRouterSpecBgpIpAliasNexthop = RouterSpecBgpIpAliasNexthop + + +class VirtualNetworkSpecRouterSpecBgpIpv4Unicast(BaseModel): + """ + Parameters relating to the IPv4 unicast AFI/SAFI. + """ + + advertiseIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.", + title="Advertise IPv6 Next Hops", + ), + ] = None + enabled: Annotated[ + bool, Field(description="Enables the IPv4 unicast AFISAFI.", title="Enabled") + ] + multipath: Annotated[ + Optional[VirtualNetworkSpecRouterSpecBgpIpv4UnicastMultipath], + Field(description="Enable multipath.", title="Multipath"), + ] = None + receiveIPV6NextHops: Annotated[ + Optional[bool], + Field( + description="Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.", + title="Receive IPv6 Next Hops", + ), + ] = None + + +VirtualNetworkSpecRouterSpecBgpIpv4UnicastMultipath = RouterSpecBgpIpv4UnicastMultipath + + +class VirtualNetworkSpecRouterSpecBgpIpv6Unicast(BaseModel): + """ + Parameters relating to the IPv6 unicast AFI/SAFI. + """ + + enabled: Annotated[ + bool, Field(description="Enables the IPv6 unicast AFISAFI", title="Enabled") + ] + multipath: Annotated[ + Optional[VirtualNetworkSpecRouterSpecBgpIpv6UnicastMultipath], + Field(description="Enable multipath", title="Multipath"), + ] = None + + +VirtualNetworkSpecRouterSpecBgpIpv6UnicastMultipath = RouterSpecBgpIpv6UnicastMultipath + + +class VirtualNetworkSpecRouterSpecIpLoadBalancing(BaseModel): + """ + IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming. + """ + + prefix: Annotated[ + Optional[List[VirtualNetworkSpecRouterSpecIpLoadBalancingPrefixItem]], + Field( + description="IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.", + title="Prefix", + ), + ] = None + + +VirtualNetworkSpecRouterSpecIpLoadBalancingPrefixItem = ( + RouterSpecIpLoadBalancingPrefixItem +) + + +VirtualNetworkSpecRouterSpecRouteLeaking = RouterSpecRouteLeaking + + +class VirtualNetworkSpecVlan(BaseModel): + name: Annotated[str, Field(description="The name of the VLAN.", title="VLAN Name")] + spec: Annotated[ + VirtualNetworkSpecVlanSpec, + Field(description="Specification of the Vlan", title="VLAN Spec"), + ] + + +class VirtualNetworkSpecVlanSpec(BaseModel): + """ + Specification of the Vlan + """ + + bridgeDomain: Annotated[ + str, + Field( + description="Reference to a BridgeDomain or SimpleBridgeDomain.", + title="Bridge Domain", + ), + ] + description: Annotated[ + Optional[str], + Field(description="The description of the VLAN.", title="Description"), + ] = None + egress: Annotated[ + Optional[VirtualNetworkSpecVlanSpecEgress], + Field(description="Manages actions on traffic at Egress.", title="Egress"), + ] = None + ingress: Annotated[ + Optional[VirtualNetworkSpecVlanSpecIngress], + Field(description="Manages actions on traffic at Ingress.", title="Ingress"), + ] = None + interfaceSelector: Annotated[ + List[str], + Field( + description="Interfaces to use for attachment to this VLAN based on the label selector. Selects Interfaces based on their associated labels.", + title="Interface Selector", + ), + ] + l2MTU: Annotated[ + Optional[int], + Field( + description="L2 MTU specifies the maximum sized Ethernet frame that can be transmitted on the subinterface. If a frame exceeds this size it is discarded. If the l2-mtu of the subinterface exceeds the port-mtu of the associated interface, the subinterface will remain operationally down.", + ge=1450, + le=9500, + title="L2 MTU", + ), + ] = None + macDuplicationDetectionAction: Annotated[ + Optional[ + Literal["Blackhole", "OperDown", "StopLearning", "UseBridgeDomainAction"] + ], + Field( + description="If Mac Duplication Detection is enabled on the associated Bridge Domain, this property will override the MDD action set in the BridgeDomain.", + title="MAC Duplication Detection Action", + ), + ] = None + splitHorizonGroup: Annotated[ + Optional[str], + Field( + description="Name of the Split Horizon Group to be used for this VLAN. All subinterfaces within this VLAN will be members of this Split Horizon Group.", + title="Split Horizon Group", + ), + ] = None + uplink: Annotated[ + Optional[VirtualNetworkSpecVlanSpecUplink], + Field( + description="The Uplink between your access breakout switch and your leaf switch.", + title="Uplink", + ), + ] = None + vlanID: Annotated[ + Optional[str], + Field( + description="Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.", + title="VLAN ID", + ), + ] = "pool" + vlanPool: Annotated[ + Optional[str], + Field( + description='Reference to a VLAN pool to use for allocations. [default="vlan-pool"]', + title="VLAN Pool", + ), + ] = None + + +VirtualNetworkSpecVlanSpecEgress = BridgeInterfaceSpecEgress + + +VirtualNetworkSpecVlanSpecIngress = BridgeInterfaceSpecIngress + + +class VirtualNetworkSpecVlanSpecUplink(BaseModel): + """ + The Uplink between your access breakout switch and your leaf switch. + """ + + egress: Annotated[ + Optional[VirtualNetworkSpecVlanSpecUplinkEgress], + Field( + description="Manages actions on traffic at Egress of the Local enpoint of the Uplink.", + title="Egress", + ), + ] = None + ingress: Annotated[ + Optional[VirtualNetworkSpecVlanSpecUplinkIngress], + Field( + description="Manages actions on traffic at Ingress of the Local enpoint of the Uplink.", + title="Ingress", + ), + ] = None + uplinkSelector: Annotated[ + Optional[List[str]], + Field( + description="Selects TopoLinks which connect a leaf switch to a breakout switch. This is the uplink between your access breakout switch and your leaf switch. There can only be a single TopoLink between the access breakout switch and the leaf switch, if more than one TopoLink is present between two devices the transaction will fail.", + title="Uplink Selector", + ), + ] = None + uplinkVLANID: Annotated[ + Optional[str], + Field( + description="The VLAN ID to be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.", + title="Uplink VLAN ID", + ), + ] = "pool" + uplinkVLANPool: Annotated[ + Optional[str], + Field( + description="A VLAN from this pool will be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.", + title="Uplink VLAN Pool", + ), + ] = None + + +VirtualNetworkSpecVlanSpecUplinkEgress = BridgeInterfaceSpecUplinkEgress + + +VirtualNetworkSpecVlanSpecUplinkIngress = BridgeInterfaceSpecUplinkIngress + + +class VirtualNetworkStatus(BaseModel): + health: Annotated[ + Optional[int], + Field(description="Indicates the health score of the VNET.", title="Health"), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score.", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed.", + title="Last Change", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of Nodes on which the Router is deployed.", title="Nodes" + ), + ] = None + numBGPPeers: Annotated[ + Optional[int], + Field( + description="Total number of configured BGP Peers.", + title="Number of BGP Peers", + ), + ] = None + numBGPPeersOperDown: Annotated[ + Optional[int], + Field( + description="Total Number of BGP Peer operationally down.", + title="Number of BGP Peers Oper Down", + ), + ] = None + numIRBInterfaces: Annotated[ + Optional[int], + Field( + description="Total number of irb-interfaces configured by the VNET.", + title="Number of IRB Interfaces", + ), + ] = None + numIRBInterfacesOperDown: Annotated[ + Optional[int], + Field( + description="Total number of irb-interfaces configured by the VNET which are oper-down.", + title="Number of IRB Interfaces Oper Down", + ), + ] = None + numNodes: Annotated[ + Optional[int], + Field( + description="Total number of Nodes on which the VNET is configured.", + title="Number of Nodes", + ), + ] = None + numRoutedInterfaces: Annotated[ + Optional[int], + Field( + description="Total number of routed-interfaces configured by the VNET.", + title="Number of Routed Interfaces", + ), + ] = None + numRoutedInterfacesOperDown: Annotated[ + Optional[int], + Field( + description="Total number of routed-interfaces configured by the VNET which are oper-down.", + title="Number of Routed Interfaces Oper Down", + ), + ] = None + numSubInterfaces: Annotated[ + Optional[int], + Field( + description="Total number of sub-interfaces configured by the VNET.", + title="Number of Sub Interfaces", + ), + ] = None + numSubInterfacesOperDown: Annotated[ + Optional[int], + Field( + description="Total number of sub-interfaces configured by the VNET which are oper-down.", + title="Number of Sub Interfaces Oper Down", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field(description="Operational state of the VNET.", title="Operational State"), + ] = None diff --git a/pydantic_eda/apps/siteinfo/v1alpha1/models.py b/pydantic_eda/apps/siteinfo/v1alpha1/models.py new file mode 100644 index 0000000..93bb911 --- /dev/null +++ b/pydantic_eda/apps/siteinfo/v1alpha1/models.py @@ -0,0 +1,240 @@ +# generated by datamodel-codegen: +# filename: siteinfo.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class Banner(BaseModel): + """ + Banner is the Schema for the banners API + """ + + apiVersion: str + kind: str + metadata: BannerMetadata + spec: Annotated[ + BannerSpec, + Field( + description="BannerSpec allows the configuration of login and MOTD (Message of the Day) banners on selected nodes. The banners can be applied to specific nodes or selected using label selectors.", + title="Specification", + ), + ] + status: Annotated[ + Optional[BannerStatus], + Field( + description="BannerStatus defines the observed state of Banner", + title="Status", + ), + ] = None + + +class BannerDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class BannerDeletedResources(RootModel[List[BannerDeletedResourceEntry]]): + root: List[BannerDeletedResourceEntry] + + +class BannerList(BaseModel): + """ + BannerList is a list of banners + """ + + apiVersion: str + items: Optional[List[Banner]] = None + kind: str + + +class BannerMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class BannerSpec(BaseModel): + """ + BannerSpec allows the configuration of login and MOTD (Message of the Day) banners on selected nodes. The banners can be applied to specific nodes or selected using label selectors. + """ + + loginBanner: Annotated[ + Optional[str], + Field( + description="This is the login banner displayed before a user has logged into the Node.", + title="Login Banner", + ), + ] = None + motd: Annotated[ + Optional[str], + Field( + description="This is the MOTD banner displayed after a user has logged into the Node.", + title="MOTD", + ), + ] = None + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Labe selector to select nodes on which to configure the banners.", + title="Node Selector", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of nodes on which to configure the banners.", + title="Nodes", + ), + ] = None + + +class BannerStatus(BaseModel): + """ + BannerStatus defines the observed state of Banner + """ + + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of nodes this banner has been applied to", title="Nodes" + ), + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/system/v1alpha1/models.py b/pydantic_eda/apps/system/v1alpha1/models.py new file mode 100644 index 0000000..f9630c8 --- /dev/null +++ b/pydantic_eda/apps/system/v1alpha1/models.py @@ -0,0 +1,639 @@ +# generated by datamodel-codegen: +# filename: system.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class Monitor(BaseModel): + """ + Monitor is the Schema for the monitors API + """ + + apiVersion: str + kind: str + metadata: MonitorMetadata + spec: Annotated[ + MonitorSpec, + Field( + description="MonitorSpec defines the desired state of Monitor", + title="Specification", + ), + ] + status: Annotated[ + Optional[MonitorStatus], + Field( + description="MonitorStatus defines the observed state of Monitor", + title="Status", + ), + ] = None + + +class MonitorAggregateState(BaseModel): + """ + MonitorAggregateState is the Schema for the monitoraggregatestates API + """ + + apiVersion: str + kind: str + metadata: MonitorAggregateStateMetadata + spec: Annotated[ + MonitorAggregateStateSpec, + Field( + description="MonitorAggregateStateSpec defines the desired state of MonitorAggregateState", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="MonitorAggregateStateStatus defines the observed state of MonitorAggregateState", + title="Status", + ), + ] = None + + +class MonitorAggregateStateDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class MonitorAggregateStateDeletedResources( + RootModel[List[MonitorAggregateStateDeletedResourceEntry]] +): + root: List[MonitorAggregateStateDeletedResourceEntry] + + +class MonitorAggregateStateList(BaseModel): + """ + MonitorAggregateStateList is a list of monitoraggregatestates + """ + + apiVersion: str + items: Optional[List[MonitorAggregateState]] = None + kind: str + + +class MonitorAggregateStateMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class MonitorAggregateStateSpec(BaseModel): + """ + MonitorAggregateStateSpec defines the desired state of MonitorAggregateState + """ + + nodes: Annotated[ + Optional[List[str]], + Field( + description="List of TopoNodes monitored by this instance", title="Nodes" + ), + ] = None + + +MonitorDeletedResourceEntry = MonitorAggregateStateDeletedResourceEntry + + +class MonitorDeletedResources(RootModel[List[MonitorDeletedResourceEntry]]): + root: List[MonitorDeletedResourceEntry] + + +class MonitorList(BaseModel): + """ + MonitorList is a list of monitors + """ + + apiVersion: str + items: Optional[List[Monitor]] = None + kind: str + + +MonitorMetadata = MonitorAggregateStateMetadata + + +class MonitorSpec(BaseModel): + """ + MonitorSpec defines the desired state of Monitor + """ + + cpu: Annotated[ + Optional[MonitorSpecCpu], + Field( + description="CPU monitoring for targets matching this Monitor.", title="CPU" + ), + ] = None + disk: Annotated[ + Optional[MonitorSpecDisk], + Field( + description="Disk monitoring for targets matching this Monitor.", + title="Disk", + ), + ] = None + memory: Annotated[ + Optional[MonitorSpecMemory], + Field( + description="Memory monitoring for targets matching this Monitor.", + title="Memory", + ), + ] = None + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Selector to use when including TopoNodes to monitor.", + title="Node Selector", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field(description="References to TopoNodes to monitor.", title="Nodes"), + ] = None + + +class MonitorSpecCpu(BaseModel): + """ + CPU monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable CPU monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorSpecCpuUtilization], + Field( + description="Parameters relating to CPU utilization monitoring.", + title="Thresholds", + ), + ] = None + + +class MonitorSpecCpuUtilization(BaseModel): + """ + Parameters relating to CPU utilization monitoring. + """ + + criticalThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.", + ge=1, + le=100, + title="Critical Threshold", + ), + ] = 95 + fallingDelta: Annotated[ + Optional[int], + Field( + description="The delta in which a triggered threshold must drop below to clear an alarm.\nFor example, with a criticalThreshold of 90 and a fallingDelta of 5, the critical alarm will clear when the utilization drops below 85.", + ge=1, + le=25, + title="Falling Delta", + ), + ] = 5 + majorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.", + ge=1, + le=100, + title="Major Threshold", + ), + ] = 90 + minorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a minor alarm.", + ge=1, + le=100, + title="Minor Threshold", + ), + ] = 80 + + +class MonitorSpecDisk(BaseModel): + """ + Disk monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable disk monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorSpecDiskUtilization], + Field( + description="Parameters relating to disk utilization monitoring.", + title="Thresholds", + ), + ] = None + + +class MonitorSpecDiskUtilization(BaseModel): + """ + Parameters relating to disk utilization monitoring. + """ + + criticalThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.", + ge=1, + le=100, + title="Critical Threshold", + ), + ] = 95 + fallingDelta: Annotated[ + Optional[int], + Field( + description="The delta in which a triggered threshold must drop below to clear an alarm.\nFor example, with a criticalThreshold of 90 and a fallingDelta of 5, the critical alarm will clear when the utilization drops below 85.", + ge=1, + le=25, + title="Falling Delta", + ), + ] = 5 + majorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.", + ge=1, + le=100, + title="Major Threshold", + ), + ] = 90 + minorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a minor alarm.", + ge=1, + le=100, + title="Minor Threshold", + ), + ] = 80 + + +class MonitorSpecMemory(BaseModel): + """ + Memory monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable memory monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorSpecMemoryUtilization], + Field( + description="Parameters relating to memory utilization monitoring.", + title="Thresholds", + ), + ] = None + + +class MonitorSpecMemoryUtilization(BaseModel): + """ + Parameters relating to memory utilization monitoring. + """ + + criticalThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.", + ge=1, + le=100, + title="Critical Threshold", + ), + ] = 95 + fallingDelta: Annotated[ + Optional[int], + Field( + description="The delta in which a triggered threshold must drop below to clear an alarm.\nFor example, with a criticalThreshold of 90 and a fallingDelta of 5, the critical alarm will clear when the utilization drops below 85.", + ge=1, + le=25, + title="Falling Delta", + ), + ] = 5 + majorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.", + ge=1, + le=100, + title="Major Threshold", + ), + ] = 90 + minorThreshold: Annotated[ + Optional[int], + Field( + description="The minimum average utilization over the last 1 minute to trigger a minor alarm.", + ge=1, + le=100, + title="Minor Threshold", + ), + ] = 80 + + +class MonitorState(BaseModel): + """ + MonitorState is the Schema for the monitorstates API + """ + + apiVersion: str + kind: str + metadata: MonitorStateMetadata + spec: Annotated[ + MonitorStateSpec, + Field( + description="MonitorStateSpec defines the desired state of MonitorState", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="MonitorStateStatus defines the observed state of MonitorState", + title="Status", + ), + ] = None + + +MonitorStateDeletedResourceEntry = MonitorAggregateStateDeletedResourceEntry + + +class MonitorStateDeletedResources(RootModel[List[MonitorStateDeletedResourceEntry]]): + root: List[MonitorStateDeletedResourceEntry] + + +class MonitorStateList(BaseModel): + """ + MonitorStateList is a list of monitorstates + """ + + apiVersion: str + items: Optional[List[MonitorState]] = None + kind: str + + +MonitorStateMetadata = MonitorAggregateStateMetadata + + +class MonitorStateSpec(BaseModel): + """ + MonitorStateSpec defines the desired state of MonitorState + """ + + monitorSpec: Annotated[ + MonitorStateSpecMonitorSpec, Field(description="The spec of the input Monitor") + ] + node: Annotated[str, Field(description="Reference to the TopoNode being monitored")] + operatingSystem: Annotated[ + str, Field(description="The operating system of the TopoNode being monitored") + ] + version: Annotated[ + str, Field(description="The version of the TopoNode being monitored") + ] + + +class MonitorStateSpecMonitorSpec(BaseModel): + """ + The spec of the input Monitor + """ + + cpu: Annotated[ + Optional[MonitorStateSpecMonitorSpecCpu], + Field( + description="CPU monitoring for targets matching this Monitor.", title="CPU" + ), + ] = None + disk: Annotated[ + Optional[MonitorStateSpecMonitorSpecDisk], + Field( + description="Disk monitoring for targets matching this Monitor.", + title="Disk", + ), + ] = None + memory: Annotated[ + Optional[MonitorStateSpecMonitorSpecMemory], + Field( + description="Memory monitoring for targets matching this Monitor.", + title="Memory", + ), + ] = None + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Selector to use when including TopoNodes to monitor.", + title="Node Selector", + ), + ] = None + nodes: Annotated[ + Optional[List[str]], + Field(description="References to TopoNodes to monitor.", title="Nodes"), + ] = None + + +class MonitorStateSpecMonitorSpecCpu(BaseModel): + """ + CPU monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable CPU monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorStateSpecMonitorSpecCpuUtilization], + Field( + description="Parameters relating to CPU utilization monitoring.", + title="Thresholds", + ), + ] = None + + +MonitorStateSpecMonitorSpecCpuUtilization = MonitorSpecCpuUtilization + + +class MonitorStateSpecMonitorSpecDisk(BaseModel): + """ + Disk monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable disk monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorStateSpecMonitorSpecDiskUtilization], + Field( + description="Parameters relating to disk utilization monitoring.", + title="Thresholds", + ), + ] = None + + +MonitorStateSpecMonitorSpecDiskUtilization = MonitorSpecDiskUtilization + + +class MonitorStateSpecMonitorSpecMemory(BaseModel): + """ + Memory monitoring for targets matching this Monitor. + """ + + enabled: Annotated[ + bool, Field(description="Enable or disable memory monitoring.", title="Enabled") + ] + utilization: Annotated[ + Optional[MonitorStateSpecMonitorSpecMemoryUtilization], + Field( + description="Parameters relating to memory utilization monitoring.", + title="Thresholds", + ), + ] = None + + +MonitorStateSpecMonitorSpecMemoryUtilization = MonitorSpecMemoryUtilization + + +class MonitorStatus(BaseModel): + """ + MonitorStatus defines the observed state of Monitor + """ + + nodes: Annotated[ + Optional[List[str]], + Field(description="TopoNodes being monitored.", title="Nodes"), + ] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/timing/v1alpha1/models.py b/pydantic_eda/apps/timing/v1alpha1/models.py new file mode 100644 index 0000000..e76bb51 --- /dev/null +++ b/pydantic_eda/apps/timing/v1alpha1/models.py @@ -0,0 +1,315 @@ +# generated by datamodel-codegen: +# filename: timing.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Literal, Optional +from pydantic import BaseModel, Field, RootModel +from datetime import date + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class NTPClient(BaseModel): + """ + NTPClient is the Schema for the ntpclients API + """ + + apiVersion: str + kind: str + metadata: NTPClientMetadata + spec: Annotated[ + NTPClientSpec, + Field( + description="The NTP client allows for configuring NTP servers and the source of NTP traffic in order for the devices to synchronize their clocks.", + title="Specification", + ), + ] + status: Annotated[ + Optional[NTPClientStatus], + Field( + description="NTPClientStatus defines the observed state of NTPClient", + title="Status", + ), + ] = None + + +class NTPClientDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + namespace: Optional[str] = None + transactionId: Optional[int] = None + + +class NTPClientDeletedResources(RootModel[List[NTPClientDeletedResourceEntry]]): + root: List[NTPClientDeletedResourceEntry] + + +class NTPClientList(BaseModel): + """ + NTPClientList is a list of ntpclients + """ + + apiVersion: str + items: Optional[List[NTPClient]] = None + kind: str + + +class NTPClientMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: str + + +class NTPClientSpec(BaseModel): + """ + The NTP client allows for configuring NTP servers and the source of NTP traffic in order for the devices to synchronize their clocks. + """ + + router: Annotated[ + Optional[str], + Field(description="Router used to reach the NTP servers.", title="Router"), + ] = None + routerKind: Annotated[ + Literal["MANAGEMENTROUTER", "ROUTER", "DEFAULTROUTER"], + Field( + description="the Kind of the router used to reach the NTP servers.", + title="Router Kind", + ), + ] + routerSelector: Annotated[ + Optional[List[str]], + Field( + description="Selects router resources based on the defined KIND. Applies to DefaultRouter only. Not supported for Router and ManagementRouter.", + title="Router Selector", + ), + ] = None + servers: Annotated[ + List[NTPClientSpecServer], + Field( + description="A list of NTP servers, each entry in the list can either be an IP address or an FQDN.", + title="Servers", + ), + ] + sourceInterface: Annotated[ + Optional[str], + Field( + description="Specifies a Interface resource to use as a source of NTP traffic. If none is specified the Node default behavior is used.", + title="Source Interface", + ), + ] = None + sourceInterfaceKind: Annotated[ + Optional[Literal["IRB", "ROUTED", "DEFAULT", "SYSTEM"]], + Field( + description="Specifies the source interface Kind to use as a source of NTP traffic.", + title="Source Interface Kind", + ), + ] = None + + +class NTPClientSpecServer(BaseModel): + iBurst: Annotated[ + Optional[bool], + Field( + description="Indicates whether this server should enable burst synchronization or not", + title="Enable iBurst", + ), + ] = None + preferred: Annotated[ + Optional[bool], + Field( + description="Indicates whether this server should be preferred or not", + title="Preferred Server", + ), + ] = None + server: Annotated[ + str, + Field( + description="An NTP server can either be an IP address or an FQDN", + title="Server", + ), + ] + + +class NTPClientStatus(BaseModel): + """ + NTPClientStatus defines the observed state of NTPClient + """ + + health: Annotated[ + Optional[int], + Field( + description="Indicates the health score of the NTPClient", + title="Health Score", + ), + ] = None + healthScoreReason: Annotated[ + Optional[str], + Field( + description="Indicates the reason for the health score", + title="Health Score Reason", + ), + ] = None + lastChange: Annotated[ + Optional[date], + Field( + description="The time when the state of the resource last changed", + title="Last Change", + ), + ] = None + nodes: Annotated[ + Optional[List[NTPClientStatusNode]], + Field( + description="List of nodes which are not synchronized", + title="Unsynchronized Nodes", + ), + ] = None + operationalState: Annotated[ + Optional[str], + Field( + description="Operational state of the NTPClient", title="Operational State" + ), + ] = None + + +class NTPClientStatusNode(BaseModel): + node: Annotated[str, Field(description="Reference to Node object", title="Node")] + operatingSystem: Annotated[ + str, Field(description="Operating System of the Node", title="Operating System") + ] + synchronized: Annotated[ + Optional[str], + Field(description="Synchronized state of the Node", title="Synchronized"), + ] = None + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/apps/topologies/v1alpha1/models.py b/pydantic_eda/apps/topologies/v1alpha1/models.py new file mode 100644 index 0000000..b66f0ab --- /dev/null +++ b/pydantic_eda/apps/topologies/v1alpha1/models.py @@ -0,0 +1,1006 @@ +# generated by datamodel-codegen: +# filename: topologies.json + +from __future__ import annotations +from typing import Annotated, Any, Dict, List, Optional +from pydantic import BaseModel, Field, RootModel + + +class AppGroup(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + preferredVersion: Optional[AppGroupVersion] = None + versions: Optional[List[AppGroupVersion]] = None + + +class AppGroupVersion(BaseModel): + groupVersion: Optional[str] = None + version: Optional[str] = None + + +class CPUUtilOverlay(BaseModel): + """ + CPUUtilOverlay is the Schema for the cpuutiloverlays API + """ + + apiVersion: str + kind: str + metadata: CPUUtilOverlayMetadata + spec: Annotated[ + CPUUtilOverlaySpec, + Field( + description="CPUUtilOverlaySpec defines the desired state of CPUUtilOverlay", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="CPUUtilOverlayStatus defines the observed state of CPUUtilOverlay", + title="Status", + ), + ] = None + + +class CPUUtilOverlayDeletedResourceEntry(BaseModel): + commitTime: Optional[str] = None + hash: Optional[str] = None + name: Optional[str] = None + transactionId: Optional[int] = None + + +class CPUUtilOverlayDeletedResources( + RootModel[List[CPUUtilOverlayDeletedResourceEntry]] +): + root: List[CPUUtilOverlayDeletedResourceEntry] + + +class CPUUtilOverlayList(BaseModel): + """ + CPUUtilOverlayList is a list of cpuutiloverlays + """ + + apiVersion: str + items: Optional[List[CPUUtilOverlay]] = None + kind: str + + +class CPUUtilOverlayMetadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + + +class CPUUtilOverlaySpec(BaseModel): + """ + CPUUtilOverlaySpec defines the desired state of CPUUtilOverlay + """ + + enabled: Annotated[ + bool, + Field( + description="Enable or disable the generation of the status of this overlay", + title="Enabled", + ), + ] + topology: Annotated[ + CPUUtilOverlaySpecTopology, + Field( + description="Reference to the topology that this overlay is extending.", + title="Topology", + ), + ] + uiDescription: Annotated[ + Optional[str], + Field( + description="A description of the overlay to expose in the UI", + title="UI Description", + ), + ] = None + uiDescriptionKey: Annotated[ + Optional[str], + Field( + description="The translation key for the description of the overlay to expose in the UI", + title="UI Description Key", + ), + ] = None + uiName: Annotated[ + Optional[str], + Field( + description="The name of the overlay to expose in the UI", title="UI Name" + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description="The translation key for the name of the overlay to expose in the UI", + title="UI Name Key", + ), + ] = None + + +class CPUUtilOverlaySpecTopology(BaseModel): + """ + Reference to the topology that this overlay is extending. + """ + + group: Annotated[ + str, + Field( + description="The group of the application which published the topology this overlay is extending.", + title="Group", + ), + ] + name: Annotated[ + str, + Field( + description="The name of the resource which published the topology this overlay is extending.", + title="Name", + ), + ] + version: Annotated[ + str, + Field( + description="The version of the application which published the topology this overlay is extending.", + title="Version", + ), + ] + + +class DeviationOverlay(BaseModel): + """ + DeviationOverlay is the Schema for the deviationoverlays API + """ + + apiVersion: str + kind: str + metadata: DeviationOverlayMetadata + spec: Annotated[ + DeviationOverlaySpec, + Field( + description="DeviationOverlaySpec defines the desired state of DeviationOverlay", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="DeviationOverlayStatus defines the observed state of DeviationOverlay", + title="Status", + ), + ] = None + + +DeviationOverlayDeletedResourceEntry = CPUUtilOverlayDeletedResourceEntry + + +class DeviationOverlayDeletedResources( + RootModel[List[DeviationOverlayDeletedResourceEntry]] +): + root: List[DeviationOverlayDeletedResourceEntry] + + +class DeviationOverlayList(BaseModel): + """ + DeviationOverlayList is a list of deviationoverlays + """ + + apiVersion: str + items: Optional[List[DeviationOverlay]] = None + kind: str + + +DeviationOverlayMetadata = CPUUtilOverlayMetadata + + +class DeviationOverlaySpec(BaseModel): + """ + DeviationOverlaySpec defines the desired state of DeviationOverlay + """ + + enabled: Annotated[ + bool, + Field( + description="Enable or disable the generation of the status of this overlay", + title="Enabled", + ), + ] + topology: Annotated[ + DeviationOverlaySpecTopology, + Field( + description="Reference to the topology that this overlay is extending.", + title="Topology", + ), + ] + uiDescription: Annotated[ + Optional[str], + Field( + description="A description of the overlay to expose in the UI", + title="UI Description", + ), + ] = None + uiDescriptionKey: Annotated[ + Optional[str], + Field( + description="The translation key for the description of the overlay to expose in the UI", + title="UI Description Key", + ), + ] = None + uiName: Annotated[ + Optional[str], + Field( + description="The name of the overlay to expose in the UI", title="UI Name" + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description="The translation key for the name of the overlay to expose in the UI", + title="UI Name Key", + ), + ] = None + + +DeviationOverlaySpecTopology = CPUUtilOverlaySpecTopology + + +class DiskOverlay(BaseModel): + """ + DiskOverlay is the Schema for the diskoverlays API + """ + + apiVersion: str + kind: str + metadata: DiskOverlayMetadata + spec: Annotated[ + DiskOverlaySpec, + Field( + description="DiskOverlaySpec defines the desired state of DiskOverlay", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="DiskOverlayStatus defines the observed state of DiskOverlay", + title="Status", + ), + ] = None + + +DiskOverlayDeletedResourceEntry = CPUUtilOverlayDeletedResourceEntry + + +class DiskOverlayDeletedResources(RootModel[List[DiskOverlayDeletedResourceEntry]]): + root: List[DiskOverlayDeletedResourceEntry] + + +class DiskOverlayList(BaseModel): + """ + DiskOverlayList is a list of diskoverlays + """ + + apiVersion: str + items: Optional[List[DiskOverlay]] = None + kind: str + + +DiskOverlayMetadata = CPUUtilOverlayMetadata + + +class DiskOverlaySpec(BaseModel): + """ + DiskOverlaySpec defines the desired state of DiskOverlay + """ + + enabled: Annotated[ + bool, + Field( + description="Enable or disable the generation of the status of this overlay", + title="Enabled", + ), + ] + topology: Annotated[ + DiskOverlaySpecTopology, + Field( + description="Reference to the topology that this overlay is extending.", + title="Topology", + ), + ] + uiDescription: Annotated[ + Optional[str], + Field( + description="A description of the overlay to expose in the UI", + title="UI Description", + ), + ] = None + uiDescriptionKey: Annotated[ + Optional[str], + Field( + description="The translation key for the description of the overlay to expose in the UI", + title="UI Description Key", + ), + ] = None + uiName: Annotated[ + Optional[str], + Field( + description="The name of the overlay to expose in the UI", title="UI Name" + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description="The translation key for the name of the overlay to expose in the UI", + title="UI Name Key", + ), + ] = None + + +DiskOverlaySpecTopology = CPUUtilOverlaySpecTopology + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class LldpOverlay(BaseModel): + """ + LldpOverlay is the Schema for the lldpoverlays API + """ + + apiVersion: str + kind: str + metadata: LldpOverlayMetadata + spec: Annotated[ + LldpOverlaySpec, + Field( + description="LldpOverlaySpec defines the desired state of lldp", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="LldpOverlayStatus defines the observed state of LldpOverlay", + title="Status", + ), + ] = None + + +LldpOverlayDeletedResourceEntry = CPUUtilOverlayDeletedResourceEntry + + +class LldpOverlayDeletedResources(RootModel[List[LldpOverlayDeletedResourceEntry]]): + root: List[LldpOverlayDeletedResourceEntry] + + +class LldpOverlayList(BaseModel): + """ + LldpOverlayList is a list of lldpoverlays + """ + + apiVersion: str + items: Optional[List[LldpOverlay]] = None + kind: str + + +LldpOverlayMetadata = CPUUtilOverlayMetadata + + +class LldpOverlaySpec(BaseModel): + """ + LldpOverlaySpec defines the desired state of lldp + """ + + enabled: Annotated[ + bool, + Field( + description="Enable or disable the generation of the status of this overlay", + title="Enabled", + ), + ] + topology: Annotated[ + LldpOverlaySpecTopology, + Field( + description="Reference to the topology that this overlay is extending.", + title="Topology", + ), + ] + uiDescription: Annotated[ + Optional[str], + Field( + description="A description of the overlay to expose in the UI", + title="UI Description", + ), + ] = None + uiDescriptionKey: Annotated[ + Optional[str], + Field( + description="The translation key for the description of the overlay to expose in the UI", + title="UI Description Key", + ), + ] = None + uiName: Annotated[ + Optional[str], + Field( + description="The name of the overlay to expose in the UI", title="UI Name" + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description="The translation key for the name of the overlay to expose in the UI", + title="UI Name Key", + ), + ] = None + + +LldpOverlaySpecTopology = CPUUtilOverlaySpecTopology + + +class MemoryOverlay(BaseModel): + """ + MemoryOverlay is the Schema for the memoryoverlays API + """ + + apiVersion: str + kind: str + metadata: MemoryOverlayMetadata + spec: Annotated[ + MemoryOverlaySpec, + Field( + description="MemoryOverlaySpec defines the desired state of MemoryOverlay", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="MemoryOverlayStatus defines the observed state of MemoryOverlay", + title="Status", + ), + ] = None + + +MemoryOverlayDeletedResourceEntry = CPUUtilOverlayDeletedResourceEntry + + +class MemoryOverlayDeletedResources(RootModel[List[MemoryOverlayDeletedResourceEntry]]): + root: List[MemoryOverlayDeletedResourceEntry] + + +class MemoryOverlayList(BaseModel): + """ + MemoryOverlayList is a list of memoryoverlays + """ + + apiVersion: str + items: Optional[List[MemoryOverlay]] = None + kind: str + + +MemoryOverlayMetadata = CPUUtilOverlayMetadata + + +class MemoryOverlaySpec(BaseModel): + """ + MemoryOverlaySpec defines the desired state of MemoryOverlay + """ + + enabled: Annotated[ + bool, + Field( + description="Enable or disable the generation of the status of this overlay", + title="Enabled", + ), + ] + topology: Annotated[ + MemoryOverlaySpecTopology, + Field( + description="Reference to the topology that this overlay is extending.", + title="Topology", + ), + ] + uiDescription: Annotated[ + Optional[str], + Field( + description="A description of the overlay to expose in the UI", + title="UI Description", + ), + ] = None + uiDescriptionKey: Annotated[ + Optional[str], + Field( + description="The translation key for the description of the overlay to expose in the UI", + title="UI Description Key", + ), + ] = None + uiName: Annotated[ + Optional[str], + Field( + description="The name of the overlay to expose in the UI", title="UI Name" + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description="The translation key for the name of the overlay to expose in the UI", + title="UI Name Key", + ), + ] = None + + +MemoryOverlaySpecTopology = CPUUtilOverlaySpecTopology + + +class Patch(RootModel[List[K8SPatchOp]]): + root: List[K8SPatchOp] + + +class Resource(BaseModel): + kind: Optional[str] = None + name: Optional[str] = None + namespaced: Optional[bool] = None + readOnly: Optional[bool] = None + singularName: Optional[str] = None + uiCategory: Optional[str] = None + + +class ResourceHistory(RootModel[List[ResourceHistoryEntry]]): + root: List[ResourceHistoryEntry] + + +class ResourceHistoryEntry(BaseModel): + author: Optional[str] = None + changeType: Optional[str] = None + commitTime: Optional[str] = None + hash: Optional[str] = None + message: Optional[str] = None + transactionId: Optional[int] = None + + +class ResourceList(BaseModel): + apiVersion: Optional[str] = None + groupVersion: Optional[str] = None + kind: Optional[str] = None + resources: Optional[List[Resource]] = None + + +class Status(BaseModel): + apiVersion: Optional[str] = None + details: Optional[StatusDetails] = None + kind: Optional[str] = None + string: Optional[str] = None + + +class StatusDetails(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + name: Optional[str] = None + + +class Topology(BaseModel): + """ + Topology is the Schema for the topologies API + """ + + apiVersion: str + kind: str + metadata: TopologyMetadata + spec: Annotated[ + TopologySpec, + Field( + description="TopologySpec defines the desired state of Topology", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="TopologyStatus defines the observed state of Topology", + title="Status", + ), + ] = None + + +TopologyDeletedResourceEntry = CPUUtilOverlayDeletedResourceEntry + + +class TopologyDeletedResources(RootModel[List[TopologyDeletedResourceEntry]]): + root: List[TopologyDeletedResourceEntry] + + +class TopologyGrouping(BaseModel): + """ + TopologyGrouping is the Schema for the topologygroupings API + """ + + apiVersion: str + kind: str + metadata: TopologyGroupingMetadata + spec: Annotated[ + TopologyGroupingSpec, + Field( + description="TopologyGroupingSpec defines the desired state of TopologyGrouping", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="TopologyGroupingStatus defines the observed state of TopologyGrouping", + title="Status", + ), + ] = None + + +TopologyGroupingDeletedResourceEntry = CPUUtilOverlayDeletedResourceEntry + + +class TopologyGroupingDeletedResources( + RootModel[List[TopologyGroupingDeletedResourceEntry]] +): + root: List[TopologyGroupingDeletedResourceEntry] + + +class TopologyGroupingList(BaseModel): + """ + TopologyGroupingList is a list of topologygroupings + """ + + apiVersion: str + items: Optional[List[TopologyGrouping]] = None + kind: str + + +TopologyGroupingMetadata = CPUUtilOverlayMetadata + + +class TopologyGroupingSpec(BaseModel): + """ + TopologyGroupingSpec defines the desired state of TopologyGrouping + """ + + groupSelectors: Annotated[ + Optional[List[TopologyGroupingSpecGroupSelector]], + Field( + description="The set of selectors for assigning nodes to groups", + title="Group Selectors", + ), + ] = None + tierSelectors: Annotated[ + Optional[List[TopologyGroupingSpecTierSelector]], + Field( + description="The set of selectors for assigning nodes to tiers", + title="Tier Selectors", + ), + ] = None + uiDescription: Annotated[ + Optional[str], + Field( + description="A description of the topology grouping to expose in the UI", + title="UI Description", + ), + ] = None + uiDescriptionKey: Annotated[ + Optional[str], + Field( + description="The translation key for the description of the topology grouping to expose in the UI", + title="UI Description Key", + ), + ] = None + uiName: Annotated[ + Optional[str], + Field( + description="The name of the topology grouping to expose in the UI", + title="UI Name", + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description="The translation key for the name of the topology grouping to expose in the UI", + title="UI Name Key", + ), + ] = None + + +class TopologyGroupingSpecGroupSelector(BaseModel): + group: Annotated[ + str, + Field( + description="The group to assign to nodes that match the selector.", + title="Group", + ), + ] + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector to use to match nodes that should be assigned to this group.", + title="Node Selector", + ), + ] = None + + +class TopologyGroupingSpecTierSelector(BaseModel): + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description="Label selector to use to match nodes that should be assigned to this tier.", + title="Node Selector", + ), + ] = None + tier: Annotated[ + int, + Field( + description="The tier to assign to nodes that match the selector.", + title="Tier", + ), + ] + + +class TopologyList(BaseModel): + """ + TopologyList is a list of topologies + """ + + apiVersion: str + items: Optional[List[Topology]] = None + kind: str + + +TopologyMetadata = CPUUtilOverlayMetadata + + +class TopologySpec(BaseModel): + """ + TopologySpec defines the desired state of Topology + """ + + enabled: Annotated[ + bool, + Field( + description="Enable or disable the generation of the status of this topology", + title="Enabled", + ), + ] + endpointSubtitle: Annotated[ + Optional[str], + Field( + description="Override the subtitle to show for endpoints in the topology", + title="Endpoint Subtitle", + ), + ] = None + linkSubtitle: Annotated[ + Optional[str], + Field( + description="Override the subtitle to show for links in the topology", + title="Link Subtitle", + ), + ] = None + nodeSubtitle: Annotated[ + Optional[str], + Field( + description="Override the subtitle to show for nodes in the topology", + title="Node Subtitle", + ), + ] = None + overlays: Annotated[ + List[TopologySpecOverlay], + Field( + description="The set of overlays supported with this topology", + title="Overlays", + ), + ] + uiDescription: Annotated[ + Optional[str], + Field( + description="A description of the topology to expose in the UI", + title="UI Description", + ), + ] = None + uiDescriptionKey: Annotated[ + Optional[str], + Field( + description="The translation key for the description of the topology to expose in the UI", + title="UI Description Key", + ), + ] = None + uiName: Annotated[ + Optional[str], + Field( + description="The name of the topology to expose in the UI", title="UI Name" + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description="The translation key for the name of the topology to expose in the UI", + title="UI Name Key", + ), + ] = None + + +class TopologySpecOverlay(BaseModel): + enabled: Annotated[ + bool, + Field( + description="Enable or disable the generation of the status of this overlay", + title="Enabled", + ), + ] + key: Annotated[ + str, + Field( + description="A unique key for identifying this overlay within the topology. This is used internally\nonly.", + title="Key", + ), + ] + + +class TrafficRateOverlay(BaseModel): + """ + TrafficRateOverlay is the Schema for the trafficrateoverlays API + """ + + apiVersion: str + kind: str + metadata: TrafficRateOverlayMetadata + spec: Annotated[ + TrafficRateOverlaySpec, + Field( + description="TrafficRateOverlaySpec defines the desired state of TrafficRateOverlay", + title="Specification", + ), + ] + status: Annotated[ + Optional[Dict[str, Any]], + Field( + description="TrafficRateOverlayStatus defines the observed state of TrafficRateOverlay", + title="Status", + ), + ] = None + + +TrafficRateOverlayDeletedResourceEntry = CPUUtilOverlayDeletedResourceEntry + + +class TrafficRateOverlayDeletedResources( + RootModel[List[TrafficRateOverlayDeletedResourceEntry]] +): + root: List[TrafficRateOverlayDeletedResourceEntry] + + +class TrafficRateOverlayList(BaseModel): + """ + TrafficRateOverlayList is a list of trafficrateoverlays + """ + + apiVersion: str + items: Optional[List[TrafficRateOverlay]] = None + kind: str + + +TrafficRateOverlayMetadata = CPUUtilOverlayMetadata + + +class TrafficRateOverlaySpec(BaseModel): + """ + TrafficRateOverlaySpec defines the desired state of TrafficRateOverlay + """ + + enabled: Annotated[ + bool, + Field( + description="Enable or disable the generation of the status of this overlay", + title="Enabled", + ), + ] + topology: Annotated[ + TrafficRateOverlaySpecTopology, + Field( + description="Reference to the topology that this overlay is extending.", + title="Topology", + ), + ] + uiDescription: Annotated[ + Optional[str], + Field( + description="A description of the overlay to expose in the UI", + title="UI Description", + ), + ] = None + uiDescriptionKey: Annotated[ + Optional[str], + Field( + description="The translation key for the description of the overlay to expose in the UI", + title="UI Description Key", + ), + ] = None + uiName: Annotated[ + Optional[str], + Field( + description="The name of the overlay to expose in the UI", title="UI Name" + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description="The translation key for the name of the overlay to expose in the UI", + title="UI Name Key", + ), + ] = None + + +TrafficRateOverlaySpecTopology = CPUUtilOverlaySpecTopology + + +class UIResult(RootModel[str]): + root: str diff --git a/pydantic_eda/com/__init__.py b/pydantic_eda/com/__init__.py deleted file mode 100644 index f4ab115..0000000 --- a/pydantic_eda/com/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/topologies.eda.nokia.com/v1alpha1/topologies.json -# timestamp: 2025-05-07T11:44:28+00:00 diff --git a/pydantic_eda/com/nokia/__init__.py b/pydantic_eda/com/nokia/__init__.py deleted file mode 100644 index f4ab115..0000000 --- a/pydantic_eda/com/nokia/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/topologies.eda.nokia.com/v1alpha1/topologies.json -# timestamp: 2025-05-07T11:44:28+00:00 diff --git a/pydantic_eda/com/nokia/eda/__init__.py b/pydantic_eda/com/nokia/eda/__init__.py deleted file mode 100644 index f4ab115..0000000 --- a/pydantic_eda/com/nokia/eda/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/topologies.eda.nokia.com/v1alpha1/topologies.json -# timestamp: 2025-05-07T11:44:28+00:00 diff --git a/pydantic_eda/com/nokia/eda/aaa/__init__.py b/pydantic_eda/com/nokia/eda/aaa/__init__.py deleted file mode 100644 index 326a232..0000000 --- a/pydantic_eda/com/nokia/eda/aaa/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/aaa.eda.nokia.com/v1alpha1/aaa.json -# timestamp: 2025-05-07T11:43:10+00:00 diff --git a/pydantic_eda/com/nokia/eda/aaa/v1alpha1.py b/pydantic_eda/com/nokia/eda/aaa/v1alpha1.py deleted file mode 100644 index 2d845bf..0000000 --- a/pydantic_eda/com/nokia/eda/aaa/v1alpha1.py +++ /dev/null @@ -1,135 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/aaa.eda.nokia.com/v1alpha1/aaa.json -# timestamp: 2025-05-07T11:43:10+00:00 - -from __future__ import annotations - -from typing import Annotated, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Rule(BaseModel): - action: Annotated[ - Literal['Deny', 'ReadWrite', 'Read'], - Field(description='Set the action for this entry.', title='Action'), - ] - match: Annotated[ - Optional[str], - Field( - description='Set the match for this entry. This is a string to match input against - for example "interface" for srl or "configure port" for sros.\nRules here should be specified in the target specific format.', - title='Match', - ), - ] = None - operatingSystem: Annotated[ - Literal['srl', 'sros'], - Field( - description='Operating system to match against for this rule.\nOperating system to deploy this rule to.', - title='Operating System', - ), - ] - - -class Tacacs(BaseModel): - privilegeLevel: Annotated[ - Optional[int], - Field( - description='Set the privilege level for this group.', - ge=0, - le=15, - title='Privilege Level', - ), - ] = None - - -class Spec(BaseModel): - groupName: Annotated[ - Optional[str], - Field( - description='Set the local name for this group. If not provided, the resource name will be used.', - title='Group Name', - ), - ] = None - rules: Annotated[ - Optional[List[Rule]], Field(description='Rules for this group.', title='Rules') - ] = None - services: Annotated[ - List[ - Literal[ - 'CLI', - 'FTP', - 'GNMI', - 'GNOI', - 'GNSI', - 'GRIBI', - 'Reflection', - 'JSON-RPC', - 'NETCONF', - ] - ], - Field(description='Enabled services for this group', title='Services'), - ] - superuser: Annotated[ - Optional[bool], - Field(description='Make members of this group superusers.', title='Superuser'), - ] = None - tacacs: Annotated[ - Optional[Tacacs], Field(description='TACACS configuration.', title='TACACS') - ] = None - - -class Status(BaseModel): - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of TopoNodes group has been deployed to.', title='Nodes' - ), - ] = None - - -class NodeGroupDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class NodeGroupDeletedResources(RootModel[List[NodeGroupDeletedResourceEntry]]): - root: List[NodeGroupDeletedResourceEntry] - - -class NodeGroupMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class NodeGroup(BaseModel): - apiVersion: str - kind: str - metadata: NodeGroupMetadata - spec: Annotated[ - Spec, - Field( - description='NodeGroup is a representation of a group on a node, including the services it has access to, any RBAC, and TACACS configuration.\nNodeGroups are deployed to nodes by NodeUser or other permission-consuming resources.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field(description='Deployment status of this NodeGroup.', title='Status'), - ] = None - - -class NodeGroupList(BaseModel): - apiVersion: str - items: Optional[List[NodeGroup]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/aifabrics/__init__.py b/pydantic_eda/com/nokia/eda/aifabrics/__init__.py deleted file mode 100644 index 91fde3e..0000000 --- a/pydantic_eda/com/nokia/eda/aifabrics/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/aifabrics.eda.nokia.com/v1alpha1/aifabrics.json -# timestamp: 2025-05-07T11:43:13+00:00 diff --git a/pydantic_eda/com/nokia/eda/aifabrics/v1alpha1.py b/pydantic_eda/com/nokia/eda/aifabrics/v1alpha1.py deleted file mode 100644 index b4920bb..0000000 --- a/pydantic_eda/com/nokia/eda/aifabrics/v1alpha1.py +++ /dev/null @@ -1,341 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/aifabrics.eda.nokia.com/v1alpha1/aifabrics.json -# timestamp: 2025-05-07T11:43:13+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Dict, List, Optional - -from pydantic import BaseModel, Field, RootModel - - -class GpuIsolationGroup(BaseModel): - interfaceSelector: Annotated[List[str], Field(title='Interface Selector')] - name: Annotated[ - str, Field(description='Name of the IsolationGroup.', title='Isolation Group') - ] - - -class Rocev2QoS(BaseModel): - ecnMaxDropProbabilityPercent: Annotated[ - int, - Field( - description='If the queue depth is between min and max threshold then this the probability with which packets are dropped or marked.', - title='ECN Max Drop Probability Percent', - ), - ] - ecnSlopeMaxThresholdPercent: Annotated[ - int, - Field( - description='The maximum threshold parameter for a RED-managed queue in percent. When the average queue length exceeds the max value, all packets are dropped (or marked if ECN is enabled). Mutually exclusive with min-threshold and max-threshold.', - title='ECN Max Threshold Percent', - ), - ] - ecnSlopeMinThresholdPercent: Annotated[ - int, - Field( - description='The mininum threshold parameter for a RED-managed queue in percent. When the average queue length is less than min, all packets are admitted to the queue. Mutually exclusive with min-threshold and max-threshold.', - title='ECN Min Threshold Percent', - ), - ] - pfcDeadlockDetectionTimer: Annotated[ - int, - Field( - description='Number of milliseconds during which outgoing interface is receiving pfc-pause-frames before triggering recovery-timer.', - title='PFC Deadlock Detection Timer', - ), - ] - pfcDeadlockRecoveryTimer: Annotated[ - int, - Field( - description='Number of milliseconds during which the pfc-pause-frames will be ignored.', - title='PFC Deadlock Recovery Timer', - ), - ] - queueMaximumBurstSize: Annotated[ - int, - Field( - description='Maximum amount of shared buffer memory available to the queue in bytes.', - ge=0, - le=4294967295, - title='Maximum Burst Size', - ), - ] - - -class StripeConnector(BaseModel): - asnPool: Annotated[ - Optional[str], - Field( - description='Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations.', - title='Autonomous System Pool', - ), - ] = None - linkSelector: Annotated[ - List[str], - Field( - description='Selects TopoLinks to include in this AI Fabric, the selected TopoLinks will be used to create ISLs between the stripe connector devices and the leaf devices.', - title='Link Selector', - ), - ] - name: Annotated[ - str, - Field( - description='The name of the Stripe Connector.', - title='Stripe Connector Name', - ), - ] - nodeSelector: Annotated[ - List[str], - Field( - description='Node selector to select the nodes to be used for this stripe connector.', - title='Node Selector', - ), - ] - systemPoolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces for the stripe connector devices. If not specified, the system will use the default IPAllocationPool.', - title='IPv4 Pool - System IP', - ), - ] = None - - -class Stripe(BaseModel): - asnPool: Annotated[ - Optional[str], - Field( - description='Optional reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. If left blank, ASN allocation will be done from the ASNAllocationRange.', - title='Autonomous System Pool', - ), - ] = None - gpuVlan: Annotated[ - int, - Field( - description='The VLAN used on interfaces facing the GPU servers.', - title='GPU VLAN', - ), - ] - name: Annotated[ - str, Field(description='The name of the Stripe.', title='Stripe Name') - ] - nodeSelector: Annotated[ - List[str], - Field( - description='Node selector to select the nodes to be used for this stripe.', - title='Node Selector', - ), - ] - stripeID: Annotated[ - int, Field(description='Unique ID for a stripe', title='Stripe ID') - ] - systemPoolIPV4: Annotated[ - Optional[str], - Field( - description='Optional reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. If left blank, system IP allocation will be done from the SystemIPV4Subnet.', - title='IPv4 Pool - System IP', - ), - ] = None - - -class Spec(BaseModel): - asnPool: Annotated[ - Optional[str], - Field( - description='Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol.', - title='Autonomous System Pool', - ), - ] = None - gpuIsolationGroups: Annotated[ - List[GpuIsolationGroup], - Field( - description='GPU Isolation Groups are used to isolate GPU traffic over the network, GPUs in different GPU isolation groups will not be able to communicate with each other. If all GPUs across all stripes need to be able to communicate with each other, create a single GPUIsolationGroup selecting all GPU facing interfaces.', - title='GPU Isolation Groups', - ), - ] - rocev2QoS: Annotated[ - Rocev2QoS, - Field( - description='Set of properties to configure the RoCEv2 QoS.', - title='RoCEv2 QoS', - ), - ] - stripeConnector: Annotated[ - Optional[StripeConnector], - Field( - description='StripeConnector is the spine layer interconnecting multiple stripes.', - title='Stripe Connector', - ), - ] = None - stripes: Annotated[ - List[Stripe], - Field( - description='A list of stripes, stripes contain a set of nodes (rails).', - title='Stripes', - ), - ] - systemPoolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. If specified under the Leaf/Spine/Superspine/Borderleaf those will take precedence.', - title='IPv4 Pool - System IP', - ), - ] = None - - -class StripeConnectorNode(BaseModel): - node: Annotated[ - Optional[str], Field(description='Name of the TopoNode.', title='Node') - ] = None - operatingSystem: Annotated[ - Optional[str], - Field( - description='Operating system running on the node.', - title='Operating System', - ), - ] = None - operatingSystemVersion: Annotated[ - Optional[str], - Field( - description='Operating system version running on the node.', - title='Operating System Version', - ), - ] = None - - -class StripeConnectorModel(BaseModel): - name: Annotated[ - Optional[str], - Field( - description='The name of the Stripe Connector.', - title='Stripe Connector Name', - ), - ] = None - stripeConnectorNodes: Annotated[ - Optional[List[StripeConnectorNode]], - Field( - description='List of stripe connector nodes in the Stripe.', - title='Leaf Nodes', - ), - ] = None - - -class LeafNode(BaseModel): - node: Annotated[ - Optional[str], Field(description='Name of the TopoNode.', title='Node') - ] = None - operatingSystem: Annotated[ - Optional[str], - Field( - description='Operating system running on the node.', - title='Operating System', - ), - ] = None - operatingSystemVersion: Annotated[ - Optional[str], - Field( - description='Operating system version running on the node.', - title='Operating System Version', - ), - ] = None - - -class StripeModel(BaseModel): - leafNodes: Annotated[ - Optional[List[LeafNode]], - Field(description='List of leaf nodes in the Stripe.', title='Leaf Nodes'), - ] = None - name: Annotated[ - Optional[str], Field(description='The name of the Stripe.', title='Stripe Name') - ] = None - - -class Status(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the Fabric. The health score of the Fabric is determined by the aggregate health score of the resources emited by the Fabric such as ISL, DefaultRouteReflectors etc.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the Fabric. The operational state of the fabric is determined by monitoring the operational state of the following resources (if applicable): DefaultRouters, ISLs.', - title='Operational State', - ), - ] = None - stripeConnector: Annotated[ - Optional[StripeConnectorModel], - Field(description='Stripe connector in the Backend.', title='Stripe Connector'), - ] = None - stripes: Annotated[ - Optional[List[StripeModel]], - Field(description='List of stripes in the Backend.', title='Stripes'), - ] = None - - -class BackendDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class BackendDeletedResources(RootModel[List[BackendDeletedResourceEntry]]): - root: List[BackendDeletedResourceEntry] - - -class BackendMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Backend(BaseModel): - apiVersion: str - kind: str - metadata: BackendMetadata - spec: Annotated[ - Spec, - Field( - description='BackendSpec defines the desired state of Backend', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='BackendStatus defines the observed state of Backend', - title='Status', - ), - ] = None - - -class BackendList(BaseModel): - apiVersion: str - items: Optional[List[Backend]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/appstore/__init__.py b/pydantic_eda/com/nokia/eda/appstore/__init__.py deleted file mode 100644 index 79ff041..0000000 --- a/pydantic_eda/com/nokia/eda/appstore/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/appstore.eda.nokia.com/v1/appstore.json -# timestamp: 2025-05-07T11:43:16+00:00 diff --git a/pydantic_eda/com/nokia/eda/appstore/v1.py b/pydantic_eda/com/nokia/eda/appstore/v1.py deleted file mode 100644 index 0d3a971..0000000 --- a/pydantic_eda/com/nokia/eda/appstore/v1.py +++ /dev/null @@ -1,241 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/appstore.eda.nokia.com/v1/appstore.json -# timestamp: 2025-05-07T11:43:16+00:00 - -from __future__ import annotations - -from datetime import datetime -from typing import Annotated, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Spec(BaseModel): - authSecretRef: Annotated[ - Optional[str], - Field( - description='AuthSecretRef is the authentication secret reference, used for authentication.\nMust be in the same namespace as the catalog.', - title='Authentication Secret Reference', - ), - ] = None - description: Annotated[ - Optional[str], - Field( - description='Description is an optional short description of the catalog.', - max_length=70, - title='Description', - ), - ] = None - refreshInterval: Annotated[ - Optional[int], - Field( - description='RefreshInterval tells the controller how often it should check the remote catalog for new updates, in seconds.\nDefault is 180 seconds. Minimum is 30 seconds for production environments; 10 seconds for test environments.', - title='Refresh Interval', - ), - ] = 180 - remoteType: Annotated[ - Optional[Literal['git']], - Field( - description="RemoteType type of the catalog, only 'git' is supported at the moment.", - title='Remote Type', - ), - ] = 'git' - remoteURL: Annotated[ - Optional[str], - Field( - description="RemoteURL is the HTTP(S) remote URL of the catalog. Supported URI schemes: 'https://' and 'http://'.\nDefault is HTTPS if no scheme is given.", - title='Remote URL', - ), - ] = None - skipTLSVerify: Annotated[ - Optional[bool], - Field( - description="SkipTLSVerify skips the validity check for the server's certificate. This will make HTTPS connections insecure.", - title='Skip TLS Verify', - ), - ] = False - title: Annotated[ - Optional[str], - Field( - description='Title is an UI-friendly name for the catalog.', - max_length=50, - title='Title', - ), - ] = None - - -class Status(BaseModel): - error: Annotated[ - Optional[str], - Field( - description='Error denotes the last error that was encountered by the controller.', - title='Error', - ), - ] = None - lastRefreshTime: Annotated[ - Optional[datetime], - Field( - description='LastRefreshTime is the last attempt to refresh the catalog cache by the controller.', - title='Last Refresh Time', - ), - ] = None - operational: Annotated[ - Optional[bool], - Field( - description='Operational reports whether the catalog remote is operational.', - title='Operational', - ), - ] = False - - -class CatalogDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class CatalogDeletedResources(RootModel[List[CatalogDeletedResourceEntry]]): - root: List[CatalogDeletedResourceEntry] - - -class CatalogMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class SpecModel(BaseModel): - authSecretRef: Annotated[ - Optional[str], - Field( - description='AuthSecretRef is the authentication secret reference, used for authentication.\nMust be in the same namespace as the catalog.', - title='Authentication Secret Reference', - ), - ] = None - mirror: Annotated[ - Optional[str], - Field( - description='Mirror registry of the original remote registry.\nApp store will use the mirror instead of the original registry that is referenced by a catalog.', - title='Mirror', - ), - ] = None - remoteURL: Annotated[ - str, - Field( - description="RemoteURL is the remote URL of the registry. Supported URI schemes: 'https://' and 'http://'.\n\tDefault is HTTPS if no scheme is given.", - title='Remote URL', - ), - ] - skipTLSVerify: Annotated[ - Optional[bool], - Field( - description='Skip TLS Verification on connection', title='Skip TLS Verify' - ), - ] = False - title: Annotated[ - Optional[str], - Field( - description='Title is an UI-friendly name for the catalog.', - max_length=50, - title='Title', - ), - ] = None - - -class Status1Model(BaseModel): - error: Annotated[ - str, - Field( - description='Error denotes the last error that was encountered by the controller.', - title='Error', - ), - ] - reachable: Annotated[ - Optional[bool], - Field( - description='Reachable indicates if the registry is reachable.', - title='Reachable', - ), - ] = False - - -class RegistryDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class RegistryDeletedResources(RootModel[List[RegistryDeletedResourceEntry]]): - root: List[RegistryDeletedResourceEntry] - - -class RegistryMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class Catalog(BaseModel): - apiVersion: str - kind: str - metadata: CatalogMetadata - spec: Annotated[ - Spec, - Field( - description='CatalogSpec defines the desired state of a Catalog.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='CatalogStatus defines the observed state of a Catalog.', - title='Status', - ), - ] = None - - -class CatalogList(BaseModel): - apiVersion: str - items: Optional[List[Catalog]] = None - kind: str - - -class Registry(BaseModel): - apiVersion: str - kind: str - metadata: RegistryMetadata - spec: Annotated[ - SpecModel, - Field( - description='RegistrySpec defines the desired state of a Registry', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model], - Field( - description='RegistryStatus defines the observed state of Registry', - title='Status', - ), - ] = None - - -class RegistryList(BaseModel): - apiVersion: str - items: Optional[List[Registry]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/bootstrap/__init__.py b/pydantic_eda/com/nokia/eda/bootstrap/__init__.py deleted file mode 100644 index ef36cb5..0000000 --- a/pydantic_eda/com/nokia/eda/bootstrap/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/bootstrap.eda.nokia.com/v1alpha1/bootstrap.json -# timestamp: 2025-05-07T11:43:19+00:00 diff --git a/pydantic_eda/com/nokia/eda/bootstrap/v1alpha1.py b/pydantic_eda/com/nokia/eda/bootstrap/v1alpha1.py deleted file mode 100644 index a0a5166..0000000 --- a/pydantic_eda/com/nokia/eda/bootstrap/v1alpha1.py +++ /dev/null @@ -1,184 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/bootstrap.eda.nokia.com/v1alpha1/bootstrap.json -# timestamp: 2025-05-07T11:43:19+00:00 - -from __future__ import annotations - -from typing import Annotated, Any, Dict, List, Optional - -from pydantic import BaseModel, Field, RootModel - - -class StaticRoute(BaseModel): - nextHop: Annotated[ - Optional[str], Field(description='Static route next hop.', title='Next Hop') - ] = None - prefix: Annotated[ - Optional[str], Field(description='Static route prefix.', title='Prefix') - ] = None - - -class Mgmt(BaseModel): - ipMTU: Annotated[ - Optional[int], - Field(description='Set the management interface IP MTU.', title='IP MTU'), - ] = None - ipv4DHCP: Annotated[ - Optional[bool], - Field(description='Enable IPv4 DHCP client.', title='IPv4 DHCP Client'), - ] = None - ipv6DHCP: Annotated[ - Optional[bool], - Field(description='Enable IPv6 DHCP client.', title='IPv6 DHCP Client'), - ] = None - staticRoutes: Annotated[ - Optional[List[StaticRoute]], - Field( - description='Optional list of static routes to add to the management network instance as part of the initial configuration.', - title='Static Routes', - ), - ] = None - - -class Spec(BaseModel): - commitSave: Annotated[ - Optional[bool], - Field( - description='Save a startup configuration after each commit.', - title='Commit Save', - ), - ] = None - mgmt: Annotated[ - Optional[Mgmt], - Field( - description='Optional management interface settings.\nAllows setting DHCP clients or static IPs as well as\nthe IP MTU.', - title='Mgmt', - ), - ] = None - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Optional node selectors to perform initial configuration for.\nIf not provided initialization is performed for all nodes.', - title='Node Selector', - ), - ] = None - - -class InitDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class InitDeletedResources(RootModel[List[InitDeletedResourceEntry]]): - root: List[InitDeletedResourceEntry] - - -class InitMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel(BaseModel): - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Selects TopoNodes on which to configure the management VRF. When left empty, all TopoNodes are selected.', - title='Node Selector', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of TopoNodes on which to configure the management VRF. When left empty, all TopoNodes are selected.', - title='Nodes', - ), - ] = None - - -class ManagementRouterDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class ManagementRouterDeletedResources( - RootModel[List[ManagementRouterDeletedResourceEntry]] -): - root: List[ManagementRouterDeletedResourceEntry] - - -class ManagementRouterMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Init(BaseModel): - apiVersion: str - kind: str - metadata: InitMetadata - spec: Annotated[ - Spec, - Field( - description='InitSpec defines the desired state of Init', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='InitStatus defines the observed state of Init', title='Status' - ), - ] = None - - -class InitList(BaseModel): - apiVersion: str - items: Optional[List[Init]] = None - kind: str - - -class ManagementRouter(BaseModel): - apiVersion: str - kind: str - metadata: ManagementRouterMetadata - spec: Annotated[ - SpecModel, - Field( - description='ManagementRouterSpec defines the desired state of ManagementRouter', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='ManagementRouterStatus defines the observed state of ManagementRouter', - title='Status', - ), - ] = None - - -class ManagementRouterList(BaseModel): - apiVersion: str - items: Optional[List[ManagementRouter]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/components/__init__.py b/pydantic_eda/com/nokia/eda/components/__init__.py deleted file mode 100644 index 23d8f34..0000000 --- a/pydantic_eda/com/nokia/eda/components/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/components.eda.nokia.com/v1/components.json -# timestamp: 2025-05-07T11:43:26+00:00 diff --git a/pydantic_eda/com/nokia/eda/components/v1.py b/pydantic_eda/com/nokia/eda/components/v1.py deleted file mode 100644 index d76bd2a..0000000 --- a/pydantic_eda/com/nokia/eda/components/v1.py +++ /dev/null @@ -1,1213 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/components.eda.nokia.com/v1/components.json -# timestamp: 2025-05-07T11:43:26+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Child(BaseModel): - name: Annotated[ - Optional[str], Field(description='Reference to a child component', title='Name') - ] = None - type: Annotated[ - Optional[ - Literal[ - 'Fan', - 'FanTray', - 'PowerSupply', - 'PowerModule', - 'PowerShelf', - 'InterfaceModule', - 'ControlModule', - 'FabricModule', - 'Chassis', - 'Transceiver', - ] - ], - Field(description='Type of the child component', title='Type'), - ] = None - - -class Status(BaseModel): - chassisMacAddress: Annotated[ - Optional[str], - Field(description='MAC Address of the Chassis', title='Chassis MAC Address'), - ] = None - children: Annotated[ - Optional[List[Child]], - Field(description='References to children components', title='Children'), - ] = None - commonLanguageEquipmentIdentifier: Annotated[ - Optional[str], - Field(description='The CLEI code of this component', title='CLEI Code'), - ] = None - lastBooted: Annotated[ - Optional[date], - Field( - description='The date and time this component last booted', - title='Last Booted', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The date and time this component last changed operational state', - title='Last Change', - ), - ] = None - manufacturedDate: Annotated[ - Optional[date], - Field( - description='The date this component was manufactured', - title='Manufactured Date', - ), - ] = None - operationalState: Annotated[ - Optional[Literal['Up', 'Down', 'Rebooting', 'Unknown', 'Starting', 'Empty']], - Field( - description='Indicates the current operational state of this component.', - title='Operational State', - ), - ] = None - partNumber: Annotated[ - Optional[str], - Field( - description='The discovered part number of this component', - title='Part Number', - ), - ] = None - removable: Annotated[ - Optional[bool], - Field( - description='Indicates if this component is removable', title='Removable' - ), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='The discovered serial number of this component', - title='Serial Number', - ), - ] = None - target: Annotated[ - Optional[str], - Field(description='Target this component resides on.', title='Target'), - ] = None - type: Annotated[ - Optional[str], - Field(description='Component type, as provided by the target', title='Type'), - ] = None - - -class ChassisMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Spec(BaseModel): - node: Annotated[ - str, - Field( - description='TopologyNode this Component resides on.\nIndicates the operation in which to apply the configuration', - title='Node', - ), - ] - slot: Annotated[ - Optional[str], - Field( - description='Slot this Component resides in, unset for Components that do not have a slot or ID.', - title='Slot', - ), - ] = None - type: Annotated[ - Literal[ - 'Fan', - 'FanTray', - 'PowerSupply', - 'PowerModule', - 'PowerShelf', - 'InterfaceModule', - 'ControlModule', - 'FabricModule', - 'Chassis', - 'Transceiver', - ], - Field(description='Type of Component.', title='Type'), - ] - - -class Status1Model(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='The administrative status of this Component.', title='Enabled' - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The date and time this Component last changed operational state', - title='Last Change', - ), - ] = None - manufacturedDate: Annotated[ - Optional[date], - Field( - description='The date this Component was manufactured', - title='Manufactured Date', - ), - ] = None - operationalState: Annotated[ - Optional[Literal['Up', 'Down', 'Rebooting', 'Unknown', 'Starting', 'Empty']], - Field( - description='Indicates the current operational state of this Component.', - title='Operational State', - ), - ] = None - partNumber: Annotated[ - Optional[str], - Field( - description='The discovered part number of this Component', - title='Part Number', - ), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='The discovered serial number of this Component', - title='Serial Number', - ), - ] = None - type: Annotated[ - Optional[str], - Field(description='Component type, as provided by the node.', title='Type'), - ] = None - - -class ComponentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Temperature(BaseModel): - alarmState: Annotated[ - Optional[bool], - Field( - description='The temperature alarm state, as reported by the component', - title='Alarm State', - ), - ] = None - instant: Annotated[ - Optional[int], - Field(description='The current temperature of this component', title='Instant'), - ] = None - margin: Annotated[ - Optional[int], - Field(description='The margin temperature of this component', title='Margin'), - ] = None - maximum: Annotated[ - Optional[int], - Field(description='The maximum temperature of this component', title='Maximum'), - ] = None - threshold: Annotated[ - Optional[int], - Field( - description='The threshold temperature of this component', title='Threshold' - ), - ] = None - - -class Status1Model1(BaseModel): - commonLanguageEquipmentIdentifier: Annotated[ - Optional[str], - Field(description='The CLEI code of this component', title='CLEI Code'), - ] = None - lastBooted: Annotated[ - Optional[date], - Field( - description='The date and time this component last booted', - title='Last Booted', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The date and time this component last changed operational state', - title='Last Change', - ), - ] = None - locatorEnabled: Annotated[ - Optional[bool], - Field( - description='Indicates if the locator LED for the component is active', - title='Locator Enabled', - ), - ] = None - manufacturedDate: Annotated[ - Optional[date], - Field( - description='The date this component was manufactured', - title='Manufactured Date', - ), - ] = None - operationalState: Annotated[ - Optional[Literal['Up', 'Down', 'Rebooting', 'Unknown', 'Starting', 'Empty']], - Field( - description='Indicates the current operational state of this component.', - title='Operational State', - ), - ] = None - parent: Annotated[ - Optional[str], - Field(description='Reference to a parent component', title='Parent'), - ] = None - parentType: Annotated[ - Optional[ - Literal[ - 'Fan', - 'FanTray', - 'PowerSupply', - 'PowerModule', - 'PowerShelf', - 'InterfaceModule', - 'ControlModule', - 'FabricModule', - 'Chassis', - 'Transceiver', - ] - ], - Field(description='Type of the parent component', title='Parent Type'), - ] = None - partNumber: Annotated[ - Optional[str], - Field( - description='The discovered part number of this component', - title='Part Number', - ), - ] = None - removable: Annotated[ - Optional[bool], - Field( - description='Indicates if this component is removable', title='Removable' - ), - ] = None - role: Annotated[ - Optional[Literal['Active', 'Standby']], - Field(description='Role of the control module', title='Role'), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='The discovered serial number of this component', - title='Serial Number', - ), - ] = None - slot: Annotated[ - Optional[str], - Field( - description='Slot this component resides in, unset for components that do not have a slot or ID', - title='Slot', - ), - ] = None - softwareVersion: Annotated[ - Optional[str], - Field( - description='Version string of the software running on this component', - title='Software Version', - ), - ] = None - target: Annotated[ - Optional[str], - Field(description='Target this component resides on.', title='Target'), - ] = None - temperature: Annotated[ - Optional[Temperature], - Field( - description='Temperature information for this component', - title='Temperature', - ), - ] = None - type: Annotated[ - Optional[str], - Field(description='Component type, as provided by the target', title='Type'), - ] = None - - -class ControlModuleMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Status1Model2(BaseModel): - commonLanguageEquipmentIdentifier: Annotated[ - Optional[str], - Field(description='The CLEI code of this component', title='CLEI Code'), - ] = None - lastBooted: Annotated[ - Optional[date], - Field( - description='The date and time this component last booted', - title='Last Booted', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The date and time this component last changed operational state', - title='Last Change', - ), - ] = None - locatorEnabled: Annotated[ - Optional[bool], - Field( - description='Indicates if the locator LED for the component is active', - title='Locator Enabled', - ), - ] = None - manufacturedDate: Annotated[ - Optional[date], - Field( - description='The date this component was manufactured', - title='Manufactured Date', - ), - ] = None - operationalState: Annotated[ - Optional[Literal['Up', 'Down', 'Rebooting', 'Unknown', 'Starting', 'Empty']], - Field( - description='Indicates the current operational state of this component.', - title='Operational State', - ), - ] = None - parent: Annotated[ - Optional[str], - Field(description='Reference to a parent component', title='Parent'), - ] = None - parentType: Annotated[ - Optional[ - Literal[ - 'Fan', - 'FanTray', - 'PowerSupply', - 'PowerModule', - 'PowerShelf', - 'InterfaceModule', - 'ControlModule', - 'FabricModule', - 'Chassis', - 'Transceiver', - ] - ], - Field(description='Type of the parent component', title='Parent Type'), - ] = None - partNumber: Annotated[ - Optional[str], - Field( - description='The discovered part number of this component', - title='Part Number', - ), - ] = None - removable: Annotated[ - Optional[bool], - Field( - description='Indicates if this component is removable', title='Removable' - ), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='The discovered serial number of this component', - title='Serial Number', - ), - ] = None - slot: Annotated[ - Optional[str], - Field( - description='Slot this component resides in, unset for components that do not have a slot or ID', - title='Slot', - ), - ] = None - softwareVersion: Annotated[ - Optional[str], - Field( - description='Version string of the software running on this component', - title='Software Version', - ), - ] = None - target: Annotated[ - Optional[str], - Field(description='Target this component resides on.', title='Target'), - ] = None - temperature: Annotated[ - Optional[Temperature], - Field( - description='Temperature information for this component', - title='Temperature', - ), - ] = None - type: Annotated[ - Optional[str], - Field(description='Component type, as provided by the target', title='Type'), - ] = None - - -class FabricModuleMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Status1Model3(BaseModel): - commonLanguageEquipmentIdentifier: Annotated[ - Optional[str], - Field(description='The CLEI code of this component', title='CLEI Code'), - ] = None - lastBooted: Annotated[ - Optional[date], - Field( - description='The date and time this component last booted', - title='Last Booted', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The date and time this component last changed operational state', - title='Last Change', - ), - ] = None - locatorEnabled: Annotated[ - Optional[bool], - Field( - description='Indicates if the locator LED for the component is active', - title='Locator Enabled', - ), - ] = None - manufacturedDate: Annotated[ - Optional[date], - Field( - description='The date this component was manufactured', - title='Manufactured Date', - ), - ] = None - operationalState: Annotated[ - Optional[Literal['Up', 'Down', 'Rebooting', 'Unknown', 'Starting', 'Empty']], - Field( - description='Indicates the current operational state of this component.', - title='Operational State', - ), - ] = None - parent: Annotated[ - Optional[str], - Field(description='Reference to a parent component', title='Parent'), - ] = None - parentType: Annotated[ - Optional[ - Literal[ - 'Fan', - 'FanTray', - 'PowerSupply', - 'PowerModule', - 'PowerShelf', - 'InterfaceModule', - 'ControlModule', - 'FabricModule', - 'Chassis', - 'Transceiver', - ] - ], - Field(description='Type of the parent component', title='Parent Type'), - ] = None - partNumber: Annotated[ - Optional[str], - Field( - description='The discovered part number of this component', - title='Part Number', - ), - ] = None - removable: Annotated[ - Optional[bool], - Field( - description='Indicates if this component is removable', title='Removable' - ), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='The discovered serial number of this component', - title='Serial Number', - ), - ] = None - slot: Annotated[ - Optional[str], - Field( - description='Slot this component resides in, unset for components that do not have a slot or ID', - title='Slot', - ), - ] = None - target: Annotated[ - Optional[str], - Field(description='Target this component resides on.', title='Target'), - ] = None - type: Annotated[ - Optional[str], - Field(description='Component type, as provided by the target', title='Type'), - ] = None - - -class FanMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Status1Model4(BaseModel): - commonLanguageEquipmentIdentifier: Annotated[ - Optional[str], - Field(description='The CLEI code of this component', title='CLEI Code'), - ] = None - lastBooted: Annotated[ - Optional[date], - Field( - description='The date and time this component last booted', - title='Last Booted', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The date and time this component last changed operational state', - title='Last Change', - ), - ] = None - locatorEnabled: Annotated[ - Optional[bool], - Field( - description='Indicates if the locator LED for the component is active', - title='Locator Enabled', - ), - ] = None - manufacturedDate: Annotated[ - Optional[date], - Field( - description='The date this component was manufactured', - title='Manufactured Date', - ), - ] = None - operationalState: Annotated[ - Optional[Literal['Up', 'Down', 'Rebooting', 'Unknown', 'Starting', 'Empty']], - Field( - description='Indicates the current operational state of this component.', - title='Operational State', - ), - ] = None - parent: Annotated[ - Optional[str], - Field(description='Reference to a parent component', title='Parent'), - ] = None - parentType: Annotated[ - Optional[ - Literal[ - 'Fan', - 'FanTray', - 'PowerSupply', - 'PowerModule', - 'PowerShelf', - 'InterfaceModule', - 'ControlModule', - 'FabricModule', - 'Chassis', - 'Transceiver', - ] - ], - Field(description='Type of the parent component', title='Parent Type'), - ] = None - partNumber: Annotated[ - Optional[str], - Field( - description='The discovered part number of this component', - title='Part Number', - ), - ] = None - removable: Annotated[ - Optional[bool], - Field( - description='Indicates if this component is removable', title='Removable' - ), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='The discovered serial number of this component', - title='Serial Number', - ), - ] = None - slot: Annotated[ - Optional[str], - Field( - description='Slot this component resides in, unset for components that do not have a slot or ID', - title='Slot', - ), - ] = None - softwareVersion: Annotated[ - Optional[str], - Field( - description='Version string of the software running on this component', - title='Software Version', - ), - ] = None - target: Annotated[ - Optional[str], - Field(description='Target this component resides on.', title='Target'), - ] = None - temperature: Annotated[ - Optional[Temperature], - Field( - description='Temperature information for this component', - title='Temperature', - ), - ] = None - type: Annotated[ - Optional[str], - Field(description='Component type, as provided by the target', title='Type'), - ] = None - - -class InterfaceModuleMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Utilization(BaseModel): - criticalThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.', - ge=1, - le=100, - title='Critical Threshold', - ), - ] = 95 - fallingDelta: Annotated[ - Optional[int], - Field( - description='The delta in which a triggered threshold must drop below to clear an alarm.\nFor example, with a criticalThreshold of 90 and a fallingDelta of 5, the critical alarm will clear when the utilization drops below 85.', - ge=1, - le=25, - title='Falling Delta', - ), - ] = 5 - majorThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.', - ge=1, - le=100, - title='Major Threshold', - ), - ] = 90 - minorThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a minor alarm.', - ge=1, - le=100, - title='Minor Threshold', - ), - ] = 80 - - -class Cpu(BaseModel): - enabled: Annotated[ - bool, Field(description='Enable or disable CPU monitoring.', title='Enabled') - ] - utilization: Annotated[ - Optional[Utilization], - Field( - description='Parameters relating to CPU utilization monitoring.', - title='Thresholds', - ), - ] = None - - -class Memory(BaseModel): - enabled: Annotated[ - bool, Field(description='Enable or disable memory monitoring.', title='Enabled') - ] - utilization: Annotated[ - Optional[Utilization], - Field( - description='Parameters relating to memory utilization monitoring.', - title='Thresholds', - ), - ] = None - - -class Volume(BaseModel): - enabled: Annotated[ - bool, Field(description='Enable or disable volume monitoring.', title='Enabled') - ] - utilization: Annotated[ - Optional[Utilization], - Field( - description='Parameters relating to volume utilization monitoring.', - title='Thresholds', - ), - ] = None - - -class SpecModel(BaseModel): - cpu: Annotated[ - Optional[Cpu], - Field( - description='CPU monitoring for targets matching this Monitor.', title='CPU' - ), - ] = None - memory: Annotated[ - Optional[Memory], - Field( - description='Memory monitoring for targets matching this Monitor.', - title='Memory', - ), - ] = None - targetSelector: Annotated[ - Optional[List[str]], - Field( - description='Selector to use when including targets to monitor.', - title='Target Selector', - ), - ] = None - targets: Annotated[ - Optional[List[str]], - Field(description='References to targets to monitor.', title='Targets'), - ] = None - volume: Annotated[ - Optional[Volume], - Field( - description='Volume monitoring for targets matching this Monitor.', - title='Volume', - ), - ] = None - - -class Status1Model5(BaseModel): - targets: Annotated[ - Optional[List[str]], - Field(description='Targets being monitored.', title='Targets'), - ] = None - - -class MonitorDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class MonitorDeletedResources(RootModel[List[MonitorDeletedResourceEntry]]): - root: List[MonitorDeletedResourceEntry] - - -class MonitorMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel1(BaseModel): - foo: Annotated[ - str, - Field( - description='INSERT ADDITIONAL SPEC FIELDS - define desired state of cluster\nImportant: Run "edabuilder generate" to regenerate code after modifying this file' - ), - ] - - -class Status1Model6(BaseModel): - commonLanguageEquipmentIdentifier: Annotated[ - Optional[str], - Field(description='The CLEI code of this component', title='CLEI Code'), - ] = None - lastBooted: Annotated[ - Optional[date], - Field( - description='The date and time this component last booted', - title='Last Booted', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The date and time this component last changed operational state', - title='Last Change', - ), - ] = None - locatorEnabled: Annotated[ - Optional[bool], - Field( - description='Indicates if the locator LED for the component is active', - title='Locator Enabled', - ), - ] = None - manufacturedDate: Annotated[ - Optional[date], - Field( - description='The date this component was manufactured', - title='Manufactured Date', - ), - ] = None - operationalState: Annotated[ - Optional[Literal['Up', 'Down', 'Rebooting', 'Unknown', 'Starting', 'Empty']], - Field( - description='Indicates the current operational state of this component.', - title='Operational State', - ), - ] = None - parent: Annotated[ - Optional[str], - Field(description='Reference to a parent component', title='Parent'), - ] = None - parentType: Annotated[ - Optional[ - Literal[ - 'Fan', - 'FanTray', - 'PowerSupply', - 'PowerModule', - 'PowerShelf', - 'InterfaceModule', - 'ControlModule', - 'FabricModule', - 'Chassis', - 'Transceiver', - ] - ], - Field(description='Type of the parent component', title='Parent Type'), - ] = None - partNumber: Annotated[ - Optional[str], - Field( - description='The discovered part number of this component', - title='Part Number', - ), - ] = None - removable: Annotated[ - Optional[bool], - Field( - description='Indicates if this component is removable', title='Removable' - ), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='The discovered serial number of this component', - title='Serial Number', - ), - ] = None - slot: Annotated[ - Optional[str], - Field( - description='Slot this component resides in, unset for components that do not have a slot or ID', - title='Slot', - ), - ] = None - softwareVersion: Annotated[ - Optional[str], - Field( - description='Version string of the software running on this component', - title='Software Version', - ), - ] = None - target: Annotated[ - Optional[str], - Field(description='Target this component resides on.', title='Target'), - ] = None - temperature: Annotated[ - Optional[Temperature], - Field( - description='Temperature information for this component', - title='Temperature', - ), - ] = None - type: Annotated[ - Optional[str], - Field(description='Component type, as provided by the target', title='Type'), - ] = None - - -class PowerSupplyMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Chassis(BaseModel): - apiVersion: str - kind: str - metadata: ChassisMetadata - spec: Annotated[ - Dict[str, Any], - Field( - description='ChassisSpec defines the desired state of Chassis', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='ChassisStatus defines the observed state of Chassis', - title='Status', - ), - ] = None - - -class ChassisList(BaseModel): - apiVersion: str - items: Optional[List[Chassis]] = None - kind: str - - -class Component(BaseModel): - apiVersion: str - kind: str - metadata: ComponentMetadata - spec: Annotated[ - Spec, - Field( - description='ComponentSpec defines the desired state of Component', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model], - Field( - description='ComponentStatus defines the observed state of Component', - title='Status', - ), - ] = None - - -class ComponentList(BaseModel): - apiVersion: str - items: Optional[List[Component]] = None - kind: str - - -class ControlModule(BaseModel): - apiVersion: str - kind: str - metadata: ControlModuleMetadata - spec: Annotated[ - Dict[str, Any], - Field( - description='ControlModuleSpec defines the desired state of ControlModule', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model1], - Field( - description='ControlModuleStatus defines the observed state of ControlModule', - title='Status', - ), - ] = None - - -class ControlModuleList(BaseModel): - apiVersion: str - items: Optional[List[ControlModule]] = None - kind: str - - -class FabricModule(BaseModel): - apiVersion: str - kind: str - metadata: FabricModuleMetadata - spec: Annotated[ - Dict[str, Any], - Field( - description='FabricModuleSpec defines the desired state of FabricModule', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model2], - Field( - description='FabricModuleStatus defines the observed state of FabricModule', - title='Status', - ), - ] = None - - -class FabricModuleList(BaseModel): - apiVersion: str - items: Optional[List[FabricModule]] = None - kind: str - - -class Fan(BaseModel): - apiVersion: str - kind: str - metadata: FanMetadata - spec: Annotated[ - Dict[str, Any], - Field( - description='FanSpec defines the desired state of Fan', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model3], - Field( - description='FanStatus defines the observed state of Fan', title='Status' - ), - ] = None - - -class FanList(BaseModel): - apiVersion: str - items: Optional[List[Fan]] = None - kind: str - - -class InterfaceModule(BaseModel): - apiVersion: str - kind: str - metadata: InterfaceModuleMetadata - spec: Annotated[ - Dict[str, Any], - Field( - description='InterfaceModuleSpec defines the desired state of InterfaceModule', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model4], - Field( - description='InterfaceModuleStatus defines the observed state of InterfaceModule', - title='Status', - ), - ] = None - - -class InterfaceModuleList(BaseModel): - apiVersion: str - items: Optional[List[InterfaceModule]] = None - kind: str - - -class Monitor(BaseModel): - apiVersion: str - kind: str - metadata: MonitorMetadata - spec: Annotated[ - SpecModel, - Field( - description='MonitorSpec defines the desired state of Monitor', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model5], - Field( - description='MonitorStatus defines the observed state of Monitor', - title='Status', - ), - ] = None - - -class MonitorList(BaseModel): - apiVersion: str - items: Optional[List[Monitor]] = None - kind: str - - -class PowerSupply(BaseModel): - apiVersion: str - kind: str - metadata: PowerSupplyMetadata - spec: Annotated[ - SpecModel1, - Field( - description='PowerSupplySpec defines the desired state of PowerSupply', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model6], - Field( - description='PowerSupplyStatus defines the observed state of PowerSupply', - title='Status', - ), - ] = None - - -class PowerSupplyList(BaseModel): - apiVersion: str - items: Optional[List[PowerSupply]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/components/v1alpha1.py b/pydantic_eda/com/nokia/eda/components/v1alpha1.py deleted file mode 100644 index b9688b0..0000000 --- a/pydantic_eda/com/nokia/eda/components/v1alpha1.py +++ /dev/null @@ -1,173 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v24.12.1/apps/components.eda.nokia.com/v1alpha1/components.json -# timestamp: 2025-01-29T15:18:35+00:00 - -from __future__ import annotations - -from datetime import date -from typing import List, Literal, Optional - -from pydantic import BaseModel, Field -from typing_extensions import Annotated - -from ..... import Metadata - - -class Spec(BaseModel): - node: Annotated[ - str, - Field( - description='TopologyNode this Component resides on.\nIndicates the operation in which to apply the configuration', - title='Node', - ), - ] - slot: Annotated[ - Optional[str], - Field( - description='Slot this Component resides in, unset for Components that do not have a slot or ID.', - title='Slot', - ), - ] = None - type: Annotated[ - Literal[ - 'FanTray', - 'PowerSupply', - 'LineCard', - 'Control', - 'Fabric', - 'Chassis', - 'Transceiver', - ], - Field(description='Type of Component.', title='Type'), - ] - - -class Status(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='The administrative status of this Component.', title='Enabled' - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The date and time this Component last changed operational state', - title='Last Change', - ), - ] = None - manufacturedDate: Annotated[ - Optional[date], - Field( - description='The date this Component was manufactured', - title='Manufactured Date', - ), - ] = None - operationalState: Annotated[ - Optional[Literal['Up', 'Down', 'Rebooting', 'Unknown', 'Starting', 'Empty']], - Field( - description='Indicates the current operational state of this Component.', - title='Operational State', - ), - ] = None - partNumber: Annotated[ - Optional[str], - Field( - description='The discovered part number of this Component', - title='Part Number', - ), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='The discovered serial number of this Component', - title='Serial Number', - ), - ] = None - type: Annotated[ - Optional[str], - Field(description='Component type, as provided by the node.', title='Type'), - ] = None - - -class Component(BaseModel): - apiVersion: str - kind: str - metadata: Metadata - spec: Annotated[ - Spec, - Field( - description='ComponentSpec defines the desired state of Component', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='ComponentStatus defines the observed state of Component', - title='Status', - ), - ] = None - - -class ComponentList(BaseModel): - apiVersion: str - items: Optional[List[Component]] = None - kind: str - - -class SpecModel(BaseModel): - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Selector to use when selecting TopoNodes to discover components for.', - title='Node Selector', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field(description=' TopoNodes to discover components for.', title='Nodes'), - ] = None - operatingSystem: Annotated[ - Optional[str], - Field( - description='Operating system to match against when selecting TopoNodes', - title='Operating System', - ), - ] = None - - -class Status1Model(BaseModel): - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of TopoNodes component discovery is running for', - title='Nodes', - ), - ] = None - - -class Discovery(BaseModel): - apiVersion: str - kind: str - metadata: Metadata - spec: Annotated[ - SpecModel, - Field( - description='DiscoverySpec defines the desired state of Discovery', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model], - Field( - description='DiscoveryStatus defines the observed state of Discovery', - title='Status', - ), - ] = None - - -class DiscoveryList(BaseModel): - apiVersion: str - items: Optional[List[Discovery]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/config/__init__.py b/pydantic_eda/com/nokia/eda/config/__init__.py deleted file mode 100644 index f67e2ad..0000000 --- a/pydantic_eda/com/nokia/eda/config/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/config.eda.nokia.com/v1alpha1/config.json -# timestamp: 2025-05-07T11:43:29+00:00 diff --git a/pydantic_eda/com/nokia/eda/config/v1alpha1.py b/pydantic_eda/com/nokia/eda/config/v1alpha1.py deleted file mode 100644 index d45a39b..0000000 --- a/pydantic_eda/com/nokia/eda/config/v1alpha1.py +++ /dev/null @@ -1,137 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/config.eda.nokia.com/v1alpha1/config.json -# timestamp: 2025-05-07T11:43:29+00:00 - -from __future__ import annotations - -from typing import Annotated, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Config(BaseModel): - config: Annotated[ - str, - Field( - description='JSON-formatted string representing the configuration to apply.', - title='Configuration', - ), - ] - operation: Annotated[ - Literal['Create', 'Update', 'Delete'], - Field( - description='Indicates the operation in which to apply the configuration.', - title='Operation', - ), - ] - path: Annotated[ - str, - Field( - description='Path to apply the configuration in jspath notation, including any keys if relevant, e.g. .system.information.', - title='Path', - ), - ] - - -class Spec(BaseModel): - configs: Annotated[ - List[Config], - Field( - description='Configurations to apply, being sets of paths, operations and JSON configurations.', - title='Configurations', - ), - ] - endpointSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector to use to match targets to deploy Configlet to.', - title='Target Selector', - ), - ] = None - endpoints: Annotated[ - Optional[List[str]], - Field( - description='Reference to targets to deploy Configlet to.', title='Targets' - ), - ] = None - operatingSystem: Annotated[ - Optional[Literal['srl', 'sros']], - Field( - description='Operating system to match against when selecting targets.', - title='Operating System', - ), - ] = None - priority: Annotated[ - Optional[int], - Field( - description='Priority of this Configlet, between -100 and 100. Higher priorities overwrite lower priorities in the event of conflicts.', - ge=-100, - le=100, - title='Priority', - ), - ] = 0 - version: Annotated[ - Optional[str], - Field( - description='Version to match against when selecting targets.', - title='Version', - ), - ] = None - - -class Status(BaseModel): - endpoints: Annotated[ - Optional[List[str]], - Field( - description='List of targets this configlet has been applied to.', - title='Targets', - ), - ] = None - - -class ConfigletDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class ConfigletDeletedResources(RootModel[List[ConfigletDeletedResourceEntry]]): - root: List[ConfigletDeletedResourceEntry] - - -class ConfigletMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Configlet(BaseModel): - apiVersion: str - kind: str - metadata: ConfigletMetadata - spec: Annotated[ - Spec, - Field( - description='Configlet is a configuration snippet that can be applied to a set of targets.\nThe path on the target is provided in jspath notation, and the configuration is provided as a JSON string.\nConfiglets can be applied to a set of targets based on a label selector, a list of targets, or a combination of both.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field(description='Deployment status of this Configlet.', title='Status'), - ] = None - - -class ConfigletList(BaseModel): - apiVersion: str - items: Optional[List[Configlet]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/core/__init__.py b/pydantic_eda/com/nokia/eda/core/__init__.py deleted file mode 100644 index 98c2e47..0000000 --- a/pydantic_eda/com/nokia/eda/core/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/core.eda.nokia.com/v1/core.json -# timestamp: 2025-05-07T11:43:34+00:00 diff --git a/pydantic_eda/com/nokia/eda/core/v1.py b/pydantic_eda/com/nokia/eda/core/v1.py deleted file mode 100644 index 8e78d14..0000000 --- a/pydantic_eda/com/nokia/eda/core/v1.py +++ /dev/null @@ -1,2364 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/core.eda.nokia.com/v1/core.json -# timestamp: 2025-05-07T11:43:34+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel, SecretStr - - -class ApiGroup(RootModel[str]): - root: Annotated[str, Field(min_length=1)] - - -class Resource(RootModel[str]): - root: Annotated[str, Field(min_length=1)] - - -class ResourceRule(BaseModel): - apiGroups: Annotated[ - List[ApiGroup], - Field( - description='The API groups for the resources controlled by the rule.\nAn API group consists of an apiGroup and a version, e.g. "apigroup/version".\nThe API group can be a wildcard ("*"), in which case it will match any API group.', - min_length=1, - title='API Groups', - ), - ] - permissions: Annotated[ - Literal['none', 'read', 'readWrite'], - Field( - description='Permissions for resources specified by the rule.', - title='Permissions', - ), - ] - resources: Annotated[ - List[Resource], - Field( - description='Names for the resources controlled by the rule.\nIt can be a wildcard ("*"), in which case it will match any resource\nin the matching API groups.', - min_length=1, - title='Resources', - ), - ] - - -class TableRule(BaseModel): - path: Annotated[ - str, - Field( - description='EDB path to which this rule applies. It can end in ".*"\nin which case the final portion of the table path can be anything, if the\nprefix matches. It can end in ".**" in which case the table path can be\nanything if the prefix matches.', - min_length=1, - pattern='^\\..*', - title='Path', - ), - ] - permissions: Annotated[ - Literal['none', 'read'], - Field(description='Permissions for the given EDB path.', title='Permissions'), - ] - - -class UrlRule(BaseModel): - path: Annotated[ - str, - Field( - description='The API server URL path to which this rule applies. It can end in "/*"\nin which case the final portion of the URL path can be anything, if the\nprefix matches. It can end in "/**" in which case the URL path can be\nanything if the prefix matches.', - min_length=1, - pattern='^/.*', - title='Path', - ), - ] - permissions: Annotated[ - Literal['none', 'read', 'readWrite'], - Field( - description='The permissions for the API server URL for the rule.', - title='Permissions', - ), - ] - - -class Spec(BaseModel): - description: Annotated[ - Optional[str], - Field(description='A description for the role.', title='Description'), - ] = None - resourceRules: Annotated[ - Optional[List[ResourceRule]], - Field(description='Rules for access to resources.', title='Resource Rules'), - ] = None - tableRules: Annotated[ - Optional[List[TableRule]], - Field( - description='Rules for access to EDB tables, including via EQL.', - title='Table Rules', - ), - ] = None - urlRules: Annotated[ - Optional[List[UrlRule]], - Field( - description='Rules for access to APIServer proxied routes.', - title='URL Rules', - ), - ] = None - - -class ClusterRoleDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class ClusterRoleDeletedResources(RootModel[List[ClusterRoleDeletedResourceEntry]]): - root: List[ClusterRoleDeletedResourceEntry] - - -class ClusterRoleMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class AssociatedCr(BaseModel): - groupVersion: Annotated[ - str, - Field( - description='Group and version of the resource.', title='Group + Version' - ), - ] - kind: Annotated[str, Field(description='Kind of the resource.', title='Kind')] - name: Annotated[str, Field(description='Name of the resource.', title='Name')] - - -class SpecModel(BaseModel): - accepted: Annotated[ - Optional[bool], - Field( - description='Indicates whether this Deviation has been accepted.', - title='Accepted', - ), - ] = None - associatedCrs: Annotated[ - Optional[List[AssociatedCr]], - Field( - description='Resources impacted by this Deviation.', - title='Associated Resources', - ), - ] = None - intendedValues: Annotated[ - Optional[str], - Field( - description='JSON object containing intended values of fields at the specified path.', - title='Intended Values', - ), - ] = None - nodeEndpoint: Annotated[ - str, - Field(description='Target on which this Deviation is present.', title='Target'), - ] - operation: Annotated[ - Literal['create', 'delete'], - Field( - description='Indicates the operation in this Deviation.', title='Operation' - ), - ] - path: Annotated[ - str, - Field( - description='Path on the target this Deviation is present at. This path is relative to the target\'s root, without any EDA prefixes - for example ".system" rather than ".namespace.node.srl.system".', - title='Path', - ), - ] - runningValues: Annotated[ - Optional[str], - Field( - description='JSON object containing running values of fields at the specified path.', - title='Running Values', - ), - ] = None - - -class Action(BaseModel): - action: Annotated[ - Literal['setAccept', 'clearAccept', 'reject'], - Field(description='Action to perform on matching Deviations.', title='Action'), - ] - path: Annotated[ - str, - Field( - description='Path to match Deviation resources on this target. Only one action is allowed per path.', - title='Path', - ), - ] - recurse: Annotated[ - Optional[bool], - Field( - description='Recursively accept/reject Deviations from the specified path.', - title='Recurse', - ), - ] = None - - -class SpecModel1(BaseModel): - actions: Annotated[ - List[Action], - Field( - description='The set of actions to perform on the target.', title='Actions' - ), - ] - nodeEndpoint: Annotated[ - str, - Field( - description='The target on which this action is to be performed.', - title='Target', - ), - ] - - -class Status(BaseModel): - result: Annotated[ - Optional[Literal['OK', 'Failed']], - Field(description='The result of the set of actions.', title='Result'), - ] = None - transactionId: Annotated[ - Optional[int], - Field( - description='The transaction id these actions were part of.', - title='Transaction Id', - ), - ] = None - - -class DeviationActionDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DeviationActionDeletedResources( - RootModel[List[DeviationActionDeletedResourceEntry]] -): - root: List[DeviationActionDeletedResourceEntry] - - -class DeviationActionMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class DeviationMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class GatewayIPV4Address(BaseModel): - ipPrefix: Annotated[ - str, Field(description='Address and mask to use', title='IP Prefix') - ] - primary: Annotated[ - Optional[bool], - Field( - description='Indicates which address to use as primary for broadcast', - title='Primary', - ), - ] = None - - -class GatewayIPV6Address(BaseModel): - ipPrefix: Annotated[ - str, Field(description='Address and mask to use', title='IP Prefix') - ] - primary: Annotated[ - Optional[bool], - Field( - description='Indicates which address to use as primary for broadcast', - title='Primary', - ), - ] = None - - -class SpecModel2(BaseModel): - bridgeDomain: Annotated[ - Optional[str], - Field(description='Reference to a Bridge Domain', title='bridgeDomain'), - ] = None - encapType: Annotated[ - Literal['null', 'dot1q'], - Field( - description='Indicates if the EdgeInterface uses VLAN tagging', - title='Encapsulation', - ), - ] - gatewayIPV4Addresses: Annotated[ - Optional[List[GatewayIPV4Address]], - Field( - description='List of gateway IPv4 addresses in ip/mask form - e.g. 192.168.0.1/24', - title='Gateway IPv4 Addresses', - ), - ] = None - gatewayIPV6Addresses: Annotated[ - Optional[List[GatewayIPV6Address]], - Field( - description='List of gateway IPv6 addresses in ip/mask form - e.g. fc00::1/120', - title='Gateway IPv6 Addresses', - ), - ] = None - interfaceResource: Annotated[ - str, Field(description='Reference to an interface', title='Interface Resource') - ] - router: Annotated[ - Optional[str], Field(description='Reference to a Router', title='Router') - ] = None - vlanID: Annotated[ - Optional[int], - Field( - description='Single value between 0-4094 supported', - ge=0, - le=4094, - title='VLAN ID', - ), - ] = None - - -class EdgeInterfaceDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class EdgeInterfaceDeletedResources(RootModel[List[EdgeInterfaceDeletedResourceEntry]]): - root: List[EdgeInterfaceDeletedResourceEntry] - - -class EdgeInterfaceMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel3(BaseModel): - authType: Annotated[ - Literal['atDestination', 'inApiServer'], - Field( - description='Determines where authentication happens.\nIf "atDestination", then no authentication happens in API server and any auth tokens are forwarded as is.\nIf "inApiServer", then authentication happens within the API server and auth tokens are stripped prior to forwarding.', - title='Authentication Type', - ), - ] - rootUrl: Annotated[ - str, - Field( - description='The proxy destination, including the protocol.', title='Git' - ), - ] - - -class HttpProxyDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class HttpProxyDeletedResources(RootModel[List[HttpProxyDeletedResourceEntry]]): - root: List[HttpProxyDeletedResourceEntry] - - -class HttpProxyMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class Allocation(BaseModel): - name: Annotated[str, Field(description='Name of this allocation.', title='Name')] - value: Annotated[str, Field(description='Allocation to reserve.', title='Value')] - - -class Reservation(BaseModel): - end: Annotated[str, Field(description='Value to reserve to.', title='End')] - start: Annotated[str, Field(description='Value to start reserving.', title='Start')] - - -class Segment(BaseModel): - allocations: Annotated[ - Optional[List[Allocation]], - Field( - description='List of reservations to exclude from allocations from this segment.', - title='Allocations', - ), - ] = None - reservations: Annotated[ - Optional[List[Reservation]], - Field( - description='List of ranges to exclude from allocations from this segment.', - title='Reservations', - ), - ] = None - subnet: Annotated[ - str, Field(description='IPv4 or IPv6 subnet, e.g. 10.1.1.0/24.', title='Subnet') - ] - - -class SpecModel4(BaseModel): - publishAllocations: Annotated[ - Optional[bool], - Field( - description='If true, allocations in segments will be published to EDB, available to query via EQL and trigger state applications off of.', - title='Publish Allocations', - ), - ] = None - segments: Annotated[ - List[Segment], - Field( - description='List of segments containing IPv4 or IPv6 addresses to allocate.', - min_length=1, - title='Segments', - ), - ] - - -class IPAllocationPoolDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class IPAllocationPoolDeletedResources( - RootModel[List[IPAllocationPoolDeletedResourceEntry]] -): - root: List[IPAllocationPoolDeletedResourceEntry] - - -class IPAllocationPoolMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class IPInSubnetAllocationPoolDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class IPInSubnetAllocationPoolDeletedResources( - RootModel[List[IPInSubnetAllocationPoolDeletedResourceEntry]] -): - root: List[IPInSubnetAllocationPoolDeletedResourceEntry] - - -class IPInSubnetAllocationPoolMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class AllocationModel(BaseModel): - name: Annotated[str, Field(description='Name of this allocation.', title='Name')] - value: Annotated[int, Field(description='Index to reserve.', title='Value')] - - -class ReservationModel(BaseModel): - end: Annotated[int, Field(description='Value to reserve to.', title='End')] - start: Annotated[int, Field(description='Value to start reserving.', title='Start')] - - -class SegmentModel(BaseModel): - allocations: Annotated[ - Optional[List[AllocationModel]], - Field( - description='List of reservations to exclude from allocations from this segment.', - title='Allocations', - ), - ] = None - reservations: Annotated[ - Optional[List[ReservationModel]], - Field( - description='Range of reservations to exclude from allocations from this segment.', - title='Reservations', - ), - ] = None - size: Annotated[ - int, Field(description='Number of elements in the segment.', title='Size') - ] - start: Annotated[ - int, Field(description='Starting value of the segment.', title='Start') - ] - - -class SpecModel5(BaseModel): - publishAllocations: Annotated[ - Optional[bool], - Field( - description='If true, allocations in segments will be published to EDB, available to query via EQL and trigger state applications off of.', - title='Publish Allocations', - ), - ] = None - segments: Annotated[ - List[SegmentModel], - Field( - description='List of segments containing indexes to allocate.', - min_length=1, - title='Segments', - ), - ] - - -class IndexAllocationPoolDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class IndexAllocationPoolDeletedResources( - RootModel[List[IndexAllocationPoolDeletedResourceEntry]] -): - root: List[IndexAllocationPoolDeletedResourceEntry] - - -class IndexAllocationPoolMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel6(BaseModel): - data: Annotated[ - str, - Field( - description='The license key. This is a base64 encoded string.', - title='Data', - ), - ] - enabled: Annotated[ - Optional[bool], - Field( - description='Indicates if this license is available for use.', - title='Enabled', - ), - ] = True - - -class Status1Model(BaseModel): - comment: Annotated[ - Optional[str], - Field(description='Any comment provided in the license.', title='Comment'), - ] = None - expirationDate: Annotated[ - Optional[date], - Field( - description='Date and time the license expires.', title='Expiration Date' - ), - ] = None - expired: Annotated[ - bool, - Field(description='Indicates if the license has expired.', title='Expired'), - ] - issuedDate: Annotated[ - Optional[date], - Field(description='Date and time the license was issued.', title='Issued Date'), - ] = None - used: Annotated[ - bool, Field(description='Indicates if license has been used.', title='Used') - ] - valid: Annotated[ - bool, Field(description='Indicates if the license is valid.', title='Valid') - ] - - -class LicenseMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class SpecModel7(BaseModel): - description: Annotated[ - Optional[str], - Field( - description='An optional description of the use of the namespace.', - title='Description', - ), - ] = None - - -class NamespaceDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class NamespaceDeletedResources(RootModel[List[NamespaceDeletedResourceEntry]]): - root: List[NamespaceDeletedResourceEntry] - - -class NamespaceMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class Dhcp4Option(BaseModel): - option: Annotated[ - Literal[ - '1-SubnetMask', - '2-TimeOffset', - '3-Router', - '4-TimeServer', - '5-NameServer', - '6-DomainNameServer', - '7-LogServer', - '8-QuoteServer', - '9-LPRServer', - '10-ImpressServer', - '11-ResourceLocationServer', - '12-HostName', - '13-BootFileSize', - '14-MeritDumpFile', - '15-DomainName', - '16-SwapServer', - '17-RootPath', - '18-ExtensionsPath', - '19-IPForwarding', - '20-NonLocalSourceRouting', - '21-PolicyFilter', - '22-MaximumDatagramAssemblySize', - '23-DefaultIPTTL', - '24-PathMTUAgingTimeout', - '25-PathMTUPlateauTable', - '26-InterfaceMTU', - '27-AllSubnetsAreLocal', - '28-BroadcastAddress', - '29-PerformMaskDiscovery', - '30-MaskSupplier', - '31-PerformRouterDiscovery', - '32-RouterSolicitationAddress', - '33-StaticRoutingTable', - '34-TrailerEncapsulation', - '35-ArpCacheTimeout', - '36-EthernetEncapsulation', - '37-DefaulTCPTTL', - '38-TCPKeepaliveInterval', - '39-TCPKeepaliveGarbage', - '40-NetworkInformationServiceDomain', - '41-NetworkInformationServers', - '42-NTPServers', - '43-VendorSpecificInformation', - '44-NetBIOSOverTCPIPNameServer', - '45-NetBIOSOverTCPIPDatagramDistributionServer', - '46-NetBIOSOverTCPIPNodeType', - '47-NetBIOSOverTCPIPScope', - '48-XWindowSystemFontServer', - '49-XWindowSystemDisplayManager', - '50-RequestedIPAddress', - '51-IPAddressLeaseTime', - '52-OptionOverload', - '53-DHCPMessageType', - '54-ServerIdentifier', - '55-ParameterRequestList', - '56-Message', - '57-MaximumDHCPMessageSize', - '58-RenewTimeValue', - '59-RebindingTimeValue', - '60-ClassIdentifier', - '61-ClientIdentifier', - '62-NetWareIPDomainName', - '63-NetWareIPInformation', - '64-NetworkInformationServicePlusDomain', - '65-NetworkInformationServicePlusServers', - '66-TFTPServerName', - '67-BootfileName', - '68-MobileIPHomeAgent', - '69-SimpleMailTransportProtocolServer', - '70-PostOfficeProtocolServer', - '71-NetworkNewsTransportProtocolServer', - '72-DefaultWorldWideWebServer', - '73-DefaultFingerServer', - '74-DefaultInternetRelayChatServer', - '75-StreetTalkServer', - '76-StreetTalkDirectoryAssistanceServer', - '77-UserClassInformation', - '78-SLPDirectoryAgent', - '79-SLPServiceScope', - '80-RapidCommit', - '81-FQDN', - '82-RelayAgentInformation', - '83-InternetStorageNameService', - '85-NDSServers', - '86-NDSTreeName', - '87-NDSContext', - '88-BCMCSControllerDomainNameList', - '89-BCMCSControllerIPv4AddressList', - '90-Authentication', - '91-ClientLastTransactionTime', - '92-AssociatedIP', - '93-ClientSystemArchitectureType', - '94-ClientNetworkInterfaceIdentifier', - '95-LDAP', - '97-ClientMachineIdentifier', - '98-OpenGroupUserAuthentication', - '99-GeoConfCivic', - '100-IEEE10031TZString', - '101-ReferenceToTZDatabase', - '112-NetInfoParentServerAddress', - '113-NetInfoParentServerTag', - '114-URL', - '116-AutoConfigure', - '117-NameServiceSearch', - '118-SubnetSelection', - '119-DNSDomainSearchList', - '120-SIPServers', - '121-ClasslessStaticRoute', - '122-CCC', - '123-GeoConf', - '124-VendorIdentifyingVendorClass', - '125-VendorIdentifyingVendorSpecific', - '128-TFTPServerIPAddress', - '129-CallServerIPAddress', - '130-DiscriminationString', - '131-RemoteStatisticsServerIPAddress', - '132-8021PVLANID', - '133-8021QL2Priority', - '134-DiffservCodePoint', - '135-HTTPProxyForPhoneSpecificApplications', - '136-PANAAuthenticationAgent', - '137-LoSTServer', - '138-CAPWAPAccessControllerAddresses', - '139-OPTIONIPv4AddressMoS', - '140-OPTIONIPv4FQDNMoS', - '141-SIPUAConfigurationServiceDomains', - '142-OPTIONIPv4AddressANDSF', - '143-OPTIONIPv6AddressANDSF', - '150-TFTPServerAddress', - '151-StatusCode', - '152-BaseTime', - '153-StartTimeOfState', - '154-QueryStartTime', - '155-QueryEndTime', - '156-DHCPState', - '157-DataSource', - '175-Etherboot', - '176-IPTelephone', - '177-EtherbootPacketCableAndCableHome', - '208-PXELinuxMagicString', - '209-PXELinuxConfigFile', - '210-PXELinuxPathPrefix', - '211-PXELinuxRebootTime', - '212-OPTION6RD', - '213-OPTIONv4AccessDomain', - '220-SubnetAllocation', - '221-VirtualSubnetAllocation', - '224-Reserved', - '225-Reserved', - '226-Reserved', - '227-Reserved', - '228-Reserved', - '229-Reserved', - '230-Reserved', - '231-Reserved', - '232-Reserved', - '233-Reserved', - '234-Reserved', - '235-Reserved', - '236-Reserved', - '237-Reserved', - '238-Reserved', - '239-Reserved', - '240-Reserved', - '241-Reserved', - '242-Reserved', - '243-Reserved', - '244-Reserved', - '245-Reserved', - '246-Reserved', - '247-Reserved', - '248-Reserved', - '249-Reserved', - '250-Reserved', - '251-Reserved', - '252-Reserved', - '253-Reserved', - '254-Reserved', - '255-End', - ], - Field(description='DHCPv4 option to return to the TopoNode.', title='Option'), - ] - value: Annotated[ - List[str], - Field( - description='Value to return to the TopoNode for the specified option.', - min_length=1, - title='Value', - ), - ] - - -class Dhcp6Option(BaseModel): - option: Annotated[ - Literal['59-BootfileUrl'], - Field(description='DHCPv6 option to return to the TopoNode.', title='Option'), - ] - value: Annotated[ - List[str], - Field( - description='Value to return to the TopoNode for the specified option.', - min_length=1, - title='Value', - ), - ] - - -class Dhcp(BaseModel): - dhcp4Options: Annotated[ - Optional[List[Dhcp4Option]], - Field( - description='DHCPv4 options to return to TopoNodes referencing this NodeProfile.', - title='DHCPv4 Options', - ), - ] = None - dhcp6Options: Annotated[ - Optional[List[Dhcp6Option]], - Field( - description='DHCPv6 options to return to TopoNodes referencing this NodeProfile.', - title='DHCPv6 Options', - ), - ] = None - managementPoolv4: Annotated[ - Optional[str], - Field( - description='IPInSubnetAllocationPool to use for IPv4 allocations of the management address for TopoNodes referencing this NodeProfile.', - title='Management Pool - IPv4', - ), - ] = None - managementPoolv6: Annotated[ - Optional[str], - Field( - description='IPInSubnetAllocationPool to use for IPv6 allocations of the management address for TopoNodes referencing this NodeProfile.', - title='Management Pool - IPv6', - ), - ] = None - preferredAddressFamily: Annotated[ - Optional[Literal['IPv4', 'IPv6']], - Field( - description='Preferred IP address family', title='Preferred Address Family' - ), - ] = None - - -class Image(BaseModel): - image: Annotated[ - str, - Field( - description='URL hosting the software image, e.g. srlimages/srlinux-24.7.1.bin.', - title='Image', - ), - ] - imageMd5: Annotated[ - Optional[str], - Field( - description='URL hosting the software image md5 hash. e.g. srlimages/srlinux-24.7.1.bin.md5.', - title='Image MD5', - ), - ] = None - - -class SpecModel8(BaseModel): - annotate: Annotated[ - Optional[bool], - Field( - description='Indicates if NPP should annotate sent configuration.', - title='Annotations', - ), - ] = False - containerImage: Annotated[ - Optional[str], - Field( - description='Container image to use when simulating TopoNodes referencing this NodeProfile, e.g. ghcr.io/nokia/srlinux:24.7.1.', - title='Container Image', - ), - ] = None - dhcp: Annotated[ - Optional[Dhcp], - Field( - description='DHCP options to use when onboarding the TopoNode. Optional if not bootstrapping using EDA.', - title='DHCP', - ), - ] = None - imagePullSecret: Annotated[ - Optional[str], - Field( - description='Secret used to authenticate to the container registry where the container image is hosted.', - title='Image Pull Secret', - ), - ] = None - images: Annotated[ - Optional[List[Image]], - Field( - description='URLs hosting software images for bootstrapping TopoNodes referencing this NodeProfile.', - title='Images', - ), - ] = None - license: Annotated[ - Optional[str], - Field( - description='ConfigMap containing a license for TopoNodes referencing this NodeProfile.', - title='License', - ), - ] = None - llmDb: Annotated[ - Optional[str], - Field( - description='URL containing LLDB to use when interacting with LLM-DB and OpenAI for query autocompletion, e.g. http://eda-asvr/llmdb/ce-llm-db-srlinux-24.7.1.tar.gz.', - title='LLMDB', - ), - ] = None - nodeUser: Annotated[ - str, - Field( - description='Reference to a NodeUser to use for authentication to TopoNodes referencing this NodeProfile.', - title='Node User', - ), - ] - onboardingPassword: Annotated[ - Optional[SecretStr], - Field( - description='The password to use when onboarding TopoNodes referencing this NodeProfile, e.g. admin.', - title='Onboarding Password', - ), - ] = None - onboardingUsername: Annotated[ - Optional[str], - Field( - description='The username to use when onboarding TopoNodes referencing this NodeProfile, e.g. admin.', - title='Onboarding Username', - ), - ] = None - operatingSystem: Annotated[ - Literal['srl', 'sros', 'nxos'], - Field( - description='Sets the operating system of this NodeProfile, e.g. srl.', - title='Operating System', - ), - ] - platformPath: Annotated[ - Optional[str], - Field( - description='JSPath to use for retrieving the version string from TopoNodes referencing this NodeProfile, e.g. .platform.chassis.type.', - title='Platform Path', - ), - ] = None - port: Annotated[ - Optional[int], - Field( - description='Port used to establish a connection to the TopoNode, e.g. 57400.', - ge=1, - le=65535, - title='Port', - ), - ] = 57400 - serialNumberPath: Annotated[ - Optional[str], - Field( - description='JSPath to use for retrieving the serial number string from TopoNodes referencing this NodeProfile, e.g. .platform.chassis.serial-number.', - title='Serial Number Path', - ), - ] = None - version: Annotated[ - str, - Field( - description='Sets the software version of this NodeProfile, e.g. 24.7.1 (for srl), or 24.7.r1 (for sros).', - title='Version', - ), - ] - versionMatch: Annotated[ - Optional[str], - Field( - description='Regular expression to match the node-retrieved version string to TopoNode version, e.g. v0\\.0\\.0.*.', - title='Version Match', - ), - ] = None - versionPath: Annotated[ - Optional[str], - Field( - description='JSPath to use for retrieving the version string from TopoNodes referencing this NodeProfile, e.g. .system.information.version.', - title='Version Path', - ), - ] = None - yang: Annotated[ - str, - Field( - description='URL containing YANG modules and schema profile to use when interacting with TopoNodes referencing this NodeProfile, e.g. http://eda-asvr/schemaprofiles/srlinux-24.7.1.zip.', - title='YANG', - ), - ] - - -class NodeProfileDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class NodeProfileDeletedResources(RootModel[List[NodeProfileDeletedResourceEntry]]): - root: List[NodeProfileDeletedResourceEntry] - - -class NodeProfileMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class GroupBinding(BaseModel): - groups: Annotated[ - List[str], Field(description='Assigned groups for this user.', title='Groups') - ] - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Selector to use when selecting TopoNodes to deploy this user to.', - title='Node Selector', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field(description=' TopoNodes to deploy this user to.', title='Nodes'), - ] = None - - -class SpecModel9(BaseModel): - groupBindings: Annotated[ - List[GroupBinding], - Field( - description='Matching of this user to node-specific permissions via groups.', - title='Group Bindings', - ), - ] - password: Annotated[ - SecretStr, Field(description='Password for this user.', title='Password') - ] - sshPublicKeys: Annotated[ - Optional[List[str]], - Field( - description='SSH public keys to deploy for the user.', - title='SSH Public Keys', - ), - ] = None - username: Annotated[ - Optional[str], - Field( - description='Name of this user. If not provided, the name of the resource will be used.', - max_length=32, - title='Username', - ), - ] = None - - -class GroupBindingModel(BaseModel): - groups: Annotated[ - Optional[List[str]], - Field( - description='Groups this user is a member of on this node.', title='Groups' - ), - ] = None - node: Annotated[ - Optional[str], Field(description='Node this user is deployed to.', title='Node') - ] = None - - -class Status1Model1(BaseModel): - groupBindings: Annotated[ - Optional[List[GroupBindingModel]], - Field( - description='List of TopoNodes user has been deployed to, along with corresponding groups.', - title='Group Bindings', - ), - ] = None - - -class NodeUserDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class NodeUserDeletedResources(RootModel[List[NodeUserDeletedResourceEntry]]): - root: List[NodeUserDeletedResourceEntry] - - -class NodeUserMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel10(BaseModel): - description: Annotated[ - Optional[str], - Field(description='A description for the role.', title='Description'), - ] = None - resourceRules: Annotated[ - Optional[List[ResourceRule]], - Field( - description='The rules for access to kubernetes resources', - title='Resource Rules', - ), - ] = None - tableRules: Annotated[ - Optional[List[TableRule]], - Field( - description='The rules for access to the database tables.', - title='Table Rules', - ), - ] = None - urlRules: Annotated[ - Optional[List[UrlRule]], - Field( - description='The rules for access to api-server proxied routes.', - title='URL Rules', - ), - ] = None - - -class RoleDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class RoleDeletedResources(RootModel[List[RoleDeletedResourceEntry]]): - root: List[RoleDeletedResourceEntry] - - -class RoleMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class AllocationModel1(BaseModel): - name: Annotated[str, Field(description='Name of this allocation.', title='Name')] - value: Annotated[str, Field(description='Allocation to reserve.', title='Value')] - - -class ReservationModel1(BaseModel): - end: Annotated[str, Field(description='Value to reserve to.', title='End')] - start: Annotated[str, Field(description='Value to start reserving.', title='Start')] - - -class SegmentModel1(BaseModel): - allocations: Annotated[ - Optional[List[AllocationModel1]], - Field( - description='List of reservations to exclude from allocations from this segment.', - title='Allocations', - ), - ] = None - reservations: Annotated[ - Optional[List[ReservationModel1]], - Field( - description='List of ranges to exclude from allocations from this segment.', - title='Reservations', - ), - ] = None - subnet: Annotated[ - str, - Field( - description='IPv4 or IPv6 subnet to allocate subnets from, e.g. 10.1.0.0/16.', - title='Subnet', - ), - ] - subnetLength: Annotated[ - int, - Field( - description='The size of the subnets to be allocated from within the parent subnet, e.g. 29 (which could allocate 10.1.0.8/29, for example).', - title='Subnet Length', - ), - ] - - -class SpecModel11(BaseModel): - publishAllocations: Annotated[ - Optional[bool], - Field( - description='If true, allocations in segments will be published to EDB, available to query via EQL and trigger state applications off of.', - title='Publish Allocations', - ), - ] = None - segments: Annotated[ - List[SegmentModel1], - Field( - description='List of segments containing subnets to allocate.', - min_length=1, - title='Segments', - ), - ] - - -class SubnetAllocationPoolDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class SubnetAllocationPoolDeletedResources( - RootModel[List[SubnetAllocationPoolDeletedResourceEntry]] -): - root: List[SubnetAllocationPoolDeletedResourceEntry] - - -class SubnetAllocationPoolMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel12(BaseModel): - channels: Annotated[ - int, - Field( - description='The number of breakout channels to create', - ge=1, - le=8, - title='Number of Channels', - ), - ] - interface: Annotated[ - Optional[List[str]], - Field( - description='A list of normalized parent interface/port', - title='Normalized Parent Interface', - ), - ] = None - node: Annotated[ - List[str], - Field( - description='Reference to a list of TopoNodes where the parent interfaces are to be broken out', - title='Node', - ), - ] - speed: Annotated[ - Literal['800G', '400G', '200G', '100G', '50G', '40G', '25G', '10G'], - Field(description='The speed of each breakout channel', title='Speed'), - ] - - -class TopoBreakoutDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class TopoBreakoutDeletedResources(RootModel[List[TopoBreakoutDeletedResourceEntry]]): - root: List[TopoBreakoutDeletedResourceEntry] - - -class TopoBreakoutMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Local(BaseModel): - interface: Annotated[ - Optional[str], - Field( - description='Normalized name of the interface/port, e.g. ethernet-1-1.', - title='Interface', - ), - ] = None - interfaceResource: Annotated[ - str, Field(description='Reference to a Interface.', title='Interface Resource') - ] - node: Annotated[str, Field(description='Reference to a TopoNode.', title='Node')] - - -class Remote(BaseModel): - interface: Annotated[ - Optional[str], - Field( - description='Normalized name of the interface/port, e.g. ethernet-1-1.', - title='Interface', - ), - ] = None - interfaceResource: Annotated[ - str, Field(description='Reference to a Interface.', title='Interface Resource') - ] - node: Annotated[str, Field(description='Reference to a TopoNode.', title='Node')] - - -class Link(BaseModel): - local: Annotated[ - Local, Field(description='Local, or "A" endpoint of the link.', title='A') - ] - remote: Annotated[ - Optional[Remote], - Field(description='Remote, or "B" endpoint of the link.', title='B'), - ] = None - speed: Annotated[ - Optional[ - Literal[ - '800G', - '400G', - '200G', - '100G', - '50G', - '40G', - '25G', - '10G', - '2.5G', - '1G', - '100M', - ] - ], - Field(description='Speed of the link.', title='Speed'), - ] = None - type: Annotated[ - Literal['edge', 'interSwitch', 'loopback'], - Field( - description='Specify the type of link.\nIf type is set to edge, topology information for the remote device can be set; when doing so the Remote Node can be set as the hostname of the remote device and Remote Interface as the remote interface name in the device specific format, e.g. eth0.', - title='Type', - ), - ] - - -class SpecModel13(BaseModel): - links: Annotated[ - List[Link], - Field( - description='Define the set of physical links making up this TopoLink.', - min_length=1, - title='Links', - ), - ] - - -class Member(BaseModel): - interface: Annotated[ - Optional[str], Field(description='Reference to an Interface', title='Interface') - ] = None - node: Annotated[str, Field(description='Reference to a TopoNode', title='Node')] - operationalState: Annotated[ - str, - Field( - description='Indicates the operational state of the TopoLink member.', - title='Operational State', - ), - ] - - -class Status1Model2(BaseModel): - members: Annotated[ - Optional[List[Member]], - Field(description='List of members present on the TopoLink.', title='Members'), - ] = None - operationalState: Annotated[ - str, - Field( - description='Indicates the aggregate operational state of the TopoLink.', - title='Operational State', - ), - ] - - -class TopoLinkDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class TopoLinkDeletedResources(RootModel[List[TopoLinkDeletedResourceEntry]]): - root: List[TopoLinkDeletedResourceEntry] - - -class TopoLinkMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class ComponentItem(BaseModel): - kind: Annotated[ - Literal[ - 'lineCard', - 'fabric', - 'mda', - 'connector', - 'xiom', - 'powerShelf', - 'powerModule', - ], - Field(description='The kind of Component, e.g. lineCard.', title='Kind'), - ] - slot: Annotated[ - Optional[str], - Field( - description='The slot this Component resides in, unset for Components that do not have a slot or ID.\ne.g. 1 would denote the linecard slot 1, 1/1 would denote linecard slot 1 mda slot 1.', - title='Slot', - ), - ] = None - type: Annotated[ - str, - Field( - description='Denotes the type of hardware being provisioned, e.g. xcm-x20.', - title='Type', - ), - ] - - -class Npp(BaseModel): - mode: Annotated[ - Optional[Literal['normal', 'maintenance', 'null', 'emulate']], - Field( - description='The mode in which this TopoNode is functioning.\n"normal" (the default)\n indicates that NPP is expecting an endpoint to exist, and will accept and confirm changes only if the endpoint\n accepts them.\n"maintenance"\n indicates that no changes will be accepted for the TopoNode, irrespective if the endpoint is up and reachable.\n The exception is if an upgrade is occuring, in which case changes will be accepted.\n"null"\n\t indicates that changes will be accepted from CRs and no NPP will be spun up. NPP validation will not occur.\n This may be useful in playground mode to avoid spinning up of 1000s of NPPs.\n"emulate"\n indicates that changes will be accepted at the NPP level, without pushing them to a endpoint. NPP validation\n still occurs. If no IP address is present, we also run in emulate mode.', - title='Mode', - ), - ] = 'normal' - - -class ProductionAddress(BaseModel): - ipv4: Annotated[ - Optional[str], Field(description='The IPv4 production address', title='IPv4') - ] = None - ipv6: Annotated[ - Optional[str], Field(description='The IPv6 production address', title='IPv6') - ] = None - - -class SpecModel14(BaseModel): - component: Annotated[ - Optional[List[ComponentItem]], - Field( - description='List of components within the TopoNode.\nUsed to define the type and location of linecards, fabrics (SFM), media adapter cards (MDA) and control cards (CPM).', - title='Components', - ), - ] = None - license: Annotated[ - Optional[str], - Field( - description='Reference to a ConfigMap containing a license for the TopoNode. Overrides the license set in the referenced NodeProfile, if present.', - title='License', - ), - ] = None - macAddress: Annotated[ - Optional[str], - Field( - description='MAC address to associate with this TopoNode.\nTypically the chassis MAC address, optionally sent by a node in DHCP requests.\nNot required when a TopoNode is not being bootstrapped by EDA, or is simulated through CX.', - title='MAC Address', - ), - ] = None - nodeProfile: Annotated[ - str, - Field( - description='Reference to a NodeProfile to use with this TopoNode.', - title='Node Profile', - ), - ] - npp: Annotated[ - Optional[Npp], - Field( - description='Options relating to NPP interactions with the node.', - title='NPP', - ), - ] = None - onBoarded: Annotated[ - Optional[bool], - Field( - description='Indicates if this TopoNode has been bootstrapped or is reachable via configured credentials. Set by BootstrapServer when it completes onboarding functions for a given TopoNode.\nMost applications ignore TopoNodes that have not been onboarded yet.', - title='Onboarded', - ), - ] = False - operatingSystem: Annotated[ - Literal['srl', 'sros', 'nxos'], - Field( - description='Operating system running on this TopoNode, e.g. srl.', - title='Operating System', - ), - ] - platform: Annotated[ - str, - Field( - description='Platform type of this TopoNode, e.g. 7220 IXR-D3L.', - title='Platform', - ), - ] - productionAddress: Annotated[ - Optional[ProductionAddress], - Field( - description='Production address of this TopoNode - this is the address the real, production instance of this TopoNode uses.\nIf left blank, an address will be allocated from the management IP pool specified in the referenced NodeProfile.\nIf this TopoNode is not bootstrapped by EDA this field must be provided.', - title='Production Address', - ), - ] = None - serialNumber: Annotated[ - Optional[str], - Field( - description='Serial number of this TopoNode, optionally sent by a node in DHCP requests.\nNot required when a TopoNode is not being bootstrapped by EDA, or is simulated through CX.', - title='Serial Number', - ), - ] = None - systemInterface: Annotated[ - Optional[str], - Field( - description='Name of the Interface resource representing the primary loopback on the TopoNode.', - title='System Interface', - ), - ] = None - version: Annotated[ - str, - Field( - description='Sets the software version of this TopoNode, e.g. 24.7.1 (for srl), or 24.7.r1 (for sros).', - title='Version', - ), - ] - - -class Status1Model3(BaseModel): - node_details: Annotated[ - Optional[str], - Field( - alias='node-details', - description='Address and port used to connected to the node.', - title='Node Address', - ), - ] = None - node_state: Annotated[ - Optional[str], - Field( - alias='node-state', - description='The current state of the connection between NPP and the node.\n"TryingToConnect"\n NPP is attempting to connect and establish connectivity to the node\n"WaitingForInitialCfg"\n NPP is connected to the node but waiting for intial config to push\n"Committing"\n\t NPP is in progress of commiting\n"RetryingCommit"\n NPP lost sync to node and is re-pushing current config\n"Synced"\n NPP is in fully synced state\n"Standby"\n NPP is running in standby mode. This state is only used on standby clusters with georedundancy.\n"NoIpAddress"\n NPP is running but there is no IP address for node. This only happen in sim setups when\n CX has not created the simulated node, or the simulated pod failed to launch due to image error.', - title='Node', - ), - ] = None - npp_details: Annotated[ - Optional[str], - Field( - alias='npp-details', - description='NPP address and port for this TopoNode.', - title='NPP Address', - ), - ] = None - npp_pod: Annotated[ - Optional[str], - Field(alias='npp-pod', description='NPP pod name', title='NPP Pod'), - ] = None - npp_state: Annotated[ - Optional[str], - Field( - alias='npp-state', - description='The current state of the connection between ConfigEngine and NPP.', - title='NPP', - ), - ] = None - operatingSystem: Annotated[ - Optional[str], - Field( - description='Operational operating system running on this TopoNode, e.g. srl, sros.', - title='Operating System', - ), - ] = None - platform: Annotated[ - Optional[str], - Field( - description='Operational platform type of this TopoNode, e.g. 7220 IXR-D3L.', - title='Platform', - ), - ] = None - simulate: Annotated[ - Optional[bool], - Field( - description='Simulate using CX - if true CX is reponsible for generating the TargetNode resource.', - title='Simulate', - ), - ] = None - version: Annotated[ - Optional[str], - Field( - description='Operational software version of this TopoNode, e.g. 24.7.1 (for srl), or 24.7.r1 (for sros).', - title='Version', - ), - ] = None - - -class TopoNodeDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class TopoNodeDeletedResources(RootModel[List[TopoNodeDeletedResourceEntry]]): - root: List[TopoNodeDeletedResourceEntry] - - -class TopoNodeMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel15(BaseModel): - bufferSize: Annotated[ - int, - Field( - description='The proxy will use a buffer of this size for all datagrams it receives and this must be sized\nto accommodate the largest datagrams expected', - ge=64, - le=65535, - title='Buffer Size', - ), - ] - destHost: Annotated[ - str, - Field( - description='The destination hostname or IP address to forward the datagrams to', - title='Destination Host', - ), - ] - destPort: Annotated[ - int, - Field( - description='The destination UDP port to forward the datagrams to', - ge=1, - le=65535, - title='Destination Port', - ), - ] - idleTimeout: Annotated[ - int, - Field( - description='The proxy will listen for responses from the destination and forward it back to the source\nof the datagram until there is no traffic at all for at least the idle timeout in seconds', - ge=1, - title='Idle Timeout', - ), - ] - proxyPort: Annotated[ - int, - Field( - description='The UDP port on which to listen for datagrams and then proxy to the destination', - ge=1, - le=65535, - title='Proxy Port', - ), - ] - - -class UdpProxyDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class UdpProxyDeletedResources(RootModel[List[UdpProxyDeletedResourceEntry]]): - root: List[UdpProxyDeletedResourceEntry] - - -class UdpProxyMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class FlowDefinitionResource(BaseModel): - group: Annotated[Optional[str], Field(title='Group')] = None - kind: Annotated[str, Field(title='Kind')] - version: Annotated[str, Field(title='Version')] - - -class FlowDefinitionSchema(BaseModel): - jsonSchemaSpec: Annotated[ - Optional[str], - Field( - description='A string containing the JSON schema the workflow accepts as input.', - title='JSON Schema (Spec)', - ), - ] = None - jsonSchemaStatus: Annotated[ - Optional[str], - Field( - description='A string containing the JSON schema the workflow will populate as output.', - title='JSON Schema (Status)', - ), - ] = None - - -class SpecModel16(BaseModel): - flowDefinitionResource: Annotated[ - Optional[FlowDefinitionResource], - Field( - description='the resource type to be used for this flow, can only be set if Schema is not set' - ), - ] = None - flowDefinitionSchema: Annotated[ - Optional[FlowDefinitionSchema], - Field( - description='the schema for the flow, can only be set if Resource is not set' - ), - ] = None - image: Annotated[ - str, - Field( - description='Container image containing the flow. For example "ghcr.io/nokia-eda/apps/operatingsystem:v1.0.0".', - title='Image', - ), - ] - imagePullSecrets: Annotated[ - Optional[List[str]], - Field( - description='Secrets to use to pull the image for this workflow.', - title='Image Pull Secrets', - ), - ] = None - - -class WorkflowDefinitionDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class WorkflowDefinitionDeletedResources( - RootModel[List[WorkflowDefinitionDeletedResourceEntry]] -): - root: List[WorkflowDefinitionDeletedResourceEntry] - - -class WorkflowDefinitionMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class ClusterRole(BaseModel): - apiVersion: str - kind: str - metadata: ClusterRoleMetadata - spec: Annotated[ - Spec, - Field( - description='ClusterRole defines a set of permissions to access EDA resources.\nClusterRoles and users are bound via groups, selecting a set of users and a set of ClusterRoles to bind.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='RoleStatus defines the observed state of Role', title='Status' - ), - ] = None - - -class ClusterRoleList(BaseModel): - apiVersion: str - items: Optional[List[ClusterRole]] = None - kind: str - - -class Deviation(BaseModel): - apiVersion: str - kind: str - metadata: DeviationMetadata - spec: Annotated[ - SpecModel, - Field( - description='Deviations are used to represent differences between the intended and actual state of a target.\nThey indicate the intended state - or the computed configuration EDA expects, and compare this to the actual or running state, or the configuration retrieved from the target.\nDeviations are most often generated by out-of-band changes to a target by an external system or user, and\ncan be accepted or rejected. Rejecting a Deviation will result in the intended configuration being re-applied, undoing the out-of-band change.\nDeviations are raised per table, meaning a single change on a target may result in more than one Deviation.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='DeviationStatus defines the observed state of Deviation', - title='Status', - ), - ] = None - - -class DeviationAction(BaseModel): - apiVersion: str - kind: str - metadata: DeviationActionMetadata - spec: Annotated[ - SpecModel1, - Field( - description='DeviationAction allows manual and API-driven actions to be performed on Deviation resources.\nThey are the only means to which and end user can accept or reject deviations, as Deviation resources themselves are read only.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='DeviationActionStatus defines the observed state of DeviationAction', - title='Status', - ), - ] = None - - -class DeviationActionList(BaseModel): - apiVersion: str - items: Optional[List[DeviationAction]] = None - kind: str - - -class DeviationList(BaseModel): - apiVersion: str - items: Optional[List[Deviation]] = None - kind: str - - -class EdgeInterface(BaseModel): - apiVersion: str - kind: str - metadata: EdgeInterfaceMetadata - spec: Annotated[ - SpecModel2, - Field( - description='EdgeInterfaceSpec defines the desired state of EdgeInterface', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='EdgeInterfaceStatus defines the observed state of EdgeInterface', - title='Status', - ), - ] = None - - -class EdgeInterfaceList(BaseModel): - apiVersion: str - items: Optional[List[EdgeInterface]] = None - kind: str - - -class HttpProxy(BaseModel): - apiVersion: str - kind: str - metadata: HttpProxyMetadata - spec: Annotated[ - SpecModel3, - Field( - description='HttpProxySpec defines the desired state of HttpProxy', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='HttpProxyStatus defines the observed state of HttpProxy', - title='Status', - ), - ] = None - - -class HttpProxyList(BaseModel): - apiVersion: str - items: Optional[List[HttpProxy]] = None - kind: str - - -class IPAllocationPool(BaseModel): - apiVersion: str - kind: str - metadata: IPAllocationPoolMetadata - spec: Annotated[ - SpecModel4, - Field( - description='IPAllocationPool is a generic IP allocation pool supporting allocation of IPv4 and/or IPv6 addresses from a set of segments.\nIt is different from IPInSubnetAllocationPool in that it returns a single unzoned IP address, i.e. an IP address without a subnet. For example a 10.1.1.0/24 segment could return 10.1.1.1.\nConsult application documentation to know which pool type to use for a given use case.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='IPAllocationPoolStatus defines the observed state of IPAllocationPool', - title='Status', - ), - ] = None - - -class IPAllocationPoolList(BaseModel): - apiVersion: str - items: Optional[List[IPAllocationPool]] = None - kind: str - - -class IPInSubnetAllocationPool(BaseModel): - apiVersion: str - kind: str - metadata: IPInSubnetAllocationPoolMetadata - spec: Annotated[ - SpecModel4, - Field( - description='IPInSubnetAllocationPool is a generic IP allocation pool supporting allocation of IPv4 and/or IPv6 addresses from a set of segments.\nIt is different from IPAllocationPool in that it returns a single zoned IP address, i.e. an IP address with a subnet. For example a 10.1.1.0/24 segment could return 10.1.1.1/24.\nConsult application documentation to know which pool type to use for a given use case.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='IPInSubnetAllocationPoolStatus defines the observed state of IPInSubnetAllocationPool', - title='Status', - ), - ] = None - - -class IPInSubnetAllocationPoolList(BaseModel): - apiVersion: str - items: Optional[List[IPInSubnetAllocationPool]] = None - kind: str - - -class IndexAllocationPool(BaseModel): - apiVersion: str - kind: str - metadata: IndexAllocationPoolMetadata - spec: Annotated[ - SpecModel5, - Field( - description='IndexAllocationPool is a generic allocation pool supporting allocation of indexes from a set of segments.\nIt supports allocating things like VLANs, subinterface indexes, autonomous system numbers, or any other integer-based index.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='IndexAllocationPoolStatus defines the observed state of IndexAllocationPool', - title='Status', - ), - ] = None - - -class IndexAllocationPoolList(BaseModel): - apiVersion: str - items: Optional[List[IndexAllocationPool]] = None - kind: str - - -class License(BaseModel): - apiVersion: str - kind: str - metadata: LicenseMetadata - spec: Annotated[ - SpecModel6, - Field( - description='A License represents an application license providing functionality within EDA. A license providing the "base" feature must be provided/valid for transactions to be processed.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model], - Field(description='Status information for this license.', title='Status'), - ] = None - - -class LicenseList(BaseModel): - apiVersion: str - items: Optional[List[License]] = None - kind: str - - -class Namespace(BaseModel): - apiVersion: str - kind: str - metadata: NamespaceMetadata - spec: Annotated[ - SpecModel7, - Field( - description='A Namespace is a logical partition within the cluster that provides a mechanism for isolating resources.\nNamespaces allow for resource segmentation, enabling multiple teams or applications to share the same cluster without conflict.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='NamespaceStatus defines the observed state of Namespace', - title='Status', - ), - ] = None - - -class NamespaceList(BaseModel): - apiVersion: str - items: Optional[List[Namespace]] = None - kind: str - - -class NodeProfile(BaseModel): - apiVersion: str - kind: str - metadata: NodeProfileMetadata - spec: Annotated[ - SpecModel8, - Field( - description='NodeProfileSpec defines the desired state of NodeProfile', - title='Specification', - ), - ] - status: Annotated[Optional[Dict[str, Any]], Field(title='Status')] = None - - -class NodeProfileList(BaseModel): - apiVersion: str - items: Optional[List[NodeProfile]] = None - kind: str - - -class NodeUser(BaseModel): - apiVersion: str - kind: str - metadata: NodeUserMetadata - spec: Annotated[ - SpecModel9, - Field( - description="The NodeUser resource represents a user that can be deployed to a set of TopoNodes. It supports managing the user's password, SSH keys, and group bindings.\nAdditionally a NodeUser is referenced by a NodeProfile to indicate how NPP should connect to TopoNodes.", - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model1], - Field(description='Deployment status of this NodeUser.', title='Status'), - ] = None - - -class NodeUserList(BaseModel): - apiVersion: str - items: Optional[List[NodeUser]] = None - kind: str - - -class Role(BaseModel): - apiVersion: str - kind: str - metadata: RoleMetadata - spec: Annotated[ - SpecModel10, - Field( - description='RoleSpec defines the desired state of Role', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='RoleStatus defines the observed state of Role', title='Status' - ), - ] = None - - -class RoleList(BaseModel): - apiVersion: str - items: Optional[List[Role]] = None - kind: str - - -class SubnetAllocationPool(BaseModel): - apiVersion: str - kind: str - metadata: SubnetAllocationPoolMetadata - spec: Annotated[ - SpecModel11, - Field( - description='SubnetAllocationPool is a generic subnet allocation pool supporting allocation of IPv4 and/or IPv6 child subnets from a list of parent subnet segments.\nIt allocates a subnet of the configured length from the provided parent subnet.\nFor example a pool could return 10.1.0.8/29 when a segment is defined as subnet 10.1.0.0/16 with subnet length 29.\nConsult application documentation to know which pool type to use for a given use case.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='SubnetAllocationPoolStatus defines the observed state of SubnetAllocationPool', - title='Status', - ), - ] = None - - -class SubnetAllocationPoolList(BaseModel): - apiVersion: str - items: Optional[List[SubnetAllocationPool]] = None - kind: str - - -class TopoBreakout(BaseModel): - apiVersion: str - kind: str - metadata: TopoBreakoutMetadata - spec: Annotated[ - SpecModel12, - Field( - description='TopoBreakoutSpec defines the desired state of TopoBreakout', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='TopoBreakoutStatus defines the observed state of TopoBreakout', - title='Status', - ), - ] = None - - -class TopoBreakoutList(BaseModel): - apiVersion: str - items: Optional[List[TopoBreakout]] = None - kind: str - - -class TopoLink(BaseModel): - apiVersion: str - kind: str - metadata: TopoLinkMetadata - spec: Annotated[ - SpecModel13, - Field( - description='TopoLink represents a logical link between two TopoNodes. It may include more than one physical link, being used to represent a LAG or multihomed link.\nTo create a point to point link with a single interface on both sides use a single link property.\nTo create a point to point link with a LAG configured on both side, use two links with matching nodes.\nA multihomed LAG is created by using two or more links where the A side and/or B side can be different.\nCreating a link with only A specified will create an edge interface.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model2], - Field( - description='TopoLinkStatus defines the observed state of TopoLink', - title='Status', - ), - ] = None - - -class TopoLinkList(BaseModel): - apiVersion: str - items: Optional[List[TopoLink]] = None - kind: str - - -class TopoNode(BaseModel): - apiVersion: str - kind: str - metadata: TopoNodeMetadata - spec: Annotated[ - SpecModel14, - Field( - description='A managed network element is represented via a TopoNode resource, describing characteristics of a specific element in the topology.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model3], - Field( - description='TopoNodeStatus defines the observed state of TopoNode', - title='Status', - ), - ] = None - - -class TopoNodeList(BaseModel): - apiVersion: str - items: Optional[List[TopoNode]] = None - kind: str - - -class UdpProxy(BaseModel): - apiVersion: str - kind: str - metadata: UdpProxyMetadata - spec: Annotated[ - SpecModel15, - Field( - description='UdpProxySpec defines the desired state of UdpProxy', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='UdpProxyStatus defines the observed state of UdpProxy', - title='Status', - ), - ] = None - - -class UdpProxyList(BaseModel): - apiVersion: str - items: Optional[List[UdpProxy]] = None - kind: str - - -class WorkflowDefinition(BaseModel): - apiVersion: str - kind: str - metadata: WorkflowDefinitionMetadata - spec: Annotated[ - SpecModel16, - Field( - description='WorkflowDefinitionSpec defines the desired state of FlowDefinition', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='WorkflowDefinitionStatus defines the observed state of FlowDefinition', - title='Status', - ), - ] = None - - -class WorkflowDefinitionList(BaseModel): - apiVersion: str - items: Optional[List[WorkflowDefinition]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/fabrics/__init__.py b/pydantic_eda/com/nokia/eda/fabrics/__init__.py deleted file mode 100644 index b9430f4..0000000 --- a/pydantic_eda/com/nokia/eda/fabrics/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/fabrics.eda.nokia.com/v1alpha1/fabrics.json -# timestamp: 2025-05-07T11:43:39+00:00 diff --git a/pydantic_eda/com/nokia/eda/fabrics/v1alpha1.py b/pydantic_eda/com/nokia/eda/fabrics/v1alpha1.py deleted file mode 100644 index bb84460..0000000 --- a/pydantic_eda/com/nokia/eda/fabrics/v1alpha1.py +++ /dev/null @@ -1,948 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/fabrics.eda.nokia.com/v1alpha1/fabrics.json -# timestamp: 2025-05-07T11:43:39+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class RouteLeaking(BaseModel): - exportPolicy: Annotated[ - str, - Field( - description='Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.', - title='Export Policy', - ), - ] - importPolicy: Annotated[ - str, - Field( - description='Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.', - title='Import Policy', - ), - ] - - -class BorderLeafs(BaseModel): - asnPool: Annotated[ - Optional[str], - Field( - description='Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. This reference will take precedence over the spec.underlayProtocol.asnPool.', - title='Autonomous System Pool', - ), - ] = None - borderLeafNodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select Toponodes to configure as Borderleaf nodes.', - title='Borderleaf Node Selector', - ), - ] = None - routeLeaking: Annotated[ - Optional[RouteLeaking], - Field( - description='Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.', - title='Route Leaking', - ), - ] = None - systemPoolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV4. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv4 Pool - System IP', - ), - ] = None - systemPoolIPV6: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV6. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv6 Pool - System IP', - ), - ] = None - - -class Qos(BaseModel): - egressPolicy: Annotated[Optional[str], Field(title='Egress Policy')] = None - ingressPolicy: Annotated[Optional[str], Field(title='Ingress Policy')] = None - - -class InterSwitchLinks(BaseModel): - linkSelector: Annotated[ - Optional[List[str]], - Field( - description='Selects TopoLinks to include in this Fabric, creating an ISL resource if both Nodes in the TopoLink are part of this Fabric or a selected Fabric.', - title='Link Selector', - ), - ] = None - poolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to DefaultInterfaces which are members of the ISLs. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack DefaultInterfaces.', - title='IPv4 Pool - InterSwitch Link IP', - ), - ] = None - poolIPV6: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to DefaultInterfaces which are members of the ISLs. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack DefaultInterfaces.', - title='IPv6 Pool - InterSwitch Link IP', - ), - ] = None - qos: Annotated[Optional[Qos], Field(title='QoS')] = None - unnumbered: Annotated[ - Optional[Literal['IPV6']], - Field( - description='Enables unnumbered interfaces on the ISL; for IPv6, only link-local addresses are used unless a PoolIPV6 is also specified. DefaultInterfaces in the ISL are added to the DefaultBGPPeer dynamic neighbor list when using an eBGP underlay.', - title='Unnumbered', - ), - ] = None - vlanID: Annotated[ - Optional[int], - Field( - description='Configures the provided VLAN on the DefaultInterfaces which are members of the ISLs.', - ge=1, - le=4094, - title='VLAN ID - InterSwitch Link', - ), - ] = None - - -class Leafs(BaseModel): - asnPool: Annotated[ - Optional[str], - Field( - description='Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. This reference will take precedence over the spec.underlayProtocol.asnPool.', - title='Autonomous System Pool', - ), - ] = None - leafNodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select Toponodes to configure as Leaf nodes.', - title='Leaf Node Selector', - ), - ] = None - routeLeaking: Annotated[ - Optional[RouteLeaking], - Field( - description='Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.', - title='Route Leaking', - ), - ] = None - systemPoolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV4. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv4 Pool - System IP', - ), - ] = None - systemPoolIPV6: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV6. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv6 Pool - System IP', - ), - ] = None - - -class Bfd(BaseModel): - desiredMinTransmitInt: Annotated[ - Optional[int], - Field( - description='The minimum interval in microseconds between transmission of BFD control packets.', - ge=10000, - le=100000000, - title='Transmit Interval', - ), - ] = 1000000 - detectionMultiplier: Annotated[ - Optional[int], - Field( - description='The number of packets that must be missed to declare this session as down.', - ge=3, - le=20, - title='Multiplier', - ), - ] = 3 - enabled: Annotated[ - Optional[bool], - Field(description='Enable Biforward Detection.', title='Enabled'), - ] = False - minEchoReceiveInterval: Annotated[ - Optional[int], - Field( - description='The minimum interval between echo packets the local node can receive in microseconds.', - ge=0, - le=100000000, - title='Minimum Echo Receive Interval', - ), - ] = 1000000 - requiredMinReceive: Annotated[ - Optional[int], - Field( - description='The minimum interval in microseconds between received BFD control packets that this system should support.', - ge=10000, - le=100000000, - title='Receive Interval', - ), - ] = 1000000 - - -class Timers(BaseModel): - connectRetry: Annotated[ - Optional[int], - Field( - description='The time interval in seconds between successive attempts to establish a session with a peer.', - ge=1, - le=65535, - title='Connect Retry', - ), - ] = None - holdTime: Annotated[ - Optional[int], - Field( - description='The hold-time interval in seconds that the router proposes to the peer in its OPEN message.', - ge=0, - le=65535, - title='Hold Time', - ), - ] = None - keepAlive: Annotated[ - Optional[int], - Field( - description='The interval in seconds between successive keepalive messages sent to the peer.', - ge=0, - le=21845, - title='Keep Alive', - ), - ] = None - minimumAdvertisementInterval: Annotated[ - Optional[int], - Field( - description='The value assigned to the MinRouteAdvertisementIntervalTimer of RFC 4271, for both EBGP and IBGP sessions.', - ge=1, - le=255, - title='Minimum Advertisement Interval', - ), - ] = None - - -class Bgp(BaseModel): - autonomousSystem: Annotated[ - Optional[int], - Field( - description='Autonomous System used for iBGP peering session, when protocol is set to IBGP providing an autonomousSystem is required.', - title='Autonomous System', - ), - ] = None - clusterID: Annotated[ - Optional[str], - Field( - description='Sets the cluster ID used by DefaultRouteReflectors, when protocol is set to IBGP providing a clusterID is required.', - title='Cluster ID', - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy, when left empty or not specified the Fabric will automatically generate a policy for the specified protocols.', - title='Export Policy', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy, when left empty or not specified the Fabric will automatically generate a policy for the specified protocols.', - title='Import Policy', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Keychain to be used for authentication when overlay protocol is IBGP, ignored otherwise', - title='Keychain', - ), - ] = None - rrClientNodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select Toponodes to configure as DefaultRouteReflectorClients, these are typically Leaf or Borderleaf nodes. Used on conjunction with rrNodeSelector in order to configure the DefaultBGPPeers for both the DefaultRouteReflectors and DefaultRouteReflectorClients.', - title='Route Reflector Client Node Selector', - ), - ] = None - rrIPAddresses: Annotated[ - Optional[List[str]], - Field( - description='List of route reflector IP addresses not provisioned by this instance of a Fabric resource. Used with rrClientNodeSelector to configure the DefaultBGPPeers on the selected nodes to peer the list of external route reflector IPs.', - title='Route Reflector IP Addresses', - ), - ] = None - rrNodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select Toponodes to configure as DefaultRouteReflectors, these are typically Spine, Superspine or Borderleaf nodes. Used on conjunction with rrClientNodeSelector in order to configure the DefaultBGPPeers for both the DefaultRouteReflectors and DefaultRouteReflectorClients.', - title='Route Reflector Node Selector', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class OverlayProtocol(BaseModel): - bfd: Annotated[ - Optional[Bfd], - Field( - description='Enable BFD on overlay protocol', title='Overlay Protocol BFD' - ), - ] = None - bgp: Annotated[ - Optional[Bgp], - Field(description='Overlay specific BGP properties.', title='BGP'), - ] = None - protocol: Annotated[ - Literal['IBGP', 'EBGP'], - Field( - description='List of routing protocols to used to advertise EVPN routes for overlay services. When EBGP is used, the BGP properties configured under the spec.underlayProtocol will be used.', - title='Protocol', - ), - ] - - -class Spines(BaseModel): - asnPool: Annotated[ - Optional[str], - Field( - description='Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. This reference will take precedence over the spec.underlayProtocol.asnPool.', - title='Autonomous System Pool', - ), - ] = None - routeLeaking: Annotated[ - Optional[RouteLeaking], - Field( - description='Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.', - title='Route Leaking', - ), - ] = None - spineNodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select Toponodes to configure as Spine nodes.', - title='Spine Node Selector', - ), - ] = None - systemPoolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV4. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv4 Pool - System IP', - ), - ] = None - systemPoolIPV6: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV6. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv6 Pool - System IP', - ), - ] = None - - -class SuperSpines(BaseModel): - asnPool: Annotated[ - Optional[str], - Field( - description='Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. This reference will take precedence over the spec.underlayProtocol.asnPool.', - title='Autonomous System Pool', - ), - ] = None - routeLeaking: Annotated[ - Optional[RouteLeaking], - Field( - description='Route leaking controlled by routing policies in and out of the DefaultRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.', - title='Route Leaking', - ), - ] = None - superSpineNodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select Toponodes to configure as Superspine nodes.', - title='Superspine Node Selector', - ), - ] = None - systemPoolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV4. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv4 Pool - System IP', - ), - ] = None - systemPoolIPV6: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. This reference will take precedence over the spec.systemPoolIPV6. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv6 Pool - System IP', - ), - ] = None - - -class BgpModel(BaseModel): - asnPool: Annotated[ - Optional[str], - Field( - description='Reference to an IndexAllocationPool pool to use for Autonomous System Number allocations. Used when eBGP is configured as an underlay protocol. If specified under the Leaf/Spine/Superspine/Borderleaf those will take precedence.', - title='Autonomous System Pool', - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy, when left empty or not specified the Fabric will automatically generate a policy for the specified protocols.', - title='Export Policy', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy, when left empty or not specified the Fabric will automatically generate a policy for the specified protocols.', - title='Import Policy', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field(description='Keychain to be used for authentication', title='Keychain'), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class UnderlayProtocol(BaseModel): - bfd: Annotated[ - Optional[Bfd], - Field( - description='Enable BFD on underlay protocol', title='Underlay Protocol BFD' - ), - ] = None - bgp: Annotated[ - BgpModel, Field(description='Underlay specific BGP properties.', title='BGP') - ] - protocol: Annotated[ - List[Literal['EBGP']], - Field( - description='List of routing protocols to used between peers of an ISL. Multiple protocols may be listed, if so multiple protocols will be used.', - title='Protocol', - ), - ] - - -class Spec(BaseModel): - borderLeafs: Annotated[Optional[BorderLeafs], Field(title='Borderleafs')] = None - fabricSelector: Annotated[ - Optional[List[str]], - Field( - description='Selects Fabric resources when connecting multiple Fabrics together. Only one Fabric needs the selector, typically the upper layer (e.g., Superspine) selecting the lower layer (e.g., a pod fabric of leafs and spines). This helps build complete Fabrics in smaller instances of the Fabric resource. This instance selecting other fabrics must also select the InterSwitchLinks connecting itself to the selected Fabrics.', - title='Fabric Selector', - ), - ] = None - interSwitchLinks: Annotated[ - Optional[InterSwitchLinks], Field(title='InterSwitchLinks') - ] = None - leafs: Annotated[Optional[Leafs], Field(title='Leafs')] = None - overlayProtocol: Annotated[ - Optional[OverlayProtocol], - Field(description='Set the overlay protocol used', title='Overlay Protocol'), - ] = None - routeLeaking: Annotated[ - Optional[RouteLeaking], - Field( - description='Route leaking controlled by routing policies in and out of the DefaulRouters on each node. If specifided under the Leafs, Spines, SuperSpines, or BorderLeafs those will take precedence.', - title='Route Leaking', - ), - ] = None - spines: Annotated[Optional[Spines], Field(title='Spines')] = None - superSpines: Annotated[Optional[SuperSpines], Field(title='Superspines')] = None - systemPoolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv4 address to system/lo0 interfaces. If specified under the Leaf/Spine/Superspine/Borderleaf those will take precedence. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv4 Pool - System IP', - ), - ] = None - systemPoolIPV6: Annotated[ - Optional[str], - Field( - description='Reference to an IPAllocationPool used to dynamically allocate an IPv6 address to system/lo0 interfaces. If specified under the Leaf/Spine/Superspine/Borderleaf those will take precedence. Both IPv4 and IPv6 pools can be configured simultaneously for dual-stack system/lo0 interfaces.', - title='IPv6 Pool - System IP', - ), - ] = None - underlayProtocol: Annotated[ - Optional[UnderlayProtocol], - Field(description='Set the underlay protocol used', title='Underlay Protocol'), - ] = None - - -class BorderLeafNode(BaseModel): - node: Annotated[ - Optional[str], Field(description='Name of the TopoNode.', title='Node') - ] = None - operatingSystem: Annotated[ - Optional[str], - Field( - description='Operating system running on the node.', - title='Operating System', - ), - ] = None - operatingSystemVersion: Annotated[ - Optional[str], - Field( - description='Operating system version running on the node.', - title='Operating System Version', - ), - ] = None - underlayAutonomousSystem: Annotated[ - Optional[int], - Field( - description='Underlay Autonomous System used for eBGP peering session, when protocol is set to eBGP this is required.', - title='Underlay Autonomous System', - ), - ] = None - - -class LeafNode(BaseModel): - node: Annotated[ - Optional[str], Field(description='Name of the TopoNode.', title='Node') - ] = None - operatingSystem: Annotated[ - Optional[str], - Field( - description='Operating system running on the node.', - title='Operating System', - ), - ] = None - operatingSystemVersion: Annotated[ - Optional[str], - Field( - description='Operating system version running on the node.', - title='Operating System Version', - ), - ] = None - underlayAutonomousSystem: Annotated[ - Optional[int], - Field( - description='Underlay Autonomous System used for eBGP peering session, when protocol is set to eBGP this is required.', - title='Underlay Autonomous System', - ), - ] = None - - -class SpineNode(BaseModel): - node: Annotated[ - Optional[str], Field(description='Name of the TopoNode.', title='Node') - ] = None - operatingSystem: Annotated[ - Optional[str], - Field( - description='Operating system running on the node.', - title='Operating System', - ), - ] = None - operatingSystemVersion: Annotated[ - Optional[str], - Field( - description='Operating system version running on the node.', - title='Operating System Version', - ), - ] = None - underlayAutonomousSystem: Annotated[ - Optional[int], - Field( - description='Underlay Autonomous System used for eBGP peering session, when protocol is set to eBGP this is required.', - title='Underlay Autonomous System', - ), - ] = None - - -class SuperSpineNode(BaseModel): - node: Annotated[ - Optional[str], Field(description='Name of the TopoNode.', title='Node') - ] = None - operatingSystem: Annotated[ - Optional[str], - Field( - description='Operating system running on the node.', - title='Operating System', - ), - ] = None - operatingSystemVersion: Annotated[ - Optional[str], - Field( - description='Operating system version running on the node.', - title='Operating System Version', - ), - ] = None - underlayAutonomousSystem: Annotated[ - Optional[int], - Field( - description='Underlay Autonomous System used for eBGP peering session, when protocol is set to eBGP this is required.', - title='Underlay Autonomous System', - ), - ] = None - - -class Status(BaseModel): - borderLeafNodes: Annotated[ - Optional[List[BorderLeafNode]], - Field( - description='List of border leaf nodes in the Fabric.', - title='Border Leaf Nodes', - ), - ] = None - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the Fabric. The health score of the Fabric is determined by the aggregate health score of the resources emited by the Fabric such as ISL, DefaultRouteReflectors etc.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - leafNodes: Annotated[ - Optional[List[LeafNode]], - Field(description='List of leaf nodes in the Fabric.', title='Leaf Nodes'), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the Fabric. The operational state of the fabric is determined by monitoring the operational state of the following resources (if applicable): DefaultRouters, ISLs.', - title='Operational State', - ), - ] = None - spineNodes: Annotated[ - Optional[List[SpineNode]], - Field(description='List of spine nodes in the Fabric.', title='Spine Nodes'), - ] = None - superSpineNodes: Annotated[ - Optional[List[SuperSpineNode]], - Field( - description='List of super spine nodes in the Fabric.', - title='Superspine Nodes', - ), - ] = None - - -class FabricDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class FabricDeletedResources(RootModel[List[FabricDeletedResourceEntry]]): - root: List[FabricDeletedResourceEntry] - - -class FabricMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class BgpModel1(BaseModel): - afiSAFI: Annotated[ - Optional[List[str]], - Field( - description='Which AFI and SAFI to advertise on the BGP peering session. Options: ipv4unicast, ipv6unicast, l2vpnevpn', - title='AFI SAFI', - ), - ] = None - bgpGroup: Annotated[ - Optional[str], - Field(description='Reference to a DefaultBgpGroup.', title='BGP Group'), - ] = None - enabled: Annotated[ - bool, - Field( - description='Enable or disable BGP peering between the two endpoints of the ISL. [default=false]', - title='Enabled', - ), - ] - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a RoutingPolicy to use when evaluating route exports from the DefaultRouter.', - title='Export Policy', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a RoutingPolicy to use when evaluating route imports into the DefaultRouter.', - title='Import Policy', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field(description='Keychain to be used for authentication', title='Keychain'), - ] = None - localInterfaceAS: Annotated[ - int, - Field( - description='The Autonomous System to configure on the Local Interface.', - ge=0, - le=4294967295, - title='Local Interface AS', - ), - ] - remoteInterfaceAS: Annotated[ - int, - Field( - description='The Autonomous System to configure on the Remote Interface.', - ge=0, - le=4294967295, - title='Remote Interface AS', - ), - ] - - -class SpecModel(BaseModel): - bfd: Annotated[ - Optional[Bfd], - Field( - description='Enable or disable BFD on the ISL. [default=false]', title='BFD' - ), - ] = None - bgp: Annotated[Optional[BgpModel1], Field(title='BGP')] = None - localDefaultRouter: Annotated[ - str, - Field( - description='Reference to the DefautlRouter associated with the local Interface in which the ISL will be provisioned.', - title='Local Default Router', - ), - ] - localInterface: Annotated[ - str, Field(description='Reference to an Interface.', title='Local Interface') - ] - poolIPV4: Annotated[ - Optional[str], - Field( - description='Reference to an IPv4 allocation pool to use for ISL subnet allocations.', - title='IPv4 Allocation Pool', - ), - ] = None - poolIPV6: Annotated[ - Optional[str], - Field( - description='Reference to an IPv6 allocation pool to use for ISL subnet allocations.', - title='IPv6 Allocation Pool', - ), - ] = None - qos: Annotated[Optional[Qos], Field(title='QoS')] = None - remoteDefaultRouter: Annotated[ - str, - Field( - description='Reference to the DefautlRouter associated with the remote Interface in which the ISL will be provisioned.', - title='Remote Default Router', - ), - ] - remoteInterface: Annotated[ - str, Field(description='Reference to an Interface', title='Remote Interface') - ] - unnumbered: Annotated[ - Optional[Literal['IPV6']], - Field( - description='Enables the use of unnumbered interfaces on the ISL. For IPv6, no IP address are configured on the sub-interface and only the link local address will be used. If any allocation pool is specified for IPv6 that will take precedence and IPs will be assigned to the interfaces. When using eBGP for an underlay protocol, the DefaultInterfaces which are a part of the ISL will be added to the BGP dynamic neighbor list.', - title='Unnumbered', - ), - ] = None - vlanID: Annotated[ - Optional[int], - Field( - description='Single VLAN tag value between 1-4094.', - ge=1, - le=4094, - title='VLAN ID', - ), - ] = None - - -class LocalInterface(BaseModel): - IPv4Address: Annotated[ - Optional[str], - Field(description='Local Interface IPv4 address', title='IPv4 Address'), - ] = None - IPv6Address: Annotated[ - Optional[str], - Field(description='Local Interface IPv4 address', title='IPv6 Address'), - ] = None - defaultInterface: Annotated[ - Optional[str], - Field( - description='Reference to the DefaulInterface assocaited with the local interface', - title='Default Interface', - ), - ] = None - node: Annotated[ - Optional[str], - Field( - description='Reference to the TopoNode on which the local interface is configured', - title='Node', - ), - ] = None - - -class RemoteInterface(BaseModel): - IPv4Address: Annotated[ - Optional[str], - Field(description='Remote Interface IPv4 address', title='IPv4 Address'), - ] = None - IPv6Address: Annotated[ - Optional[str], - Field(description='Remote Interface IPv6 address', title='IPv6 Address'), - ] = None - defaultInterface: Annotated[ - Optional[str], - Field( - description='Reference to the DefaulInterface assocaited with the remote interface', - title='Default Interface', - ), - ] = None - node: Annotated[ - Optional[str], - Field( - description='Reference to the TopoNode on which the remote interface is configured', - title='Node', - ), - ] = None - - -class Status1Model(BaseModel): - health: Annotated[ - Optional[int], - Field(description='Indicates the health score of the ISL', title='Health'), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed', - title='Last Change', - ), - ] = None - localInterface: Annotated[ - Optional[LocalInterface], - Field(description='Local Interface', title='Local Interface'), - ] = None - operationalState: Annotated[ - Optional[str], - Field(description='Operational state of the ISL', title='Operational State'), - ] = None - remoteInterface: Annotated[ - Optional[RemoteInterface], - Field(description='Remote Interface', title='Remote Interface'), - ] = None - - -class ISLDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class ISLDeletedResources(RootModel[List[ISLDeletedResourceEntry]]): - root: List[ISLDeletedResourceEntry] - - -class ISLMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Fabric(BaseModel): - apiVersion: str - kind: str - metadata: FabricMetadata - spec: Annotated[ - Spec, - Field( - description='The Fabric defines the desired state of a Fabric resource, enabling the automation and management of data center network fabrics. It includes configurations for IP address allocation pools, network topology roles (Leafs, Spines, SuperSpines, BorderLeafs), inter-switch links, and network protocols (underlay and overlay). The specification allows for detailed control over routing strategies, including ASN allocations for BGP-based protocols, and supports advanced features like BFD.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='FabricStatus defines the observed state of Fabric', - title='Status', - ), - ] = None - - -class FabricList(BaseModel): - apiVersion: str - items: Optional[List[Fabric]] = None - kind: str - - -class ISL(BaseModel): - apiVersion: str - kind: str - metadata: ISLMetadata - spec: Annotated[ - SpecModel, - Field( - description='The ISL enables the configuration and management of direct links between Nodes. This resource allows for specifying IPv4 and IPv6 allocation pools, enabling BFD for fast failure detection, and configuring VLAN IDs for the ISL. It also supports BGP peering between the endpoints, with options for setting autonomous systems, AFI/SAFI configurations, and import/export routing policies.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model], - Field( - description='ISLStatus defines the observed state of ISL', title='Status' - ), - ] = None - - -class ISLList(BaseModel): - apiVersion: str - items: Optional[List[ISL]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/filters/__init__.py b/pydantic_eda/com/nokia/eda/filters/__init__.py deleted file mode 100644 index 5645986..0000000 --- a/pydantic_eda/com/nokia/eda/filters/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/filters.eda.nokia.com/v1alpha1/filters.json -# timestamp: 2025-05-07T11:43:43+00:00 diff --git a/pydantic_eda/com/nokia/eda/filters/v1alpha1.py b/pydantic_eda/com/nokia/eda/filters/v1alpha1.py deleted file mode 100644 index 8150a9e..0000000 --- a/pydantic_eda/com/nokia/eda/filters/v1alpha1.py +++ /dev/null @@ -1,807 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/filters.eda.nokia.com/v1alpha1/filters.json -# timestamp: 2025-05-07T11:43:43+00:00 - -from __future__ import annotations - -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class RateLimit(BaseModel): - burstSize: Annotated[ - Optional[int], - Field(description='The maximum burst size in bytes.', title='Burst Size'), - ] = None - entrySpecificPolicer: Annotated[ - Optional[bool], - Field( - description='Controls policer instantiation: false for shared instance, true for per-entry instances', - title='Entry Specific Policer', - ), - ] = False - peakRate: Annotated[ - Optional[int], - Field(description='The peak rate in kilobytes per second.', title='Peak Rate'), - ] = None - scope: Annotated[ - Optional[Literal['Global', 'Subinterface']], - Field( - description='Determines how the policer is applied across subinterfaces. Global applies the policer across all subinterfaces, while Subinterface applies it individually to each subinterface.', - title='Scope', - ), - ] = 'Global' - - -class IpEntry(BaseModel): - action: Annotated[ - Optional[Literal['Drop', 'Accept', 'RateLimit']], - Field( - description="An action to take, either 'Accept','Drop', or 'RateLimit'.", - title='Action', - ), - ] = None - destinationPortName: Annotated[ - Optional[ - Literal[ - 'ACAP', - 'AFP-TCP', - 'ARNS', - 'ASF-RMCP', - 'ASHARE', - 'ATALK-RM', - 'AURP', - 'AUTH', - 'BFD', - 'BFD-ECHO', - 'BFTP', - 'BGMP', - 'BGP', - 'BOOTPC', - 'BOOTPS', - 'CCSO-NS', - 'CHARGEN', - 'CISCO-TDP', - 'CITADEL', - 'CLEARCASE', - 'COMMERCE', - 'COURIER', - 'DAYTIME', - 'DHCP-FAILOVER', - 'DHCPV6-CLIENT', - 'DHCPV6-SERVER', - 'DICOM', - 'DISCARD', - 'DNSIX', - 'DOMAIN', - 'DSP', - 'ECHO', - 'EPP', - 'ESRO', - 'EXEC', - 'FINGER', - 'FTP', - 'FTP-DATA', - 'FTPS', - 'FTPS-DATA', - 'GODI', - 'GOPHER', - 'GTP-C', - 'GTP-PRIME', - 'GTP-U', - 'HA-CLUSTER', - 'HOSTNAME', - 'HP-ALARM-MGR', - 'HTTP', - 'HTTP-ALT', - 'HTTP-MGMT', - 'HTTP-RPC', - 'HTTPS', - 'IEEE-MMS-SSL', - 'IMAP', - 'IMAP3', - 'IMAPS', - 'IPP', - 'IPSEC', - 'IPX', - 'IRC', - 'IRIS-BEEP', - 'ISAKMP', - 'ISAKMP-NAT', - 'ISCSI', - 'ISO-TSAP', - 'KERBEROS', - 'KERBEROS-ADM', - 'KLOGIN', - 'KPASSWD', - 'KSHELL', - 'L2TP', - 'LDAP', - 'LDAPS', - 'LDP', - 'LMP', - 'LOGIN', - 'LPD', - 'LSP-PING', - 'MAC-SERVER-ADM', - 'MATIP-A', - 'MATIP-B', - 'MICRO-BFD', - 'MICROSOFT-DS', - 'MOBILE-IP', - 'MONITOR', - 'MPP', - 'MS-EXCHANGE', - 'MSDP', - 'MSP', - 'MSSQL-M', - 'MSSQL-S', - 'MULTIHOP-BFD', - 'NAS', - 'NCP', - 'NETBIOS-DATA', - 'NETBIOS-NS', - 'NETBIOS-SS', - 'NETNEWS', - 'NETRJS-1', - 'NETRJS-2', - 'NETRJS-3', - 'NETRJS-4', - 'NETWALL', - 'NEW-RWHO', - 'NFS', - 'NNTP', - 'NNTPS', - 'NTP', - 'ODMR', - 'OLSR', - 'OPENVPN', - 'PIM-AUTO-RP', - 'PKIX-TIMESTAMP', - 'POP2', - 'POP3', - 'POP3S', - 'PPTP', - 'PRINT-SRV', - 'PTP-EVENT', - 'PTP-GENERAL', - 'QMTP', - 'QOTD', - 'RADIUS', - 'RADIUS-ACCT', - 'REMOTE-MAIL', - 'REMOTEFS', - 'REMOTECMD', - 'RIP', - 'RJE', - 'RLP', - 'RLZDB', - 'RMC', - 'RMONITOR', - 'RPC2PORTMAP', - 'RSYNC', - 'RTELNET', - 'RTSP', - 'SGMP', - 'SILC', - 'SMUX', - 'SNA-GW', - 'SNMP', - 'SNMP-TRAP', - 'SNPP', - 'SMTP', - 'SQL-SVCS', - 'SQL', - 'SSH', - 'SUBMISSION', - 'SUNRPC', - 'SVCLOC', - 'SYSLOG', - 'SYSTAT', - 'TACACS', - 'TALK', - 'TCPMUX', - 'TCPNETHASPSRV', - 'TFTP', - 'TIME', - 'TIMED', - 'UPS', - 'XDMCP', - 'XNS-CH', - 'XNS-MAIL', - 'XNS-TIME', - 'Z3950', - ] - ], - Field( - description='Destination port to match by name.', - title='Destination Port Name', - ), - ] = None - destinationPortNumber: Annotated[ - Optional[int], - Field( - description='Destination port to match by numerical value.', - ge=0, - le=65535, - title='Destination Port Number', - ), - ] = None - destinationPortOperator: Annotated[ - Optional[Literal['Equals', 'GreaterOrEquals', 'LessOrEquals']], - Field( - description='Operator to use when matching destinationPort, either Equals, GreaterOrEquals, or LessOrEquals.', - title='Destination Port Operator', - ), - ] = None - destinationPortRange: Annotated[ - Optional[str], - Field( - description='Range of destination ports to match, in the format n-m, e.g. 100-200, The start and end of the range must be port numbers.', - title='Destination Port Range', - ), - ] = None - destinationPrefix: Annotated[ - Optional[str], - Field(description='Destination prefix to match.', title='Destination Prefix'), - ] = None - firstFragment: Annotated[ - Optional[bool], - Field(description='Match the first fragment only.', title='First Fragment'), - ] = None - fragment: Annotated[ - Optional[bool], Field(description='Match any fragment.', title='Fragment') - ] = None - icmpCode: Annotated[ - Optional[List[int]], - Field( - description='Match a specific ICMP code, as a number between 0-255, e.g. 0.', - max_length=255, - min_length=0, - title='ICMP Code', - ), - ] = None - icmpTypeName: Annotated[ - Optional[ - Literal[ - 'DestUnreachable', - 'Echo', - 'EchoReply', - 'EchoRequest', - 'McastRtrAdv', - 'McastRtrSolicit', - 'McastRtrTerm', - 'MldDone', - 'MldQuery', - 'MldReport', - 'MldV2', - 'NeighborAdvertise', - 'NeighborSolicit', - 'NodeInfoQuery', - 'NodeInfoResponse', - 'PacketTooBig', - 'ParamProblem', - 'Redirect', - 'RouterAdvertise', - 'RouterRenumber', - 'RouterSolicit', - 'SourceQuench', - 'TimeExceeded', - 'Timestamp', - 'TimestampReply', - ] - ], - Field( - description='Match a specific ICMP type by name, e.g. dest-unreachable.', - title='ICMP Type Name', - ), - ] = None - icmpTypeNumber: Annotated[ - Optional[int], - Field( - description='Match a specific ICMP type by number.', - ge=0, - le=255, - title='ICMP Type Number', - ), - ] = None - protocolName: Annotated[ - Optional[ - Literal[ - 'AH', - 'EGP', - 'EIGRP', - 'ESP', - 'GGP', - 'GRE', - 'ICMP', - 'ICMP6', - 'IDRP', - 'IGMP', - 'IGP', - 'IPV4', - 'IPV6', - 'IPV6-DEST-OPTS', - 'IPV6-HOP', - 'L2TP', - 'MPLS-IN-IP', - 'NO-NEXT-HDR', - 'OSPF', - 'PIM', - 'ROHC', - 'RSVP', - 'SCTP', - 'ST', - 'TCP', - 'UDP', - 'VRRP', - ] - ], - Field( - description='Match a specific IP protocol name (specified in the type field of the IP header).', - title='Protocol Name', - ), - ] = None - protocolNumber: Annotated[ - Optional[int], - Field( - description='Match a specific IP protocol number (specified in the type field of the IP header).', - ge=0, - le=255, - title='Protocol Number', - ), - ] = None - rateLimit: Annotated[ - Optional[RateLimit], - Field( - description="Rate limit to apply when the action is 'RateLimit'.", - title='Rate Limit', - ), - ] = None - sourcePortName: Annotated[ - Optional[ - Literal[ - 'ACAP', - 'AFP-TCP', - 'ARNS', - 'ASF-RMCP', - 'ASHARE', - 'ATALK-RM', - 'AURP', - 'AUTH', - 'BFD', - 'BFD-ECHO', - 'BFTP', - 'BGMP', - 'BGP', - 'BOOTPC', - 'BOOTPS', - 'CCSO-NS', - 'CHARGEN', - 'CISCO-TDP', - 'CITADEL', - 'CLEARCASE', - 'COMMERCE', - 'COURIER', - 'DAYTIME', - 'DHCP-FAILOVER', - 'DHCPV6-CLIENT', - 'DHCPV6-SERVER', - 'DICOM', - 'DISCARD', - 'DNSIX', - 'DOMAIN', - 'DSP', - 'ECHO', - 'EPP', - 'ESRO', - 'EXEC', - 'FINGER', - 'FTP', - 'FTP-DATA', - 'FTPS', - 'FTPS-DATA', - 'GODI', - 'GOPHER', - 'GTP-C', - 'GTP-PRIME', - 'GTP-U', - 'HA-CLUSTER', - 'HOSTNAME', - 'HP-ALARM-MGR', - 'HTTP', - 'HTTP-ALT', - 'HTTP-MGMT', - 'HTTP-RPC', - 'HTTPS', - 'IEEE-MMS-SSL', - 'IMAP', - 'IMAP3', - 'IMAPS', - 'IPP', - 'IPSEC', - 'IPX', - 'IRC', - 'IRIS-BEEP', - 'ISAKMP', - 'ISAKMP-NAT', - 'ISCSI', - 'ISO-TSAP', - 'KERBEROS', - 'KERBEROS-ADM', - 'KLOGIN', - 'KPASSWD', - 'KSHELL', - 'L2TP', - 'LDAP', - 'LDAPS', - 'LDP', - 'LMP', - 'LOGIN', - 'LPD', - 'LSP-PING', - 'MAC-SERVER-ADM', - 'MATIP-A', - 'MATIP-B', - 'MICRO-BFD', - 'MICROSOFT-DS', - 'MOBILE-IP', - 'MONITOR', - 'MPP', - 'MS-EXCHANGE', - 'MSDP', - 'MSP', - 'MSSQL-M', - 'MSSQL-S', - 'MULTIHOP-BFD', - 'NAS', - 'NCP', - 'NETBIOS-DATA', - 'NETBIOS-NS', - 'NETBIOS-SS', - 'NETNEWS', - 'NETRJS-1', - 'NETRJS-2', - 'NETRJS-3', - 'NETRJS-4', - 'NETWALL', - 'NEW-RWHO', - 'NFS', - 'NNTP', - 'NNTPS', - 'NTP', - 'ODMR', - 'OLSR', - 'OPENVPN', - 'PIM-AUTO-RP', - 'PKIX-TIMESTAMP', - 'POP2', - 'POP3', - 'POP3S', - 'PPTP', - 'PRINT-SRV', - 'PTP-EVENT', - 'PTP-GENERAL', - 'QMTP', - 'QOTD', - 'RADIUS', - 'RADIUS-ACCT', - 'REMOTE-MAIL', - 'REMOTEFS', - 'REMOTECMD', - 'RIP', - 'RJE', - 'RLP', - 'RLZDB', - 'RMC', - 'RMONITOR', - 'RPC2PORTMAP', - 'RSYNC', - 'RTELNET', - 'RTSP', - 'SGMP', - 'SILC', - 'SMUX', - 'SNA-GW', - 'SNMP', - 'SNMP-TRAP', - 'SNPP', - 'SMTP', - 'SQL-SVCS', - 'SQL', - 'SSH', - 'SUBMISSION', - 'SUNRPC', - 'SVCLOC', - 'SYSLOG', - 'SYSTAT', - 'TACACS', - 'TALK', - 'TCPMUX', - 'TCPNETHASPSRV', - 'TFTP', - 'TIME', - 'TIMED', - 'UPS', - 'XDMCP', - 'XNS-CH', - 'XNS-MAIL', - 'XNS-TIME', - 'Z3950', - ] - ], - Field(description='Source port to match by name.', title='Source Port Name'), - ] = None - sourcePortNumber: Annotated[ - Optional[int], - Field( - description='Source port to match by numerical value.', - ge=0, - le=65535, - title='Source Port Number', - ), - ] = None - sourcePortOperator: Annotated[ - Optional[Literal['Equals', 'GreaterOrEquals', 'LessOrEquals']], - Field( - description='Operator to use when matching sourcePort, either Equals, GreaterOrEquals, or LessOrEquals.', - title='Source Port Operator', - ), - ] = None - sourcePortRange: Annotated[ - Optional[str], - Field( - description='Range of source ports to match, in the format n-m, e.g. 100-200. The start and end of the range must be port numbers.', - title='Source Port Range', - ), - ] = None - sourcePrefix: Annotated[ - Optional[str], - Field(description='Source prefix to match.', title='Source Prefix'), - ] = None - tcpFlags: Annotated[ - Optional[str], - Field( - description='Match TCP flags, usable with !, &, | and the flags RST, SYN, and ACK.', - title='TCP Flags', - ), - ] = None - - -class MacEntry(BaseModel): - action: Annotated[ - Optional[Literal['Drop', 'Accept', 'RateLimit']], - Field( - description="An action to take, either 'Accept','Drop', or 'RateLimit'.", - title='Action', - ), - ] = None - destinationMAC: Annotated[ - Optional[str], - Field( - description='Match an Ethernet frame if its destination MAC address logically anded with the mask equals this MAC address.', - title='Destination MAC', - ), - ] = None - destinationMACMask: Annotated[ - Optional[str], - Field( - description='Match an Ethernet frame if its destination MAC address logically anded with the mask equals the configured MAC address.', - title='Destination MAC Mask', - ), - ] = None - ethertype: Annotated[ - Optional[ - Literal[ - 'ARP', - 'AUTHENTICATION8021X', - 'ETHOAM', - 'FCOE', - 'FCOEINITIALIZATION', - 'FLOWCONTROL', - 'IPV4', - 'IPV6', - 'LACP', - 'LLDP', - 'MACSEC', - 'MPLSMULTICAST', - 'MPLSUNICAST', - 'PBB', - 'PPPOEDISCOVERY', - 'PPPOESESSION', - 'PTP', - 'ROCE', - ] - ], - Field( - description='An Ethernet frame matches this condition if its ethertype value (after 802.1Q VLAN tags) matches the specified value.', - title='Ethertype', - ), - ] = None - outerVLANIDOperator: Annotated[ - Optional[Literal['Equals', 'GreaterOrEquals', 'LessOrEquals']], - Field( - description='Operator to use when matching OuterVlanIdValue, either Equals, GreaterOrEquals, or LessOrEquals.', - title='Outer VLAN ID Operator', - ), - ] = None - outerVLANIDRange: Annotated[ - Optional[str], - Field( - description='Range of Outer vlan IDs to match, in the format n-m, e.g. 100-200', - title='Outer VLAN ID Range', - ), - ] = None - outerVLANIDValue: Annotated[ - Optional[str], - Field( - description="Ethernet frame matching criteria based on the outermost VLAN ID found before the subinterface-defining VLAN tag (if any) is removed. A value of 'none' will match only untagged frames.", - title='Outer VLAN ID Value', - ), - ] = None - rateLimit: Annotated[ - Optional[RateLimit], - Field( - description="Rate limit to apply when the action is 'RateLimit'.", - title='Rate Limit', - ), - ] = None - sourceMAC: Annotated[ - Optional[str], - Field( - description='Match an Ethernet frame if its source MAC address logically anded with the mask equals this MAC address.', - title='Source MAC', - ), - ] = None - sourceMACMask: Annotated[ - Optional[str], - Field( - description='Match an Ethernet frame if its source MAC address logically anded with the mask equals the configured MAC address.', - title='Source MAC Mask', - ), - ] = None - - -class Entry(BaseModel): - ipEntry: Annotated[Optional[IpEntry], Field(title='IP Entry')] = None - macEntry: Annotated[Optional[MacEntry], Field(title='MAC Entry')] = None - type: Annotated[Literal['IPV4', 'IPV6', 'MAC', 'Auto'], Field(title='Type')] - - -class Spec(BaseModel): - entries: Annotated[ - List[Entry], - Field( - description='Specifies the list of filter entries, in order.', - title='Entries', - ), - ] - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select Toponodes on which to deploy the CPM filter.', - title='Node Selector', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field( - description='Reference to a list of TopoNodes on which to deploy the CPM filter.', - title='Nodes', - ), - ] = None - - -class ControlPlaneFilterDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class ControlPlaneFilterDeletedResources( - RootModel[List[ControlPlaneFilterDeletedResourceEntry]] -): - root: List[ControlPlaneFilterDeletedResourceEntry] - - -class ControlPlaneFilterMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel(BaseModel): - entries: Annotated[ - List[Entry], - Field( - description='Specifies the list of filter entries, in order.', - title='Entries', - ), - ] - - -class FilterDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class FilterDeletedResources(RootModel[List[FilterDeletedResourceEntry]]): - root: List[FilterDeletedResourceEntry] - - -class FilterMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class ControlPlaneFilter(BaseModel): - apiVersion: str - kind: str - metadata: ControlPlaneFilterMetadata - spec: Annotated[ - Spec, - Field( - description='ControlPlaneFilter allows for specifying a list of Nodes or Node selectors where the filter should be applied and managing filter entries in order.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='ControlPlaneFilterStatus defines the observed state of ControlPlaneFilter', - title='Status', - ), - ] = None - - -class ControlPlaneFilterList(BaseModel): - apiVersion: str - items: Optional[List[ControlPlaneFilter]] = None - kind: str - - -class Filter(BaseModel): - apiVersion: str - kind: str - metadata: FilterMetadata - spec: Annotated[ - SpecModel, - Field( - description='Filter allows for the creation and management of ordered filtering rules based on IP or MAC criteria. The resource supports various conditions and actions, enabling fine-grained control over network traffic by specifying rules for source and destination addresses, ports, and protocols.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='FilterStatus defines the observed state of Filter', - title='Status', - ), - ] = None - - -class FilterList(BaseModel): - apiVersion: str - items: Optional[List[Filter]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/interfaces/__init__.py b/pydantic_eda/com/nokia/eda/interfaces/__init__.py deleted file mode 100644 index 15b0704..0000000 --- a/pydantic_eda/com/nokia/eda/interfaces/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/interfaces.eda.nokia.com/v1alpha1/interfaces.json -# timestamp: 2025-05-07T11:43:46+00:00 diff --git a/pydantic_eda/com/nokia/eda/interfaces/v1alpha1.py b/pydantic_eda/com/nokia/eda/interfaces/v1alpha1.py deleted file mode 100644 index bade249..0000000 --- a/pydantic_eda/com/nokia/eda/interfaces/v1alpha1.py +++ /dev/null @@ -1,672 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/interfaces.eda.nokia.com/v1alpha1/interfaces.json -# timestamp: 2025-05-07T11:43:46+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Spec(BaseModel): - channels: Annotated[ - int, - Field( - description='The number of breakout channels to create.', - ge=1, - le=8, - title='Number of Channels', - ), - ] - interface: Annotated[ - Optional[List[str]], - Field( - description='A list of normalized parent interface/port.', - title='Nomalized Parent Interface', - ), - ] = None - node: Annotated[ - List[str], - Field( - description='Reference to a list of TopoNodes where the parent interfaces are to be broken out.', - title='Nodes', - ), - ] - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='TopoNode where the parent interfaces are to be broken out.', - title='TopoNode', - ), - ] = None - speed: Annotated[ - Literal['800G', '400G', '200G', '100G', '50G', '40G', '25G', '10G'], - Field(description='The speed of each breakout channel.', title='Speed'), - ] - - -class BreakoutDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class BreakoutDeletedResources(RootModel[List[BreakoutDeletedResourceEntry]]): - root: List[BreakoutDeletedResourceEntry] - - -class BreakoutMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class StormControl(BaseModel): - broadcastRate: Annotated[ - Optional[int], - Field( - description='Sets the maximum rate allowed for ingress broadcast frames on the interface.', - ge=0, - le=100000000, - title='Broadcast Rate', - ), - ] = None - enabled: Annotated[ - Optional[bool], Field(description='Enables storm control.', title='Enabled') - ] = None - multicastRate: Annotated[ - Optional[int], - Field( - description='Sets the maximum rate allowed for ingress multicast frames on the interface.', - ge=0, - le=100000000, - title='Multicast Rate', - ), - ] = None - units: Annotated[ - Optional[Literal['kbps', 'percentage']], - Field(description='Set the units to be used for measurement.', title='Units'), - ] = None - unknownUnicastRate: Annotated[ - Optional[int], - Field( - description='Sets the maximum rate allowed for ingress unknown unicast frames on the interface.', - ge=0, - le=100000000, - title='Unknown Unicast Rate', - ), - ] = None - - -class Ethernet(BaseModel): - fec: Annotated[ - Optional[Literal['disabled', 'rs528', 'rs544', 'baser', 'rs108']], - Field( - description='Sets the Forward Error Correction (FEC) on the members of the interface.', - title='Forward Error Correction', - ), - ] = None - holdDownTimer: Annotated[ - Optional[int], - Field( - description='The hold-time down behavior is triggered with events that try to bring the ethernet interface down and can change quickly. It is not triggered with an admin-state disable event or interface disable due to other internal reasons. Units in milliseconds.', - ge=100, - le=86400000, - title='Hold Down Timer', - ), - ] = None - holdUpTimer: Annotated[ - Optional[int], - Field( - description='The hold-time up behavior is triggered with any event that tries to bring up the ethernet interface. While the hold-time up is running, the transceiver laser will be enabled, however the higher layers will not be notified that the interface is operationally up until the timer expires. Units in milliseconds.', - ge=100, - le=86400000, - title='Hold Up Timer', - ), - ] = None - reloadDelayTimer: Annotated[ - Optional[int], - Field( - description='After the system boots, the reload-delay timer in seconds keeps an interface shut down with the laser off for a configured amount of time until connectivity with the rest of network is established.', - ge=1, - le=86400, - title='Reload Delay Timer', - ), - ] = None - speed: Annotated[ - Optional[Literal['100G', '10G', '1G', '25G', '40G', '50G', '400G']], - Field( - description='The speed of this interface, in human-readable format - e.g. 25G, 100G.', - title='Speed', - ), - ] = None - standbySignaling: Annotated[ - Optional[Literal['lacp', 'power-off']], - Field( - description='Indicates the standby-signaling used in the interface.', - title='Standby Signaling', - ), - ] = None - stormControl: Annotated[ - Optional[StormControl], - Field(description='Enables storm control.', title='Storm Control'), - ] = None - transparentL2CPProtocols: Annotated[ - Optional[List[Literal['LLDP', 'LACP', 'xSTP', 'Dot1x', 'PTP', 'All']]], - Field( - description='A list of L2CP protocols to tunnel. Options: LLDP, LACP, xSTP, Dot1x, PTP, All.', - title='Transparent L2CP Protocols', - ), - ] = None - - -class LacpFallback(BaseModel): - mode: Annotated[ - Optional[Literal['static']], - Field(description='Specifies lacp-fallback mode if enabled.', title='Mode'), - ] = 'static' - timeout: Annotated[ - Optional[int], - Field( - description='Specifies the LACP-fallback timeout interval in seconds. [default=60]', - ge=4, - le=3600, - title='Timeout', - ), - ] = 60 - - -class Lacp(BaseModel): - adminKey: Annotated[ - Optional[int], - Field( - description='Configure the LACP admin-key to be advertised by the local system.', - ge=1, - le=65535, - title='Admin Key', - ), - ] = None - interval: Annotated[ - Optional[Literal['fast', 'slow']], - Field( - description='Set the period between LACP messages, uses the lacp-period-type enumeration. [default="fast"]', - title='Interval', - ), - ] = 'fast' - lacpFallback: Annotated[ - Optional[LacpFallback], - Field( - description='LACP fallback allows one or more designated links of an LACP controlled LAG to go into forwarding mode if LACP is not yet operational after a configured timeout period. [default=disabled]', - title='Fallback', - ), - ] = None - mode: Annotated[ - Optional[Literal['active', 'passive']], - Field( - description='Active is to initiate the transmission of LACP PDUs. Passive is to wait for peer to initiate the transmission of LACP PDUs.[default="active"]', - title='Mode', - ), - ] = 'active' - systemIdMac: Annotated[ - Optional[str], - Field( - description="The MAC address portion of the Node's System ID. This is combined with the system priority to construct the 8-octet system-id.", - title='System ID MAC', - ), - ] = None - systemPriority: Annotated[ - Optional[int], - Field( - description='System priority used by the Node on this LAG interface. Lower value is higher priority for determining which Node is the controlling system.[default=32768]', - ge=0, - le=65535, - title='System Priority', - ), - ] = 32768 - - -class Multihoming(BaseModel): - esi: Annotated[ - Optional[str], - Field( - description='10 byte Ethernet Segment Identifier, if not set a type 0 ESI is generated. [default=auto]', - title='ESI', - ), - ] = 'auto' - mode: Annotated[ - Optional[Literal['all-active', 'single-active', 'port-active']], - Field( - description='"all-active": All interfaces are active.\n"single-active": In a single active MH LAG, the active and standby function is handled at the sub-interface layer within a network-instance. That is, the physical interfaces within the same LAG all remain operationally up, however each sub-interface associated with a network-instance has its operational state up or down based on whether it is selected to be the active or standby sub-interface.\n"port-active": When port active MH LAG is enabled, the active and standby function is handled at the interface level.', - title='Mode', - ), - ] = 'all-active' - preferredActiveNode: Annotated[ - Optional[str], - Field( - description='To be used in single-active or port-active modes. This references the Node object and when set, the DF algorithm is configured to type preference and the selected Node is set with a higher preference value. All other Nodes have a lower value configured.', - title='Preferred Active Node', - ), - ] = None - reloadDelayTimer: Annotated[ - Optional[int], - Field( - description='After the system boots, the reload-delay timer in seconds keeps an interface shut down with the laser off for a configured amount of time until connectivity with the rest of network is established. [default=100]', - ge=1, - le=86400, - title='Reload Delay Timer', - ), - ] = 100 - revertive: Annotated[ - Optional[bool], - Field( - description='To be used in single-active or port-active modes. When true, if there is a switch of active interface in the LAG and the original interface comes back up, the LAG will switch back to using the original interface as active. [default=false]', - title='Revertive', - ), - ] = False - - -class Lag(BaseModel): - lacp: Annotated[Optional[Lacp], Field(title='LACP')] = None - minLinks: Annotated[ - Optional[int], - Field( - description='The min-link threshold specifies the minimum number of member links that must be active in order for the LAG to be operationally up. If the number of active links falls below this threshold, the entire LAG is brought operationally down.[default=1]', - ge=1, - le=64, - title='Minimum Links', - ), - ] = 1 - multihoming: Annotated[Optional[Multihoming], Field(title='Multi Homing')] = None - type: Annotated[ - Optional[Literal['lacp', 'static']], - Field( - description='This type defines whether whether it is a static or LACP LAG. [default=lacp]', - title='Type', - ), - ] = 'lacp' - - -class Member(BaseModel): - aggregateId: Annotated[ - Optional[str], - Field( - description='When using a LAG, the aggregateId can be specified per set of interfaces on a node.\nLAG interface with which this interface is associated.', - title='Aggregate ID', - ), - ] = None - description: Annotated[ - Optional[str], - Field( - description='Description of the member, inherited from the interface if not provided.', - title='Description', - ), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enable or disable this member.', title='Enabled'), - ] = True - interface: Annotated[ - str, - Field( - description='Reference to an interface in the normalized format. Ex: SRL ethernet-1/1 would be ethernet-1-1. SROS port 2/1/1 would be ethernet-2-1.', - title='Interface', - ), - ] - lacpPortPriority: Annotated[ - Optional[int], - Field( - description='Configure the port priority for LACP. This value is used to determine which port should be activated with LACP fallback mode. Lower values are more preferred.[default=32768]', - ge=0, - le=65535, - title='LACP Port Priority', - ), - ] = 32768 - node: Annotated[str, Field(description='Node name.', title='Node Name')] - - -class SpecModel(BaseModel): - ddm: Annotated[ - Optional[bool], - Field(description='Enables reporting of DDM events.', title='DDM'), - ] = None - description: Annotated[ - Optional[str], - Field(description='Description of the interface.', title='Description'), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enable or disable the interface.', title='Enabled'), - ] = True - encapType: Annotated[ - Optional[Literal['null', 'dot1q']], - Field( - description='Enable or disable VLAN tagging on this interface. [default="null"]', - title='Encapsulation Type', - ), - ] = 'null' - ethernet: Annotated[ - Optional[Ethernet], - Field(description='Ethernet configuration options.', title='Ethernet'), - ] = None - lag: Annotated[ - Optional[Lag], Field(description='LAG configuration options.', title='LAG') - ] = None - lldp: Annotated[ - Optional[bool], - Field( - description='Enable or disable LLDP on the members of the interface.', - title='Link Layer Discovery Protocol', - ), - ] = True - members: Annotated[ - List[Member], - Field( - description='List of members on which to apply properties, for single interface this would be a list of 1.', - title='Members', - ), - ] - mtu: Annotated[ - Optional[int], - Field( - description='MTU to apply on the interface(s).', - ge=1450, - le=9500, - title='MTU', - ), - ] = None - type: Annotated[ - Optional[Literal['lag', 'interface', 'loopback']], - Field( - description='Type defines whether the interface is a Lag or Interface.', - title='Type', - ), - ] = 'interface' - - -class LagModel(BaseModel): - adminKey: Annotated[Optional[int], Field(title='Admin Key')] = None - systemIdMac: Annotated[Optional[str], Field(title='System ID MAC')] = None - - -class Neighbor(BaseModel): - interface: Annotated[ - Optional[str], - Field( - description='The name of a neighbor interface of this member in node specific format.', - title='Interface', - ), - ] = None - node: Annotated[ - Optional[str], - Field( - description='The name of a neighbor node of this member in node specific format.', - title='Node', - ), - ] = None - - -class MemberModel(BaseModel): - enabled: Annotated[ - Optional[bool], - Field(description='The administrative status of this member.', title='Enabled'), - ] = None - interface: Annotated[ - Optional[str], - Field( - description='The name of the interface in normalized format.', - title='Interface', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='Indicates when this member last changed state.', - title='Last Change', - ), - ] = None - neighbors: Annotated[ - Optional[List[Neighbor]], - Field( - description='List of discovered neighbors on this member.', - title='Neighbors', - ), - ] = None - node: Annotated[ - Optional[str], - Field( - description='The node on which the interface is configured.', title='Node' - ), - ] = None - nodeInterface: Annotated[ - str, - Field( - description='Node specific interface name, for example "ethernet-1/1", "1/1/c1/1".', - title='Node Interface', - ), - ] - operationalState: Annotated[ - Optional[str], - Field( - description='Indicates the current operational state of this member.', - title='Operational State', - ), - ] = None - speed: Annotated[ - Optional[str], - Field( - description='Indicates the operational speed of the member.', title='Speed' - ), - ] = None - - -class Status(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='The administrative status of the Interface.', title='Enabled' - ), - ] = None - lag: Annotated[Optional[LagModel], Field(title='Lag')] = None - lastChange: Annotated[ - Optional[date], - Field( - description='Indicates when this Interface last changed state.', - title='Last Change', - ), - ] = None - members: Annotated[ - Optional[List[MemberModel]], - Field(description='List of members in this Interface.', title='Members'), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Indicates the current operational state of the Interface.', - title='Operational State', - ), - ] = None - speed: Annotated[ - Optional[str], - Field( - description='Indicates the operational speed of the Interface in aggregate.', - title='Speed', - ), - ] = None - - -class MemberModel1(BaseModel): - aggregateId: Annotated[ - Optional[str], - Field(description='LAG interface with which this interface is associated'), - ] = None - enabled: Annotated[ - Optional[bool], Field(description='Enable or disable this member.') - ] = None - interface: Annotated[str, Field(description='Normalized interface name')] - node: Annotated[ - str, Field(description='Reference to the TopoNode on which this member resides') - ] - nodeInterface: Annotated[ - str, - Field( - description='Node specific interface name, for example "ethernet-1/1", "1/1/c1/1"' - ), - ] - operatingSystem: Annotated[ - str, - Field( - description='The operating system of the TopoNode on which this member resides' - ), - ] - version: Annotated[ - str, - Field( - description='The version of the TopoNode on which this interface resides' - ), - ] - - -class SpecModel1(BaseModel): - enabled: Annotated[ - Optional[bool], Field(description='Enable or disable the interface.') - ] = None - lag: Annotated[Optional[LagModel], Field(title='Lag')] = None - members: Annotated[ - List[MemberModel1], - Field(description='List of members on which to monitor state for'), - ] - role: Annotated[ - Optional[Literal['isl', 'edge', 'loopback']], - Field( - description='Role of this interface. This is used to calculate severity of alarms. [default="edge"]' - ), - ] = 'edge' - - -class InterfaceStateDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class InterfaceStateDeletedResources( - RootModel[List[InterfaceStateDeletedResourceEntry]] -): - root: List[InterfaceStateDeletedResourceEntry] - - -class InterfaceStateMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class InterfaceDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class InterfaceDeletedResources(RootModel[List[InterfaceDeletedResourceEntry]]): - root: List[InterfaceDeletedResourceEntry] - - -class InterfaceMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Breakout(BaseModel): - apiVersion: str - kind: str - metadata: BreakoutMetadata - spec: Annotated[ - Spec, - Field( - description='Breakout allows for the configuration of interface breakouts on specified Nodes. This resource specifies the Nodes, parent Interfaces, the number of breakout channels, and the speed of each channel.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='BreakoutStatus defines the observed state of Breakout', - title='Status', - ), - ] = None - - -class BreakoutList(BaseModel): - apiVersion: str - items: Optional[List[Breakout]] = None - kind: str - - -class Interface(BaseModel): - apiVersion: str - kind: str - metadata: InterfaceMetadata - spec: Annotated[ - SpecModel, - Field( - description='Interface allows for the configuration of various interface properties such as enabling/disabling the interface, setting descriptions, specifying interface types (e.g., LAG, interface, loopback), configuring VLAN encapsulation, and setting Ethernet or LAG-specific options.', - title='Specification', - ), - ] - status: Annotated[Optional[Status], Field(title='Status')] = None - - -class InterfaceList(BaseModel): - apiVersion: str - items: Optional[List[Interface]] = None - kind: str - - -class InterfaceState(BaseModel): - apiVersion: str - kind: str - metadata: InterfaceStateMetadata - spec: Annotated[SpecModel1, Field(title='Specification')] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='InterfaceStateStatus defines the observed state of Interface', - title='Status', - ), - ] = None - - -class InterfaceStateList(BaseModel): - apiVersion: str - items: Optional[List[InterfaceState]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/oam/__init__.py b/pydantic_eda/com/nokia/eda/oam/__init__.py deleted file mode 100644 index 61d2388..0000000 --- a/pydantic_eda/com/nokia/eda/oam/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/oam.eda.nokia.com/v1alpha1/oam.json -# timestamp: 2025-05-07T11:43:49+00:00 diff --git a/pydantic_eda/com/nokia/eda/oam/v1alpha1.py b/pydantic_eda/com/nokia/eda/oam/v1alpha1.py deleted file mode 100644 index 8128b08..0000000 --- a/pydantic_eda/com/nokia/eda/oam/v1alpha1.py +++ /dev/null @@ -1,1166 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/oam.eda.nokia.com/v1alpha1/oam.json -# timestamp: 2025-05-07T11:43:49+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class LocalDestination(BaseModel): - interface: Annotated[ - Optional[str], - Field( - description='Reference to an Interface resource to send the mirrored traffic to. This must be on the same Node as the source.', - title='Local Interface', - ), - ] = None - vlanID: Annotated[ - Optional[str], - Field( - description='Single value between 0-4094 support, or the special keyword untagged.', - title='VLAN ID', - ), - ] = None - - -class RemoteDestination(BaseModel): - defaultRouter: Annotated[ - Optional[str], - Field( - description='Specifies the DefaultRouter to reach the remote destination of the mirror, a Router and DefaultRouter reference cannot be set at the same time.', - title='Default Router', - ), - ] = None - destinationIP: Annotated[ - Optional[str], - Field( - description='Remote destination IP address. When a remote destination is used for the mirror, the destinationIP is mandatory.', - title='Destination IP', - ), - ] = None - encapsulation: Annotated[ - Optional[Literal['L2OGRE', 'L3OGRE']], Field(title='Encapsulation') - ] = None - router: Annotated[ - Optional[str], - Field( - description='Specifies the Router to reach the remote destination of the mirror, a Router and DefaultRouter reference cannot be set at the same time.', - title='Router', - ), - ] = None - sourceIP: Annotated[ - Optional[str], - Field( - description='Source IP to use when sending a mirror to a remote destination. When a remote destination us used for the mirror, the sourceIP is mandatory.', - title='Source IP', - ), - ] = None - - -class RateLimit(BaseModel): - burstSize: Annotated[ - Optional[int], - Field(description='The maximum burst size in bytes.', title='Burst Size'), - ] = None - entrySpecificPolicer: Annotated[ - Optional[bool], - Field( - description='Controls policer instantiation: false for shared instance, true for per-entry instances', - title='Entry Specific Policer', - ), - ] = False - peakRate: Annotated[ - Optional[int], - Field(description='The peak rate in kilobytes per second.', title='Peak Rate'), - ] = None - scope: Annotated[ - Optional[Literal['Global', 'Subinterface']], - Field( - description='Determines how the policer is applied across subinterfaces. Global applies the policer across all subinterfaces, while Subinterface applies it individually to each subinterface.', - title='Scope', - ), - ] = 'Global' - - -class IpEntry(BaseModel): - action: Annotated[ - Optional[Literal['Drop', 'Accept', 'RateLimit']], - Field( - description="An action to take, either 'Accept','Drop', or 'RateLimit'.", - title='Action', - ), - ] = None - destinationPortName: Annotated[ - Optional[ - Literal[ - 'ACAP', - 'AFP-TCP', - 'ARNS', - 'ASF-RMCP', - 'ASHARE', - 'ATALK-RM', - 'AURP', - 'AUTH', - 'BFD', - 'BFD-ECHO', - 'BFTP', - 'BGMP', - 'BGP', - 'BOOTPC', - 'BOOTPS', - 'CCSO-NS', - 'CHARGEN', - 'CISCO-TDP', - 'CITADEL', - 'CLEARCASE', - 'COMMERCE', - 'COURIER', - 'DAYTIME', - 'DHCP-FAILOVER', - 'DHCPV6-CLIENT', - 'DHCPV6-SERVER', - 'DICOM', - 'DISCARD', - 'DNSIX', - 'DOMAIN', - 'DSP', - 'ECHO', - 'EPP', - 'ESRO', - 'EXEC', - 'FINGER', - 'FTP', - 'FTP-DATA', - 'FTPS', - 'FTPS-DATA', - 'GODI', - 'GOPHER', - 'GTP-C', - 'GTP-PRIME', - 'GTP-U', - 'HA-CLUSTER', - 'HOSTNAME', - 'HP-ALARM-MGR', - 'HTTP', - 'HTTP-ALT', - 'HTTP-MGMT', - 'HTTP-RPC', - 'HTTPS', - 'IEEE-MMS-SSL', - 'IMAP', - 'IMAP3', - 'IMAPS', - 'IPP', - 'IPSEC', - 'IPX', - 'IRC', - 'IRIS-BEEP', - 'ISAKMP', - 'ISAKMP-NAT', - 'ISCSI', - 'ISO-TSAP', - 'KERBEROS', - 'KERBEROS-ADM', - 'KLOGIN', - 'KPASSWD', - 'KSHELL', - 'L2TP', - 'LDAP', - 'LDAPS', - 'LDP', - 'LMP', - 'LOGIN', - 'LPD', - 'LSP-PING', - 'MAC-SERVER-ADM', - 'MATIP-A', - 'MATIP-B', - 'MICRO-BFD', - 'MICROSOFT-DS', - 'MOBILE-IP', - 'MONITOR', - 'MPP', - 'MS-EXCHANGE', - 'MSDP', - 'MSP', - 'MSSQL-M', - 'MSSQL-S', - 'MULTIHOP-BFD', - 'NAS', - 'NCP', - 'NETBIOS-DATA', - 'NETBIOS-NS', - 'NETBIOS-SS', - 'NETNEWS', - 'NETRJS-1', - 'NETRJS-2', - 'NETRJS-3', - 'NETRJS-4', - 'NETWALL', - 'NEW-RWHO', - 'NFS', - 'NNTP', - 'NNTPS', - 'NTP', - 'ODMR', - 'OLSR', - 'OPENVPN', - 'PIM-AUTO-RP', - 'PKIX-TIMESTAMP', - 'POP2', - 'POP3', - 'POP3S', - 'PPTP', - 'PRINT-SRV', - 'PTP-EVENT', - 'PTP-GENERAL', - 'QMTP', - 'QOTD', - 'RADIUS', - 'RADIUS-ACCT', - 'REMOTE-MAIL', - 'REMOTEFS', - 'REMOTECMD', - 'RIP', - 'RJE', - 'RLP', - 'RLZDB', - 'RMC', - 'RMONITOR', - 'RPC2PORTMAP', - 'RSYNC', - 'RTELNET', - 'RTSP', - 'SGMP', - 'SILC', - 'SMUX', - 'SNA-GW', - 'SNMP', - 'SNMP-TRAP', - 'SNPP', - 'SMTP', - 'SQL-SVCS', - 'SQL', - 'SSH', - 'SUBMISSION', - 'SUNRPC', - 'SVCLOC', - 'SYSLOG', - 'SYSTAT', - 'TACACS', - 'TALK', - 'TCPMUX', - 'TCPNETHASPSRV', - 'TFTP', - 'TIME', - 'TIMED', - 'UPS', - 'XDMCP', - 'XNS-CH', - 'XNS-MAIL', - 'XNS-TIME', - 'Z3950', - ] - ], - Field( - description='Destination port to match by name.', - title='Destination Port Name', - ), - ] = None - destinationPortNumber: Annotated[ - Optional[int], - Field( - description='Destination port to match by numerical value.', - ge=0, - le=65535, - title='Destination Port Number', - ), - ] = None - destinationPortOperator: Annotated[ - Optional[Literal['Equals', 'GreaterOrEquals', 'LessOrEquals']], - Field( - description='Operator to use when matching destinationPort, either Equals, GreaterOrEquals, or LessOrEquals.', - title='Destination Port Operator', - ), - ] = None - destinationPortRange: Annotated[ - Optional[str], - Field( - description='Range of destination ports to match, in the format n-m, e.g. 100-200, The start and end of the range must be port numbers.', - title='Destination Port Range', - ), - ] = None - destinationPrefix: Annotated[ - Optional[str], - Field(description='Destination prefix to match.', title='Destination Prefix'), - ] = None - firstFragment: Annotated[ - Optional[bool], - Field(description='Match the first fragment only.', title='First Fragment'), - ] = None - fragment: Annotated[ - Optional[bool], Field(description='Match any fragment.', title='Fragment') - ] = None - icmpCode: Annotated[ - Optional[List[int]], - Field( - description='Match a specific ICMP code, as a number between 0-255, e.g. 0.', - max_length=255, - min_length=0, - title='ICMP Code', - ), - ] = None - icmpTypeName: Annotated[ - Optional[ - Literal[ - 'DestUnreachable', - 'Echo', - 'EchoReply', - 'EchoRequest', - 'McastRtrAdv', - 'McastRtrSolicit', - 'McastRtrTerm', - 'MldDone', - 'MldQuery', - 'MldReport', - 'MldV2', - 'NeighborAdvertise', - 'NeighborSolicit', - 'NodeInfoQuery', - 'NodeInfoResponse', - 'PacketTooBig', - 'ParamProblem', - 'Redirect', - 'RouterAdvertise', - 'RouterRenumber', - 'RouterSolicit', - 'SourceQuench', - 'TimeExceeded', - 'Timestamp', - 'TimestampReply', - ] - ], - Field( - description='Match a specific ICMP type by name, e.g. dest-unreachable.', - title='ICMP Type Name', - ), - ] = None - icmpTypeNumber: Annotated[ - Optional[int], - Field( - description='Match a specific ICMP type by number.', - ge=0, - le=255, - title='ICMP Type Number', - ), - ] = None - protocolName: Annotated[ - Optional[ - Literal[ - 'AH', - 'EGP', - 'EIGRP', - 'ESP', - 'GGP', - 'GRE', - 'ICMP', - 'ICMP6', - 'IDRP', - 'IGMP', - 'IGP', - 'IPV4', - 'IPV6', - 'IPV6-DEST-OPTS', - 'IPV6-HOP', - 'L2TP', - 'MPLS-IN-IP', - 'NO-NEXT-HDR', - 'OSPF', - 'PIM', - 'ROHC', - 'RSVP', - 'SCTP', - 'ST', - 'TCP', - 'UDP', - 'VRRP', - ] - ], - Field( - description='Match a specific IP protocol name (specified in the type field of the IP header).', - title='Protocol Name', - ), - ] = None - protocolNumber: Annotated[ - Optional[int], - Field( - description='Match a specific IP protocol number (specified in the type field of the IP header).', - ge=0, - le=255, - title='Protocol Number', - ), - ] = None - rateLimit: Annotated[ - Optional[RateLimit], - Field( - description="Rate limit to apply when the action is 'RateLimit'.", - title='Rate Limit', - ), - ] = None - sourcePortName: Annotated[ - Optional[ - Literal[ - 'ACAP', - 'AFP-TCP', - 'ARNS', - 'ASF-RMCP', - 'ASHARE', - 'ATALK-RM', - 'AURP', - 'AUTH', - 'BFD', - 'BFD-ECHO', - 'BFTP', - 'BGMP', - 'BGP', - 'BOOTPC', - 'BOOTPS', - 'CCSO-NS', - 'CHARGEN', - 'CISCO-TDP', - 'CITADEL', - 'CLEARCASE', - 'COMMERCE', - 'COURIER', - 'DAYTIME', - 'DHCP-FAILOVER', - 'DHCPV6-CLIENT', - 'DHCPV6-SERVER', - 'DICOM', - 'DISCARD', - 'DNSIX', - 'DOMAIN', - 'DSP', - 'ECHO', - 'EPP', - 'ESRO', - 'EXEC', - 'FINGER', - 'FTP', - 'FTP-DATA', - 'FTPS', - 'FTPS-DATA', - 'GODI', - 'GOPHER', - 'GTP-C', - 'GTP-PRIME', - 'GTP-U', - 'HA-CLUSTER', - 'HOSTNAME', - 'HP-ALARM-MGR', - 'HTTP', - 'HTTP-ALT', - 'HTTP-MGMT', - 'HTTP-RPC', - 'HTTPS', - 'IEEE-MMS-SSL', - 'IMAP', - 'IMAP3', - 'IMAPS', - 'IPP', - 'IPSEC', - 'IPX', - 'IRC', - 'IRIS-BEEP', - 'ISAKMP', - 'ISAKMP-NAT', - 'ISCSI', - 'ISO-TSAP', - 'KERBEROS', - 'KERBEROS-ADM', - 'KLOGIN', - 'KPASSWD', - 'KSHELL', - 'L2TP', - 'LDAP', - 'LDAPS', - 'LDP', - 'LMP', - 'LOGIN', - 'LPD', - 'LSP-PING', - 'MAC-SERVER-ADM', - 'MATIP-A', - 'MATIP-B', - 'MICRO-BFD', - 'MICROSOFT-DS', - 'MOBILE-IP', - 'MONITOR', - 'MPP', - 'MS-EXCHANGE', - 'MSDP', - 'MSP', - 'MSSQL-M', - 'MSSQL-S', - 'MULTIHOP-BFD', - 'NAS', - 'NCP', - 'NETBIOS-DATA', - 'NETBIOS-NS', - 'NETBIOS-SS', - 'NETNEWS', - 'NETRJS-1', - 'NETRJS-2', - 'NETRJS-3', - 'NETRJS-4', - 'NETWALL', - 'NEW-RWHO', - 'NFS', - 'NNTP', - 'NNTPS', - 'NTP', - 'ODMR', - 'OLSR', - 'OPENVPN', - 'PIM-AUTO-RP', - 'PKIX-TIMESTAMP', - 'POP2', - 'POP3', - 'POP3S', - 'PPTP', - 'PRINT-SRV', - 'PTP-EVENT', - 'PTP-GENERAL', - 'QMTP', - 'QOTD', - 'RADIUS', - 'RADIUS-ACCT', - 'REMOTE-MAIL', - 'REMOTEFS', - 'REMOTECMD', - 'RIP', - 'RJE', - 'RLP', - 'RLZDB', - 'RMC', - 'RMONITOR', - 'RPC2PORTMAP', - 'RSYNC', - 'RTELNET', - 'RTSP', - 'SGMP', - 'SILC', - 'SMUX', - 'SNA-GW', - 'SNMP', - 'SNMP-TRAP', - 'SNPP', - 'SMTP', - 'SQL-SVCS', - 'SQL', - 'SSH', - 'SUBMISSION', - 'SUNRPC', - 'SVCLOC', - 'SYSLOG', - 'SYSTAT', - 'TACACS', - 'TALK', - 'TCPMUX', - 'TCPNETHASPSRV', - 'TFTP', - 'TIME', - 'TIMED', - 'UPS', - 'XDMCP', - 'XNS-CH', - 'XNS-MAIL', - 'XNS-TIME', - 'Z3950', - ] - ], - Field(description='Source port to match by name.', title='Source Port Name'), - ] = None - sourcePortNumber: Annotated[ - Optional[int], - Field( - description='Source port to match by numerical value.', - ge=0, - le=65535, - title='Source Port Number', - ), - ] = None - sourcePortOperator: Annotated[ - Optional[Literal['Equals', 'GreaterOrEquals', 'LessOrEquals']], - Field( - description='Operator to use when matching sourcePort, either Equals, GreaterOrEquals, or LessOrEquals.', - title='Source Port Operator', - ), - ] = None - sourcePortRange: Annotated[ - Optional[str], - Field( - description='Range of source ports to match, in the format n-m, e.g. 100-200. The start and end of the range must be port numbers.', - title='Source Port Range', - ), - ] = None - sourcePrefix: Annotated[ - Optional[str], - Field(description='Source prefix to match.', title='Source Prefix'), - ] = None - tcpFlags: Annotated[ - Optional[str], - Field( - description='Match TCP flags, usable with !, &, | and the flags RST, SYN, and ACK.', - title='TCP Flags', - ), - ] = None - - -class Entry(BaseModel): - ipEntry: Annotated[Optional[IpEntry], Field(title='IP Entry')] = None - type: Annotated[Literal['IPV4', 'IPV6', 'Auto'], Field(title='Type')] - - -class Filter(BaseModel): - entries: Annotated[ - List[Entry], - Field( - description='Specifies the list of filter entries, in order.', - title='Entries', - ), - ] - - -class Subinterface(BaseModel): - index: Annotated[ - Optional[int], - Field( - description='Index of the sub-interface. This is ignored on a node running SROS.', - title='Subinterface Index', - ), - ] = None - interfaceName: Annotated[ - str, - Field( - description='Reference to an Interface resource, the combination of the Interface and the specified subinterface index will build the subinterface to be used as a source of traffic to be mirrored. A combination of VLANs, BridgeInterfaces and subinterfaces can be configured as sources together.', - title='Interface Name', - ), - ] - vlan: Annotated[ - Optional[str], - Field( - description='Reference to the VLAN resource under which the sub-interface is configured. This is mandatory when the sub-interface is on a node running SROS and ignored for all other node operating systems.', - title='VLAN', - ), - ] = None - - -class Subinterfaces(BaseModel): - bridgeInterfaces: Annotated[ - Optional[List[str]], - Field( - description='List of BridgeInterfaces, all traffic from all BridgeInterfaces in the list will be used as sources to be mirrored. A combination of VLANs, BridgeInterfaces and subinterfaces can be configured as sources together.', - title='Bridge Interfaces', - ), - ] = None - subinterfaces: Annotated[ - Optional[List[Subinterface]], - Field( - description='List of Interfaces and subinterface indices', - title='Subinterfaces', - ), - ] = None - vlans: Annotated[ - Optional[List[str]], - Field( - description='List of VLAN resources, all subinterfaces attached to the VLAN will be used as sources to be mirrored. A combination of VLANs, BridgeInterfaces and subinterfaces can be configured as sources together.', - title='VLAN', - ), - ] = None - - -class FilterModel(BaseModel): - filter: Annotated[ - Optional[Filter], - Field( - description='Emittes an MirrorFilter and uses the filter as a source for the Mirror.', - title='Filter', - ), - ] = None - subinterfaces: Annotated[ - Optional[Subinterfaces], - Field( - description='Subinterfaces on which to deploy the IPFilter to use as a source for the Mirror.', - title='Subinterfaces', - ), - ] = None - - -class Interfaces(BaseModel): - interfaceSelector: Annotated[ - Optional[List[str]], - Field( - description='Select Interfaces using a label selector to be mirrored. Traffic from the entire Interface will be mirrored for any selected Interfaces. If both a label selector is used and a list of Interfaces is provided, a combination of all selected and provided interfaces will be mirrored.', - title='Interface Selector', - ), - ] = None - interfaces: Annotated[ - Optional[List[str]], - Field( - description='List of Interfaces to be mirrored. Traffic from the entire Interface will be mirrored for any selected Interfaces. If both a label selector is used and a list of Interfaces is provided, a combination of all selected and provided interfaces will be mirrored.', - title='Interfaces', - ), - ] = None - - -class Sources(BaseModel): - direction: Annotated[ - Literal['Ingress', 'Egress', 'IngressEgress'], - Field( - description='The direction of the traffic being mirrored.', - title='Direction', - ), - ] - filters: Annotated[Optional[List[FilterModel]], Field(title='Filters')] = None - interfaces: Annotated[ - Optional[Interfaces], - Field( - description='Reference to an Interface resource to be mirrored. Traffic from the entire Interface will be mirrored for any selected Interfaces.', - title='Interfaces', - ), - ] = None - subinterfaces: Annotated[Optional[Subinterfaces], Field(title='Subinterfaces')] = ( - None - ) - - -class Spec(BaseModel): - localDestination: Annotated[ - Optional[LocalDestination], - Field( - description='Local destination for the mirror, there can only be either a remote destination or local destination provisioned for a Mirror.', - title='Local Destination', - ), - ] = None - remoteDestination: Annotated[ - Optional[RemoteDestination], - Field( - description='Remote destination for the mirror, there can only be either a remote destination or local destination provisioned for a Mirror.', - title='Remote Destination', - ), - ] = None - sources: Annotated[Sources, Field(description='Mirror sources.', title='Sources')] - - -class SubinterfaceModel(BaseModel): - configuredSource: Annotated[ - Literal[ - 'VLAN', - 'BridgeInterface', - 'Subinterface', - 'Interface', - 'FilterV4', - 'FilterV6', - ], - Field( - description='Indicates what is driving the particular subinterface to be selected as a mirror source.', - title='Configured Source', - ), - ] - interface: Annotated[ - str, Field(description='Node specific interface name.', title='Interface') - ] - node: Annotated[str, Field(description='Reference to Node object.', title='Node')] - operatingSystem: Annotated[ - str, - Field(description='Operating System of the Node.', title='Operating System'), - ] - subinterfaceIndex: Annotated[ - Optional[int], - Field( - description='Index allocated to the subinterface which is being mirrored. If an interface is used as a source, this will not be set.', - title='Subinterface Index', - ), - ] = None - vlanID: Annotated[ - Optional[str], - Field(description='vlan assigned to this subinterface.', title='VLAN ID'), - ] = None - - -class Status(BaseModel): - lastChange: Annotated[ - Optional[date], - Field( - description='Indicates when this SubInterface last changed state.', - title='Last Change', - ), - ] = None - mirrorID: Annotated[ - Optional[str], - Field( - description='Mirror Identifier used as the name of the mirror.', - title='MirrorID', - ), - ] = None - numActiveInterfaces: Annotated[ - Optional[int], - Field( - description='Total number of active Interfaces used as sources of the mirror.', - title='Number of Active Interfaces', - ), - ] = None - numActiveSubinterfaces: Annotated[ - Optional[int], - Field( - description='Total number of active subinterfaces used as sources of the mirror.', - title='Number of Active Subinterfaces', - ), - ] = None - numActiveV4FilterSubinterfaces: Annotated[ - Optional[int], - Field( - description='Total number of active subinterfaces used as sources of the mirror derived from IPV4Filter associations.', - title='Number of Active V4 Filter Subinterfaces', - ), - ] = None - numActiveV6FilterSubinterfaces: Annotated[ - Optional[int], - Field( - description='Total number of active subinterfaces used as sources of the mirror derived from IPV6Filter associations.', - title='Number of Active V6 Filter Subinterfaces', - ), - ] = None - numActiveVLANSubinterfaces: Annotated[ - Optional[int], - Field( - description='Total number of active subinterfaces used as sources of the mirror derived from VLAN resource references.', - title='Number of Active VLAN Subinterfaces', - ), - ] = None - numberActiveBridgeInterfaces: Annotated[ - Optional[int], - Field( - description='Total number of active subinterfaces used as sources of the mirror derived from BridgeInterface resource references.', - title='Number of Active Bridge Interfaces', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Indicates the current operational state of the Mirror instance.', - title='Operational State', - ), - ] = None - subinterfaces: Annotated[ - Optional[List[SubinterfaceModel]], - Field(description='List of members in this Interface.', title='Subinterfaces'), - ] = None - - -class MirrorDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class MirrorDeletedResources(RootModel[List[MirrorDeletedResourceEntry]]): - root: List[MirrorDeletedResourceEntry] - - -class MirrorMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel(BaseModel): - address: Annotated[Optional[str], Field(title='address')] = None - networkInstance: Annotated[Optional[str], Field(title='NetworkInstance')] = None - node: Annotated[Optional[str], Field(title='node')] = None - pingType: Annotated[Literal['isl', 'node', 'system'], Field(title='pingtype')] - pods: Annotated[Optional[List[str]], Field(title='Pods')] = None - roles: Annotated[Optional[List[str]], Field(title='roles')] = None - - -class Status1Model(BaseModel): - id: Annotated[Optional[int], Field(description='Id', title='ID')] = None - result: Annotated[ - Literal[ - 'OK', - 'Failed', - 'Terminated', - 'WaitingForInput', - 'Running', - 'WaitingToStart', - 'SubflowWaitingForInput', - ], - Field(description='Aggregate result of the Flow', title='Result'), - ] - - -class PingDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class PingDeletedResources(RootModel[List[PingDeletedResourceEntry]]): - root: List[PingDeletedResourceEntry] - - -class PingMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Alarm(BaseModel): - description: Annotated[ - Optional[str], - Field(description='The description of the alarm.', title='Description'), - ] = None - probableCause: Annotated[ - Optional[str], - Field(description='The probable cause of the alarm.', title='Probable Cause'), - ] = None - remedialAction: Annotated[ - Optional[str], - Field( - description='The remedial action for the alarm.', title='Remedial Action' - ), - ] = None - - -class Resource(BaseModel): - group: Annotated[ - str, Field(description='The group of the resource to monitor.', title='Group') - ] - kind: Annotated[ - str, Field(description='The kind of resource to monitor.', title='Kind') - ] - name: Annotated[ - str, Field(description='The name of the resource to monitor.', title='Name') - ] - - -class Thresholds(BaseModel): - criticalThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.', - title='Critical Threshold', - ), - ] = None - delta: Annotated[ - Optional[int], - Field( - description='The delta value for clearing a threshold.\nFor example, with a critical threshold of 90, direction of Rising and a delta of 5, the critical alarm will clear when the utilization drops below 85.', - title='Delta', - ), - ] = 5 - direction: Annotated[ - Literal['Rising', 'Falling'], - Field( - description='Direction of the threshold: "Rising" or "Falling".', - title='Threshold Direction', - ), - ] - majorThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.', - title='Major Threshold', - ), - ] = None - minorThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a minor alarm.', - title='Minor Threshold', - ), - ] = None - warningThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a warning alarm.', - title='Warning Threshold', - ), - ] = None - - -class SpecModel1(BaseModel): - alarm: Annotated[ - Optional[Alarm], - Field(description='Alarm details for this threshold.', title='Thresholds'), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enable or disable this threshold.', title='Enabled'), - ] = True - field: Annotated[ - str, - Field( - description='Field to monitor for this threshold, for example `utilization`.', - title='Field', - ), - ] - generateOverlay: Annotated[ - Optional[bool], - Field( - description='Enable or disable generation of a topology overlay for this threshold.', - title='Generate Overlay', - ), - ] = False - name: Annotated[ - str, - Field( - description='The name of this threshold. This name will be used to generate the alarm name, so should follow CamelCase conventions, e.g. VolumeUtilization.', - title='Threshold Name', - ), - ] - path: Annotated[ - str, - Field( - description='Path to monitor for this threshold. This should be the full EDB path to the table containing the field you wish to trigger a threshold on.\nFor example, to monitor the utilization field of the component volume table, you would use `.namespace.node.normal.components_eda_nokia_com.v1.controlmodule.volume`, and set field to `utilization`.', - title='Path', - ), - ] - resource: Annotated[ - Optional[Resource], - Field( - description='Which resource to associate with this threshold. This overrides the destination resource in alarms raised as a result of threshold breaches.\nBy default a resource will attempt to be derived based on the monitored path.', - title='Associated Resource', - ), - ] = None - thresholds: Annotated[ - Thresholds, - Field( - description='Severities and their associated values.', title='Thresholds' - ), - ] - - -class ThresholdDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class ThresholdDeletedResources(RootModel[List[ThresholdDeletedResourceEntry]]): - root: List[ThresholdDeletedResourceEntry] - - -class ThresholdMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Mirror(BaseModel): - apiVersion: str - kind: str - metadata: MirrorMetadata - spec: Annotated[ - Spec, - Field( - description='Mirror allows for the configuration of mirroring sources, including interfaces, subinterfaces, and filters, as well as the destination for the mirrored traffic, which can be either local or remote.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='MirrorStatus defines the observed state of Mirror', - title='Status', - ), - ] = None - - -class MirrorList(BaseModel): - apiVersion: str - items: Optional[List[Mirror]] = None - kind: str - - -class Ping(BaseModel): - apiVersion: str - kind: str - metadata: PingMetadata - spec: Annotated[ - SpecModel, - Field( - description='PingSpec defines the desired state of Ping', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model], - Field( - description='PingStatus defines the observed state of Ping', title='Status' - ), - ] = None - - -class PingList(BaseModel): - apiVersion: str - items: Optional[List[Ping]] = None - kind: str - - -class Threshold(BaseModel): - apiVersion: str - kind: str - metadata: ThresholdMetadata - spec: Annotated[ - SpecModel1, - Field( - description='A Threshold allows you to monitor a field in EDB and trigger severity-correct alarms based on the value of that field.\nBy using EDB as a source you are able to trigger thresholds on any published field from a TopoNode, or any other EDB source.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='ThresholdStatus defines the observed state of Threshold', - title='Status', - ), - ] = None - - -class ThresholdList(BaseModel): - apiVersion: str - items: Optional[List[Threshold]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/os/__init__.py b/pydantic_eda/com/nokia/eda/os/__init__.py deleted file mode 100644 index 12096b6..0000000 --- a/pydantic_eda/com/nokia/eda/os/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/os.eda.nokia.com/v1alpha1/os.json -# timestamp: 2025-05-07T11:43:52+00:00 diff --git a/pydantic_eda/com/nokia/eda/os/v1alpha1.py b/pydantic_eda/com/nokia/eda/os/v1alpha1.py deleted file mode 100644 index 952af63..0000000 --- a/pydantic_eda/com/nokia/eda/os/v1alpha1.py +++ /dev/null @@ -1,122 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/os.eda.nokia.com/v1alpha1/os.json -# timestamp: 2025-05-07T11:43:52+00:00 - -from __future__ import annotations - -from enum import Enum -from typing import Annotated, Dict, List, Literal, Optional, Union - -from pydantic import BaseModel, Field, RootModel - - -class Checks(Enum): - Interface = 'Interface' - DefaultBGP = 'DefaultBGP' - PingISL = 'PingISL' - PingSystem = 'PingSystem' - - -class ChecksModel(BaseModel): - checks: Annotated[ - Union[List[str], Checks], - Field( - description='Checks to run before (pre) and after (post) any image changes', - title='checks', - ), - ] - force: Annotated[ - bool, Field(description='Do not prompt for user input, even if checks fail') - ] - skip: Annotated[bool, Field(description='Do not run any checks')] - - -class Drains(BaseModel): - interfaceDisableSelectors: Annotated[ - Optional[List[str]], Field(title='InterfaceDisableSelectors') - ] = None - minimumWaitTime: Annotated[Optional[int], Field(title='minimumWaitTime')] = None - skip: Annotated[ - Optional[bool], Field(description='Do not run any drains', title='skip') - ] = None - - -class Prompt(Enum): - AfterPreChecks = 'AfterPreChecks' - AfterPostChecks = 'AfterPostChecks' - - -class Tranche(BaseModel): - name: Annotated[Optional[str], Field(title='name')] = None - nodeSelector: Annotated[Optional[List[str]], Field(title='nodeSelector')] = None - - -class Spec(BaseModel): - canaries: Annotated[Optional[List[str]], Field(title='canaries')] = None - checks: Annotated[Optional[ChecksModel], Field(title='checks')] = None - drains: Annotated[Optional[Drains], Field(title='drains')] = None - nodeProfile: Annotated[Optional[str], Field(title='nodeProfile')] = None - nodeSelector: Annotated[Optional[List[str]], Field(title='nodeSelector')] = None - nodes: Annotated[Optional[List[str]], Field(title='nodes')] = None - prompt: Annotated[Optional[Union[List[str], Prompt]], Field(title='prompt')] = None - tranches: Annotated[Optional[List[Tranche]], Field(title='tranches')] = None - type: Annotated[Literal['node', 'nodeselector', 'tranche'], Field(title='type')] - version: Annotated[Optional[str], Field(title='version')] = None - - -class Status(BaseModel): - id: Annotated[Optional[int], Field(description='Id', title='ID')] = None - result: Annotated[ - Optional[str], Field(description='Aggregate result of the Flow', title='Result') - ] = None - - -class DeployImageDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DeployImageDeletedResources(RootModel[List[DeployImageDeletedResourceEntry]]): - root: List[DeployImageDeletedResourceEntry] - - -class DeployImageMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class DeployImage(BaseModel): - apiVersion: str - kind: str - metadata: DeployImageMetadata - spec: Annotated[ - Spec, - Field( - description='DeployImageSpec defines the desired state of DeployImage', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='DeployImageStatus defines the observed state of DeployImage', - title='Status', - ), - ] = None - - -class DeployImageList(BaseModel): - apiVersion: str - items: Optional[List[DeployImage]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/protocols/__init__.py b/pydantic_eda/com/nokia/eda/protocols/__init__.py deleted file mode 100644 index 9895532..0000000 --- a/pydantic_eda/com/nokia/eda/protocols/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/protocols.eda.nokia.com/v1alpha1/protocols.json -# timestamp: 2025-05-07T11:43:57+00:00 diff --git a/pydantic_eda/com/nokia/eda/protocols/v1alpha1.py b/pydantic_eda/com/nokia/eda/protocols/v1alpha1.py deleted file mode 100644 index 765dd12..0000000 --- a/pydantic_eda/com/nokia/eda/protocols/v1alpha1.py +++ /dev/null @@ -1,3055 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/protocols.eda.nokia.com/v1alpha1/protocols.json -# timestamp: 2025-05-07T11:43:57+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Spec(BaseModel): - aggregatorASN: Annotated[ - Optional[int], - Field(description="Specifies the aggregator's ASN.", title='Aggregator ASN'), - ] = None - aggregatorIP: Annotated[ - Optional[str], - Field( - description="Specifies the aggregator's IP address.", title='Aggregator IP' - ), - ] = None - generateICMP: Annotated[ - Optional[bool], - Field( - description='When set to true the router generares ICMP unreachable messages for packets matching the aggregate route (and not a more specific route).', - title='Generate ICMP', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of nodes on which to configure the aggregate routes. An AND operation is executed against the nodes in this list and the nodes on which the Router is configured to determine the Nodes on which to configure the aggregate routes.', - title='Nodes', - ), - ] = None - prefixes: Annotated[ - List[str], - Field( - description='List of destination prefixes for the aggregate routes.', - title='Prefixes', - ), - ] - router: Annotated[ - str, - Field( - description='Reference to a Router on which to configure the aggregate routes. If no Nodes are provided then the aggregate routes will be provisioned on all Nodes on which the Router is provisioned.', - title='Router', - ), - ] - summaryOnly: Annotated[ - Optional[bool], - Field( - description='When set to true the router blocks the advertisement of all contributing routes of this aggregate route in dynamic protocols such as BGP.', - title='Summary Only', - ), - ] = None - - -class AggregateRouteDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class AggregateRouteDeletedResources( - RootModel[List[AggregateRouteDeletedResourceEntry]] -): - root: List[AggregateRouteDeletedResourceEntry] - - -class AggregateRouteMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class RemovePrivateAS(BaseModel): - ignorePeerAS: Annotated[ - bool, - Field( - description='If set to true then do not delete or replace a private AS number that is the same as the peer AS number.', - title='Ignore Peer AS', - ), - ] - leadingOnly: Annotated[ - bool, - Field( - description='If set to true then only delete or replace private AS numbers that appear before the first occurrence of a non-private ASN in the sequence of most recent ASNs in the AS path.', - title='Leading Only', - ), - ] - removePrivateASMode: Annotated[ - Literal['DISABLED', 'REPLACE', 'DELETE'], - Field( - description='The method by which private AS numbers are removed from the advertised AS_PATH attribute.', - title='Remove Private AS Mode', - ), - ] - - -class AsPathOptions(BaseModel): - allowOwnAS: Annotated[ - int, - Field( - description='The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.', - ge=0, - le=255, - title='Allow Own AS', - ), - ] - removePrivateAS: Annotated[ - Optional[RemovePrivateAS], - Field( - description='Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.', - title='Remove Private AS', - ), - ] = None - - -class Ipv4Unicast(BaseModel): - advertiseIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.', - title='Advertise IPv6 Next Hops', - ), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enables the IPv4 unicast AFISAFI.', title='Enabled'), - ] = None - maxReceivedRoutes: Annotated[ - Optional[int], - Field( - description='Maximum number of IPv4 Unicast routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.', - ge=1, - le=4294967295, - title='Max Received Routes', - ), - ] = None - receiveIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.', - title='Receive IPv6 Next Hops', - ), - ] = None - - -class Ipv6Unicast(BaseModel): - enabled: Annotated[ - Optional[bool], - Field(description='Enables the IPv6 unicast AFISAFI', title='Enabled'), - ] = None - maxReceivedRoutes: Annotated[ - Optional[int], - Field( - description='Maximum number of IPv6 Unicast routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.', - ge=1, - le=4294967295, - title='Max Received Routes', - ), - ] = None - - -class LocalAS(BaseModel): - autonomousSystem: Annotated[ - int, - Field( - description='Local Autonomous System number.', - ge=1, - le=4294967295, - title='Local Autonomous System', - ), - ] - prependGlobalAS: Annotated[ - Optional[bool], - Field( - description='When set to true, the global ASN value is prepended to the AS path in outbound routes towards each BGP peer.', - title='Prepend Global Autonomous System', - ), - ] = None - prependLocalAS: Annotated[ - Optional[bool], - Field( - description='When set to true, the local AS value is prepended to the AS path of inbound routes from each EBGP peer.', - title='Prepend Local Autonomous System', - ), - ] = None - - -class PeerAS(BaseModel): - autonomousSystem: Annotated[ - int, - Field( - description='Local Autonomous System number.', - ge=1, - le=4294967295, - title='Peer Autonomous System', - ), - ] - - -class SendDefaultRoute(BaseModel): - addressFamily: Annotated[ - List[Literal['IPV4-UNICAST', 'IPV6-UNICAST']], - Field( - description='Enables the sending of a synthetically generated default IPv4 or IPV6 route to each peer.', - title='Address Families', - ), - ] - exportPolicy: Annotated[ - Optional[str], - Field( - description='Reference to a Policy that should be applied to the advertised default routes, in order to set their attributes to non-default values.', - title='Export Policy', - ), - ] = None - - -class Timers(BaseModel): - connectRetry: Annotated[ - Optional[int], - Field( - description='The time interval in seconds between successive attempts to establish a session with a peer.', - ge=1, - le=65535, - title='Connect Retry', - ), - ] = None - holdTime: Annotated[ - Optional[int], - Field( - description='The hold-time interval in seconds that the router proposes to the peer in its OPEN message.', - ge=0, - le=65535, - title='Hold Time', - ), - ] = None - keepAlive: Annotated[ - Optional[int], - Field( - description='The interval in seconds between successive keepalive messages sent to the peer.', - ge=0, - le=21845, - title='Keep Alive', - ), - ] = None - minimumAdvertisementInterval: Annotated[ - Optional[int], - Field( - description='The value assigned to the MinRouteAdvertisementIntervalTimer of RFC 4271, for both EBGP and IBGP sessions.', - ge=1, - le=255, - title='Minimum Advertisement Interval', - ), - ] = None - - -class SpecModel(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - client: Annotated[ - Optional[bool], - Field( - description='When set to true, all configured and dynamic BGP peers are considered RR clients.', - title='Route Reflector Client', - ), - ] = None - clusterID: Annotated[ - Optional[str], - Field( - description='Enables route reflect client and sets the cluster ID.', - title='Cluster ID', - ), - ] = None - description: Annotated[ - Optional[str], - Field( - description='Sets the description on the BGP group.', title='Description' - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - localPreference: Annotated[ - Optional[int], - Field( - description='Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.', - ge=0, - le=4294967295, - title='Local Preference', - ), - ] = None - multiHopMaxHop: Annotated[ - Optional[int], - Field( - description='Enable multihop for eBGP peers and sets the maximum number of hops allowed.', - ge=1, - le=255, - title='Multihop Max Hop Count', - ), - ] = None - nextHopSelf: Annotated[ - Optional[bool], - Field( - description='When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.', - title='Next Hop Self', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class Status(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the BGP group.', title='Health' - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - numPeers: Annotated[ - Optional[int], - Field( - description='Number of configured BGP peers within the BGP Group.', - title='Number of Peers', - ), - ] = None - numPeersOperDown: Annotated[ - Optional[int], - Field( - description='Number of configured BGP peers which have an Operational State of down within the BGP Group.', - title='Number of Peers Operational Down', - ), - ] = None - numPeersUnknown: Annotated[ - Optional[int], - Field( - description='Number of configured BGP peers within the BGP Group which cannot be reached by npp.', - title='Number of unknown BGP Peers', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the BGP group.', title='Operational State' - ), - ] = None - - -class BGPGroupDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class BGPGroupDeletedResources(RootModel[List[BGPGroupDeletedResourceEntry]]): - root: List[BGPGroupDeletedResourceEntry] - - -class BGPGroupMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel1(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - client: Annotated[ - Optional[bool], - Field( - description='When set to true, all configured and dynamic BGP peers are considered RR clients.', - title='Route Reflector Client', - ), - ] = None - clusterID: Annotated[ - Optional[str], - Field( - description='Enables route reflect client and sets the cluster ID.', - title='Cluster ID', - ), - ] = None - description: Annotated[ - Optional[str], - Field(description='Sets the description on the BGP peer', title='Description'), - ] = None - dynamicNeighbor: Annotated[ - Optional[bool], - Field( - description='When set to true the Interface is added to the dynamic-neighbor list for dynamic peering.', - title='Dynamic Neighbor', - ), - ] = False - dynamicNeighborAllowedPeerAS: Annotated[ - Optional[List[int]], - Field( - description='The autonomous system numbers allowed from peers if dynamic peering is enabled.', - title='Dynamic Neighbor Allowed Peer AS', - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - group: Annotated[ - str, - Field( - description='Reference to a BGPGroup. When present this BGP peer will be added to the BGP group', - title='Group', - ), - ] - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to a RoutedInterface or IrbInterface resource whose IP will be used as a source IP for the BGP session.', - title='Interface Reference', - ), - ] - interfaceKind: Annotated[ - Literal['ROUTEDINTERFACE', 'IRBINTERFACE'], - Field( - description='InterfaceReference type defines whether the provided Reference is a RoutedInterface or IrbInterface.', - title='Interface Reference Type', - ), - ] - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - localPreference: Annotated[ - Optional[int], - Field( - description='Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.', - ge=0, - le=4294967295, - title='Local Preference', - ), - ] = None - multiHopMaxHop: Annotated[ - Optional[int], - Field( - description='Enable multihop for eBGP peers and sets the maximum number of hops allowed.', - ge=1, - le=255, - title='Multihop Max Hop Count', - ), - ] = None - nextHopSelf: Annotated[ - Optional[bool], - Field( - description='When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.', - title='Next Hop Self', - ), - ] = None - node: Annotated[ - Optional[str], - Field( - description='Node on which to configure the BGP peer. This node must be one of the nodes on which the IRBInterface is configured. When left blank or if the node is not part of the IRBInterface, the peer will not be deployed. Ignored for RoutedInterfaces.', - title='Node', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - peerIP: Annotated[ - Optional[str], - Field( - description='Peer IP to which the peering session will be established.', - title='Peer IP', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class Status1Model(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='Indicated whether the BGP Peer is administratively enabled.', - title='Enabled', - ), - ] = None - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the BGP peer.', title='Health' - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - lastEvent: Annotated[ - Optional[str], - Field(description='Last event of the BGP peer.', title='Last Event'), - ] = None - lastState: Annotated[ - Optional[str], - Field(description='Last state of the BGP peer.', title='Last State'), - ] = None - negotiatedHoldTime: Annotated[ - Optional[int], - Field( - description='Hold time negotiated with the BGP peer.', - title='Negotiated Hold Time', - ), - ] = None - negotiatedKeepaliveInterval: Annotated[ - Optional[int], - Field( - description='Keepalive interval negotiated with the BGP peer.', - title='Negotiated Keepalive Interval', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the BGP peer', title='Operational State' - ), - ] = None - peerAS: Annotated[ - Optional[int], Field(description='Peer AS of the BGP peer.', title='Peer AS') - ] = None - sessionState: Annotated[ - Optional[str], - Field(description='The state of the BGP session.', title='Session State'), - ] = None - underMaintenance: Annotated[ - Optional[bool], - Field( - description='Indicates if the BGP peer is under maintenance.', - title='Under Maintenance', - ), - ] = None - - -class SpecModel2(BaseModel): - afiSAFI: Annotated[ - Optional[List[str]], - Field(description='List of configured AFI-SAFI on the BGP peer'), - ] = None - defaultNetworkInstance: Annotated[ - bool, Field(description='Denotes if the router is a DefaultRouter or Router') - ] - dynamicNeighbor: Annotated[ - bool, - Field( - description='When set to true the PeerDefaultInterface is added to the dynamic-neighbor list for dynamic peering.' - ), - ] - group: Annotated[Optional[str], Field(description='Reference to a BGPGroup')] = None - networkInstanceName: Annotated[ - str, - Field( - description='The name of the network-instance or VPRN in which the BGP peer is configured' - ), - ] - node: Annotated[ - Optional[str], - Field(description='The Node on which the BGP peer configuration resides'), - ] = None - nodeInterface: Annotated[ - Optional[str], - Field( - description='Node interface of the default interface which is configured to peer as a dynamic neighbor' - ), - ] = None - operatingSystem: Annotated[ - Optional[str], Field(description='Operating System of the Node') - ] = None - peerIP: Annotated[Optional[str], Field(description='The IP of the BGP peer')] = None - router: Annotated[ - str, Field(description='Router to which the BGP peer is attached') - ] - subInterfaceIndex: Annotated[ - Optional[int], - Field( - description='Sub interface index of the default interface which is configured to peer as a dynamic neighbor' - ), - ] = None - - -class BGPPeerStateDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class BGPPeerStateDeletedResources(RootModel[List[BGPPeerStateDeletedResourceEntry]]): - root: List[BGPPeerStateDeletedResourceEntry] - - -class BGPPeerStateMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class BGPPeerDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class BGPPeerDeletedResources(RootModel[List[BGPPeerDeletedResourceEntry]]): - root: List[BGPPeerDeletedResourceEntry] - - -class BGPPeerMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel3(BaseModel): - aggregatorASN: Annotated[ - Optional[int], - Field(description="Specifies the aggregator's ASN.", title='Aggregator ASN'), - ] = None - aggregatorIP: Annotated[ - Optional[str], - Field( - description="Specifies the aggregator's IP address.", title='Aggregator IP' - ), - ] = None - defaultRouter: Annotated[ - str, - Field( - description='Reference to a Default Router on which to configure the aggregate routes. If no Nodes are provided then the aggregate routes will be provisioned on all Nodes on which the Router is provisioned.', - title='DefaultRouter', - ), - ] - generateICMP: Annotated[ - Optional[bool], - Field( - description='When set to true the router generares ICMP unreachable messages for packets matching the aggregate route (and not a more specific route).', - title='Generate ICMP', - ), - ] = None - prefixes: Annotated[ - List[str], - Field( - description='List of destination prefixes for the aggregate routes.', - title='Prefixes', - ), - ] - summaryOnly: Annotated[ - Optional[bool], - Field( - description='When set to true the router blocks the advertisement of all contributing routes of this aggregate route in dynamic protocols such as BGP.', - title='Summary Only', - ), - ] = None - - -class DefaultAggregateRouteDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DefaultAggregateRouteDeletedResources( - RootModel[List[DefaultAggregateRouteDeletedResourceEntry]] -): - root: List[DefaultAggregateRouteDeletedResourceEntry] - - -class DefaultAggregateRouteMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class L2VPNEVPN(BaseModel): - advertiseIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables advertisement of EVPN routes with IPv6 next-hops to peers.', - title='Advertise IPv6 Next Hops', - ), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enables the L2VPN EVPN AFISAFI.', title='Enabled'), - ] = None - maxReceivedRoutes: Annotated[ - Optional[int], - Field( - description='Maximum number of EVPN routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.', - ge=1, - le=4294967295, - title='Max Received Routes', - ), - ] = None - - -class SpecModel4(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - client: Annotated[ - Optional[bool], - Field( - description='When set to true, all configured and dynamic BGP peers are considered RR clients.', - title='Route Reflector Client', - ), - ] = None - clusterID: Annotated[ - Optional[str], - Field( - description='Enables route reflect client and sets the cluster ID.', - title='Cluster ID', - ), - ] = None - description: Annotated[ - Optional[str], - Field( - description='Sets the description on the BGP group.', title='Description' - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - l2VPNEVPN: Annotated[ - Optional[L2VPNEVPN], - Field( - description='Parameters relating to the EVPN AFI/SAFI.', - title='L2VPN EVPN Settings', - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - localPreference: Annotated[ - Optional[int], - Field( - description='Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.', - ge=0, - le=4294967295, - title='Local Preference', - ), - ] = None - multiHopMaxHop: Annotated[ - Optional[int], - Field( - description='Enable multihop for eBGP peers and sets the maximum number of hops allowed.', - ge=1, - le=255, - title='Multihop Max Hop Count', - ), - ] = None - nextHopSelf: Annotated[ - Optional[bool], - Field( - description='When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.', - title='Next Hop Self', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class Status1Model1(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the BGP group.', title='Health' - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - numPeers: Annotated[ - Optional[int], - Field( - description='Number of configured BGP peers within the BGP Group.', - title='Number of Peers', - ), - ] = None - numPeersOperDown: Annotated[ - Optional[int], - Field( - description='Number of configured BGP peers which have an Operational State of down within the BGP Group.', - title='Number of Peers Operational Down', - ), - ] = None - numPeersUnknown: Annotated[ - Optional[int], - Field( - description='Number of configured BGP peers within the BGP Group which cannot be reached by npp.', - title='Number of unknown BGP Peers', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the BGP group.', title='Operational State' - ), - ] = None - - -class DefaultBGPGroupDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DefaultBGPGroupDeletedResources( - RootModel[List[DefaultBGPGroupDeletedResourceEntry]] -): - root: List[DefaultBGPGroupDeletedResourceEntry] - - -class DefaultBGPGroupMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel5(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - client: Annotated[ - Optional[bool], - Field( - description='When set to true, all configured and dynamic BGP peers are considered RR clients.', - title='Route Reflector Client', - ), - ] = None - clusterID: Annotated[ - Optional[str], - Field( - description='Enables route reflect client and sets the cluster ID.', - title='Cluster ID', - ), - ] = None - description: Annotated[ - Optional[str], - Field(description='Sets the description on the BGP peer.', title='Description'), - ] = None - dynamicNeighbor: Annotated[ - Optional[bool], - Field( - description='When set to true the DefaultInterface is added to the dynamic-neighbor list for dynamic peering.', - title='Dynamic Neighbor', - ), - ] = False - dynamicNeighborAllowedPeerAS: Annotated[ - Optional[List[int]], - Field( - description='The autonomous system numbers allowed from peers if dynamic peering is enabled.', - title='Dynamic Neighbor Allowed Peer AS', - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - group: Annotated[ - str, Field(description='Reference to a DefaultBGPGroup.', title='Group') - ] - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to either a DefaultInterface or SystemInterface whose IP will be used as a source IP for the BGP session.', - title='Interface', - ), - ] - interfaceKind: Annotated[ - Literal['DEFAULTINTERFACE', 'SYSTEMINTERFACE'], - Field( - description='Reference to a the Kind of interface whose IP will be used as a source IP for the BGP session.', - title='Interface Kind', - ), - ] - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - l2VPNEVPN: Annotated[ - Optional[L2VPNEVPN], - Field( - description='Parameters relating to the EVPN AFI/SAFI.', title='L2VPN EVPN' - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - localPreference: Annotated[ - Optional[int], - Field( - description='Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.', - ge=0, - le=4294967295, - title='Local Preference', - ), - ] = None - multiHopMaxHop: Annotated[ - Optional[int], - Field( - description='Enable multihop for eBGP peers and sets the maximum number of hops allowed.', - ge=1, - le=255, - title='Multihop Max Hop Count', - ), - ] = None - nextHopSelf: Annotated[ - Optional[bool], - Field( - description='When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.', - title='Next Hop Self', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - peerIP: Annotated[ - Optional[str], - Field( - description='Peer IP to which the peering session will be established. There cannot be both a PeerIp and PeerDefaultInterface property set.', - title='Peer IP', - ), - ] = None - peerInterface: Annotated[ - Optional[str], - Field( - description='Reference to a DefaultInterface or SystemInterface resource to which the peering session will be established. There cannot be both a PeerIp and PeerDefaultInterface property set.', - title='Peer DefaultInterface', - ), - ] = None - peerInterfaceKind: Annotated[ - Optional[Literal['DEFAULTINTERFACE', 'SYSTEMINTERFACE']], - Field( - description='Reference to a the Kind of interface to which to peer to.', - title='Peer DefaultInterface Kind', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class Status1Model2(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='Indicated whether the BGP Peer is administratively enabled.', - title='Enabled', - ), - ] = None - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the BGP peer.', title='Health' - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - lastEvent: Annotated[ - Optional[str], - Field(description='Last event of the BGP peer.', title='Last Event'), - ] = None - lastState: Annotated[ - Optional[str], - Field(description='Last state of the BGP peer.', title='Last State'), - ] = None - negotiatedHoldTime: Annotated[ - Optional[int], - Field( - description='Hold time negotiated with the BGP peer.', - title='Negotiated Hold Time', - ), - ] = None - negotiatedKeepaliveInterval: Annotated[ - Optional[int], - Field( - description='Keepalive interval negotiated with the BGP peer.', - title='Negotiated Keepalive Interval', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the BGP peer', title='Operational State' - ), - ] = None - peerAS: Annotated[ - Optional[int], Field(description='Peer AS of the BGP peer.', title='Peer AS') - ] = None - sessionState: Annotated[ - Optional[str], - Field(description='The state of the BGP session.', title='Session State'), - ] = None - underMaintenance: Annotated[ - Optional[bool], - Field( - description='Indicates if the BGP peer is under maintenance.', - title='Under Maintenance', - ), - ] = None - - -class DefaultBGPPeerDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DefaultBGPPeerDeletedResources( - RootModel[List[DefaultBGPPeerDeletedResourceEntry]] -): - root: List[DefaultBGPPeerDeletedResourceEntry] - - -class DefaultBGPPeerMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel6(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - clientIPs: Annotated[ - Optional[List[str]], - Field( - description='List of RR client IPs to which the iBGP sessions are established.', - title='Client IPs', - ), - ] = None - clientSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select the RouteReflectorClients to which the iBGP sessions are established.', - title='Client Selector', - ), - ] = None - clusterID: Annotated[ - str, - Field( - description='Sets the cluster ID for route reflectors.', title='Cluster ID' - ), - ] - defaultBGPRRGroup: Annotated[ - str, - Field( - description='Reference to a DefaultBGPGroup.', title='Default BGP RR Group' - ), - ] - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to either a DefaultInterface or SystemInterface from which the session to the client will be done from.', - title='Interface Reference', - ), - ] - interfaceKind: Annotated[ - Literal['DEFAULTINTERFACE', 'SYSTEMINTERFACE'], - Field( - description='Reference to a the Kind of interface from which the session to the client will be done from.', - title='Interface Kind', - ), - ] - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - l2VPNEVPN: Annotated[ - Optional[L2VPNEVPN], - Field( - description='Parameters relating to the EVPN AFI/SAFI.', title='L2VPN EVPN' - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class Status1Model3(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the Route Reflector.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - numRouteReflectorBGPPeers: Annotated[ - Optional[int], - Field( - description='Total number of configured route reflector client peers on the route reflector.', - title='Number of Route Reflector BGP Peers', - ), - ] = None - numRouteReflectorBGPPeersOperDown: Annotated[ - Optional[int], - Field( - description='Total number of configured route reflector client peers on the route reflector that are operationally down.', - title='Number of Oper Down Route Reflector BGP Peers', - ), - ] = None - operDownRouteReflectorPeers: Annotated[ - Optional[List[str]], - Field( - description='List of route reflector BGPPeers which are operationally down.', - title='Oper Down Route Reflector Peers', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the Route Reflector.', - title='Operational State', - ), - ] = None - - -class SpecModel7(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - defaultBgpClientGroup: Annotated[ - str, - Field( - description='Reference to Default Bgp Group.', - title='Default BGP Client Group', - ), - ] - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to either a DefaultInterface or SystemInterface from which the session to the RR will be done from.', - title='Interface', - ), - ] - interfaceKind: Annotated[ - Literal['DEFAULTINTERFACE', 'SYSTEMINTERFACE'], - Field( - description='Reference to a the Kind of interface from which the session to the RR will be done from.', - title='Interface Kind', - ), - ] - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - l2VPNEVPN: Annotated[ - Optional[L2VPNEVPN], - Field( - description='Parameters relating to the EVPN AFI/SAFI.', title='L2VPN EVPN' - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - routeReflectorIPs: Annotated[ - Optional[List[str]], - Field( - description='List of the peering IPs on the RRs to which peering session is established.', - title='Route Reflector IPs', - ), - ] = None - routeReflectorSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select the RouteReflectors to which the iBGP sessions are established.', - title='Route Reflector Selector', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class Status1Model4(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the DefaultRouteReflectorClient.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - numRouteReflectorClientBGPPeers: Annotated[ - Optional[int], - Field( - description='Total number of configured route reflector peers on the route reflector client.', - title='Number of Route Reflector Client BGP Peers', - ), - ] = None - numRouteReflectorClientBGPPeersOperDown: Annotated[ - Optional[int], - Field( - description='Total number of configured route reflector peers on the route reflector client that are operationally down.', - title='Number of Oper Down Route Reflector Client BGP Peers', - ), - ] = None - operDownRouteReflectorClientPeers: Annotated[ - Optional[List[str]], - Field( - description='List of route reflector BGPPeers which are operationally down.', - title='Oper Down Route Reflector Client Peers', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the DefaultRouteReflectorClient.', - title='Operational State', - ), - ] = None - - -class DefaultRouteReflectorClientDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DefaultRouteReflectorClientDeletedResources( - RootModel[List[DefaultRouteReflectorClientDeletedResourceEntry]] -): - root: List[DefaultRouteReflectorClientDeletedResourceEntry] - - -class DefaultRouteReflectorClientMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class DefaultRouteReflectorDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DefaultRouteReflectorDeletedResources( - RootModel[List[DefaultRouteReflectorDeletedResourceEntry]] -): - root: List[DefaultRouteReflectorDeletedResourceEntry] - - -class DefaultRouteReflectorMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Bfd(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='Defines whether BFD should be enabled towards the nexthops.', - title='Enabled', - ), - ] = False - localAddress: Annotated[ - Optional[str], - Field( - description='Defines the local address to use when establishing the BFD session with the nexthop.', - title='Local Address', - ), - ] = None - localDiscriminator: Annotated[ - Optional[int], - Field( - description='Defines the local discriminator.', title='Local Discriminator' - ), - ] = None - remoteDiscriminator: Annotated[ - Optional[int], - Field( - description='Defines the remote discriminator.', - title='Remote Discriminator', - ), - ] = None - - -class Nexthop(BaseModel): - bfd: Annotated[ - Optional[Bfd], - Field( - description='Enables BFD to the next-hops in the group. This overrides the configuration at the group.', - title='BFD', - ), - ] = None - ipPrefix: Annotated[str, Field(description='Address to use.', title='IP Prefix')] - resolve: Annotated[ - Optional[bool], - Field( - description='If set to true the next-hops can be destinations which are resolved in the route table. This overrides the configuration at the group.', - title='Resolve', - ), - ] = False - - -class NexthopGroup(BaseModel): - bfd: Annotated[ - Optional[Bfd], - Field( - description='Enables BFD to the next-hops in the group. Local and Remote discriminator parameters have been deprecated at this level. Use Nexthop to set these parameters.', - title='BFD', - ), - ] = None - blackhole: Annotated[ - Optional[bool], - Field( - description='If set to true all traffic destined to the prefixes will be blackholed. If enabled, next-hops are ignored and this takes precedence.', - title='Blackhole', - ), - ] = False - nexthops: Annotated[ - Optional[List[Nexthop]], - Field(description='Ordered list of nexthops.', title='Nexthops'), - ] = None - resolve: Annotated[ - Optional[bool], - Field( - description='If set to true the next-hops can be destinations which are resolved in the route table.', - title='Resolve', - ), - ] = False - - -class SpecModel8(BaseModel): - defaultRouter: Annotated[ - str, - Field( - description='Reference to a DefaultRouter on which to configure the static routes.', - title='Default Router', - ), - ] - nexthopGroup: Annotated[ - NexthopGroup, - Field( - description='Group of nexthops for the list of prefixes.', - title='Nexthop Group', - ), - ] - preference: Annotated[ - Optional[int], - Field(description='Defines the route preference.', title='Preference'), - ] = None - prefixes: Annotated[ - List[str], - Field( - description='List of destination prefixes and mask to use for the static routes.', - title='Prefixes', - ), - ] - - -class Status1Model5(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the static routes.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the static routes.', - title='Operational State', - ), - ] = None - - -class DefaultStaticRouteDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DefaultStaticRouteDeletedResources( - RootModel[List[DefaultStaticRouteDeletedResourceEntry]] -): - root: List[DefaultStaticRouteDeletedResourceEntry] - - -class DefaultStaticRouteMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel9(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - bgpGroup: Annotated[ - str, Field(description='Reference to BgpGroup', title='BGP Group') - ] - clientIPs: Annotated[ - Optional[List[str]], - Field( - description='List of RR client IPs to which the iBGP sessions are established.', - title='Client IPs', - ), - ] = None - clusterID: Annotated[ - str, - Field( - description='Sets the cluster ID for route reflectors.', title='Cluster ID' - ), - ] - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to a RoutedInterface or IrbInterface resource whose IP will be used as a source IP for the BGP session.', - title='Interface Reference', - ), - ] - interfaceKind: Annotated[ - Literal['ROUTEDINTERFACE', 'IRBINTERFACE'], - Field( - description='InterfaceReference type defines whether the provided Reference is a RoutedInterface or IrbInterface.', - title='Interface Reference Type', - ), - ] - ipv4ClientSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select the RouteReflectorClients to which the iBGP sessions are established for IPv4.', - title='IPv4 Client Selector', - ), - ] = None - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6ClientSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select the RouteReflectorClients to which the iBGP sessions are established for IPv6.', - title='IPv6 Client Selector', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class Status1Model6(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the RouteReflector.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - numRouteReflectorBGPPeers: Annotated[ - Optional[int], - Field( - description='Total number of configured route reflector client peers on the route reflector.', - title='Number of Route Reflector BGP Peers', - ), - ] = None - numRouteReflectorBGPPeersOperDown: Annotated[ - Optional[int], - Field( - description='Total number of configured route reflector client peers on the route reflector that are operationally down.', - title='Number of Oper Down Route Reflector BGP Peers', - ), - ] = None - operDownRouteReflectorPeers: Annotated[ - Optional[List[str]], - Field( - description='List of route reflector BGPPeers which are operationally down.', - title='Oper Down Route Reflector Peers', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the RouteReflector.', - title='Operational State', - ), - ] = None - - -class SpecModel10(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - bgpGroup: Annotated[ - str, Field(description='Reference to BgpGroup.', title='BGP Group') - ] - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to a RoutedInterface or IrbInterface resource whose IP will be used as a source IP for the BGP session.', - title='Interface Reference', - ), - ] - interfaceKind: Annotated[ - Literal['ROUTEDINTERFACE', 'IRBINTERFACE'], - Field( - description='InterfaceReference type defines whether the provided Reference is a RoutedInterface or IrbInterface.', - title='Interface Reference Type', - ), - ] - ipv4RouteReflectorSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select the RouteReflectors to which the iBGP sessions are established for IPv4.', - title='IPv4 Route Reflector Selector', - ), - ] = None - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6RouteReflectorSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector used to select the RouteReflectors to which the iBGP sessions are established for IPv6.', - title='IPv6 Route Reflector Selector', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - routeReflectorIPs: Annotated[ - Optional[List[str]], - Field( - description='List of the peering IPs on the RRs to which peering session is established.', - title='Route Reflector IPs', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class Status1Model7(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the RouteReflectorClient.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - numRouteReflectorClientBGPPeers: Annotated[ - Optional[int], - Field( - description='Total number of configured route reflector peers on the route reflector client.', - title='Number of Route Reflector Client BGP Peers', - ), - ] = None - numRouteReflectorClientBGPPeersOperDown: Annotated[ - Optional[int], - Field( - description='Total number of configured route reflector peers on the route reflector client that are operationally down.', - title='Number of Oper Down Route Reflector Client BGP Peers', - ), - ] = None - operDownRouteReflectorClientPeers: Annotated[ - Optional[List[str]], - Field( - description='List of route reflector BGPPeers which are operationally down.', - title='Oper Down Route Reflector Client Peers', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the RouteReflectorClient.', - title='Operational State', - ), - ] = None - - -class SpecModel11(BaseModel): - defaultRouteReflectorClient: Annotated[ - Optional[bool], - Field( - description='Denotes if the route reflector client is a DefaultRouteReflectorClient or RouteReflectorClient' - ), - ] = None - routeReflectorClientBGPPeers: Annotated[ - Optional[List[str]], - Field( - description='A list of BGPPeers configured on the route reflector client to peer with route reflectors' - ), - ] = None - - -class RouteReflectorClientStateDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class RouteReflectorClientStateDeletedResources( - RootModel[List[RouteReflectorClientStateDeletedResourceEntry]] -): - root: List[RouteReflectorClientStateDeletedResourceEntry] - - -class RouteReflectorClientStateMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class RouteReflectorClientDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class RouteReflectorClientDeletedResources( - RootModel[List[RouteReflectorClientDeletedResourceEntry]] -): - root: List[RouteReflectorClientDeletedResourceEntry] - - -class RouteReflectorClientMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel12(BaseModel): - defaultRouteReflector: Annotated[ - Optional[bool], - Field( - description='Denotes if the route reflector is a DefaultRouteReflector or RouteReflector' - ), - ] = None - routeReflectorBGPPeers: Annotated[ - Optional[List[str]], - Field( - description='A list of BGPPeers configured on the route reflector to peer with clients' - ), - ] = None - - -class RouteReflectorStateDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class RouteReflectorStateDeletedResources( - RootModel[List[RouteReflectorStateDeletedResourceEntry]] -): - root: List[RouteReflectorStateDeletedResourceEntry] - - -class RouteReflectorStateMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class RouteReflectorDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class RouteReflectorDeletedResources( - RootModel[List[RouteReflectorDeletedResourceEntry]] -): - root: List[RouteReflectorDeletedResourceEntry] - - -class RouteReflectorMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel13(BaseModel): - nexthopGroup: Annotated[ - NexthopGroup, - Field( - description='Group of nexthops for the list of prefixes.', - title='Nexthop Group', - ), - ] - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of nodes on which to configure the static routes. An AND operation is executed against the nodes in this list and the nodes on which the Router is configured to determine the Nodes on which to configure the static routes.', - title='Nodes', - ), - ] = None - preference: Annotated[ - Optional[int], - Field(description='Defines the route preference.', title='Preference'), - ] = None - prefixes: Annotated[ - List[str], - Field( - description='List of destination prefixes and mask to use for the static routes.', - title='Prefixes', - ), - ] - router: Annotated[ - str, - Field( - description='Reference to a Router on which to configure the static routes. If no Nodes are provided then the static routes will be provisioned on all Nodes on which the Router is provisioned.', - title='Router', - ), - ] - - -class Status1Model8(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the static routes.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of Nodes on which the static routes are configured.', - title='Nodes', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the static routes.', - title='Operational State', - ), - ] = None - - -class StaticRouteDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class StaticRouteDeletedResources(RootModel[List[StaticRouteDeletedResourceEntry]]): - root: List[StaticRouteDeletedResourceEntry] - - -class StaticRouteMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class AggregateRoute(BaseModel): - apiVersion: str - kind: str - metadata: AggregateRouteMetadata - spec: Annotated[ - Spec, - Field( - description='The AggregateRoute enables the configuration of aggregated routes on a specified Router. This resource allows for the definition of destination prefixes, the selection of a router, and optionally, specific nodes where the aggregate routes should be configured. Advanced options include the ability to generate ICMP unreachable messages for packets matching the aggregate route, and the ability to block the advertisement of all contributing routes in dynamic protocols like BGP.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='AggregateRouteStatus defines the observed state of AggregateRoute', - title='Status', - ), - ] = None - - -class AggregateRouteList(BaseModel): - apiVersion: str - items: Optional[List[AggregateRoute]] = None - kind: str - - -class BGPGroup(BaseModel): - apiVersion: str - kind: str - metadata: BGPGroupMetadata - spec: Annotated[ - SpecModel, - Field( - description='The BGPGroup enables centralized management of BGP peer configurations. This resource allows setting a description, common BGP settings, and peer-specific configurations, simplifying the consistent application of policies across multiple peers. It also includes transport settings, such as local TCP address configuration, passive mode, and TCP MSS.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='BGPGroupStatus defines the observed state of BGPGroup', - title='Status', - ), - ] = None - - -class BGPGroupList(BaseModel): - apiVersion: str - items: Optional[List[BGPGroup]] = None - kind: str - - -class BGPPeer(BaseModel): - apiVersion: str - kind: str - metadata: BGPPeerMetadata - spec: Annotated[ - SpecModel1, - Field( - description='BGPPeer enables the configuration of BGP sessions. It allows specifying a description, an interface reference (either RoutedInterface or IrbInterface), and the peer IP address. The resource also supports dynamic neighbors, common BGP settings, and peer-specific configurations.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model], - Field( - description='BGPPeerStatus defines the observed state of BGPPeer', - title='Status', - ), - ] = None - - -class BGPPeerList(BaseModel): - apiVersion: str - items: Optional[List[BGPPeer]] = None - kind: str - - -class BGPPeerState(BaseModel): - apiVersion: str - kind: str - metadata: BGPPeerStateMetadata - spec: Annotated[ - SpecModel2, - Field( - description='BGPPeerStateSpec defines the desired state of BGPPeerState', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='BGPPeerStateStatus defines the observed state of BGPPeerState', - title='Status', - ), - ] = None - - -class BGPPeerStateList(BaseModel): - apiVersion: str - items: Optional[List[BGPPeerState]] = None - kind: str - - -class DefaultAggregateRoute(BaseModel): - apiVersion: str - kind: str - metadata: DefaultAggregateRouteMetadata - spec: Annotated[ - SpecModel3, - Field( - description='DefaultAggregateRoute allows the configuration of aggregate routes on a DefaultRouter. It includes specifying destination prefixes, the DefaultRouter, and settings for generating ICMP unreachable messages or blocking route advertisement. Additionally, it configures the aggregator’s IP address and ASN for efficient route management.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='DefaultAggregateRouteStatus defines the observed state of DefaultAggregateRoute', - title='Status', - ), - ] = None - - -class DefaultAggregateRouteList(BaseModel): - apiVersion: str - items: Optional[List[DefaultAggregateRoute]] = None - kind: str - - -class DefaultBGPGroup(BaseModel): - apiVersion: str - kind: str - metadata: DefaultBGPGroupMetadata - spec: Annotated[ - SpecModel4, - Field( - description='The DefaultBGPGroup enables centralized management of BGP peer configurations within a DefaultRouter. This resource allows setting a description, common BGP settings, and peer-specific configurations, simplifying the consistent application of policies across multiple peers. It also includes transport settings, such as local TCP address configuration, passive mode, and TCP MSS. type DefaultBGPGroupSpec struct {', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model1], - Field( - description='DefaultBGPGroupStatus defines the observed state of DefaultBGPGroup.', - title='Status', - ), - ] = None - - -class DefaultBGPGroupList(BaseModel): - apiVersion: str - items: Optional[List[DefaultBGPGroup]] = None - kind: str - - -class DefaultBGPPeer(BaseModel): - apiVersion: str - kind: str - metadata: DefaultBGPPeerMetadata - spec: Annotated[ - SpecModel5, - Field( - description='DefaultBGPPeer enables the configuration of BGP sessions within a DefaultRouter. It allows specifying a description, a DefaultInterface reference, and the peer IP address. The resource also supports dynamic neighbors, common BGP settings, and peer-specific configurations.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model2], - Field( - description='DefaultBGPPeerStatus defines the observed state of DefaultBGPPeer', - title='Status', - ), - ] = None - - -class DefaultBGPPeerList(BaseModel): - apiVersion: str - items: Optional[List[DefaultBGPPeer]] = None - kind: str - - -class DefaultRouteReflector(BaseModel): - apiVersion: str - kind: str - metadata: DefaultRouteReflectorMetadata - spec: Annotated[ - SpecModel6, - Field( - description='DefaultRouteReflector enables the configuration of iBGP sessions to RouteReflectorClients. It includes settings for the DefaultInterface, BGP group, client selectors, and the Cluster ID. Additionally, it allows for the configuration of L2VPN EVPN settings and applies common BGP configuration settings to manage routing efficiently within the network.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model3], - Field( - description='DefaultRouteReflectorStatus defines the observed state of DefaultRouteReflector', - title='Status', - ), - ] = None - - -class DefaultRouteReflectorClient(BaseModel): - apiVersion: str - kind: str - metadata: DefaultRouteReflectorClientMetadata - spec: Annotated[ - SpecModel7, - Field( - description='DefaultRouteReflectorClient enables the configuration of iBGP sessions from a client to RouteReflectors. It includes settings for the DefaultInterface, BGP group, client selectors, and a list of Route Reflector IPs. Additionally, it allows for the configuration of L2VPN EVPN settings and applies common BGP configuration settings to manage routing efficiently within the network.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model4], - Field( - description='DefaultRouteReflectorClientStatus defines the observed state of DefaultRouteReflectorClient', - title='Status', - ), - ] = None - - -class DefaultRouteReflectorClientList(BaseModel): - apiVersion: str - items: Optional[List[DefaultRouteReflectorClient]] = None - kind: str - - -class DefaultRouteReflectorList(BaseModel): - apiVersion: str - items: Optional[List[DefaultRouteReflector]] = None - kind: str - - -class DefaultStaticRoute(BaseModel): - apiVersion: str - kind: str - metadata: DefaultStaticRouteMetadata - spec: Annotated[ - SpecModel8, - Field( - description='DefaultStaticRoute enables the configuration of static routes within a DefaultRouter. It allows specifying destination prefixes, route preference, and a nexthop group. This resource facilitates precise control over routing behavior, including options for BFD, route resolution, and blackholing traffic.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model5], - Field( - description='DefaultStaticRouteStatus defines the observed state of default static route', - title='Status', - ), - ] = None - - -class DefaultStaticRouteList(BaseModel): - apiVersion: str - items: Optional[List[DefaultStaticRoute]] = None - kind: str - - -class RouteReflector(BaseModel): - apiVersion: str - kind: str - metadata: RouteReflectorMetadata - spec: Annotated[ - SpecModel9, - Field( - description='RouteReflector enables the configuration of iBGP sessions with RouteReflectorClients. It includes settings for selecting Interfaces, client selectors for IPv4 and IPv6, and the option to specify a BGP group and cluster ID.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model6], - Field( - description='RouteReflectorStatus defines the observed state of RouteReflector', - title='Status', - ), - ] = None - - -class RouteReflectorClient(BaseModel): - apiVersion: str - kind: str - metadata: RouteReflectorClientMetadata - spec: Annotated[ - SpecModel10, - Field( - description='RouteReflectorClient manages the configuration of iBGP sessions between a client and RouteReflectors. This resource allows you to specify the Interface for BGP sessions, set selectors for RouteReflectors, and configure common BGP settings.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model7], - Field( - description='RouteReflectorClientStatus defines the observed state of RouteReflectorClient', - title='Status', - ), - ] = None - - -class RouteReflectorClientList(BaseModel): - apiVersion: str - items: Optional[List[RouteReflectorClient]] = None - kind: str - - -class RouteReflectorClientState(BaseModel): - apiVersion: str - kind: str - metadata: RouteReflectorClientStateMetadata - spec: Annotated[ - SpecModel11, - Field( - description='RouteReflectorClientStateSpec defines the desired state of RouteReflectorClientState', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='RouteReflectorClientStateStatus defines the observed state of RouteReflectorClientState', - title='Status', - ), - ] = None - - -class RouteReflectorClientStateList(BaseModel): - apiVersion: str - items: Optional[List[RouteReflectorClientState]] = None - kind: str - - -class RouteReflectorList(BaseModel): - apiVersion: str - items: Optional[List[RouteReflector]] = None - kind: str - - -class RouteReflectorState(BaseModel): - apiVersion: str - kind: str - metadata: RouteReflectorStateMetadata - spec: Annotated[ - SpecModel12, - Field( - description='RouteReflectorStateSpec defines the desired state of RouteReflectorState', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='RouteReflectorStateStatus defines the observed state of RouteReflectorState', - title='Status', - ), - ] = None - - -class RouteReflectorStateList(BaseModel): - apiVersion: str - items: Optional[List[RouteReflectorState]] = None - kind: str - - -class StaticRoute(BaseModel): - apiVersion: str - kind: str - metadata: StaticRouteMetadata - spec: Annotated[ - SpecModel13, - Field( - description='StaticRoute allows for the specification of destination prefixes, route preferences, and the associated Router. It also supports configuring nexthop groups and specifying the nodes where the static routes should be provisioned.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model8], - Field( - description='StaticRouteStatus defines the observed state of Static Route', - title='Status', - ), - ] = None - - -class StaticRouteList(BaseModel): - apiVersion: str - items: Optional[List[StaticRoute]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/qos/__init__.py b/pydantic_eda/com/nokia/eda/qos/__init__.py deleted file mode 100644 index e4bab5a..0000000 --- a/pydantic_eda/com/nokia/eda/qos/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/qos.eda.nokia.com/v1alpha1/qos.json -# timestamp: 2025-05-07T11:44:01+00:00 diff --git a/pydantic_eda/com/nokia/eda/qos/v1alpha1.py b/pydantic_eda/com/nokia/eda/qos/v1alpha1.py deleted file mode 100644 index 9144db7..0000000 --- a/pydantic_eda/com/nokia/eda/qos/v1alpha1.py +++ /dev/null @@ -1,1685 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/qos.eda.nokia.com/v1alpha1/qos.json -# timestamp: 2025-05-07T11:44:01+00:00 - -from __future__ import annotations - -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class DropProbabilityItem(BaseModel): - level: Annotated[ - Optional[Literal['High', 'Medium', 'Low']], - Field( - description='A drop probability level within the forwarding class for which a different remarking is desired', - title='Level', - ), - ] = None - pcpValue: Annotated[ - Optional[int], - Field( - description='The PCP value to be used for packets associated with the forwarding class and the specific drop probability. This overrides the general PCP value.', - ge=0, - le=7, - title='PCP Value', - ), - ] = None - - -class Dot1pMapItem(BaseModel): - dropProbability: Annotated[ - Optional[List[DropProbabilityItem]], - Field( - description='Drop probability specific overrides within the forwarding class', - title='Drop Probability', - ), - ] = None - forwardingClasses: Annotated[ - List[str], - Field( - description='The forwarding class matched to apply the rewrite policy', - title='Forwarding Class', - ), - ] - pcpValue: Annotated[ - Optional[int], - Field( - description='The PCP value to be used for all packets associated with the forwarding class, except those with a drop-probability-specific or profile-specific override', - ge=0, - le=7, - title='PCP Value', - ), - ] = None - - -class Dot1pRewritePolicy(BaseModel): - dot1pMap: Annotated[ - List[Dot1pMapItem], - Field(description='Map of forwarding classes to PCP values', title='Map'), - ] - - -class DropProbabilityItemModel(BaseModel): - dscp: Annotated[ - Optional[int], - Field( - description='The DSCP value to be used for packets associated with the forwarding class and the specific drop probability. This overrides the general DSCP value.', - ge=0, - le=63, - title='DSCP', - ), - ] = None - level: Annotated[ - Optional[Literal['High', 'Medium', 'Low']], - Field( - description='A drop probability level within the forwarding class for which a different remarking is desired.', - title='Level', - ), - ] = None - - -class DscpMapItem(BaseModel): - dropProbability: Annotated[ - Optional[List[DropProbabilityItemModel]], - Field( - description='A drop probability within the forwarding class for which a different remarking is desired.', - title='Drop Probability', - ), - ] = None - dscp: Annotated[ - Optional[int], - Field( - description='The DSCP value to be used for all packets associated with the forwarding class, except those with a drop-probability-specific or profile-specific override.', - ge=0, - le=63, - title='DSCP', - ), - ] = None - forwardingClasses: Annotated[ - List[str], - Field( - description='The forwarding class matched to apply the rewrite policy.', - title='Forwarding Class', - ), - ] - - -class DscpRewritePolicy(BaseModel): - dscpMap: Annotated[ - List[DscpMapItem], - Field(description='Map of forwarding classes to DSCP values.', title='Map'), - ] - - -class ForwardingClassToQueueMappingItem(BaseModel): - forwardingClasses: Annotated[ - List[str], - Field( - description='The forwarding classes to which the mapping applies, these are references to ForwardingClass resources.', - min_length=1, - title='Forwarding Classes', - ), - ] - queue: Annotated[ - str, - Field( - description='The queue to which the forwarding classes are mapped, this is a reference to a Queue resource.', - title='Queue', - ), - ] - queueGroup: Annotated[ - Optional[str], - Field( - description='The queue-group name for queue to forwarding class mapping.', - title='Queue Group', - ), - ] = None - - -class PfcDeadlockAvoidance(BaseModel): - deadlockAvoidance: Annotated[ - bool, - Field( - description='Parameters related to avoid a deadlock related to pfc on outgoing interface', - title='Deadlock Avoidance', - ), - ] - deadlockDetectionTimer: Annotated[ - int, - Field( - description='Number of milliseconds during which outgoing interface is receiving pfc-pause-frames before triggering recovery-timer.', - title='Deadlock Detection Timer', - ), - ] - deadlockRecoveryTimer: Annotated[ - int, - Field( - description='Number of milliseconds during which the pfc-pause-frames will be ignored.', - title='Deadlock Recovery Timer', - ), - ] - - -class Queue(BaseModel): - committedBurstSize: Annotated[ - Optional[int], - Field(description='Committed Burst Size.', title='Committed Burst Size'), - ] = None - maximumBurstSize: Annotated[ - int, - Field( - description='Maximum amount of shared buffer memory available to the queue in bytes.', - ge=0, - le=4294967295, - title='Maximum Burst Size', - ), - ] - pfcPauseFramePriority: Annotated[ - Optional[int], - Field( - description='The pfc-priority received in pfc-pause-frame.', - title='PFC Priority', - ), - ] = None - queue: Annotated[ - str, Field(description='Reference to a Queue resource.', title='Queue') - ] - schedulerPeakRatePercent: Annotated[ - Optional[int], - Field( - description='The peak rate percent used by the scheduler for the queue.', - ge=1, - le=100, - title='Scheduler Peak Rate Percent', - ), - ] = None - schedulerPriorityLevel: Annotated[ - Optional[int], - Field( - description='The priority level at this Port Scheduler Policy.', - ge=1, - le=8, - title='Scheduler Priority Level', - ), - ] = None - schedulerWeight: Annotated[ - Optional[int], - Field( - description='The weight factor used for the WRR scheduler. If any of the queues have a configured weight the set of queues will use a WRR scheduler and thus all queues must have a weight configured. If no weights are set then the queues are scheduled in strict priority from lowest to higher queue ID.', - ge=0, - le=255, - title='Scheduler Weight', - ), - ] = None - - -class WredSlopPolicy(BaseModel): - drop: Annotated[ - bool, - Field( - description='When set to true, and if the ECN field in the packet indicates that the endpoints are not ECN-capable, and the WRED algorithm determines that the packet should be dropped based on the drop probability, the packet will be dropped', - title='Drop', - ), - ] - dropProbability: Annotated[ - Literal['High', 'Medium', 'Low', 'All'], Field(title='Drop Probability') - ] - ecn: Annotated[ - bool, - Field( - description='When set to true and the queue length is between the thresholds and the ECN field indicates ECN-capable endpoints, the CE bits are set to 1, and the packet is transmitted based on WRED. If false, such packets are discarded.', - title='ECN', - ), - ] - maxDropProbabilityPercent: Annotated[ - Optional[int], - Field( - description='If the queue depth is between min and max threshold then this the probability with which packets are dropped or marked.', - title='Max Drop Probability Percent', - ), - ] = None - maxThreshold: Annotated[ - Optional[int], - Field( - description='The maximum threshold parameter for a RED-managed queue in bytes. When the average queue length exceeds the max value, all packets are dropped (or marked if ECN is enabled). Mutually exclusive with min-threshold-percent and max-threshold-percent.', - title='Max Threshold', - ), - ] = None - maxThresholdPercent: Annotated[ - Optional[int], - Field( - description='The maximum threshold parameter for a RED-managed queue in percent. When the average queue length exceeds the max value, all packets are dropped (or marked if ECN is enabled). Mutually exclusive with min-threshold and max-threshold.', - title='Max Threshold Percent', - ), - ] = None - minThreshold: Annotated[ - Optional[int], - Field( - description='The mininum threshold parameter for a RED-managed queue in bytes. When the average queue length is less than min, all packets are admitted to the queue. Mututally exclusive with min-threshold-percent and max-threshold-percent.', - title='Min Threshold', - ), - ] = None - minThresholdPercent: Annotated[ - Optional[int], - Field( - description='The mininum threshold parameter for a RED-managed queue in percent. When the average queue length is less than min, all packets are admitted to the queue. Mutually exclusive with min-threshold and max-threshold.', - title='Min Threshold Percent', - ), - ] = None - trafficType: Annotated[ - Literal['Tcp', 'NonTcp', 'All'], - Field( - description='The traffic type to which the WRED slope applies.', - title='Traffic Type', - ), - ] - - -class QueueManagementItem(BaseModel): - queues: Annotated[List[Queue], Field(description='List of queues.', title='Queues')] - slopePolicyWeight: Annotated[ - Optional[int], - Field( - description='The average queue size is calculated using both the previous average and the current queue size: average = (previous average)(1 - 2^(-n)) + (current size)(2^(-n)), where n is a user-configurable weight factor. A higher n gives more importance to the previous average, smoothing peaks and lows in the queue. Lower n makes the average closer to the current queue size. If this leaf is absent, the default value is used.', - ge=0, - le=15, - title='Slope Policy Weight', - ), - ] = 0 - wredSlopPolicies: Annotated[ - Optional[List[WredSlopPolicy]], - Field( - description='Slope policy to apply to the set of queues.', - title='Slope Policy', - ), - ] = None - - -class Spec(BaseModel): - dot1pRewritePolicy: Annotated[ - Optional[Dot1pRewritePolicy], - Field( - description='Dot1pRewritePolicy enables the configuration of rewrite policies for Dot1p values. It includes mappings of forwarding classes to Dot1p values, with options for drop probability-specific overrides within each forwarding class.', - title='Dot1p Rewrite Policy', - ), - ] = None - dscpRewritePolicy: Annotated[ - Optional[DscpRewritePolicy], - Field( - description='DSCPRewritePolicy enables the configuration of rewrite policies for Differentiated Services Code Point (DSCP) values. It includes mappings of forwarding classes to DSCP values, with options for drop probability-specific overrides within each forwarding class. If a DSCPRewritePolicy is not specified, the DSCP value of the packet is unchanged. If a DSCP policy is specific and ECN is enabled on any of the queues, the DSCP policy will be applied to all ECN capable packets.', - title='DSCP Rewrite Policy', - ), - ] = None - forwardingClassToQueueMapping: Annotated[ - Optional[List[ForwardingClassToQueueMappingItem]], - Field( - description='Forwarding class to queue mapping policy.', - title='Forwarding Class to Queue Mapping', - ), - ] = None - pfcDeadlockAvoidance: Annotated[ - Optional[PfcDeadlockAvoidance], - Field( - description='Parameters related to avoid a deadlock related to pfc on outgoing interface.', - title='Deadlock Avoidance', - ), - ] = None - queueManagement: Annotated[ - Optional[List[QueueManagementItem]], - Field( - description='Queue management policy for egress queues.', - title='Queue Management', - ), - ] = None - - -class EgressPolicyDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class EgressPolicyDeletedResources(RootModel[List[EgressPolicyDeletedResourceEntry]]): - root: List[EgressPolicyDeletedResourceEntry] - - -class EgressPolicyMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class ForwardingClassDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class ForwardingClassDeletedResources( - RootModel[List[ForwardingClassDeletedResourceEntry]] -): - root: List[ForwardingClassDeletedResourceEntry] - - -class ForwardingClassMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class PcpValue(BaseModel): - rangeEnd: Annotated[ - Optional[int], - Field( - description='Optional end of PCP range (inclusive) which would start from the Value to the RangeEnd.', - ge=0, - le=7, - title='PCP Range End', - ), - ] = None - value: Annotated[ - int, - Field( - description='Single PCP value or start of range.', - ge=0, - le=7, - title='PCP Value', - ), - ] - - -class Dot1pPolicyEntry(BaseModel): - directToPFCQueue: Annotated[ - Optional[bool], - Field( - description='In addition to creating a Dot1p PCP value to Forwarding Class mapping, this will map the PCP values directly to the PFC queue specified in the Forwarding Class to Queue mapping.', - title='Direct to PFC Queue', - ), - ] = None - dropProbabilityLevel: Annotated[ - Optional[Literal['High', 'Medium', 'Low']], - Field( - description='Assign matching packets to the specified drop probability level.', - title='Drop Probability Level', - ), - ] = 'Low' - forwardingClass: Annotated[ - Optional[str], - Field( - description='Reference to a ForwardingClass resource to which the value is mapped.', - title='Forwarding Class', - ), - ] = None - pcpValues: Annotated[ - List[PcpValue], - Field( - description='List of PCP values or ranges used to match packets to classify into Forwarding Classes.', - min_length=1, - title='PCP Values', - ), - ] - - -class DscpValue(BaseModel): - rangeEnd: Annotated[ - Optional[int], - Field( - description='Optional end of DSCP range (inclusive) which would start from the Value to the RangeEnd.', - ge=0, - le=63, - title='DSCP Range End', - ), - ] = None - value: Annotated[ - int, - Field( - description='Single DSCP value or start of range.', - ge=0, - le=63, - title='DSCP Value', - ), - ] - - -class DscpPolicyEntry(BaseModel): - dropProbabilityLevel: Annotated[ - Optional[Literal['High', 'Medium', 'Low']], - Field( - description='Assign matching packets to the specified drop probability level.', - title='Drop Probability Level', - ), - ] = 'Low' - dscpValues: Annotated[ - List[DscpValue], - Field( - description='List of DSCP values or ranges used to match packets to classify into Forwarding Classes.', - min_length=1, - title='DSCP Values', - ), - ] - forwardingClass: Annotated[ - Optional[str], - Field( - description='Reference to a ForwardingClass resource to which the value is mapped.', - title='Forwarding Class', - ), - ] = None - - -class Action(BaseModel): - dropProbabilityLevel: Annotated[ - Optional[Literal['High', 'Medium', 'Low']], - Field( - description='Assign matching packets to the specified drop probability level.', - title='Drop Probability Level', - ), - ] = 'Low' - dscpRewriteValue: Annotated[ - Optional[int], - Field( - description='Rewrite actions associated with packets that match the classifier entry.', - ge=0, - le=63, - title='DSCP Rewrite Value', - ), - ] = None - forwardingClass: Annotated[ - Optional[str], - Field( - description='Reference to a ForwardingClass resource to which the value is mapped.', - title='Forwarding Class', - ), - ] = None - - -class IpEntry(BaseModel): - action: Annotated[ - Action, - Field(description='An action to take on the matched packets.', title='Action'), - ] - destinationPortName: Annotated[ - Optional[ - Literal[ - 'ACAP', - 'AFP-TCP', - 'ARNS', - 'ASF-RMCP', - 'ASHARE', - 'ATALK-RM', - 'AURP', - 'AUTH', - 'BFD', - 'BFD-ECHO', - 'BFTP', - 'BGMP', - 'BGP', - 'BOOTPC', - 'BOOTPS', - 'CCSO-NS', - 'CHARGEN', - 'CISCO-TDP', - 'CITADEL', - 'CLEARCASE', - 'COMMERCE', - 'COURIER', - 'DAYTIME', - 'DHCP-FAILOVER', - 'DHCPV6-CLIENT', - 'DHCPV6-SERVER', - 'DICOM', - 'DISCARD', - 'DNSIX', - 'DOMAIN', - 'DSP', - 'ECHO', - 'EPP', - 'ESRO', - 'EXEC', - 'FINGER', - 'FTP', - 'FTP-DATA', - 'FTPS', - 'FTPS-DATA', - 'GODI', - 'GOPHER', - 'GTP-C', - 'GTP-PRIME', - 'GTP-U', - 'HA-CLUSTER', - 'HOSTNAME', - 'HP-ALARM-MGR', - 'HTTP', - 'HTTP-ALT', - 'HTTP-MGMT', - 'HTTP-RPC', - 'HTTPS', - 'IEEE-MMS-SSL', - 'IMAP', - 'IMAP3', - 'IMAPS', - 'IPP', - 'IPSEC', - 'IPX', - 'IRC', - 'IRIS-BEEP', - 'ISAKMP', - 'ISAKMP-NAT', - 'ISCSI', - 'ISO-TSAP', - 'KERBEROS', - 'KERBEROS-ADM', - 'KLOGIN', - 'KPASSWD', - 'KSHELL', - 'L2TP', - 'LDAP', - 'LDAPS', - 'LDP', - 'LMP', - 'LOGIN', - 'LPD', - 'LSP-PING', - 'MAC-SERVER-ADM', - 'MATIP-A', - 'MATIP-B', - 'MICRO-BFD', - 'MICROSOFT-DS', - 'MOBILE-IP', - 'MONITOR', - 'MPP', - 'MS-EXCHANGE', - 'MSDP', - 'MSP', - 'MSSQL-M', - 'MSSQL-S', - 'MULTIHOP-BFD', - 'NAS', - 'NCP', - 'NETBIOS-DATA', - 'NETBIOS-NS', - 'NETBIOS-SS', - 'NETNEWS', - 'NETRJS-1', - 'NETRJS-2', - 'NETRJS-3', - 'NETRJS-4', - 'NETWALL', - 'NEW-RWHO', - 'NFS', - 'NNTP', - 'NNTPS', - 'NTP', - 'ODMR', - 'OLSR', - 'OPENVPN', - 'PIM-AUTO-RP', - 'PKIX-TIMESTAMP', - 'POP2', - 'POP3', - 'POP3S', - 'PPTP', - 'PRINT-SRV', - 'PTP-EVENT', - 'PTP-GENERAL', - 'QMTP', - 'QOTD', - 'RADIUS', - 'RADIUS-ACCT', - 'REMOTE-MAIL', - 'REMOTEFS', - 'REMOTECMD', - 'RIP', - 'RJE', - 'RLP', - 'RLZDB', - 'RMC', - 'RMONITOR', - 'RPC2PORTMAP', - 'RSYNC', - 'RTELNET', - 'RTSP', - 'SGMP', - 'SILC', - 'SMUX', - 'SNA-GW', - 'SNMP', - 'SNMP-TRAP', - 'SNPP', - 'SMTP', - 'SQL-SVCS', - 'SQL', - 'SSH', - 'SUBMISSION', - 'SUNRPC', - 'SVCLOC', - 'SYSLOG', - 'SYSTAT', - 'TACACS', - 'TALK', - 'TCPMUX', - 'TCPNETHASPSRV', - 'TFTP', - 'TIME', - 'TIMED', - 'UPS', - 'XDMCP', - 'XNS-CH', - 'XNS-MAIL', - 'XNS-TIME', - 'Z3950', - ] - ], - Field( - description='Destination port to match by name.', - title='Destination Port Name', - ), - ] = None - destinationPortNumber: Annotated[ - Optional[int], - Field( - description='Destination port to match by numerical value.', - ge=0, - le=65535, - title='Destination Port Number', - ), - ] = None - destinationPortOperator: Annotated[ - Optional[Literal['Equals', 'GreaterOrEquals', 'LessOrEquals']], - Field( - description='Operator to use when matching destinationPort, either Equals, GreaterOrEquals, or LessOrEquals.', - title='Destination Port Operator', - ), - ] = None - destinationPortRange: Annotated[ - Optional[str], - Field( - description='Range of destination ports to match, in the format n-m, e.g. 100-200, The start and end of the range must be port numbers.', - title='Destination Port Range', - ), - ] = None - destinationPrefix: Annotated[ - Optional[str], - Field(description='Destination prefix to match.', title='Destination Prefix'), - ] = None - firstFragment: Annotated[ - Optional[bool], - Field(description='Match the first fragment only.', title='First Fragment'), - ] = None - fragment: Annotated[ - Optional[bool], Field(description='Match any fragment.', title='Fragment') - ] = None - icmpCode: Annotated[ - Optional[List[int]], - Field( - description='Match a specific ICMP code, as a number between 0-255, e.g. 0.', - max_length=255, - min_length=0, - title='ICMP Code', - ), - ] = None - icmpTypeName: Annotated[ - Optional[ - Literal[ - 'DestUnreachable', - 'Echo', - 'EchoReply', - 'EchoRequest', - 'McastRtrAdv', - 'McastRtrSolicit', - 'McastRtrTerm', - 'MldDone', - 'MldQuery', - 'MldReport', - 'MldV2', - 'NeighborAdvertise', - 'NeighborSolicit', - 'NodeInfoQuery', - 'NodeInfoResponse', - 'PacketTooBig', - 'ParamProblem', - 'Redirect', - 'RouterAdvertise', - 'RouterRenumber', - 'RouterSolicit', - 'SourceQuench', - 'TimeExceeded', - 'Timestamp', - 'TimestampReply', - ] - ], - Field( - description='Match a specific ICMP type by name, e.g. dest-unreachable.', - title='ICMP Type Name', - ), - ] = None - icmpTypeNumber: Annotated[ - Optional[int], - Field( - description='Match a specific ICMP type by number.', - ge=0, - le=255, - title='ICMP Type Number', - ), - ] = None - protocolName: Annotated[ - Optional[ - Literal[ - 'AH', - 'EGP', - 'EIGRP', - 'ESP', - 'GGP', - 'GRE', - 'ICMP', - 'ICMP6', - 'IDRP', - 'IGMP', - 'IGP', - 'IPV4', - 'IPV6', - 'IPV6-DEST-OPTS', - 'IPV6-HOP', - 'L2TP', - 'MPLS-IN-IP', - 'NO-NEXT-HDR', - 'OSPF', - 'PIM', - 'ROHC', - 'RSVP', - 'SCTP', - 'ST', - 'TCP', - 'UDP', - 'VRRP', - ] - ], - Field( - description='Match a specific IP protocol name (specified in the type field of the IP header).', - title='Protocol Name', - ), - ] = None - protocolNumber: Annotated[ - Optional[int], - Field( - description='Match a specific IP protocol number (specified in the type field of the IP header).', - ge=0, - le=255, - title='Protocol Number', - ), - ] = None - sourcePortName: Annotated[ - Optional[ - Literal[ - 'ACAP', - 'AFP-TCP', - 'ARNS', - 'ASF-RMCP', - 'ASHARE', - 'ATALK-RM', - 'AURP', - 'AUTH', - 'BFD', - 'BFD-ECHO', - 'BFTP', - 'BGMP', - 'BGP', - 'BOOTPC', - 'BOOTPS', - 'CCSO-NS', - 'CHARGEN', - 'CISCO-TDP', - 'CITADEL', - 'CLEARCASE', - 'COMMERCE', - 'COURIER', - 'DAYTIME', - 'DHCP-FAILOVER', - 'DHCPV6-CLIENT', - 'DHCPV6-SERVER', - 'DICOM', - 'DISCARD', - 'DNSIX', - 'DOMAIN', - 'DSP', - 'ECHO', - 'EPP', - 'ESRO', - 'EXEC', - 'FINGER', - 'FTP', - 'FTP-DATA', - 'FTPS', - 'FTPS-DATA', - 'GODI', - 'GOPHER', - 'GTP-C', - 'GTP-PRIME', - 'GTP-U', - 'HA-CLUSTER', - 'HOSTNAME', - 'HP-ALARM-MGR', - 'HTTP', - 'HTTP-ALT', - 'HTTP-MGMT', - 'HTTP-RPC', - 'HTTPS', - 'IEEE-MMS-SSL', - 'IMAP', - 'IMAP3', - 'IMAPS', - 'IPP', - 'IPSEC', - 'IPX', - 'IRC', - 'IRIS-BEEP', - 'ISAKMP', - 'ISAKMP-NAT', - 'ISCSI', - 'ISO-TSAP', - 'KERBEROS', - 'KERBEROS-ADM', - 'KLOGIN', - 'KPASSWD', - 'KSHELL', - 'L2TP', - 'LDAP', - 'LDAPS', - 'LDP', - 'LMP', - 'LOGIN', - 'LPD', - 'LSP-PING', - 'MAC-SERVER-ADM', - 'MATIP-A', - 'MATIP-B', - 'MICRO-BFD', - 'MICROSOFT-DS', - 'MOBILE-IP', - 'MONITOR', - 'MPP', - 'MS-EXCHANGE', - 'MSDP', - 'MSP', - 'MSSQL-M', - 'MSSQL-S', - 'MULTIHOP-BFD', - 'NAS', - 'NCP', - 'NETBIOS-DATA', - 'NETBIOS-NS', - 'NETBIOS-SS', - 'NETNEWS', - 'NETRJS-1', - 'NETRJS-2', - 'NETRJS-3', - 'NETRJS-4', - 'NETWALL', - 'NEW-RWHO', - 'NFS', - 'NNTP', - 'NNTPS', - 'NTP', - 'ODMR', - 'OLSR', - 'OPENVPN', - 'PIM-AUTO-RP', - 'PKIX-TIMESTAMP', - 'POP2', - 'POP3', - 'POP3S', - 'PPTP', - 'PRINT-SRV', - 'PTP-EVENT', - 'PTP-GENERAL', - 'QMTP', - 'QOTD', - 'RADIUS', - 'RADIUS-ACCT', - 'REMOTE-MAIL', - 'REMOTEFS', - 'REMOTECMD', - 'RIP', - 'RJE', - 'RLP', - 'RLZDB', - 'RMC', - 'RMONITOR', - 'RPC2PORTMAP', - 'RSYNC', - 'RTELNET', - 'RTSP', - 'SGMP', - 'SILC', - 'SMUX', - 'SNA-GW', - 'SNMP', - 'SNMP-TRAP', - 'SNPP', - 'SMTP', - 'SQL-SVCS', - 'SQL', - 'SSH', - 'SUBMISSION', - 'SUNRPC', - 'SVCLOC', - 'SYSLOG', - 'SYSTAT', - 'TACACS', - 'TALK', - 'TCPMUX', - 'TCPNETHASPSRV', - 'TFTP', - 'TIME', - 'TIMED', - 'UPS', - 'XDMCP', - 'XNS-CH', - 'XNS-MAIL', - 'XNS-TIME', - 'Z3950', - ] - ], - Field(description='Source port to match by name.', title='Source Port Name'), - ] = None - sourcePortNumber: Annotated[ - Optional[int], - Field( - description='Source port to match by numerical value.', - ge=0, - le=65535, - title='Source Port Number', - ), - ] = None - sourcePortOperator: Annotated[ - Optional[Literal['Equals', 'GreaterOrEquals', 'LessOrEquals']], - Field( - description='Operator to use when matching sourcePort, either Equals, GreaterOrEquals, or LessOrEquals.', - title='Source Port Operator', - ), - ] = None - sourcePortRange: Annotated[ - Optional[str], - Field( - description='Range of source ports to match, in the format n-m, e.g. 100-200. The start and end of the range must be port numbers.', - title='Source Port Range', - ), - ] = None - sourcePrefix: Annotated[ - Optional[str], - Field(description='Source prefix to match.', title='Source Prefix'), - ] = None - tcpFlags: Annotated[ - Optional[str], - Field( - description='Match TCP flags, usable with !, &, | and the flags RST, SYN, and ACK.', - title='TCP Flags', - ), - ] = None - - -class Entry(BaseModel): - dot1pPolicyEntry: Annotated[ - Optional[Dot1pPolicyEntry], - Field( - description='A Dot1p policy entry - only a single Dot1p entry is allowed per classifier resource.', - title='Dot1p Policy Entry', - ), - ] = None - dscpPolicyEntry: Annotated[ - Optional[DscpPolicyEntry], - Field( - description='A DSCP policy entry - only a single DSCP entry is allowed per classifier resource.', - title='DSCP Policy Entry', - ), - ] = None - ipEntry: Annotated[ - Optional[IpEntry], - Field( - description='An IPv4 or IPv6 multifield classifier entry.', title='IP Entry' - ), - ] = None - type: Annotated[ - Literal['IPV4', 'IPV6', 'DOT1P', 'DSCP', 'AUTO'], - Field( - description='Type of the entry which can be IPV4, IPV6, Dot1pPolicy, DSCPPolicy, or Auto.', - title='Type', - ), - ] - - -class Classifier(BaseModel): - entries: Annotated[ - List[Entry], - Field( - description='Specifies the list of filter entries, in order.\nA classifier containing multiple entry types may result in multiple classifiers being created on the target node.\nIPV4 and IPV6 entries will create multifield classifier policies.', - title='Entries', - ), - ] - - -class ForwardingClassToQueueMappingItemModel(BaseModel): - forwardingClasses: Annotated[ - List[str], - Field( - description='The forwarding classes to which the mapping applies, these are references to ForwardingClass resources.', - min_length=1, - title='Forwarding Classes', - ), - ] - queue: Annotated[ - str, - Field( - description='The queue to which the forwarding classes are mapped, this is a reference to a Queue resource.', - title='Queue', - ), - ] - - -class ExceedAction(BaseModel): - dropProbabilityLevel: Annotated[ - Optional[Literal['High', 'Medium', 'Low']], - Field(title='Drop Probability Level'), - ] = 'Medium' - - -class ForwardingClass(BaseModel): - forwardingClasses: Annotated[ - Optional[List[str]], - Field( - description="The forwarding class of the packets on which to apply the Policer. To match all traffic set this to 'ALL'.", - title='Forwarding Class', - ), - ] = None - forwardingTypes: Annotated[ - List[ - Literal[ - 'Broadcast', - 'Unicast', - 'Multicast', - 'UnknownMulticast', - 'UnknownUnicast', - 'All', - ] - ], - Field(title='Forwarding Type'), - ] - - -class ViolateAction(BaseModel): - dropProbabilityLevel: Annotated[ - Optional[Literal['High', 'Medium', 'Low', 'All']], - Field(title='Drop Probability Level'), - ] = 'High' - - -class Policer(BaseModel): - committedBurstSize: Annotated[ - Optional[int], - Field( - description='Maximum CIR bucket depth in bytes.', - ge=0, - le=4294967295, - title='Committed Burst Size', - ), - ] = None - committedRate: Annotated[ - Optional[int], - Field( - description='The committed information rate (CIR) of the policer, defined in kilobits (1024 bits) per second.', - title='Committed Rate', - ), - ] = None - committedRatePercent: Annotated[ - Optional[int], - Field( - description='The committed information rate (CIR) of the policer, defined as a percentage of the Interface speed on which it is applied.', - ge=0, - le=100, - title='Committed Rate Percentage', - ), - ] = None - exceedAction: Annotated[ - Optional[ExceedAction], - Field( - description='Applies a drop-probability to packets that the policer has determined are exceeding (yellow).', - title='Exceed Action', - ), - ] = None - forwardingClasses: Annotated[ - Optional[List[ForwardingClass]], - Field( - description='The list of forwarding classes with traffic to be sent to the policer. Unless specified all traffic is matched for this policer.', - title='Forwarding Class', - ), - ] = None - maximumBurstSize: Annotated[ - Optional[int], - Field( - description='Maximum PIR bucket depth in bytes.', - ge=0, - le=4294967295, - title='Maximum Burst Size', - ), - ] = None - minInterfaceSpeed: Annotated[ - Optional[int], - Field( - description='Minimum interface speed (kbps) to calculate PeakRate and CommittedRate for devices where configuration is not supported in percentage.', - title='Minimum Interface Speed', - ), - ] = None - peakRate: Annotated[ - Optional[int], - Field( - description='The peak information rate (PIR) of the policer, defined in kilobits (1024 bits) per second.', - title='Peak Rate', - ), - ] = None - peakRatePercent: Annotated[ - Optional[int], - Field( - description='The peak information rate (PIR) of the policer, defined as a percentage of the Interface speed on which it is applied.', - ge=0, - le=100, - title='Peak Rate Percentage', - ), - ] = None - violateAction: Annotated[ - Optional[ViolateAction], - Field( - description='Applies a drop-probability to packets that the policer has determined are exceeding (red).', - title='Violate Action', - ), - ] = None - - -class QueueModel(BaseModel): - committedBurstSize: Annotated[ - Optional[int], - Field(description='Committed Burst Size.', title='Committed Burst Size'), - ] = None - maximumBurstSize: Annotated[ - Optional[int], - Field( - description='Maximum amount of shared buffer memory available to the queue in bytes.', - ge=0, - le=4294967295, - title='Maximum Burst Size', - ), - ] = None - pfcOffThreshold: Annotated[ - Optional[int], - Field( - description='PFC off threshold.', ge=0, le=100, title='PFC Off Threshold' - ), - ] = None - pfcOnThreshold: Annotated[ - Optional[int], - Field(description='PFC on threshold.', ge=0, le=100, title='PFC On Threshold'), - ] = None - pfcPauseFramePriority: Annotated[ - Optional[int], - Field( - description='PFC priorities indicated in generated pfc-pause-frame if congestion occurs in a given pfc-queue.', - title='PFC Priority', - ), - ] = None - pfcReservedShareBufferPercent: Annotated[ - Optional[int], - Field( - description='Maximum level the pfc-queue can take from pfc-reserved buffer configured per given forwarding-complex.', - ge=0, - le=100, - title='PFC Reserved Buffer', - ), - ] = None - queue: Annotated[ - str, Field(description='Reference to a Queue resource.', title='Queue') - ] - - -class QueueManagementItemModel(BaseModel): - pfcReservedBufferPercent: Annotated[ - Optional[int], - Field( - description='Percentage of the linecard buffer reserved for accomodating incoming traffic while upstream node reacts to generated PFC-pause frames. Note: this percentage must be common across all EgressPolicies and QueuesSets used on the same linecard.', - ge=0, - le=100, - title='PFC Reserved Linecard Buffer Percent', - ), - ] = None - queues: Annotated[ - List[QueueModel], Field(description='List of queues.', title='Queues') - ] - - -class SpecModel(BaseModel): - classifier: Annotated[ - Optional[Classifier], - Field( - description='Classifier manages the configuration of traffic classification policies in a network. It includes various entry types like IPv4, IPv6, Dot1p, and DSCP policies. Each entry specifies how traffic should be classified and what actions should be taken on the matched packets.', - title='Classifiers', - ), - ] = None - forwardingClassToQueueMapping: Annotated[ - Optional[List[ForwardingClassToQueueMappingItemModel]], - Field( - description='Forwarding class to queue mapping policy.', - title='Forwarding Class to Queue Mapping', - ), - ] = None - policers: Annotated[ - Optional[List[Policer]], - Field( - description='Ordered list of policers where the first policer is evaluated first before proceeding to the next.', - title='Policers', - ), - ] = None - queueManagement: Annotated[ - Optional[List[QueueManagementItemModel]], - Field( - description='Queue management policy for egress queues.', - title='Queue Management', - ), - ] = None - - -class IngressPolicyDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class IngressPolicyDeletedResources(RootModel[List[IngressPolicyDeletedResourceEntry]]): - root: List[IngressPolicyDeletedResourceEntry] - - -class IngressPolicyMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Attachment(BaseModel): - interface: Annotated[ - Optional[str], - Field( - description='Specifies the Interface on which to deploy the policies.', - title='Interface', - ), - ] = None - interfaceType: Annotated[ - Optional[Literal['ACCESS', 'NETWORK']], - Field( - description='Used for platforms that differentiate between access/service interfaces and network interface. These platforms may require different classifiers depending on whether they are applied on access/service interfaces or network interfaces. Specifies whether the classifier should be configured as a service Egress classifier or network Egress classifier', - title='Interface Type', - ), - ] = None - subInterfaceIndex: Annotated[ - Optional[int], - Field( - description='Specifies the SubInterfaceIndex on which to deploy the policies.', - title='SubInterface Index', - ), - ] = None - - -class SpecModel1(BaseModel): - attachments: Annotated[ - List[Attachment], - Field( - description='Specifies a list of Interfaces and subinterfaces on which to deploy the policies.', - title='Interfaces', - ), - ] - egressPolicy: Annotated[ - Optional[str], - Field( - description='Specifies an EgressPolicy to deploy on the specified Node.', - title='Egress Policy', - ), - ] = None - ingressPolicy: Annotated[ - Optional[str], - Field( - description='Specifies the IngressPolicy to deploy on the specified Node.', - title='Ingress Policy', - ), - ] = None - - -class PolicyAttachmentDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class PolicyAttachmentDeletedResources( - RootModel[List[PolicyAttachmentDeletedResourceEntry]] -): - root: List[PolicyAttachmentDeletedResourceEntry] - - -class PolicyAttachmentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel2(BaseModel): - egressPolicy: Annotated[ - Optional[str], - Field( - description='Specifies an EgressPolicy to deploy on the specified Node.', - title='Egress Policy', - ), - ] = None - ingressPolicy: Annotated[ - Optional[str], - Field( - description='Specifies the IngressPolicy to deploy on the specified Node.', - title='Ingress Policy', - ), - ] = None - interfaceSelector: Annotated[ - Optional[str], - Field( - description='Specifies a label selector to filter the interfaces on which to deploy the policies.', - title='Interface Selector', - ), - ] = None - interfaceType: Annotated[ - Optional[Literal['ACCESS', 'NETWORK']], - Field( - description='Used for platforms that differentiate between access/service interfaces and network interface. These platforms may require different classifiers depending on whether they are applied on access/service interfaces or network interfaces. Specifies whether the classifier should be configured as a service Egress classifier or network Egress classifier', - title='Interface Type', - ), - ] = None - interfaces: Annotated[ - Optional[List[str]], - Field( - description='Specifies a list of Interfaces on which to deploy the policies.', - title='Interfaces', - ), - ] = None - node: Annotated[ - Optional[str], - Field(description='Specifies a Node to deploy the policies on.', title='Node'), - ] = None - nodeSelector: Annotated[ - Optional[str], - Field( - description='Specifies a label selector to filter the nodes on which to deploy the policies.', - title='Node Selector', - ), - ] = None - - -class PolicyDeploymentDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class PolicyDeploymentDeletedResources( - RootModel[List[PolicyDeploymentDeletedResourceEntry]] -): - root: List[PolicyDeploymentDeletedResourceEntry] - - -class PolicyDeploymentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel3(BaseModel): - queueID: Annotated[ - Optional[int], - Field( - description='The ID of the queue on which to apply the properties. This is mandatory for usage of queus on SROS and is ignored on other operating systems.', - title='Queue ID', - ), - ] = None - queueType: Annotated[ - Literal['Normal', 'Pfc'], - Field( - description='QueueType specifies whether this is a normal queue or a PFC queue', - title='Queue Type', - ), - ] - trafficType: Annotated[ - Literal['Unicast', 'Multicast'], - Field( - description='The traffic type of the queue, either unicast or multicast.', - title='Traffic Type', - ), - ] - - -class QueueDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class QueueDeletedResources(RootModel[List[QueueDeletedResourceEntry]]): - root: List[QueueDeletedResourceEntry] - - -class QueueMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class EgressPolicy(BaseModel): - apiVersion: str - kind: str - metadata: EgressPolicyMetadata - spec: Annotated[ - Spec, - Field( - description='EgressPolicySpec defines the desired state of EgressPolicy', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='EgressPolicyStatus defines the observed state of EgressPolicy', - title='Status', - ), - ] = None - - -class EgressPolicyList(BaseModel): - apiVersion: str - items: Optional[List[EgressPolicy]] = None - kind: str - - -class ForwardingClassModel(BaseModel): - apiVersion: str - kind: str - metadata: ForwardingClassMetadata - spec: Annotated[ - Dict[str, Any], - Field( - description='The ForwaringClass is used as a placeholder for to allow multiple other resources to reference the same forwarding class.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='ForwardingClassStatus defines the observed state of ForwardingClass', - title='Status', - ), - ] = None - - -class ForwardingClassList(BaseModel): - apiVersion: str - items: Optional[List[ForwardingClassModel]] = None - kind: str - - -class IngressPolicy(BaseModel): - apiVersion: str - kind: str - metadata: IngressPolicyMetadata - spec: Annotated[ - SpecModel, - Field( - description='IngressPolicySpec defines the desired state of IngressPolicy', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='IngressPolicyStatus defines the observed state of IngressPolicy', - title='Status', - ), - ] = None - - -class IngressPolicyList(BaseModel): - apiVersion: str - items: Optional[List[IngressPolicy]] = None - kind: str - - -class PolicyAttachment(BaseModel): - apiVersion: str - kind: str - metadata: PolicyAttachmentMetadata - spec: Annotated[ - SpecModel1, - Field( - description='PolicyAttachmentSpec defines the desired state of PolicyAttachment', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='PolicyAttachmentStatus defines the observed state of PolicyAttachment', - title='Status', - ), - ] = None - - -class PolicyAttachmentList(BaseModel): - apiVersion: str - items: Optional[List[PolicyAttachment]] = None - kind: str - - -class PolicyDeployment(BaseModel): - apiVersion: str - kind: str - metadata: PolicyDeploymentMetadata - spec: Annotated[ - SpecModel2, - Field( - description='PolicyDeploymentSpec defines the desired state of PolicyDeployment', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='PolicyDeploymentStatus defines the observed state of PolicyDeployment', - title='Status', - ), - ] = None - - -class PolicyDeploymentList(BaseModel): - apiVersion: str - items: Optional[List[PolicyDeployment]] = None - kind: str - - -class QueueModel1(BaseModel): - apiVersion: str - kind: str - metadata: QueueMetadata - spec: Annotated[ - SpecModel3, - Field( - description='The Queue resource is used to define the properties of a queue, which can then be referenced by other resources.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='QueueStatus defines the observed state of Queue', - title='Status', - ), - ] = None - - -class QueueList(BaseModel): - apiVersion: str - items: Optional[List[QueueModel1]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/routing/__init__.py b/pydantic_eda/com/nokia/eda/routing/__init__.py deleted file mode 100644 index a40c01c..0000000 --- a/pydantic_eda/com/nokia/eda/routing/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/routing.eda.nokia.com/v1alpha1/routing.json -# timestamp: 2025-05-07T11:44:04+00:00 diff --git a/pydantic_eda/com/nokia/eda/routing/v1alpha1.py b/pydantic_eda/com/nokia/eda/routing/v1alpha1.py deleted file mode 100644 index db8a57f..0000000 --- a/pydantic_eda/com/nokia/eda/routing/v1alpha1.py +++ /dev/null @@ -1,733 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/routing.eda.nokia.com/v1alpha1/routing.json -# timestamp: 2025-05-07T11:44:04+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Bfd(BaseModel): - desiredMinTransmitInt: Annotated[ - int, - Field( - description='The minimum interval in microseconds between transmission of BFD control packets[default=1000000].', - ge=10000, - le=100000000, - title='Transmit Interval', - ), - ] - detectionMultiplier: Annotated[ - int, - Field( - description='The number of packets that must be missed to declare this session as down. [default=3]', - ge=3, - le=20, - title='Multiplier', - ), - ] - enabled: Annotated[ - bool, - Field( - description='Enable Biforward Detection[default=false].', title='Enabled' - ), - ] - minEchoReceiveInterval: Annotated[ - int, - Field( - description='The minimum interval between echo packets the local node can receive in microseconds', - ge=0, - le=100000000, - title='Minimum Echo Receive Interval', - ), - ] - requiredMinReceive: Annotated[ - int, - Field( - description='The minimum interval in microseconds between received BFD control packets that this system should support.[default=1000000].', - ge=10000, - le=100000000, - title='Receive Interval', - ), - ] - - -class Ipv4Address(BaseModel): - ipPrefix: Annotated[ - str, Field(description='Address and mask to use', title='IP Prefix') - ] - primary: Annotated[ - Optional[bool], - Field( - description='Indicates which address to use as primary for broadcast', - title='Primary', - ), - ] = None - - -class Ipv6Address(BaseModel): - ipPrefix: Annotated[ - str, Field(description='Address and mask to use', title='IP Prefix') - ] - primary: Annotated[ - Optional[bool], - Field( - description='Indicates which address to use as primary for broadcast', - title='Primary', - ), - ] = None - - -class Spec(BaseModel): - bfd: Annotated[ - Optional[Bfd], - Field( - description='Enable or disable BFD on this DefaultInterface.', - title='BFD Configuration', - ), - ] = None - defaultRouter: Annotated[ - str, Field(description='Reference to a DefaultRouter.', title='Default Router') - ] - interface: Annotated[ - str, - Field( - description='Reference to an Interface to use for attachment.', - title='Interface Reference', - ), - ] - ipMTU: Annotated[ - Optional[int], - Field( - description='Set the IP MTU for the DefaultInterface.', - ge=1280, - le=9486, - title='IP MTU', - ), - ] = None - ipv4Addresses: Annotated[ - Optional[List[Ipv4Address]], - Field( - description='List of IPv4 addresses in ip/mask form, e.g., 192.168.0.1/24.', - title='IPv4 Addresses', - ), - ] = None - ipv6Addresses: Annotated[ - Optional[List[Ipv6Address]], - Field( - description='List of IPv6 addresses in ip/mask form, e.g., fc00::1/120.', - title='IPv6 Addresses', - ), - ] = None - unnumbered: Annotated[ - Optional[Literal['IPV6']], - Field( - description='Enables the use of unnumbered interfaces on the ISL. For IPv6, no IP address are configured on the sub-interface and only the link local address will be used. If any allocation pool is specified for IPv6 that will take precedence and IPs will be assigned to the interfaces. When using eBGP for an underlay protocol, the DefaultInterfaces which are a part of the ISL will be added to the BGP dynamic neighbor list.', - title='Unnumbered', - ), - ] = None - vlanID: Annotated[ - Optional[int], - Field( - description='VLAN to use with this DefaultInterface.', - ge=1, - le=4094, - title='VLAN ID', - ), - ] = None - - -class Status(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the DefaultInterface.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='Indicates when this Interface last changed state.', - title='Last Change', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Indicates the current operational state of the DefaultInterface.', - title='Operational State', - ), - ] = None - - -class DefaultInterfaceDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DefaultInterfaceDeletedResources( - RootModel[List[DefaultInterfaceDeletedResourceEntry]] -): - root: List[DefaultInterfaceDeletedResourceEntry] - - -class DefaultInterfaceMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Multipath(BaseModel): - allowMultipleAS: Annotated[ - bool, - Field( - description='When set to true, BGP is allowed to build a multipath set using BGP routes with different neighbor AS (most recent AS in the AS_PATH), When set to false, BGP is only allowed to use non-best paths for ECMP if they meet the multipath criteria and they have the same neighbor AS as the best path.', - title='Allow Multiple Autonomous Systems Per Path', - ), - ] - maxAllowedPaths: Annotated[ - int, - Field( - description='The maximum number of BGP ECMP next-hops for BGP routes with an NLRI belonging to the address family of this configuration context.', - ge=1, - le=256, - title='Maximum Number of Paths', - ), - ] - - -class Ipv4Unicast(BaseModel): - advertiseIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.', - title='Advertise IPv6 Next Hops', - ), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enables the IPv4 unicast AFISAFI.', title='Enabled'), - ] = None - multipath: Annotated[ - Optional[Multipath], Field(description='Enable multipath.', title='Multipath') - ] = None - rapidUpdate: Annotated[ - Optional[bool], Field(description='Enables rapid update.', title='Rapid Update') - ] = None - receiveIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.', - title='Receive IPv6 Next Hops', - ), - ] = None - - -class Ipv6Unicast(BaseModel): - enabled: Annotated[ - Optional[bool], - Field(description='Enables the IPv6 unicast AFISAFI', title='Enabled'), - ] = None - multipath: Annotated[ - Optional[Multipath], Field(description='Enable multipath', title='Multipath') - ] = None - rapidUpdate: Annotated[ - Optional[bool], Field(description='Enables rapid update.', title='Rapid Update') - ] = None - - -class L2VPNEVPN(BaseModel): - advertiseIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables advertisement of EVPN routes with IPv6 next-hops to peers.', - title='Advertise IPv6 Next Hops', - ), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enables the L2VPN EVPN AFISAFI.', title='Enabled'), - ] = None - interASVPN: Annotated[ - Optional[bool], - Field(description='Enable inter-AS VPN for EVPN.', title='EVPN InterAS VPN'), - ] = False - multipath: Annotated[ - Optional[Multipath], Field(description='Enable multipath', title='Multipath') - ] = None - rapidUpdate: Annotated[ - Optional[bool], Field(description='Enables rapid update.', title='Rapid Update') - ] = None - - -class Bgp(BaseModel): - autonomousSystem: Annotated[ - Optional[int], - Field( - description='Autonomous System number for BGP.', - ge=1, - le=4294967295, - title='Autonomous System', - ), - ] = None - ebgpPreference: Annotated[ - Optional[int], - Field( - description='Preference to be set for eBGP.', - ge=1, - le=255, - title='eBGP Preference', - ), - ] = 170 - enabled: Annotated[ - Optional[bool], - Field(description='Enables BGP in the default VRF.', title='Enable BGP'), - ] = False - ibgpPreference: Annotated[ - Optional[int], - Field( - description='Preference to be set for iBGP.', - ge=1, - le=255, - title='iBGP Preference', - ), - ] = 170 - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field(description='Keychain to be used for authentication', title='Keychain'), - ] = None - l2VPNEVPN: Annotated[ - Optional[L2VPNEVPN], - Field( - description='Parameters relating to the EVPN AFI/SAFI.', title='L2VPN EVPN' - ), - ] = None - minWaitToAdvertise: Annotated[ - Optional[int], - Field( - description='Minimum wait time before advertising routes post BGP restart.', - ge=0, - le=3600, - title='Min Wait To Advertise Time', - ), - ] = 0 - rapidWithdrawl: Annotated[ - Optional[bool], - Field( - description='Enable rapid withdrawal in BGP.', - title='Enable Rapid Withdrawal', - ), - ] = False - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - waitForFibInstall: Annotated[ - Optional[bool], - Field( - description='Wait for FIB installation before advertising routes.', - title='Wait for FIB Installation', - ), - ] = False - - -class RouteLeaking(BaseModel): - exportPolicy: Annotated[ - str, - Field( - description='Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.', - title='Export Policy', - ), - ] - importPolicy: Annotated[ - str, - Field( - description='Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.', - title='Import Policy', - ), - ] - - -class SpecModel(BaseModel): - bgp: Annotated[ - Optional[Bgp], - Field(description='BGP configuration.', title='BGP Configuration'), - ] = None - description: Annotated[ - Optional[str], - Field( - description='Sets the description on the Default router.', - title='Description', - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.', - title='Export Policy', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.', - title='Import Policy', - ), - ] = None - node: Annotated[ - str, - Field( - description='Reference to a TopoNode on which to configure the default routing instance.', - title='Node', - ), - ] - routeLeaking: Annotated[ - Optional[RouteLeaking], - Field( - description='Route leaking controlled by routing policies in and out of the DefaultRouter.', - title='Route Leaking', - ), - ] = None - routerID: Annotated[ - str, Field(description='Router ID in dotted quad notation.', title='Router ID') - ] - - -class Status1Model(BaseModel): - health: Annotated[ - Optional[int], - Field(description='Indicates the health score of the Router.', title='Health'), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the Router.', title='Operational State' - ), - ] = None - - -class DefaultRouterDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DefaultRouterDeletedResources(RootModel[List[DefaultRouterDeletedResourceEntry]]): - root: List[DefaultRouterDeletedResourceEntry] - - -class DefaultRouterMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel1(BaseModel): - defaultRouterSelector: Annotated[ - Optional[List[str]], - Field( - description='Selector to use when selecting DefaultRouters to drain.', - title='Default Router Selector', - ), - ] = None - defaultRouters: Annotated[ - Optional[List[str]], - Field( - description='Reference to DefaultRouters to drain.', title='Default Routers' - ), - ] = None - enabled: Annotated[ - Optional[bool], Field(description='Enable this Drain.', title='Enabled') - ] = True - - -class Status1Model1(BaseModel): - defaultRouters: Annotated[ - Optional[List[str]], - Field( - description='List of DefaultRouters this Drain has been applied to', - title='Default Routers', - ), - ] = None - - -class DrainDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DrainDeletedResources(RootModel[List[DrainDeletedResourceEntry]]): - root: List[DrainDeletedResourceEntry] - - -class DrainMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel2(BaseModel): - bfd: Annotated[ - Optional[Bfd], - Field( - description='Enable or disable BFD on this SystemInterface.', - title='BFD Configuration', - ), - ] = None - defaultRouter: Annotated[ - str, Field(description='Reference to a DefaultRouter.', title='Default Router') - ] - ipv4Address: Annotated[ - Optional[str], - Field( - description='IPv4 address in ip/mask form, e.g., 192.168.0.1/32.', - title='IPv4 Address', - ), - ] = None - ipv6Address: Annotated[ - Optional[str], - Field( - description='IPv6 address in ip/mask form, e.g., fc00::1/128.', - title='IPv6 Address', - ), - ] = None - - -class Status1Model2(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the SystemInterface.', - title='Health', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='Indicates when this Interface last changed state.', - title='Last Change', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Indicates the current operational state of the SystemInterface.', - title='Operational State', - ), - ] = None - - -class SystemInterfaceDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class SystemInterfaceDeletedResources( - RootModel[List[SystemInterfaceDeletedResourceEntry]] -): - root: List[SystemInterfaceDeletedResourceEntry] - - -class SystemInterfaceMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class DefaultInterface(BaseModel): - apiVersion: str - kind: str - metadata: DefaultInterfaceMetadata - spec: Annotated[ - Spec, - Field( - description='DefaultInterface enables the configuration of default interfaces, including Interface references, DefaultRouter, VLAN IDs, IP MTU settings, and options for IPv4 and IPv6 addresses. It also supports unnumbered interfaces and BFD (Bidirectional Forwarding Detection) configuration.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='DefaultInterfaceStatus defines the observed state of DefaultInterface', - title='Status', - ), - ] = None - - -class DefaultInterfaceList(BaseModel): - apiVersion: str - items: Optional[List[DefaultInterface]] = None - kind: str - - -class DefaultRouter(BaseModel): - apiVersion: str - kind: str - metadata: DefaultRouterMetadata - spec: Annotated[ - SpecModel, - Field( - description='DefaultRouter enables the configuration of default routing instances on a specified Node, including options for BGP configuration, import and export policies, and router IDs.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model], - Field( - description='DefaultRouterStatus defines the observed state of DefaultRouter', - title='Status', - ), - ] = None - - -class DefaultRouterList(BaseModel): - apiVersion: str - items: Optional[List[DefaultRouter]] = None - kind: str - - -class Drain(BaseModel): - apiVersion: str - kind: str - metadata: DrainMetadata - spec: Annotated[ - SpecModel1, - Field( - description='Drain allows for the controlled disabling or draining of specific DefaultRouters, either by selecting them through labels or directly referencing them, ensuring traffic is safely rerouted or dropped before the routers are decommissioned.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model1], - Field( - description='DrainStatus defines the observed state of Drain.', - title='Status', - ), - ] = None - - -class DrainList(BaseModel): - apiVersion: str - items: Optional[List[Drain]] = None - kind: str - - -class SystemInterface(BaseModel): - apiVersion: str - kind: str - metadata: SystemInterfaceMetadata - spec: Annotated[ - SpecModel2, - Field( - description='SystemInterfaceSpec defines the desired state of SystemInterface', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model2], - Field( - description='SystemInterfaceStatus defines the observed state of SystemInterface', - title='Status', - ), - ] = None - - -class SystemInterfaceList(BaseModel): - apiVersion: str - items: Optional[List[SystemInterface]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/routingpolicies/__init__.py b/pydantic_eda/com/nokia/eda/routingpolicies/__init__.py deleted file mode 100644 index 40c9673..0000000 --- a/pydantic_eda/com/nokia/eda/routingpolicies/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/routingpolicies.eda.nokia.com/v1alpha1/routingpolicies.json -# timestamp: 2025-05-07T11:44:07+00:00 diff --git a/pydantic_eda/com/nokia/eda/routingpolicies/v1alpha1.py b/pydantic_eda/com/nokia/eda/routingpolicies/v1alpha1.py deleted file mode 100644 index 2d3e29b..0000000 --- a/pydantic_eda/com/nokia/eda/routingpolicies/v1alpha1.py +++ /dev/null @@ -1,376 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/routingpolicies.eda.nokia.com/v1alpha1/routingpolicies.json -# timestamp: 2025-05-07T11:44:07+00:00 - -from __future__ import annotations - -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Spec(BaseModel): - expressionMatch: Annotated[ - Optional[str], - Field( - description='Options that determine the matching criteria that applies to the list of community members.', - title='Expression Match', - ), - ] = None - members: Annotated[ - Optional[List[str]], - Field( - description='A standard BGP community value, regular expression or well-known name or else a large BGP community value or regular expression.', - title='Community Set Members', - ), - ] = None - - -class CommunitySetDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class CommunitySetDeletedResources(RootModel[List[CommunitySetDeletedResourceEntry]]): - root: List[CommunitySetDeletedResourceEntry] - - -class CommunitySetMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Bgp(BaseModel): - asPathPrepend: Annotated[ - Optional[int], - Field( - description='AS number to prepend to the AS Path attributes.', - ge=1, - le=4294967295, - title='AS Path Prepend', - ), - ] = None - asPathRemove: Annotated[ - Optional[bool], - Field( - description='Clear the AS path to make it empty.', title='AS Path Remove' - ), - ] = None - asPathReplace: Annotated[ - Optional[List[int]], - Field( - description='Replace the existing AS path with a new AS_SEQUENCE containing the listed AS numbers.', - title='AS Path Replace', - ), - ] = None - localPreference: Annotated[ - Optional[int], - Field( - description='Set a new LOCAL_PREF value for matching BGP routes.', - ge=0, - le=4294967295, - title='Set Local Preference', - ), - ] = None - setOrigin: Annotated[ - Optional[Literal['egp', 'igp', 'incomplete']], - Field( - description='Set a new ORIGIN attribute for matching BGP routes.', - title='Set Origin', - ), - ] = None - - -class DefaultAction(BaseModel): - bgp: Annotated[ - Optional[Bgp], - Field(description='Actions related to the BGP protocol.', title='BGP'), - ] = None - policyResult: Annotated[ - Optional[Literal['accept', 'reject']], - Field(description='Final disposition for the route.', title='Policy Result'), - ] = None - - -class Action(BaseModel): - bgp: Annotated[ - Optional[Bgp], - Field(description='Actions related to the BGP protocol.', title='BGP'), - ] = None - policyResult: Annotated[ - Optional[Literal['accept', 'reject']], - Field(description='Final disposition for the route.', title='Policy Result'), - ] = None - - -class BgpModel(BaseModel): - communitySet: Annotated[ - Optional[str], - Field( - description='Match conditions for BGP communities.', title='BGP Community' - ), - ] = None - evpnRouteType: Annotated[ - Optional[List[int]], - Field( - description='Match conditions for EVPN route types.', - title='EVPN Route Type', - ), - ] = None - - -class Match(BaseModel): - bgp: Annotated[ - Optional[BgpModel], - Field( - description='Configuration for BGP-specific policy match criteria.', - title='BGP', - ), - ] = None - family: Annotated[ - Optional[List[str]], - Field( - description='Address families that the route belongs to.', title='Family' - ), - ] = None - prefixSet: Annotated[ - Optional[str], - Field(description='Reference to a PrefixSet resource.', title='Prefix Set'), - ] = None - protocol: Annotated[ - Optional[ - Literal[ - 'AGGREGATE', - 'ARP_ND', - 'BGP', - 'BGP_EVPN', - 'DHCP', - 'GRIBI', - 'HOST', - 'ISIS', - 'LOCAL', - 'LINUX', - 'NDK1', - 'NDK2', - 'OSPFV2', - 'OSPFV3', - 'STATIC', - ] - ], - Field(description='The route protocol type to match.', title='Protocol'), - ] = None - - -class StatementItem(BaseModel): - action: Annotated[ - Optional[Action], - Field( - description='Actions for routes that match the policy statement.', - title='Action', - ), - ] = None - match: Annotated[ - Optional[Match], - Field(description='Match conditions of the policy statement.', title='Match'), - ] = None - name: Annotated[ - str, Field(description='Name of the policy statement.', title='Name') - ] - - -class SpecModel(BaseModel): - defaultAction: Annotated[ - Optional[DefaultAction], - Field( - description='The default action to apply if no other actions are defined.', - title='Default Action', - ), - ] = None - statement: Annotated[ - Optional[List[StatementItem]], - Field(description='List of policy statements.', title='Statements'), - ] = None - - -class PolicyDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class PolicyDeletedResources(RootModel[List[PolicyDeletedResourceEntry]]): - root: List[PolicyDeletedResourceEntry] - - -class PolicyMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class PrefixItem(BaseModel): - endRange: Annotated[ - Optional[int], - Field( - description='The end range when using a range to match prefixes.', - ge=0, - le=128, - title='End Range', - ), - ] = None - exact: Annotated[ - Optional[bool], - Field( - description='Indicates if it is an exact match. Ignores the StartRange and EndRange if this param is set.', - title='Exact', - ), - ] = None - prefix: Annotated[ - str, - Field( - description='The IPv4 or IPv6 prefix in CIDR notation with mask.', - title='Prefix', - ), - ] - startRange: Annotated[ - Optional[int], - Field( - description='If specifying a range, this is the start of the range.', - ge=0, - le=128, - title='Start Range', - ), - ] = None - - -class SpecModel1(BaseModel): - prefix: Annotated[ - List[PrefixItem], - Field( - description='List of IPv4 or IPv6 prefixes in CIDR notation.', - title='Prefixes', - ), - ] - - -class PrefixSetDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class PrefixSetDeletedResources(RootModel[List[PrefixSetDeletedResourceEntry]]): - root: List[PrefixSetDeletedResourceEntry] - - -class PrefixSetMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class CommunitySet(BaseModel): - apiVersion: str - kind: str - metadata: CommunitySetMetadata - spec: Annotated[ - Spec, - Field( - description='CommunitySetSpec defines the desired state of CommunitySet', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='CommunitySetStatus defines the observed state of CommunitySet', - title='Status', - ), - ] = None - - -class CommunitySetList(BaseModel): - apiVersion: str - items: Optional[List[CommunitySet]] = None - kind: str - - -class Policy(BaseModel): - apiVersion: str - kind: str - metadata: PolicyMetadata - spec: Annotated[ - SpecModel, - Field( - description='Policy defines a set of rules and actions to manage network traffic or routing behavior, with statements that include matching conditions and actions, such as accepting or rejecting routes, or modifying route attributes like BGP parameters.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='PolicyStatus defines the observed state of Policy.', - title='Status', - ), - ] = None - - -class PolicyList(BaseModel): - apiVersion: str - items: Optional[List[Policy]] = None - kind: str - - -class PrefixSet(BaseModel): - apiVersion: str - kind: str - metadata: PrefixSetMetadata - spec: Annotated[ - SpecModel1, - Field( - description='PrefixSet defines a collection of IP prefixes, which may include specific CIDR blocks or a range of prefixes. This set is typically used for matching routes or implementing routing policies.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='PrefixSetStatus defines the observed state of PrefixSet.', - title='Status', - ), - ] = None - - -class PrefixSetList(BaseModel): - apiVersion: str - items: Optional[List[PrefixSet]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/security/__init__.py b/pydantic_eda/com/nokia/eda/security/__init__.py deleted file mode 100644 index 72f729e..0000000 --- a/pydantic_eda/com/nokia/eda/security/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/security.eda.nokia.com/v1alpha1/security.json -# timestamp: 2025-05-07T11:44:10+00:00 diff --git a/pydantic_eda/com/nokia/eda/security/v1alpha1.py b/pydantic_eda/com/nokia/eda/security/v1alpha1.py deleted file mode 100644 index 5528a2a..0000000 --- a/pydantic_eda/com/nokia/eda/security/v1alpha1.py +++ /dev/null @@ -1,135 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/security.eda.nokia.com/v1alpha1/security.json -# timestamp: 2025-05-07T11:44:10+00:00 - -from __future__ import annotations - -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Key(BaseModel): - algorithm: Annotated[Literal['MD5'], Field(title='Algorithm')] - authenticationKey: Annotated[str, Field(title='Authentication Key')] - - -class Spec(BaseModel): - key: Annotated[Key, Field(title='Key')] - - -class SpecModel(BaseModel): - keychain: Annotated[ - str, Field(description='Reference to a Keychain', title='Keychain') - ] - node: Annotated[ - str, - Field( - description='Reference to a Node on which to push the BgpGroup', - title='Node', - ), - ] - - -class KeychainDeploymentDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class KeychainDeploymentDeletedResources( - RootModel[List[KeychainDeploymentDeletedResourceEntry]] -): - root: List[KeychainDeploymentDeletedResourceEntry] - - -class KeychainDeploymentMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class KeychainDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class KeychainDeletedResources(RootModel[List[KeychainDeletedResourceEntry]]): - root: List[KeychainDeletedResourceEntry] - - -class KeychainMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Keychain(BaseModel): - apiVersion: str - kind: str - metadata: KeychainMetadata - spec: Annotated[ - Spec, - Field( - description='KeychainSpec defines the desired state of Keychain', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='KeychainStatus defines the observed state of Keychain', - title='Status', - ), - ] = None - - -class KeychainDeployment(BaseModel): - apiVersion: str - kind: str - metadata: KeychainDeploymentMetadata - spec: Annotated[ - SpecModel, - Field( - description='KeychainDeploymentSpec defines the desired state of KeychainDeployment', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='KeychainDeploymentStatus defines the observed state of KeychainDeployment', - title='Status', - ), - ] = None - - -class KeychainDeploymentList(BaseModel): - apiVersion: str - items: Optional[List[KeychainDeployment]] = None - kind: str - - -class KeychainList(BaseModel): - apiVersion: str - items: Optional[List[Keychain]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/services/__init__.py b/pydantic_eda/com/nokia/eda/services/__init__.py deleted file mode 100644 index 4158756..0000000 --- a/pydantic_eda/com/nokia/eda/services/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/services.eda.nokia.com/v1alpha1/services.json -# timestamp: 2025-05-07T11:44:15+00:00 diff --git a/pydantic_eda/com/nokia/eda/services/v1alpha1.py b/pydantic_eda/com/nokia/eda/services/v1alpha1.py deleted file mode 100644 index 573ce59..0000000 --- a/pydantic_eda/com/nokia/eda/services/v1alpha1.py +++ /dev/null @@ -1,4026 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/services.eda.nokia.com/v1alpha1/services.json -# timestamp: 2025-05-07T11:44:15+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Any, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class DynamicLearning(BaseModel): - ageTime: Annotated[ - Optional[int], - Field( - description='Aging timer value for the proxy entries in seconds. If not set, this indicates that the entries are never flushed.', - ge=60, - le=86400, - title='Age Time', - ), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enables or disables Dynamic Learning.', title='Enabled'), - ] = False - sendRefresh: Annotated[ - Optional[int], - Field( - description='The interval determines the frequency at which the system generates three ARP Requests or Neighbor Solicitations with the intent to refresh the proxy entry. The refresh is sent within the age-time window.', - ge=120, - le=86400, - title='Send Refresh Interval', - ), - ] = None - - -class IpDuplication(BaseModel): - enabled: Annotated[ - Optional[bool], - Field(description='Enables or disables IP Duplication.', title='Enabled'), - ] = False - holdDownTime: Annotated[ - Optional[int], - Field( - description='Time to wait in minutes from the moment an IP is declared duplicate to the time the IP is removed from the proxy ARP/ND table.', - ge=2, - le=60, - title='Hold Down Time', - ), - ] = 9 - monitoringWindow: Annotated[ - Optional[int], - Field( - description='Monitoring window for detecting duplication on a given IP address in the proxy ARP/ND table.', - ge=1, - le=15, - title='Monitoring Window', - ), - ] = 3 - numMoves: Annotated[ - Optional[int], - Field( - description='Number of moves in the proxy ARP/ND table that an IP is allowed within the monitoring-window.', - ge=3, - le=10, - title='Number of Moves', - ), - ] = 5 - - -class L2proxyARPND(BaseModel): - dynamicLearning: Annotated[ - Optional[DynamicLearning], Field(title='Dynamic Learning') - ] = None - ipDuplication: Annotated[ - Optional[IpDuplication], Field(title='L2 Proxy ARP/ND IP Duplication Detection') - ] = None - proxyARP: Annotated[ - Optional[bool], Field(description='Enables proxy ARP.', title='Proxy ARP') - ] = False - proxyND: Annotated[ - Optional[bool], Field(description='Enables proxy ND.', title='Proxy ND') - ] = False - tableSize: Annotated[ - Optional[int], - Field( - description='Maximum number of entries allowed in the proxy table of the bridge domain.', - ge=1, - le=8192, - title='L2 Proxy ARP/ND Table Size', - ), - ] = 250 - - -class MacDuplicationDetection(BaseModel): - action: Annotated[ - Optional[Literal['Blackhole', 'OperDown', 'StopLearning']], - Field( - description='Action to take on the subinterface upon detecting at least one mac addresses as duplicate on the subinterface.', - title='Action', - ), - ] = 'StopLearning' - enabled: Annotated[ - Optional[bool], - Field( - description='Enables or disables Mac Duplication Detection.', - title='Enabled', - ), - ] = False - holdDownTime: Annotated[ - Optional[int], - Field( - description='Time to wait in minutes from the moment a mac is declared duplicate to the mac is flushed from the bridge table.', - ge=2, - le=60, - title='Hold Down Time', - ), - ] = 9 - monitoringWindow: Annotated[ - Optional[int], - Field( - description='Monitoring window in minutes for detecting duplication on a given mac address.', - ge=1, - le=15, - title='Monitoring Window', - ), - ] = 3 - numMoves: Annotated[ - Optional[int], - Field( - description='Number of moves a mac is allowed within the monitoring-window, before it is declared duplicate.', - ge=3, - title='Number of Moves', - ), - ] = 5 - - -class Spec(BaseModel): - description: Annotated[ - Optional[str], - Field(description='The description of the BridgeDomain.', title='Description'), - ] = None - evi: Annotated[ - Optional[int], - Field( - description='EVI to use for this BridgeDomain, can be optionally left blank to have it automatically allocated using the EVI Pool.', - ge=1, - le=65535, - title='EVI', - ), - ] = None - eviPool: Annotated[ - Optional[str], - Field( - description='Reference to an EVI pool to use for allocations if EVI is left blank.', - title='EVI Allocation Pool', - ), - ] = 'evi-pool' - exportTarget: Annotated[ - Optional[str], - Field( - description='Export route target in \'target:N:N\' format, if not specified, the default value taken as "target:1:".', - pattern='^target.*$', - title='Export Target', - ), - ] = None - importTarget: Annotated[ - Optional[str], - Field( - description='Import route target in \'target:N:N\' format, if not specified, the default value taken as "target:1:".', - pattern='^target.*$', - title='Import Target', - ), - ] = None - l2proxyARPND: Annotated[ - Optional[L2proxyARPND], - Field( - description='Enables / Disabled Proxy ARP / Proxy ND.', - title='L2 Proxy ARP/ND', - ), - ] = None - macAging: Annotated[ - Optional[int], - Field( - description='Configurable aging time for dynamically learned mac addresses.', - ge=60, - le=86400, - title='MAC Aging', - ), - ] = 300 - macDuplicationDetection: Annotated[ - Optional[MacDuplicationDetection], - Field( - description='Enable or disable MAC duplication detection and resolution mechanisms.', - title='MAC Duplication Detection', - ), - ] = None - macLimit: Annotated[ - Optional[int], - Field( - description='Sets the maximum number of MAC entries accepted in the bridge table.', - title='MAC Limit', - ), - ] = None - tunnelIndexPool: Annotated[ - Optional[str], - Field( - description='Reference to a tunnel index pool to use for allocations.', - title='Tunnel Index Allocation Pool', - ), - ] = 'tunnel-index-pool' - type: Annotated[ - Optional[Literal['SIMPLE', 'EVPNVXLAN']], - Field( - description="Select the type of BridgeDomain. Simple doesn't include any overlay control plane or dataplane properties (EVPN/VXLAN). EVPNVXLAN includes the properties needed to provision this BridgeDomain over an IP Fabric.", - title='Type', - ), - ] = 'EVPNVXLAN' - vni: Annotated[ - Optional[int], - Field( - description='VNI to use for this BridgeDomain, can be optionally left blank to have it allocated using the VNI Pool.', - ge=1, - le=16777215, - title='VNI', - ), - ] = None - vniPool: Annotated[ - Optional[str], - Field( - description='Reference to a VNI pool to use for allocations if VNI is left blank.', - title='VNI Allocation Pool', - ), - ] = 'vni-pool' - - -class Status(BaseModel): - evi: Annotated[ - Optional[int], - Field(description='EVI in use for this bridge domain.', title='EVI'), - ] = None - exportTarget: Annotated[ - Optional[str], - Field( - description='Export route target for this bridge domain.', - title='Export Target', - ), - ] = None - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the VNET.', title='Health Score' - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - importTarget: Annotated[ - Optional[str], - Field( - description='Import route target for this bridge domain.', - title='Import Target', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field( - description='Nodes which have the BridgeDomain configured (min 1 sub-interface).', - title='Nodes', - ), - ] = None - numNodes: Annotated[ - Optional[int], - Field( - description='Number of nodes which have the BridgeDomain configured (min 1 sub-interface).', - title='Number of Nodes', - ), - ] = None - numSubInterfaces: Annotated[ - Optional[int], - Field( - description='Number of sub-interfaces attached to the BridgeDomain.', - title='Number of Sub-Interfaces', - ), - ] = None - numSubInterfacesOperDown: Annotated[ - Optional[int], - Field( - description='Number of oper-down sub-interfaces attached to the BridgeDomain.', - title='Number of Operational Down Sub-Interfaces', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field(description='Operational state of the VNET.', title='Operational State'), - ] = None - tunnelIndex: Annotated[ - Optional[int], - Field(description='Vxlan tunnel index in use.', title='Tunnel Index'), - ] = None - vni: Annotated[ - Optional[int], - Field(description='VNI in use for this bridge domain.', title='VNI'), - ] = None - - -class BridgeDomainDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class BridgeDomainDeletedResources(RootModel[List[BridgeDomainDeletedResourceEntry]]): - root: List[BridgeDomainDeletedResourceEntry] - - -class BridgeDomainMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Egress(BaseModel): - filters: Annotated[ - Optional[List[str]], - Field( - description='List of Filter references to use at egress.', title='Filters' - ), - ] = None - qosPolicy: Annotated[ - Optional[List[str]], - Field( - description='List of QoS Egress policy references to use at egress.', - title='QoS Egress Policy', - ), - ] = None - - -class Ingress(BaseModel): - filters: Annotated[ - Optional[List[str]], - Field( - description='List of Filter references to use at ingress.', title='Filters' - ), - ] = None - qosPolicy: Annotated[ - Optional[List[str]], - Field( - description='List of QoS Ingress policy references to use at ingress.', - title='QoS Ingress Policy', - ), - ] = None - - -class Uplink(BaseModel): - egress: Annotated[ - Optional[Egress], - Field( - description='Manages actions on traffic at Egress of the Local enpoint of the Uplink.', - title='Egress', - ), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field( - description='Manages actions on traffic at Ingress of the Local enpoint of the Uplink.', - title='Ingress', - ), - ] = None - uplinkSelector: Annotated[ - Optional[List[str]], - Field( - description='Selects TopoLinks which connect a leaf switch to a breakout switch. This is the uplink between your access breakout switch and your leaf switch. There can only be a single TopoLink between the access breakout switch and the leaf switch, if more than one TopoLink is present between two devices the transaction will fail.', - title='Uplink Selector', - ), - ] = None - uplinkVLANID: Annotated[ - Optional[str], - Field( - description='The VLAN ID to be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.', - title='Uplink VLAN ID', - ), - ] = 'pool' - uplinkVLANPool: Annotated[ - Optional[str], - Field( - description='A VLAN from this pool will be utilized to isolate traffic from the VLAN on the access breakout switch to the leaf switch on the selected uplink TopoLink.', - title='Uplink VLAN Pool', - ), - ] = None - - -class SpecModel(BaseModel): - bridgeDomain: Annotated[ - str, - Field( - description='Reference to a BridgeDomain in which to attach the BridgeInterface.', - title='Bridge Domain', - ), - ] - description: Annotated[ - Optional[str], - Field( - description='The description of the BridgeInterface.', title='Description' - ), - ] = None - egress: Annotated[ - Optional[Egress], - Field( - description='Manages actions on traffic at Egress.', title='Egress Actions' - ), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field( - description='Manages actions on traffic at Ingress.', - title='Ingress Actions', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to an Interface resource to attach this BridgeInterface.', - title='Interface', - ), - ] - l2MTU: Annotated[ - Optional[int], - Field( - description='L2 MTU specifies the maximum sized Ethernet frame that can be transmitted on the subinterface. If a frame exceeds this size it is discarded. If the l2-mtu of the subinterface exceeds the port-mtu of the associated interface, the subinterface will remain operationally down.', - ge=1450, - le=9500, - title='L2 MTU', - ), - ] = None - macDuplicationDetectionAction: Annotated[ - Optional[ - Literal['Blackhole', 'OperDown', 'StopLearning', 'UseBridgeDomainAction'] - ], - Field( - description='Override for Mac Duplication Detection action if enabled in the associated BridgeDomain.', - title='MAC Duplication Detection Action', - ), - ] = None - splitHorizonGroup: Annotated[ - Optional[str], - Field( - description='Split Horizon Group to be used for this BridgeInterface. The subinterface within this BridgeInterface will be a member of this Split Horizon Group.', - title='Split Horizon Group', - ), - ] = None - uplink: Annotated[ - Optional[Uplink], - Field( - description='The Uplink between your access breakout switch and your leaf switch.', - title='Uplink', - ), - ] = None - vlanID: Annotated[ - str, - Field( - description='Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.', - title='VLAN ID', - ), - ] - - -class SubInterface(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='The administrative status of the SubInterface.', - title='Enabled', - ), - ] = None - interface: Annotated[ - str, Field(description='Normalized interface name.', title='Interface') - ] - interfaceResource: Annotated[ - str, Field(description='Eda interface resource.', title='Interface Resource') - ] - lastChange: Annotated[ - Optional[str], - Field( - description='Indicates when this SubInterface last changed state.', - title='Last Change', - ), - ] = None - node: Annotated[str, Field(description='Reference to Node object.', title='Node')] - nodeInterface: Annotated[ - str, Field(description='Node specific interface name.', title='Node Interface') - ] - operatingSystem: Annotated[ - Optional[str], - Field(description='Operating System of the Node.', title='Operating System'), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Indicates the current operational state of the SubInterface.', - title='Operational State', - ), - ] = None - subInterfaceIndex: Annotated[ - Optional[int], - Field( - description='Index allocated to the subinterface on the associated interface for the given VLAN.', - title='Sub Interface Index', - ), - ] = None - vlanID: Annotated[ - Optional[str], - Field(description='vlan assigned to this subinterface.', title='VLAN ID'), - ] = None - - -class Status1Model(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the BridgeInterface.', - title='Health Score', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the BridgeInterface.', - title='Operational State', - ), - ] = None - subInterfaces: Annotated[ - Optional[List[SubInterface]], - Field( - description='Sub-interfaces status within the BridgeInterface.', - title='Sub-Interfaces Status', - ), - ] = None - - -class BridgeInterfaceDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class BridgeInterfaceDeletedResources( - RootModel[List[BridgeInterfaceDeletedResourceEntry]] -): - root: List[BridgeInterfaceDeletedResourceEntry] - - -class BridgeInterfaceMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel1(BaseModel): - giAddress: Annotated[ - Optional[bool], - Field( - description='Set GI Address to the IP derived from the IRBInterface or RoutedInterface on which the DHCP relay is configured.', - title='Use GI Address', - ), - ] = None - irbInterfaceSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector to select the IRBInterface on which to configure the DHCP relay.', - title='IRB Interface Selector', - ), - ] = None - routedInterfaceSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector to select the RoutedInterface on which to configure the DHCP relay.', - title='Routed Interface Selector', - ), - ] = None - router: Annotated[ - Optional[str], - Field( - description='Router to be used to reach the DHCP server, if not specified the Router under which the source IRBInterface or RoutedInterface resides will be used.', - title='Router', - ), - ] = None - servers: Annotated[ - List[str], - Field( - description='List of servers to send the DHCP relayed packet to. These can be IP addresses or FQDN.', - min_length=1, - title='Servers', - ), - ] - subOptions: Annotated[ - Optional[List[str]], - Field( - description='DHCP Relay sub-options; available options are CircuitID, RemoteID, and ClientLinkLayerAddress.', - title='Sub Options', - ), - ] = None - - -class DHCPRelayDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class DHCPRelayDeletedResources(RootModel[List[DHCPRelayDeletedResourceEntry]]): - root: List[DHCPRelayDeletedResourceEntry] - - -class DHCPRelayMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Bfd(BaseModel): - desiredMinTransmitInt: Annotated[ - Optional[int], - Field( - description='The minimum interval in microseconds between transmission of BFD control packets.', - ge=10000, - le=100000000, - title='Transmit Interval', - ), - ] = 1000000 - detectionMultiplier: Annotated[ - Optional[int], - Field( - description='The number of packets that must be missed to declare this session as down.', - ge=3, - le=20, - title='Multiplier', - ), - ] = 3 - enabled: Annotated[ - bool, Field(description='Enables Biforward Detection.', title='Enabled') - ] - minEchoReceiveInterval: Annotated[ - Optional[int], - Field( - description='The minimum interval between echo packets the local node can receive.', - ge=250000, - le=100000000, - title='Minimum Echo Receive Interval', - ), - ] = 1000000 - requiredMinReceive: Annotated[ - Optional[int], - Field( - description='The minimum interval in microseconds between received BFD control packets that this system should support.', - ge=10000, - le=100000000, - title='Receive Interval', - ), - ] = 1000000 - - -class EvpnRouteAdvertisementType(BaseModel): - arpDynamic: Annotated[ - Optional[bool], - Field( - description='Advertise dynamic ARP entries.', title='Advertise Dynamic ARP' - ), - ] = False - arpStatic: Annotated[ - Optional[bool], - Field( - description='Advertise static ARP entries.', title='Advertise Static ARP' - ), - ] = False - ndDynamic: Annotated[ - Optional[bool], - Field( - description='Advertise dynamic ND entries.', title='Advertise Dynamic ND' - ), - ] = False - ndStatic: Annotated[ - Optional[bool], - Field(description='Advertise static ND entries.', title='Advertise Static ND'), - ] = False - - -class HostRoutePopulate(BaseModel): - dynamic: Annotated[ - Optional[bool], - Field( - description='Create host routes out of dynamic ARP entries.', - title='Dynamic ARP Entries', - ), - ] = True - evpn: Annotated[ - Optional[bool], - Field( - description='Create host routes out of EVPN learned ARP entries.', - title='EVPN Learned ARP Entries', - ), - ] = False - static: Annotated[ - Optional[bool], - Field( - description='Create host routes out of static ARP entries.', - title='Static ARP Entries', - ), - ] = True - - -class Ipv4Address(BaseModel): - ipPrefix: Annotated[ - str, Field(description='Address and mask to use', title='IP Prefix') - ] - primary: Annotated[ - Optional[bool], - Field( - description='Indicates which address to use as primary for broadcast', - title='Primary', - ), - ] = None - - -class Ipv6Address(BaseModel): - ipPrefix: Annotated[ - str, Field(description='Address and mask to use', title='IP Prefix') - ] - primary: Annotated[ - Optional[bool], - Field( - description='Indicates which address to use as primary for broadcast', - title='Primary', - ), - ] = None - - -class IpAddress(BaseModel): - ipv4Address: Annotated[ - Optional[Ipv4Address], - Field( - description='IPv4 address in IP/mask form, e.g., 192.168.0.1/24.', - title='IPv4 Addresses', - ), - ] = None - ipv6Address: Annotated[ - Optional[Ipv6Address], - Field( - description='IPv6 address in IP/mask form, e.g., fc00::1/120.', - title='IPv6 Addresses', - ), - ] = None - node: Annotated[ - Optional[str], - Field( - description='Reference to a TopoNode resource, if not specified the IP address will be assigned to all nodes on which the IRB is deployed. If specified the IP address will be assigned to the specified node.', - title='Node', - ), - ] = None - - -class Prefix(BaseModel): - autonomousFlag: Annotated[ - Optional[bool], - Field( - description='When this is set in the prefix information option hosts can use the prefix for stateless address autoconfiguration (SLAAC).', - title='Autonomous Flag', - ), - ] = True - onLinkFlag: Annotated[ - Optional[bool], - Field( - description='When this is set in the prefix information option hosts can use the prefix for on-link determination.', - title='On-Link Flag', - ), - ] = True - preferredLifetime: Annotated[ - Optional[int], - Field( - description='The length of time in seconds (relative to the time the packet is sent) that addresses generated from the prefix via stateless address autoconfiguration remain preferred.', - ge=0, - le=4294967295, - title='Preferred Lifetime', - ), - ] = 604800 - prefix: Annotated[ - str, - Field( - description='An IPv6 global unicast address prefix.', title='IPv6 Prefix' - ), - ] - validLifetime: Annotated[ - Optional[int], - Field( - description='The length of time in seconds (relative to the time the packet is sent) that the prefix is valid for the purpose of on-link determination.', - ge=0, - le=4294967295, - title='Valid Lifetime', - ), - ] = 2592000 - - -class Ipv6RouterAdvertisement(BaseModel): - currentHopLimit: Annotated[ - int, - Field( - description='The current hop limit to advertise in the router advertisement messages.', - ge=0, - le=255, - title='Current Hop Limit', - ), - ] - enabled: Annotated[ - bool, - Field( - description='Enable or disable IPv6 router advertisements.', - title='Enable Router Advertisements', - ), - ] - ipMTU: Annotated[ - Optional[int], - Field( - description='The IP MTU to advertise in the router advertisement messages.', - ge=1280, - le=9486, - title='IP MTU', - ), - ] = None - managedConfigurationFlag: Annotated[ - bool, - Field( - description='Enable DHCPv6 for address configuration (M-bit).', - title='Managed Configuration Flag', - ), - ] - maxAdvertisementInterval: Annotated[ - int, - Field( - description='Maximum time between router advertisements (in seconds).', - ge=4, - le=1800, - title='Maximum Advertisement Interval', - ), - ] - minAdvertisementInterval: Annotated[ - int, - Field( - description='Minimum time between router advertisements (in seconds).', - ge=3, - le=1350, - title='Minimum Advertisement Interval', - ), - ] - otherConfigurationFlag: Annotated[ - bool, - Field( - description='Enable DHCPv6 for other configuration (O-bit).', - title='Other Configuration Flag', - ), - ] - prefixes: Annotated[ - Optional[List[Prefix]], - Field( - description='IPv6 prefixes to advertise in router advertisements.', - title='Prefixes', - ), - ] = None - reachableTime: Annotated[ - Optional[int], - Field( - description='Time in milliseconds for Neighbor Unreachability Detection.', - ge=0, - le=3600000, - title='Reachable Time', - ), - ] = 0 - retransmitTime: Annotated[ - int, - Field( - description='Time in milliseconds between retransmitted NS messages.', - ge=0, - le=1800000, - title='Retransmit Time', - ), - ] - routerLifetime: Annotated[ - int, - Field( - description='Router lifetime in seconds for default gateway.', - ge=0, - le=9000, - title='Router Lifetime', - ), - ] - - -class L3ProxyARPND(BaseModel): - proxyARP: Annotated[ - Optional[bool], - Field( - description='Select whether Proxy ARP should be enabled.', - title='Proxy ARP Enabled', - ), - ] = False - proxyND: Annotated[ - Optional[bool], - Field( - description='Select whether Proxy ND should be enabled.', - title='Proxy ND Enabled', - ), - ] = False - - -class VirtualIPDiscoveryItem(BaseModel): - address: Annotated[str, Field(description='Virtual IP Address.', title='Address')] - allowedMAC: Annotated[ - Optional[List[str]], - Field( - description='List of allowed MAC addresses for a discovered virtual IP address.', - title='Allowed MAC Addresses', - ), - ] = None - bridgeInterfaceToProbe: Annotated[ - Optional[List[str]], - Field( - description='List of BridgeInterfaces on the associated MAC-VRF to which the ARP probes are sent. If left blank, the probes are sent on all BridgeInterfaces associated with the BridgeDomain.', - title='Bridge Interfaces to Probe', - ), - ] = None - probeInterval: Annotated[ - Optional[int], - Field( - description='ARP probe interval in seconds.', - ge=0, - le=86400, - title='Probe Interval', - ), - ] = 0 - vlanToProbe: Annotated[ - Optional[List[str]], - Field( - description='List of VLANs on the associated BridgeDomain to which the ARP probes are sent. If left blank, the probes are sent on all VLANs associated with the BridgeDomain.', - title='VLANs to Probe', - ), - ] = None - - -class SpecModel2(BaseModel): - anycastGatewayMAC: Annotated[ - Optional[str], - Field( - description='The gateway MAC to use on the anycast address, if left empty the node will automatically assign one.', - title='Anycast GW MAC', - ), - ] = None - arpTimeout: Annotated[ - Optional[int], - Field( - description='Duration of time that dynamic ARP entries remain in the ARP cache before they expire.', - title='ARP Timeout', - ), - ] = 14400 - bfd: Annotated[ - Optional[Bfd], - Field(description='Enable BFD on the IRBInterface.', title='BFD Configuration'), - ] = None - bridgeDomain: Annotated[ - str, Field(description='Reference to a BridgeDomain.', title='Bridge Domain') - ] - description: Annotated[ - Optional[str], - Field(description='The description of the IRBInterface.', title='Description'), - ] = None - egress: Annotated[ - Optional[Egress], - Field( - description='Manages actions on traffic at Egress.', title='Egress Actions' - ), - ] = None - evpnRouteAdvertisementType: Annotated[ - Optional[EvpnRouteAdvertisementType], - Field( - description='Controls the type of ARP/ND entries to advertise.', - title='EVPN Route Advertisement Type', - ), - ] = None - hostRoutePopulate: Annotated[ - Optional[HostRoutePopulate], - Field( - description='Configures host route population based on ARP entries.', - title='Host Route Population', - ), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field( - description='Manages actions on traffic at Ingress.', - title='Ingress Actions', - ), - ] = None - ipAddresses: Annotated[Optional[List[IpAddress]], Field(title='IP Addresses')] = ( - None - ) - ipMTU: Annotated[ - Optional[int], - Field( - description='IP MTU for the IRBInterface [default=1500].', - ge=1280, - le=9486, - title='IP MTU', - ), - ] = 1500 - ipv6RouterAdvertisement: Annotated[ - Optional[Ipv6RouterAdvertisement], Field(title='IPv6 Router Advertisement') - ] = None - l3ProxyARPND: Annotated[ - Optional[L3ProxyARPND], - Field( - description='L3 Proxy ARP and ND configuration.', title='L3 Proxy ARP/ND' - ), - ] = None - learnUnsolicited: Annotated[ - Optional[Literal['BOTH', 'GLOBAL', 'LINK-LOCAL', 'NONE']], - Field( - description='Enable or disable learning of unsolicited ARPs.', - title='Learn Unsolicited ARPs', - ), - ] = 'NONE' - router: Annotated[str, Field(description='Reference to a Router.', title='Router')] - unnumbered: Annotated[ - Optional[Literal['IPV6']], - Field( - description='Enables the use of unnumbered interfaces on the IRBInterface. If IPv6 is specified, no IP address are configured on the sub-interface and only the link local address will be used. If any IP addresses are specified for either IPv4 or IPv6 that will take precedence and IPs will be assigned to the interfaces.(Deprecated, Use IPv6RouterAdvertisement)', - title='Unnumbered', - ), - ] = None - virtualIPDiscovery: Annotated[ - Optional[List[VirtualIPDiscoveryItem]], - Field( - description='Configuration for Virtual IP discovery on the interface.', - title='Virtual IP Discovery', - ), - ] = None - - -class Interface(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='Administrative status of the SubInterface.', title='Enabled' - ), - ] = None - ipv4Addresses: Annotated[ - Optional[List[Ipv4Address]], - Field(description='List of IPv4 addresses', title='IPv4 Addresses'), - ] = None - ipv6Addresses: Annotated[ - Optional[List[Ipv6Address]], - Field(description='List of IPv6 addresses', title='IPv6 Addresses'), - ] = None - lastChange: Annotated[ - Optional[str], - Field( - description='Timestamp of when this SubInterface last changed state.', - title='Last Change', - ), - ] = None - node: Annotated[str, Field(description='Reference to Node object.', title='Node')] - nodeInterface: Annotated[ - str, Field(description='Node specific interface name.', title='Node Interface') - ] - operatingSystem: Annotated[ - Optional[str], - Field(description='Operating System of the Node.', title='Operating System'), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Current operational state of the SubInterface.', - title='Operational State', - ), - ] = None - - -class Status1Model1(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the VNET.', title='Health Score' - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Explains the reason for the health score.', - title='Health Score Reason', - ), - ] = None - interfaces: Annotated[ - Optional[List[Interface]], - Field( - description='Details of the interfaces associated with the IRB.', - title='Interface Statuses', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field(description='Timestamp of the last state change.', title='Last Change'), - ] = None - operationalState: Annotated[ - Optional[str], - Field(description='Operational state of the VNET.', title='Operational State'), - ] = None - - -class IRBInterfaceDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class IRBInterfaceDeletedResources(RootModel[List[IRBInterfaceDeletedResourceEntry]]): - root: List[IRBInterfaceDeletedResourceEntry] - - -class IRBInterfaceMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel3(BaseModel): - arpTimeout: Annotated[ - Optional[int], - Field( - description='Duration of time that dynamic ARP entries remain in the ARP cache before they expire.', - title='ARP Timeout', - ), - ] = 14400 - bfd: Annotated[ - Optional[Bfd], - Field( - description='Enables BFD on the RoutedInterface.', title='BFD Configuration' - ), - ] = None - description: Annotated[ - Optional[str], - Field( - description='The description of the RoutedInterface.', title='Description' - ), - ] = None - egress: Annotated[ - Optional[Egress], - Field( - description='Manages actions on traffic at Egress.', title='Egress Actions' - ), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field( - description='Manages actions on traffic at Ingress.', - title='Ingress Actions', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to an Interface to use for attachment.', - title='Interface', - ), - ] - ipMTU: Annotated[ - Optional[int], - Field( - description='IP MTU for the RoutedInterface.', - ge=1280, - le=9486, - title='IP MTU', - ), - ] = 1500 - ipv4Addresses: Annotated[ - Optional[List[Ipv4Address]], - Field( - description='List of IPv4 addresses in IP/mask form, e.g., 192.168.0.1/24.', - title='IPv4 Addresses', - ), - ] = None - ipv6Addresses: Annotated[ - Optional[List[Ipv6Address]], - Field( - description='List of IPv6 addresses in IP/mask form, e.g., fc00::1/120.', - title='IPv6 Addresses', - ), - ] = None - ipv6RouterAdvertisement: Annotated[ - Optional[Ipv6RouterAdvertisement], Field(title='IPv6 Router Advertisement') - ] = None - l3ProxyARPND: Annotated[ - Optional[L3ProxyARPND], - Field( - description='L3 Proxy ARP and ND configuration.', title='L3 Proxy ARP/ND' - ), - ] = None - learnUnsolicited: Annotated[ - Optional[Literal['BOTH', 'GLOBAL', 'LINK-LOCAL', 'NONE']], - Field( - description='Enable or disable learning of unsolicited ARPs.', - title='Learn Unsolicited ARPs', - ), - ] = 'NONE' - router: Annotated[str, Field(description='Reference to a Router.', title='Router')] - unnumbered: Annotated[ - Optional[Literal['IPV6']], - Field( - description='Enables the use of unnumbered interfaces on the IRBInterface. If IPv6 is specified, no IP address are configured on the sub-interface and only the link local address will be used. If any IP addresses are specified for either IPv4 or IPv6 that will take precedence and IPs will be assigned to the interfaces. (Deprecated, Use IPv6RouterAdvertisement)', - title='Unnumbered', - ), - ] = None - vlanID: Annotated[ - Optional[str], - Field( - description='Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.', - title='VLAN ID', - ), - ] = 'pool' - vlanPool: Annotated[ - Optional[str], - Field( - description='Reference to a VLAN pool to use for allocations.', - title='VLAN Pool', - ), - ] = 'vlan-pool' - - -class InterfaceModel(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='The administrative status of the SubInterface.', - title='Enabled', - ), - ] = None - interface: Annotated[ - str, Field(description='Normalized interface name.', title='Interface') - ] - interfaceResource: Annotated[ - str, Field(description='Eda interface resource.', title='Interface Resource') - ] - lastChange: Annotated[ - Optional[str], - Field( - description='Indicates when this SubInterface last changed state.', - title='Last Change', - ), - ] = None - node: Annotated[str, Field(description='Reference to Node object.', title='Node')] - nodeInterface: Annotated[ - str, Field(description='Node specific interface name.', title='Node Interface') - ] - operatingSystem: Annotated[ - Optional[str], - Field(description='Operating System of the Node.', title='Operating System'), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Indicates the current operational state of the SubInterface.', - title='Operational State', - ), - ] = None - subInterfaceIndex: Annotated[ - Optional[int], - Field( - description='Index allocated to the subinterface on the associated interface for the given VLAN.', - title='Sub Interface Index', - ), - ] = None - vlanID: Annotated[ - Optional[str], - Field(description='vlan assigned to this subinterface.', title='VLAN ID'), - ] = None - - -class Status1Model2(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the RoutedInterface.', - title='Health Score', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - interfaces: Annotated[ - Optional[List[InterfaceModel]], - Field( - description='Sub-interface status within the RoutedInterface.', - title='Sub-Interfaces Status', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the RoutedInterface.', - title='Operational State', - ), - ] = None - - -class RoutedInterfaceDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class RoutedInterfaceDeletedResources( - RootModel[List[RoutedInterfaceDeletedResourceEntry]] -): - root: List[RoutedInterfaceDeletedResourceEntry] - - -class RoutedInterfaceMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class IpAliasNexthop(BaseModel): - esi: Annotated[ - Optional[str], - Field( - description='10 byte Ethernet Segment Identifier, if not set a type 0 ESI is generated.', - title='ESI', - ), - ] = 'auto' - nextHop: Annotated[ - str, - Field( - description='The nexthop IP address to track for the IP alias.', - title='IP Alias Address', - ), - ] - preferredActiveNode: Annotated[ - Optional[str], - Field( - description='When not set the ES is used in an all active mode. This references the ToppNode object and when set, the DF algorithm is configured to type preference and the selected Node is set with a higher preference value. All other Nodes have a lower value configured.', - title='Preferred Active Node', - ), - ] = None - - -class Multipath(BaseModel): - allowMultipleAS: Annotated[ - bool, - Field( - description='When set to true, BGP is allowed to build a multipath set using BGP routes with different neighbor AS (most recent AS in the AS_PATH), When set to false, BGP is only allowed to use non-best paths for ECMP if they meet the multipath criteria and they have the same neighbor AS as the best path.', - title='Allow Multiple Autonomous Systems Per Path', - ), - ] - maxAllowedPaths: Annotated[ - int, - Field( - description='The maximum number of BGP ECMP next-hops for BGP routes with an NLRI belonging to the address family of this configuration context.', - ge=1, - le=256, - title='Maximum Number of Paths', - ), - ] - - -class Ipv4Unicast(BaseModel): - advertiseIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.', - title='Advertise IPv6 Next Hops', - ), - ] = None - enabled: Annotated[ - bool, Field(description='Enables the IPv4 unicast AFISAFI.', title='Enabled') - ] - multipath: Annotated[ - Optional[Multipath], Field(description='Enable multipath.', title='Multipath') - ] = None - receiveIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.', - title='Receive IPv6 Next Hops', - ), - ] = None - - -class Ipv6Unicast(BaseModel): - enabled: Annotated[ - bool, Field(description='Enables the IPv6 unicast AFISAFI', title='Enabled') - ] - multipath: Annotated[ - Optional[Multipath], Field(description='Enable multipath', title='Multipath') - ] = None - - -class Bgp(BaseModel): - autonomousSystem: Annotated[ - Optional[int], - Field( - description='Autonomous System number for BGP.', - ge=1, - le=4294967295, - title='Autonomous System', - ), - ] = None - ebgpPreference: Annotated[ - Optional[int], - Field( - description='Preference to be set for eBGP [default=170].', - ge=1, - le=255, - title='eBGP Preference', - ), - ] = 170 - enabled: Annotated[ - Optional[bool], Field(description='Enable or disable BGP.', title='Enable BGP') - ] = False - ibgpPreference: Annotated[ - Optional[int], - Field( - description='Preference to be set for iBGP [default=170].', - ge=1, - le=255, - title='iBGP Preference', - ), - ] = 170 - ipAliasNexthops: Annotated[ - Optional[List[IpAliasNexthop]], - Field(description='IP aliasing configuration.', title='IP Alias Nexthops'), - ] = None - ipv4Unicast: Annotated[ - Optional[Ipv4Unicast], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6Unicast], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field(description='Keychain to be used for authentication', title='Keychain'), - ] = None - minWaitToAdvertise: Annotated[ - Optional[int], - Field( - description='Minimum wait time before advertising routes post BGP restart.', - ge=0, - le=3600, - title='Min Wait To Advertise Time', - ), - ] = 0 - rapidWithdrawl: Annotated[ - Optional[bool], - Field( - description='Enable rapid withdrawal in BGP.', - title='Enable Rapid Withdrawal', - ), - ] = True - waitForFIBInstall: Annotated[ - Optional[bool], - Field( - description='Wait for FIB installation before advertising routes.', - title='Wait for FIB Installation', - ), - ] = False - - -class PrefixItem(BaseModel): - hashBucketsPerPath: Annotated[ - int, - Field( - description='The number of times each next-hop is repeated in the fill pattern if there are max-paths ECMP next-hops.', - ge=1, - le=32, - title='Max Paths', - ), - ] - maxECMP: Annotated[ - int, - Field( - description='The maximum number of ECMP next-hops per route associated with the resilient-hash prefix.', - ge=1, - le=64, - title='Max ECMP', - ), - ] - prefix: Annotated[ - str, - Field( - description='IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.', - title='Prefix', - ), - ] - - -class IpLoadBalancing(BaseModel): - prefix: Annotated[ - Optional[List[PrefixItem]], - Field( - description='IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.', - title='Prefix', - ), - ] = None - - -class RouteLeaking(BaseModel): - exportPolicy: Annotated[ - Optional[str], - Field( - description='Reference to a Policy resource to use when evaluating route exports from the DefaultRouter.', - title='Export Policy', - ), - ] = None - importPolicy: Annotated[ - Optional[str], - Field( - description='Reference to a Policy resource to use when evaluating route imports into the DefaultRouter.', - title='Import Policy', - ), - ] = None - - -class SpecModel4(BaseModel): - bgp: Annotated[ - Optional[Bgp], - Field(description='BGP configuration.', title='BGP Configuration'), - ] = None - description: Annotated[ - Optional[str], - Field(description='The description of the Router.', title='Description'), - ] = None - evi: Annotated[ - Optional[int], - Field( - description='EVI for the Router; leave blank for auto-allocation from EVI pool.', - ge=1, - le=65535, - title='EVI', - ), - ] = None - eviPool: Annotated[ - Optional[str], - Field( - description='Reference to EVI pool for auto-allocation.', - title='EVI Allocation Pool', - ), - ] = 'evi-pool' - exportTarget: Annotated[ - Optional[str], - Field( - description='Export route target in \'target:N:N\' format, if not specified, the default value taken as "target:1:".', - pattern='^target.*$', - title='Export Target', - ), - ] = None - importTarget: Annotated[ - Optional[str], - Field( - description='Import route target in \'target:N:N\' format, if not specified, the default value taken as "target:1:".', - pattern='^target.*$', - title='Import Target', - ), - ] = None - ipLoadBalancing: Annotated[ - Optional[IpLoadBalancing], - Field( - description='IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.', - title='Prefix', - ), - ] = None - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Node selectors for deployment constraints. If Nodes are selected, the Router will only be deployed on the Nodes selected, if left blank it will be deployed on all Nodes for which there are IRB or RoutedInterfaces referencing this Router.', - title='Node Selector', - ), - ] = None - routeLeaking: Annotated[ - Optional[RouteLeaking], - Field( - description='Route leaking controlled by routing policies in and out of the DefaultRouter.', - title='Route Leaking', - ), - ] = None - routerID: Annotated[ - Optional[str], Field(description='Router ID.', title='Router ID') - ] = None - tunnelIndexPool: Annotated[ - Optional[str], - Field( - description='Reference to tunnel index allocation pool.', - title='Tunnel Index Pool', - ), - ] = 'tunnel-index-pool' - type: Annotated[ - Optional[Literal['SIMPLE', 'EVPNVXLAN']], - Field( - description="Select the type of Router. Simple doesn't include any overlay control plane or dataplane properties (EVPN/VXLAN). EVPNVXLAN includes the properties needed to provision this Router over an IP Fabric.", - title='Type', - ), - ] = 'EVPNVXLAN' - vni: Annotated[ - Optional[int], - Field( - description='VNI for the Router; leave blank for auto-allocation from VNI pool.', - ge=1, - le=16777215, - title='VNI', - ), - ] = None - vniPool: Annotated[ - Optional[str], - Field( - description='Reference to VNI pool for auto-allocation.', - title='VNI Allocation Pool', - ), - ] = 'vni-pool' - - -class Status1Model3(BaseModel): - bgpPeers: Annotated[ - Optional[List[str]], - Field( - description='List of BGPPeers attached to the router.', title='BGP Peers' - ), - ] = None - evi: Annotated[ - Optional[int], Field(description='EVI in use for this Router.', title='EVI') - ] = None - exportTarget: Annotated[ - Optional[str], - Field( - description='Export route target for this Router.', title='Export Target' - ), - ] = None - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the Router.', - title='Health Score', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Explains the reason for the health score.', - title='Health Score Reason', - ), - ] = None - importTarget: Annotated[ - Optional[str], - Field( - description='Import route target for this Router.', title='Import Target' - ), - ] = None - irbInterfaces: Annotated[ - Optional[List[str]], - Field( - description='List of IRBInterfaces attached to the router.', - title='IRB Interfaces', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field(description='Timestamp of the last state change.', title='Last Change'), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of nodes on which the Router is deployed.', title='Nodes' - ), - ] = None - numNodes: Annotated[ - Optional[int], - Field( - description='Number of nodes on which the Router is configured.', - title='Number of Nodes', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the Router.', title='Operational State' - ), - ] = None - routedInterfaces: Annotated[ - Optional[List[str]], - Field( - description='List of RoutedInterfaces attached to the router.', - title='Routed Interfaces', - ), - ] = None - tunnelIndex: Annotated[ - Optional[int], - Field(description='Vxlan tunnel index in use.', title='Tunnel Index'), - ] = None - vni: Annotated[ - Optional[int], Field(description='VNI in use for this Router.', title='VNI') - ] = None - - -class RouterDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class RouterDeletedResources(RootModel[List[RouterDeletedResourceEntry]]): - root: List[RouterDeletedResourceEntry] - - -class RouterMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel5(BaseModel): - bridgeDomain: Annotated[ - str, - Field( - description='Reference to a BridgeDomain or SimpleBridgeDomain.', - title='Bridge Domain', - ), - ] - description: Annotated[ - Optional[str], - Field(description='The description of the VLAN.', title='Description'), - ] = None - egress: Annotated[ - Optional[Egress], - Field(description='Manages actions on traffic at Egress.', title='Egress'), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field(description='Manages actions on traffic at Ingress.', title='Ingress'), - ] = None - interfaceSelector: Annotated[ - List[str], - Field( - description='Interfaces to use for attachment to this VLAN based on the label selector. Selects Interfaces based on their associated labels.', - title='Interface Selector', - ), - ] - l2MTU: Annotated[ - Optional[int], - Field( - description='L2 MTU specifies the maximum sized Ethernet frame that can be transmitted on the subinterface. If a frame exceeds this size it is discarded. If the l2-mtu of the subinterface exceeds the port-mtu of the associated interface, the subinterface will remain operationally down.', - ge=1450, - le=9500, - title='L2 MTU', - ), - ] = None - macDuplicationDetectionAction: Annotated[ - Optional[ - Literal['Blackhole', 'OperDown', 'StopLearning', 'UseBridgeDomainAction'] - ], - Field( - description='If Mac Duplication Detection is enabled on the associated Bridge Domain, this property will override the MDD action set in the BridgeDomain.', - title='MAC Duplication Detection Action', - ), - ] = None - splitHorizonGroup: Annotated[ - Optional[str], - Field( - description='Name of the Split Horizon Group to be used for this VLAN. All subinterfaces within this VLAN will be members of this Split Horizon Group.', - title='Split Horizon Group', - ), - ] = None - uplink: Annotated[ - Optional[Uplink], - Field( - description='The Uplink between your access breakout switch and your leaf switch.', - title='Uplink', - ), - ] = None - vlanID: Annotated[ - Optional[str], - Field( - description='Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.', - title='VLAN ID', - ), - ] = 'pool' - vlanPool: Annotated[ - Optional[str], - Field( - description='Reference to a VLAN pool to use for allocations. [default="vlan-pool"]', - title='VLAN Pool', - ), - ] = None - - -class Status1Model4(BaseModel): - health: Annotated[ - Optional[int], - Field(description='Indicates the health score of the VNET.', title='Health'), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - numSubInterfaces: Annotated[ - Optional[int], - Field( - description='Total number of sub-interfaces configured by the VNET.', - title='Number of Sub Interfaces', - ), - ] = None - numSubInterfacesOperDown: Annotated[ - Optional[int], - Field( - description='Total number of sub-interfaces configured by the VNET which are oper-down.', - title='Number of Sub Interfaces Oper Down', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field(description='Operational state of the VNET.', title='Operational State'), - ] = None - subInterfaces: Annotated[ - Optional[List[SubInterface]], - Field(description='List of members in this Interface.', title='Sub Interfaces'), - ] = None - - -class VLANDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class VLANDeletedResources(RootModel[List[VLANDeletedResourceEntry]]): - root: List[VLANDeletedResourceEntry] - - -class VLANMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class SpecModel6(BaseModel): - description: Annotated[ - Optional[str], - Field(description='The description of the BridgeDomain.', title='Description'), - ] = None - evi: Annotated[ - Optional[int], - Field( - description='EVI to use for this BridgeDomain, can be optionally left blank to have it automatically allocated using the EVI Pool.', - ge=1, - le=65535, - title='EVI', - ), - ] = None - eviPool: Annotated[ - Optional[str], - Field( - description='Reference to an EVI pool to use for allocations if EVI is left blank.', - title='EVI Allocation Pool', - ), - ] = 'evi-pool' - exportTarget: Annotated[ - Optional[str], - Field( - description='Export route target in \'target:N:N\' format, if not specified, the default value taken as "target:1:".', - pattern='^target.*$', - title='Export Target', - ), - ] = None - importTarget: Annotated[ - Optional[str], - Field( - description='Import route target in \'target:N:N\' format, if not specified, the default value taken as "target:1:".', - pattern='^target.*$', - title='Import Target', - ), - ] = None - l2proxyARPND: Annotated[ - Optional[L2proxyARPND], - Field( - description='Enables / Disabled Proxy ARP / Proxy ND.', - title='L2 Proxy ARP/ND', - ), - ] = None - macAging: Annotated[ - Optional[int], - Field( - description='Configurable aging time for dynamically learned mac addresses.', - ge=60, - le=86400, - title='MAC Aging', - ), - ] = 300 - macDuplicationDetection: Annotated[ - Optional[MacDuplicationDetection], - Field( - description='Enable or disable MAC duplication detection and resolution mechanisms.', - title='MAC Duplication Detection', - ), - ] = None - macLimit: Annotated[ - Optional[int], - Field( - description='Sets the maximum number of MAC entries accepted in the bridge table.', - title='MAC Limit', - ), - ] = None - tunnelIndexPool: Annotated[ - Optional[str], - Field( - description='Reference to a tunnel index pool to use for allocations.', - title='Tunnel Index Allocation Pool', - ), - ] = 'tunnel-index-pool' - type: Annotated[ - Optional[Literal['SIMPLE', 'EVPNVXLAN']], - Field( - description="Select the type of BridgeDomain. Simple doesn't include any overlay control plane or dataplane properties (EVPN/VXLAN). EVPNVXLAN includes the properties needed to provision this BridgeDomain over an IP Fabric.", - title='Type', - ), - ] = 'EVPNVXLAN' - vni: Annotated[ - Optional[int], - Field( - description='VNI to use for this BridgeDomain, can be optionally left blank to have it allocated using the VNI Pool.', - ge=1, - le=16777215, - title='VNI', - ), - ] = None - vniPool: Annotated[ - Optional[str], - Field( - description='Reference to a VNI pool to use for allocations if VNI is left blank.', - title='VNI Allocation Pool', - ), - ] = 'vni-pool' - - -class BridgeDomain(BaseModel): - name: Annotated[ - str, - Field(description='The name of the BridgeDomain.', title='Bridge Domain Name'), - ] - spec: Annotated[ - SpecModel6, - Field( - description='Specification of the BridgeDomain', title='Bridge Domain Spec' - ), - ] - - -class SpecModel7(BaseModel): - bridgeDomain: Annotated[ - str, - Field( - description='Reference to a BridgeDomain in which to attach the BridgeInterface.', - title='Bridge Domain', - ), - ] - description: Annotated[ - Optional[str], - Field( - description='The description of the BridgeInterface.', title='Description' - ), - ] = None - egress: Annotated[ - Optional[Egress], - Field( - description='Manages actions on traffic at Egress.', title='Egress Actions' - ), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field( - description='Manages actions on traffic at Ingress.', - title='Ingress Actions', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to an Interface resource to attach this BridgeInterface.', - title='Interface', - ), - ] - l2MTU: Annotated[ - Optional[int], - Field( - description='L2 MTU specifies the maximum sized Ethernet frame that can be transmitted on the subinterface. If a frame exceeds this size it is discarded. If the l2-mtu of the subinterface exceeds the port-mtu of the associated interface, the subinterface will remain operationally down.', - ge=1450, - le=9500, - title='L2 MTU', - ), - ] = None - macDuplicationDetectionAction: Annotated[ - Optional[ - Literal['Blackhole', 'OperDown', 'StopLearning', 'UseBridgeDomainAction'] - ], - Field( - description='Override for Mac Duplication Detection action if enabled in the associated BridgeDomain.', - title='MAC Duplication Detection Action', - ), - ] = None - splitHorizonGroup: Annotated[ - Optional[str], - Field( - description='Split Horizon Group to be used for this BridgeInterface. The subinterface within this BridgeInterface will be a member of this Split Horizon Group.', - title='Split Horizon Group', - ), - ] = None - uplink: Annotated[ - Optional[Uplink], - Field( - description='The Uplink between your access breakout switch and your leaf switch.', - title='Uplink', - ), - ] = None - vlanID: Annotated[ - str, - Field( - description='Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.', - title='VLAN ID', - ), - ] - - -class BridgeInterface(BaseModel): - name: Annotated[ - str, - Field( - description='The name of the BridgeInterface.', - title='Bridge Interface Name', - ), - ] - spec: Annotated[ - SpecModel7, - Field( - description='Specification of the BridgeInterface', - title='Bridge Interface Spec', - ), - ] - - -class SpecModel8(BaseModel): - anycastGatewayMAC: Annotated[ - Optional[str], - Field( - description='The gateway MAC to use on the anycast address, if left empty the node will automatically assign one.', - title='Anycast GW MAC', - ), - ] = None - arpTimeout: Annotated[ - Optional[int], - Field( - description='Duration of time that dynamic ARP entries remain in the ARP cache before they expire.', - title='ARP Timeout', - ), - ] = 14400 - bfd: Annotated[ - Optional[Bfd], - Field(description='Enable BFD on the IRBInterface.', title='BFD Configuration'), - ] = None - bridgeDomain: Annotated[ - str, Field(description='Reference to a BridgeDomain.', title='Bridge Domain') - ] - description: Annotated[ - Optional[str], - Field(description='The description of the IRBInterface.', title='Description'), - ] = None - egress: Annotated[ - Optional[Egress], - Field( - description='Manages actions on traffic at Egress.', title='Egress Actions' - ), - ] = None - evpnRouteAdvertisementType: Annotated[ - Optional[EvpnRouteAdvertisementType], - Field( - description='Controls the type of ARP/ND entries to advertise.', - title='EVPN Route Advertisement Type', - ), - ] = None - hostRoutePopulate: Annotated[ - Optional[HostRoutePopulate], - Field( - description='Configures host route population based on ARP entries.', - title='Host Route Population', - ), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field( - description='Manages actions on traffic at Ingress.', - title='Ingress Actions', - ), - ] = None - ipAddresses: Annotated[Optional[List[IpAddress]], Field(title='IP Addresses')] = ( - None - ) - ipMTU: Annotated[ - Optional[int], - Field( - description='IP MTU for the IRBInterface [default=1500].', - ge=1280, - le=9486, - title='IP MTU', - ), - ] = 1500 - ipv6RouterAdvertisement: Annotated[ - Optional[Ipv6RouterAdvertisement], Field(title='IPv6 Router Advertisement') - ] = None - l3ProxyARPND: Annotated[ - Optional[L3ProxyARPND], - Field( - description='L3 Proxy ARP and ND configuration.', title='L3 Proxy ARP/ND' - ), - ] = None - learnUnsolicited: Annotated[ - Optional[Literal['BOTH', 'GLOBAL', 'LINK-LOCAL', 'NONE']], - Field( - description='Enable or disable learning of unsolicited ARPs.', - title='Learn Unsolicited ARPs', - ), - ] = 'NONE' - router: Annotated[str, Field(description='Reference to a Router.', title='Router')] - unnumbered: Annotated[ - Optional[Literal['IPV6']], - Field( - description='Enables the use of unnumbered interfaces on the IRBInterface. If IPv6 is specified, no IP address are configured on the sub-interface and only the link local address will be used. If any IP addresses are specified for either IPv4 or IPv6 that will take precedence and IPs will be assigned to the interfaces.(Deprecated, Use IPv6RouterAdvertisement)', - title='Unnumbered', - ), - ] = None - virtualIPDiscovery: Annotated[ - Optional[List[VirtualIPDiscoveryItem]], - Field( - description='Configuration for Virtual IP discovery on the interface.', - title='Virtual IP Discovery', - ), - ] = None - - -class IrbInterface(BaseModel): - name: Annotated[ - str, - Field(description='The name of the IrbInterface.', title='IRB Interface Name'), - ] - spec: Annotated[ - SpecModel8, - Field( - description='Specification of the IrbInterface', title='IRB Interface Spec' - ), - ] - - -class RemovePrivateAS(BaseModel): - ignorePeerAS: Annotated[ - bool, - Field( - description='If set to true then do not delete or replace a private AS number that is the same as the peer AS number.', - title='Ignore Peer AS', - ), - ] - leadingOnly: Annotated[ - bool, - Field( - description='If set to true then only delete or replace private AS numbers that appear before the first occurrence of a non-private ASN in the sequence of most recent ASNs in the AS path.', - title='Leading Only', - ), - ] - removePrivateASMode: Annotated[ - Literal['DISABLED', 'REPLACE', 'DELETE'], - Field( - description='The method by which private AS numbers are removed from the advertised AS_PATH attribute.', - title='Remove Private AS Mode', - ), - ] - - -class AsPathOptions(BaseModel): - allowOwnAS: Annotated[ - int, - Field( - description='The maximum number of times the global AS number or a local AS number of the BGP instance can appear in any received AS_PATH before it is considered a loop and considered invalid.', - ge=0, - le=255, - title='Allow Own AS', - ), - ] - removePrivateAS: Annotated[ - Optional[RemovePrivateAS], - Field( - description='Options for removing private AS numbers (2-byte and 4-byte) from the advertised AS path towards all peers.', - title='Remove Private AS', - ), - ] = None - - -class Ipv4UnicastModel(BaseModel): - advertiseIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.', - title='Advertise IPv6 Next Hops', - ), - ] = None - enabled: Annotated[ - Optional[bool], - Field(description='Enables the IPv4 unicast AFISAFI.', title='Enabled'), - ] = None - maxReceivedRoutes: Annotated[ - Optional[int], - Field( - description='Maximum number of IPv4 Unicast routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.', - ge=1, - le=4294967295, - title='Max Received Routes', - ), - ] = None - receiveIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.', - title='Receive IPv6 Next Hops', - ), - ] = None - - -class Ipv6UnicastModel(BaseModel): - enabled: Annotated[ - Optional[bool], - Field(description='Enables the IPv6 unicast AFISAFI', title='Enabled'), - ] = None - maxReceivedRoutes: Annotated[ - Optional[int], - Field( - description='Maximum number of IPv6 Unicast routes that will be accepted from the neighbor, counting routes accepted and rejected by import policies.', - ge=1, - le=4294967295, - title='Max Received Routes', - ), - ] = None - - -class LocalAS(BaseModel): - autonomousSystem: Annotated[ - int, - Field( - description='Local Autonomous System number.', - ge=1, - le=4294967295, - title='Local Autonomous System', - ), - ] - prependGlobalAS: Annotated[ - Optional[bool], - Field( - description='When set to true, the global ASN value is prepended to the AS path in outbound routes towards each BGP peer.', - title='Prepend Global Autonomous System', - ), - ] = None - prependLocalAS: Annotated[ - Optional[bool], - Field( - description='When set to true, the local AS value is prepended to the AS path of inbound routes from each EBGP peer.', - title='Prepend Local Autonomous System', - ), - ] = None - - -class PeerAS(BaseModel): - autonomousSystem: Annotated[ - int, - Field( - description='Local Autonomous System number.', - ge=1, - le=4294967295, - title='Peer Autonomous System', - ), - ] - - -class SendDefaultRoute(BaseModel): - addressFamily: Annotated[ - List[Literal['IPV4-UNICAST', 'IPV6-UNICAST']], - Field( - description='Enables the sending of a synthetically generated default IPv4 or IPV6 route to each peer.', - title='Address Families', - ), - ] - exportPolicy: Annotated[ - Optional[str], - Field( - description='Reference to a Policy that should be applied to the advertised default routes, in order to set their attributes to non-default values.', - title='Export Policy', - ), - ] = None - - -class Timers(BaseModel): - connectRetry: Annotated[ - Optional[int], - Field( - description='The time interval in seconds between successive attempts to establish a session with a peer.', - ge=1, - le=65535, - title='Connect Retry', - ), - ] = None - holdTime: Annotated[ - Optional[int], - Field( - description='The hold-time interval in seconds that the router proposes to the peer in its OPEN message.', - ge=0, - le=65535, - title='Hold Time', - ), - ] = None - keepAlive: Annotated[ - Optional[int], - Field( - description='The interval in seconds between successive keepalive messages sent to the peer.', - ge=0, - le=21845, - title='Keep Alive', - ), - ] = None - minimumAdvertisementInterval: Annotated[ - Optional[int], - Field( - description='The value assigned to the MinRouteAdvertisementIntervalTimer of RFC 4271, for both EBGP and IBGP sessions.', - ge=1, - le=255, - title='Minimum Advertisement Interval', - ), - ] = None - - -class SpecModel9(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - client: Annotated[ - Optional[bool], - Field( - description='When set to true, all configured and dynamic BGP peers are considered RR clients.', - title='Route Reflector Client', - ), - ] = None - clusterID: Annotated[ - Optional[str], - Field( - description='Enables route reflect client and sets the cluster ID.', - title='Cluster ID', - ), - ] = None - description: Annotated[ - Optional[str], - Field( - description='Sets the description on the BGP group.', title='Description' - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - ipv4Unicast: Annotated[ - Optional[Ipv4UnicastModel], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6UnicastModel], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - localPreference: Annotated[ - Optional[int], - Field( - description='Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.', - ge=0, - le=4294967295, - title='Local Preference', - ), - ] = None - multiHopMaxHop: Annotated[ - Optional[int], - Field( - description='Enable multihop for eBGP peers and sets the maximum number of hops allowed.', - ge=1, - le=255, - title='Multihop Max Hop Count', - ), - ] = None - nextHopSelf: Annotated[ - Optional[bool], - Field( - description='When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.', - title='Next Hop Self', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class BgpGroup(BaseModel): - name: Annotated[ - str, Field(description='The name of the BgpGroup.', title='BGP Group Name') - ] - spec: Annotated[ - SpecModel9, - Field(description='Specification of the BgpGroup', title='BGP Group Spec'), - ] - - -class SpecModel10(BaseModel): - asPathOptions: Annotated[ - Optional[AsPathOptions], - Field(description='AS Path Options', title='AS Path Options'), - ] = None - bfd: Annotated[ - Optional[bool], - Field( - description='Enable or disable Bi-forward Forwarding Detection (BFD) with fast failover.', - title='BFD', - ), - ] = None - client: Annotated[ - Optional[bool], - Field( - description='When set to true, all configured and dynamic BGP peers are considered RR clients.', - title='Route Reflector Client', - ), - ] = None - clusterID: Annotated[ - Optional[str], - Field( - description='Enables route reflect client and sets the cluster ID.', - title='Cluster ID', - ), - ] = None - description: Annotated[ - Optional[str], - Field(description='Sets the description on the BGP peer', title='Description'), - ] = None - dynamicNeighbor: Annotated[ - Optional[bool], - Field( - description='When set to true the Interface is added to the dynamic-neighbor list for dynamic peering.', - title='Dynamic Neighbor', - ), - ] = False - dynamicNeighborAllowedPeerAS: Annotated[ - Optional[List[int]], - Field( - description='The autonomous system numbers allowed from peers if dynamic peering is enabled.', - title='Dynamic Neighbor Allowed Peer AS', - ), - ] = None - exportPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes advertised to peers.', - title='Export Policy', - ), - ] = None - grStaleRouteTime: Annotated[ - Optional[int], - Field( - description='Enables Graceful Restart on the peer and sets the stale route time.', - ge=1, - le=3600, - title='GR Stale Route Time', - ), - ] = None - group: Annotated[ - str, - Field( - description='Reference to a BGPGroup. When present this BGP peer will be added to the BGP group', - title='Group', - ), - ] - importPolicy: Annotated[ - Optional[List[str]], - Field( - description='Reference to a Policy CR that will be used to filter routes received from peers.', - title='Import Policy', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to a RoutedInterface or IrbInterface resource whose IP will be used as a source IP for the BGP session.', - title='Interface Reference', - ), - ] - interfaceKind: Annotated[ - Literal['ROUTEDINTERFACE', 'IRBINTERFACE'], - Field( - description='InterfaceReference type defines whether the provided Reference is a RoutedInterface or IrbInterface.', - title='Interface Reference Type', - ), - ] - ipv4Unicast: Annotated[ - Optional[Ipv4UnicastModel], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6UnicastModel], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field( - description='Reference to a Keychain resource that will be used for authentication with the BGP peer.', - title='Keychain', - ), - ] = None - localAS: Annotated[ - Optional[LocalAS], - Field( - description='The local autonomous system number advertised to peers.', - title='Local AS', - ), - ] = None - localPreference: Annotated[ - Optional[int], - Field( - description='Local Preference attribute added to received routes from the BGP peers, also sets local preference for generated routes.', - ge=0, - le=4294967295, - title='Local Preference', - ), - ] = None - multiHopMaxHop: Annotated[ - Optional[int], - Field( - description='Enable multihop for eBGP peers and sets the maximum number of hops allowed.', - ge=1, - le=255, - title='Multihop Max Hop Count', - ), - ] = None - nextHopSelf: Annotated[ - Optional[bool], - Field( - description='When set to true, the next-hop in all IPv4-unicast, IPv6-unicast and EVPN BGP routes advertised to the peer is set to the local-address.', - title='Next Hop Self', - ), - ] = None - node: Annotated[ - Optional[str], - Field( - description='Node on which to configure the BGP peer. This node must be one of the nodes on which the IRBInterface is configured. When left blank or if the node is not part of the IRBInterface, the peer will not be deployed. Ignored for RoutedInterfaces.', - title='Node', - ), - ] = None - peerAS: Annotated[ - Optional[PeerAS], - Field( - description='The autonomous system number expected from peers.', - title='Peer AS', - ), - ] = None - peerIP: Annotated[ - Optional[str], - Field( - description='Peer IP to which the peering session will be established.', - title='Peer IP', - ), - ] = None - sendCommunityLarge: Annotated[ - Optional[bool], - Field( - description='When false, all large (12 byte) BGP communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Large', - ), - ] = None - sendCommunityStandard: Annotated[ - Optional[bool], - Field( - description='When false, all standard (4 byte) communities from all outbound routes advertised to the peer are stripped.', - title='Send Community Standard', - ), - ] = None - sendDefaultRoute: Annotated[ - Optional[SendDefaultRoute], - Field( - description='Options for controlling the generation of default routes towards BGP peers.', - title='Send Default Route', - ), - ] = None - timers: Annotated[ - Optional[Timers], Field(description='Timer configurations', title='Timers') - ] = None - - -class BgpPeer(BaseModel): - name: Annotated[ - str, Field(description='The name of the BgpPeer.', title='BGP Peer Name') - ] - spec: Annotated[ - SpecModel10, - Field(description='Specification of the BgpPeer', title='BGP Peer Spec'), - ] - - -class BgpModel(BaseModel): - bgpGroups: Annotated[ - Optional[List[BgpGroup]], - Field(description='List of BgpGroups. [emits=BGPGroup]', title='BGP Groups'), - ] = None - bgpPeers: Annotated[ - Optional[List[BgpPeer]], - Field(description='List of BgpPeers [emits=BGPPeer]', title='BGP Peers'), - ] = None - - -class BgpModel1(BaseModel): - asPathPrepend: Annotated[ - Optional[int], - Field( - description='AS number to prepend to the AS Path attributes.', - ge=1, - le=4294967295, - title='AS Path Prepend', - ), - ] = None - asPathRemove: Annotated[ - Optional[bool], - Field( - description='Clear the AS path to make it empty.', title='AS Path Remove' - ), - ] = None - asPathReplace: Annotated[ - Optional[List[int]], - Field( - description='Replace the existing AS path with a new AS_SEQUENCE containing the listed AS numbers.', - title='AS Path Replace', - ), - ] = None - localPreference: Annotated[ - Optional[int], - Field( - description='Set a new LOCAL_PREF value for matching BGP routes.', - ge=0, - le=4294967295, - title='Set Local Preference', - ), - ] = None - setOrigin: Annotated[ - Optional[Literal['egp', 'igp', 'incomplete']], - Field( - description='Set a new ORIGIN attribute for matching BGP routes.', - title='Set Origin', - ), - ] = None - - -class DefaultAction(BaseModel): - bgp: Annotated[ - Optional[BgpModel1], - Field(description='Actions related to the BGP protocol.', title='BGP'), - ] = None - policyResult: Annotated[ - Optional[Literal['accept', 'reject']], - Field(description='Final disposition for the route.', title='Policy Result'), - ] = None - - -class Action(BaseModel): - bgp: Annotated[ - Optional[BgpModel1], - Field(description='Actions related to the BGP protocol.', title='BGP'), - ] = None - policyResult: Annotated[ - Optional[Literal['accept', 'reject']], - Field(description='Final disposition for the route.', title='Policy Result'), - ] = None - - -class BgpModel2(BaseModel): - communitySet: Annotated[ - Optional[str], - Field( - description='Match conditions for BGP communities.', title='BGP Community' - ), - ] = None - evpnRouteType: Annotated[ - Optional[List[int]], - Field( - description='Match conditions for EVPN route types.', - title='EVPN Route Type', - ), - ] = None - - -class Match(BaseModel): - bgp: Annotated[ - Optional[BgpModel2], - Field( - description='Configuration for BGP-specific policy match criteria.', - title='BGP', - ), - ] = None - family: Annotated[ - Optional[List[str]], - Field( - description='Address families that the route belongs to.', title='Family' - ), - ] = None - prefixSet: Annotated[ - Optional[str], - Field(description='Reference to a PrefixSet resource.', title='Prefix Set'), - ] = None - protocol: Annotated[ - Optional[ - Literal[ - 'AGGREGATE', - 'ARP_ND', - 'BGP', - 'BGP_EVPN', - 'DHCP', - 'GRIBI', - 'HOST', - 'ISIS', - 'LOCAL', - 'LINUX', - 'NDK1', - 'NDK2', - 'OSPFV2', - 'OSPFV3', - 'STATIC', - ] - ], - Field(description='The route protocol type to match.', title='Protocol'), - ] = None - - -class StatementItem(BaseModel): - action: Annotated[ - Optional[Action], - Field( - description='Actions for routes that match the policy statement.', - title='Action', - ), - ] = None - match: Annotated[ - Optional[Match], - Field(description='Match conditions of the policy statement.', title='Match'), - ] = None - name: Annotated[ - str, Field(description='Name of the policy statement.', title='Name') - ] - - -class SpecModel11(BaseModel): - defaultAction: Annotated[ - Optional[DefaultAction], - Field( - description='The default action to apply if no other actions are defined.', - title='Default Action', - ), - ] = None - statement: Annotated[ - Optional[List[StatementItem]], - Field(description='List of policy statements.', title='Statements'), - ] = None - - -class Policy(BaseModel): - name: Annotated[str, Field(description='Name of the Policy.', title='Policy Name')] - spec: Annotated[ - Optional[SpecModel11], Field(description='A policy', title='Policy Spec') - ] = None - - -class PrefixItemModel(BaseModel): - endRange: Annotated[ - Optional[int], - Field( - description='The end range when using a range to match prefixes.', - ge=0, - le=128, - title='End Range', - ), - ] = None - exact: Annotated[ - Optional[bool], - Field( - description='Indicates if it is an exact match. Ignores the StartRange and EndRange if this param is set.', - title='Exact', - ), - ] = None - prefix: Annotated[ - str, - Field( - description='The IPv4 or IPv6 prefix in CIDR notation with mask.', - title='Prefix', - ), - ] - startRange: Annotated[ - Optional[int], - Field( - description='If specifying a range, this is the start of the range.', - ge=0, - le=128, - title='Start Range', - ), - ] = None - - -class SpecModel12(BaseModel): - prefix: Annotated[ - List[PrefixItemModel], - Field( - description='List of IPv4 or IPv6 prefixes in CIDR notation.', - title='Prefixes', - ), - ] - - -class PrefixSet(BaseModel): - name: Annotated[ - str, Field(description='Name of the PrefixSet.', title='Prefix Set Name') - ] - spec: Annotated[ - Optional[SpecModel12], - Field(description='A PrefixSets', title='Prefix Set Spec'), - ] = None - - -class RoutingPolicies(BaseModel): - policies: Annotated[ - Optional[List[Policy]], - Field(description='List of Policies. [emits=Policy]', title='Policies'), - ] = None - prefixSets: Annotated[ - Optional[List[PrefixSet]], - Field(description='List of PrefixSet [emits=PrefixSet]', title='Prefix Sets'), - ] = None - - -class BfdModel(BaseModel): - enabled: Annotated[ - Optional[bool], - Field( - description='Defines whether BFD should be enabled towards the nexthops.', - title='Enabled', - ), - ] = False - localAddress: Annotated[ - Optional[str], - Field( - description='Defines the local address to use when establishing the BFD session with the nexthop.', - title='Local Address', - ), - ] = None - localDiscriminator: Annotated[ - Optional[int], - Field( - description='Defines the local discriminator.', title='Local Discriminator' - ), - ] = None - remoteDiscriminator: Annotated[ - Optional[int], - Field( - description='Defines the remote discriminator.', - title='Remote Discriminator', - ), - ] = None - - -class Nexthop(BaseModel): - bfd: Annotated[ - Optional[BfdModel], - Field( - description='Enables BFD to the next-hops in the group. This overrides the configuration at the group.', - title='BFD', - ), - ] = None - ipPrefix: Annotated[str, Field(description='Address to use.', title='IP Prefix')] - resolve: Annotated[ - Optional[bool], - Field( - description='If set to true the next-hops can be destinations which are resolved in the route table. This overrides the configuration at the group.', - title='Resolve', - ), - ] = False - - -class NexthopGroup(BaseModel): - bfd: Annotated[ - Optional[BfdModel], - Field( - description='Enables BFD to the next-hops in the group. Local and Remote discriminator parameters have been deprecated at this level. Use Nexthop to set these parameters.', - title='BFD', - ), - ] = None - blackhole: Annotated[ - Optional[bool], - Field( - description='If set to true all traffic destined to the prefixes will be blackholed. If enabled, next-hops are ignored and this takes precedence.', - title='Blackhole', - ), - ] = False - nexthops: Annotated[ - Optional[List[Nexthop]], - Field(description='Ordered list of nexthops.', title='Nexthops'), - ] = None - resolve: Annotated[ - Optional[bool], - Field( - description='If set to true the next-hops can be destinations which are resolved in the route table.', - title='Resolve', - ), - ] = False - - -class SpecModel13(BaseModel): - nexthopGroup: Annotated[ - NexthopGroup, - Field( - description='Group of nexthops for the list of prefixes.', - title='Nexthop Group', - ), - ] - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of nodes on which to configure the static routes. An AND operation is executed against the nodes in this list and the nodes on which the Router is configured to determine the Nodes on which to configure the static routes.', - title='Nodes', - ), - ] = None - preference: Annotated[ - Optional[int], - Field(description='Defines the route preference.', title='Preference'), - ] = None - prefixes: Annotated[ - List[str], - Field( - description='List of destination prefixes and mask to use for the static routes.', - title='Prefixes', - ), - ] - router: Annotated[ - str, - Field( - description='Reference to a Router on which to configure the static routes. If no Nodes are provided then the static routes will be provisioned on all Nodes on which the Router is provisioned.', - title='Router', - ), - ] - - -class StaticRoute(BaseModel): - name: Annotated[ - str, Field(description='Name of the StaticRoute.', title='Static Route Name') - ] - spec: Annotated[ - Optional[SpecModel13], - Field(description='A StaticRoutes', title='Static Route Spec'), - ] = None - - -class Protocols(BaseModel): - bgp: Annotated[ - Optional[BgpModel], Field(description='BGP Protocol.', title='BGP') - ] = None - routingPolicies: Annotated[ - Optional[RoutingPolicies], - Field(description='Routing Policies.', title='Routing Policies'), - ] = None - staticRoutes: Annotated[ - Optional[List[StaticRoute]], - Field( - description='List of Static Routes within this VirtualNetwork. [emits=StaticRoute]', - title='Static Routes', - ), - ] = None - - -class BfdModel1(BaseModel): - desiredMinTransmitInt: Annotated[ - Optional[int], - Field( - description='The minimum interval in microseconds between transmission of BFD control packets.', - ge=10000, - le=100000000, - title='Transmit Interval', - ), - ] = 1000000 - detectionMultiplier: Annotated[ - Optional[int], - Field( - description='The number of packets that must be missed to declare this session as down.', - ge=3, - le=20, - title='Multiplier', - ), - ] = 3 - enabled: Annotated[ - bool, Field(description='Enables Biforward Detection.', title='Enabled') - ] - minEchoReceiveInterval: Annotated[ - Optional[int], - Field( - description='The minimum interval between echo packets the local node can receive.', - ge=250000, - le=100000000, - title='Minimum Echo Receive Interval', - ), - ] = 1000000 - requiredMinReceive: Annotated[ - Optional[int], - Field( - description='The minimum interval in microseconds between received BFD control packets that this system should support.', - ge=10000, - le=100000000, - title='Receive Interval', - ), - ] = 1000000 - - -class SpecModel14(BaseModel): - arpTimeout: Annotated[ - Optional[int], - Field( - description='Duration of time that dynamic ARP entries remain in the ARP cache before they expire.', - title='ARP Timeout', - ), - ] = 14400 - bfd: Annotated[ - Optional[BfdModel1], - Field( - description='Enables BFD on the RoutedInterface.', title='BFD Configuration' - ), - ] = None - description: Annotated[ - Optional[str], - Field( - description='The description of the RoutedInterface.', title='Description' - ), - ] = None - egress: Annotated[ - Optional[Egress], - Field( - description='Manages actions on traffic at Egress.', title='Egress Actions' - ), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field( - description='Manages actions on traffic at Ingress.', - title='Ingress Actions', - ), - ] = None - interface: Annotated[ - str, - Field( - description='Reference to an Interface to use for attachment.', - title='Interface', - ), - ] - ipMTU: Annotated[ - Optional[int], - Field( - description='IP MTU for the RoutedInterface.', - ge=1280, - le=9486, - title='IP MTU', - ), - ] = 1500 - ipv4Addresses: Annotated[ - Optional[List[Ipv4Address]], - Field( - description='List of IPv4 addresses in IP/mask form, e.g., 192.168.0.1/24.', - title='IPv4 Addresses', - ), - ] = None - ipv6Addresses: Annotated[ - Optional[List[Ipv6Address]], - Field( - description='List of IPv6 addresses in IP/mask form, e.g., fc00::1/120.', - title='IPv6 Addresses', - ), - ] = None - ipv6RouterAdvertisement: Annotated[ - Optional[Ipv6RouterAdvertisement], Field(title='IPv6 Router Advertisement') - ] = None - l3ProxyARPND: Annotated[ - Optional[L3ProxyARPND], - Field( - description='L3 Proxy ARP and ND configuration.', title='L3 Proxy ARP/ND' - ), - ] = None - learnUnsolicited: Annotated[ - Optional[Literal['BOTH', 'GLOBAL', 'LINK-LOCAL', 'NONE']], - Field( - description='Enable or disable learning of unsolicited ARPs.', - title='Learn Unsolicited ARPs', - ), - ] = 'NONE' - router: Annotated[str, Field(description='Reference to a Router.', title='Router')] - unnumbered: Annotated[ - Optional[Literal['IPV6']], - Field( - description='Enables the use of unnumbered interfaces on the IRBInterface. If IPv6 is specified, no IP address are configured on the sub-interface and only the link local address will be used. If any IP addresses are specified for either IPv4 or IPv6 that will take precedence and IPs will be assigned to the interfaces. (Deprecated, Use IPv6RouterAdvertisement)', - title='Unnumbered', - ), - ] = None - vlanID: Annotated[ - Optional[str], - Field( - description='Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.', - title='VLAN ID', - ), - ] = 'pool' - vlanPool: Annotated[ - Optional[str], - Field( - description='Reference to a VLAN pool to use for allocations.', - title='VLAN Pool', - ), - ] = 'vlan-pool' - - -class RoutedInterface(BaseModel): - name: Annotated[ - str, - Field( - description='The name of the RoutedInterface.', - title='Routed Interface Name', - ), - ] - spec: Annotated[ - SpecModel14, - Field( - description='Specification of the RoutedInterface', - title='Routed Interface Spec', - ), - ] - - -class Ipv4UnicastModel1(BaseModel): - advertiseIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables advertisement of IPv4 Unicast routes with IPv6 next-hops to peers.', - title='Advertise IPv6 Next Hops', - ), - ] = None - enabled: Annotated[ - bool, Field(description='Enables the IPv4 unicast AFISAFI.', title='Enabled') - ] - multipath: Annotated[ - Optional[Multipath], Field(description='Enable multipath.', title='Multipath') - ] = None - receiveIPV6NextHops: Annotated[ - Optional[bool], - Field( - description='Enables the advertisement of the RFC 5549 capability to receive IPv4 routes with IPv6 next-hops.', - title='Receive IPv6 Next Hops', - ), - ] = None - - -class Ipv6UnicastModel1(BaseModel): - enabled: Annotated[ - bool, Field(description='Enables the IPv6 unicast AFISAFI', title='Enabled') - ] - multipath: Annotated[ - Optional[Multipath], Field(description='Enable multipath', title='Multipath') - ] = None - - -class BgpModel3(BaseModel): - autonomousSystem: Annotated[ - Optional[int], - Field( - description='Autonomous System number for BGP.', - ge=1, - le=4294967295, - title='Autonomous System', - ), - ] = None - ebgpPreference: Annotated[ - Optional[int], - Field( - description='Preference to be set for eBGP [default=170].', - ge=1, - le=255, - title='eBGP Preference', - ), - ] = 170 - enabled: Annotated[ - Optional[bool], Field(description='Enable or disable BGP.', title='Enable BGP') - ] = False - ibgpPreference: Annotated[ - Optional[int], - Field( - description='Preference to be set for iBGP [default=170].', - ge=1, - le=255, - title='iBGP Preference', - ), - ] = 170 - ipAliasNexthops: Annotated[ - Optional[List[IpAliasNexthop]], - Field(description='IP aliasing configuration.', title='IP Alias Nexthops'), - ] = None - ipv4Unicast: Annotated[ - Optional[Ipv4UnicastModel1], - Field( - description='Parameters relating to the IPv4 unicast AFI/SAFI.', - title='IPv4 Unicast', - ), - ] = None - ipv6Unicast: Annotated[ - Optional[Ipv6UnicastModel1], - Field( - description='Parameters relating to the IPv6 unicast AFI/SAFI.', - title='IPv6 Unicast', - ), - ] = None - keychain: Annotated[ - Optional[str], - Field(description='Keychain to be used for authentication', title='Keychain'), - ] = None - minWaitToAdvertise: Annotated[ - Optional[int], - Field( - description='Minimum wait time before advertising routes post BGP restart.', - ge=0, - le=3600, - title='Min Wait To Advertise Time', - ), - ] = 0 - rapidWithdrawl: Annotated[ - Optional[bool], - Field( - description='Enable rapid withdrawal in BGP.', - title='Enable Rapid Withdrawal', - ), - ] = True - waitForFIBInstall: Annotated[ - Optional[bool], - Field( - description='Wait for FIB installation before advertising routes.', - title='Wait for FIB Installation', - ), - ] = False - - -class PrefixItemModel1(BaseModel): - hashBucketsPerPath: Annotated[ - int, - Field( - description='The number of times each next-hop is repeated in the fill pattern if there are max-paths ECMP next-hops.', - ge=1, - le=32, - title='Max Paths', - ), - ] - maxECMP: Annotated[ - int, - Field( - description='The maximum number of ECMP next-hops per route associated with the resilient-hash prefix.', - ge=1, - le=64, - title='Max ECMP', - ), - ] - prefix: Annotated[ - str, - Field( - description='IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.', - title='Prefix', - ), - ] - - -class SpecModel15(BaseModel): - bgp: Annotated[ - Optional[BgpModel3], - Field(description='BGP configuration.', title='BGP Configuration'), - ] = None - description: Annotated[ - Optional[str], - Field(description='The description of the Router.', title='Description'), - ] = None - evi: Annotated[ - Optional[int], - Field( - description='EVI for the Router; leave blank for auto-allocation from EVI pool.', - ge=1, - le=65535, - title='EVI', - ), - ] = None - eviPool: Annotated[ - Optional[str], - Field( - description='Reference to EVI pool for auto-allocation.', - title='EVI Allocation Pool', - ), - ] = 'evi-pool' - exportTarget: Annotated[ - Optional[str], - Field( - description='Export route target in \'target:N:N\' format, if not specified, the default value taken as "target:1:".', - pattern='^target.*$', - title='Export Target', - ), - ] = None - importTarget: Annotated[ - Optional[str], - Field( - description='Import route target in \'target:N:N\' format, if not specified, the default value taken as "target:1:".', - pattern='^target.*$', - title='Import Target', - ), - ] = None - ipLoadBalancing: Annotated[ - Optional[IpLoadBalancing], - Field( - description='IPv4 or IPv6 prefix. Active routes in the FIB that exactly match this prefix or that are longer matches of this prefix are provided with resilient-hash programming.', - title='Prefix', - ), - ] = None - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Node selectors for deployment constraints. If Nodes are selected, the Router will only be deployed on the Nodes selected, if left blank it will be deployed on all Nodes for which there are IRB or RoutedInterfaces referencing this Router.', - title='Node Selector', - ), - ] = None - routeLeaking: Annotated[ - Optional[RouteLeaking], - Field( - description='Route leaking controlled by routing policies in and out of the DefaultRouter.', - title='Route Leaking', - ), - ] = None - routerID: Annotated[ - Optional[str], Field(description='Router ID.', title='Router ID') - ] = None - tunnelIndexPool: Annotated[ - Optional[str], - Field( - description='Reference to tunnel index allocation pool.', - title='Tunnel Index Pool', - ), - ] = 'tunnel-index-pool' - type: Annotated[ - Optional[Literal['SIMPLE', 'EVPNVXLAN']], - Field( - description="Select the type of Router. Simple doesn't include any overlay control plane or dataplane properties (EVPN/VXLAN). EVPNVXLAN includes the properties needed to provision this Router over an IP Fabric.", - title='Type', - ), - ] = 'EVPNVXLAN' - vni: Annotated[ - Optional[int], - Field( - description='VNI for the Router; leave blank for auto-allocation from VNI pool.', - ge=1, - le=16777215, - title='VNI', - ), - ] = None - vniPool: Annotated[ - Optional[str], - Field( - description='Reference to VNI pool for auto-allocation.', - title='VNI Allocation Pool', - ), - ] = 'vni-pool' - - -class Router(BaseModel): - name: Annotated[ - str, Field(description='The name of the Router.', title='Router Name') - ] - spec: Annotated[ - SpecModel15, - Field(description='Specification of the Router', title='Router Spec'), - ] - - -class SpecModel16(BaseModel): - bridgeDomain: Annotated[ - str, - Field( - description='Reference to a BridgeDomain or SimpleBridgeDomain.', - title='Bridge Domain', - ), - ] - description: Annotated[ - Optional[str], - Field(description='The description of the VLAN.', title='Description'), - ] = None - egress: Annotated[ - Optional[Egress], - Field(description='Manages actions on traffic at Egress.', title='Egress'), - ] = None - ingress: Annotated[ - Optional[Ingress], - Field(description='Manages actions on traffic at Ingress.', title='Ingress'), - ] = None - interfaceSelector: Annotated[ - List[str], - Field( - description='Interfaces to use for attachment to this VLAN based on the label selector. Selects Interfaces based on their associated labels.', - title='Interface Selector', - ), - ] - l2MTU: Annotated[ - Optional[int], - Field( - description='L2 MTU specifies the maximum sized Ethernet frame that can be transmitted on the subinterface. If a frame exceeds this size it is discarded. If the l2-mtu of the subinterface exceeds the port-mtu of the associated interface, the subinterface will remain operationally down.', - ge=1450, - le=9500, - title='L2 MTU', - ), - ] = None - macDuplicationDetectionAction: Annotated[ - Optional[ - Literal['Blackhole', 'OperDown', 'StopLearning', 'UseBridgeDomainAction'] - ], - Field( - description='If Mac Duplication Detection is enabled on the associated Bridge Domain, this property will override the MDD action set in the BridgeDomain.', - title='MAC Duplication Detection Action', - ), - ] = None - splitHorizonGroup: Annotated[ - Optional[str], - Field( - description='Name of the Split Horizon Group to be used for this VLAN. All subinterfaces within this VLAN will be members of this Split Horizon Group.', - title='Split Horizon Group', - ), - ] = None - uplink: Annotated[ - Optional[Uplink], - Field( - description='The Uplink between your access breakout switch and your leaf switch.', - title='Uplink', - ), - ] = None - vlanID: Annotated[ - Optional[str], - Field( - description='Single value between 1-4094 support, ranges supported in the format x-y,x-y, or the special keyword null, any, untagged or pool for auto allocation.', - title='VLAN ID', - ), - ] = 'pool' - vlanPool: Annotated[ - Optional[str], - Field( - description='Reference to a VLAN pool to use for allocations. [default="vlan-pool"]', - title='VLAN Pool', - ), - ] = None - - -class Vlan(BaseModel): - name: Annotated[str, Field(description='The name of the VLAN.', title='VLAN Name')] - spec: Annotated[ - SpecModel16, Field(description='Specification of the Vlan', title='VLAN Spec') - ] - - -class SpecModel17(BaseModel): - bridgeDomains: Annotated[ - Optional[List[BridgeDomain]], - Field( - description='List of Subnets. [emits=BridgeDomain]', title='Bridge Domains' - ), - ] = None - bridgeInterfaces: Annotated[ - Optional[List[BridgeInterface]], - Field( - description='List of BridgeInterfaces. [emits=BridgeInterface]', - title='Bridge Interfaces', - ), - ] = None - irbInterfaces: Annotated[ - Optional[List[IrbInterface]], - Field( - description='List of IRBInterfaces. [emits=IRBInterface]', - title='IRB Interfaces', - ), - ] = None - protocols: Annotated[ - Optional[Protocols], - Field(description='Protocols to configure.', title='Protocols'), - ] = None - routedInterfaces: Annotated[ - Optional[List[RoutedInterface]], - Field( - description='List of RoutedInterface. [emits=RoutedInterface]', - title='Routed Interfaces', - ), - ] = None - routers: Annotated[ - Optional[List[Router]], - Field(description='List of Routers.[emits=Router]', title='Routers'), - ] = None - vlans: Annotated[ - Optional[List[Vlan]], - Field(description='List of VLANs. [emits=VLAN]', title='VLAN'), - ] = None - - -class Status1Model5(BaseModel): - health: Annotated[ - Optional[int], - Field(description='Indicates the health score of the VNET.', title='Health'), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score.', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed.', - title='Last Change', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of Nodes on which the Router is deployed.', title='Nodes' - ), - ] = None - numBGPPeers: Annotated[ - Optional[int], - Field( - description='Total number of configured BGP Peers.', - title='Number of BGP Peers', - ), - ] = None - numBGPPeersOperDown: Annotated[ - Optional[int], - Field( - description='Total Number of BGP Peer operationally down.', - title='Number of BGP Peers Oper Down', - ), - ] = None - numIRBInterfaces: Annotated[ - Optional[int], - Field( - description='Total number of irb-interfaces configured by the VNET.', - title='Number of IRB Interfaces', - ), - ] = None - numIRBInterfacesOperDown: Annotated[ - Optional[int], - Field( - description='Total number of irb-interfaces configured by the VNET which are oper-down.', - title='Number of IRB Interfaces Oper Down', - ), - ] = None - numNodes: Annotated[ - Optional[int], - Field( - description='Total number of Nodes on which the VNET is configured.', - title='Number of Nodes', - ), - ] = None - numRoutedInterfaces: Annotated[ - Optional[int], - Field( - description='Total number of routed-interfaces configured by the VNET.', - title='Number of Routed Interfaces', - ), - ] = None - numRoutedInterfacesOperDown: Annotated[ - Optional[int], - Field( - description='Total number of routed-interfaces configured by the VNET which are oper-down.', - title='Number of Routed Interfaces Oper Down', - ), - ] = None - numSubInterfaces: Annotated[ - Optional[int], - Field( - description='Total number of sub-interfaces configured by the VNET.', - title='Number of Sub Interfaces', - ), - ] = None - numSubInterfacesOperDown: Annotated[ - Optional[int], - Field( - description='Total number of sub-interfaces configured by the VNET which are oper-down.', - title='Number of Sub Interfaces Oper Down', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field(description='Operational state of the VNET.', title='Operational State'), - ] = None - - -class VirtualNetworkDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class VirtualNetworkDeletedResources( - RootModel[List[VirtualNetworkDeletedResourceEntry]] -): - root: List[VirtualNetworkDeletedResourceEntry] - - -class VirtualNetworkMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class BridgeDomainModel(BaseModel): - apiVersion: str - kind: str - metadata: BridgeDomainMetadata - spec: Annotated[ - Spec, - Field( - description='The BridgeDomain enables the configuration and management of Layer 2 virtual networks. It includes settings for VNI, EVI, route targets for import and export, and tunnel index allocation. Additionally, the specification allows for advanced features such as MAC address table limits, aging, Proxy ARP and detection of MAC and IP duplication.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='BridgeDomainStatus defines the observed state of BridgeDomain', - title='Status', - ), - ] = None - - -class BridgeDomainList(BaseModel): - apiVersion: str - items: Optional[List[BridgeDomainModel]] = None - kind: str - - -class BridgeInterfaceModel(BaseModel): - apiVersion: str - kind: str - metadata: BridgeInterfaceMetadata - spec: Annotated[ - SpecModel, - Field( - description='The BridgeInterface enables the attachment of network interfaces to a Bridge Domain. It includes settings for VLAN ID allocation, interface attachment, and actions on ingress and egress traffic. The specification supports integration with other network resources, such as Bridge Domains and Interfaces, and provides advanced features like MAC Duplication Detection with configurable actions.', - title='Specification', - ), - ] - status: Annotated[Optional[Status1Model], Field(title='Status')] = None - - -class BridgeInterfaceList(BaseModel): - apiVersion: str - items: Optional[List[BridgeInterfaceModel]] = None - kind: str - - -class DHCPRelay(BaseModel): - apiVersion: str - kind: str - metadata: DHCPRelayMetadata - spec: Annotated[ - SpecModel1, - Field( - description='The DHCPRelay enables the forwarding of DHCP requests and responses between clients and servers across different networks. This resource allows for the configuration of various DHCP relay sub-options, such as CircuitID, RemoteID, and ClientLinkLayerAddress, to provide detailed client information. It also includes settings for specifying the router to reach the DHCP server, the list of DHCP servers to forward requests to, and selectors for Routed and IRB interfaces where the relay will be configured. Additionally, the GI Address option can be set to derive the Gateway IP address from the selected interface, ensuring correct routing of DHCP messages.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='DHCPRelayStatus defines the observed state of DHCPRelay', - title='Status', - ), - ] = None - - -class DHCPRelayList(BaseModel): - apiVersion: str - items: Optional[List[DHCPRelay]] = None - kind: str - - -class IRBInterface(BaseModel): - apiVersion: str - kind: str - metadata: IRBInterfaceMetadata - spec: Annotated[ - SpecModel2, - Field( - description='The IRBInterface enables the configuration and management of Layer 3 interfaces associated with a BridgeDomain. This resource allows for the specification of various parameters, including IP MTU, learning of unsolicited ARPs, IPv4 and IPv6 addresses, and unnumbered interface settings. It also supports advanced features such as BFD configuration, Virtual IP discovery, and ARP/ND-related settings like Proxy ARP/ND and EVPN route advertisement.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model1], - Field( - description='IRBInterfaceStatus defines the observed state of IRBInterface', - title='Status', - ), - ] = None - - -class IRBInterfaceList(BaseModel): - apiVersion: str - items: Optional[List[IRBInterface]] = None - kind: str - - -class RoutedInterfaceModel(BaseModel): - apiVersion: str - kind: str - metadata: RoutedInterfaceMetadata - spec: Annotated[ - SpecModel3, - Field( - description='The RoutedInterface enables the configuration and management of Layer 3 interfaces for routing traffic between different networks. This resource allows for specifying an underlying Interface and Router, configuring VLAN IDs, and setting the IP MTU. It also supports the learning of unsolicited ARPs, defining both IPv4 and IPv6 addresses, and enabling unnumbered interfaces. Advanced features such as BFD configuration, Proxy ARP/ND, and ARP timeout settings are included to ensure robust and efficient routing.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model2], - Field( - description='RoutedInterfaceStatus defines the observed state of RoutedInterface', - title='Status', - ), - ] = None - - -class RoutedInterfaceList(BaseModel): - apiVersion: str - items: Optional[List[RoutedInterfaceModel]] = None - kind: str - - -class RouterModel(BaseModel): - apiVersion: str - kind: str - metadata: RouterMetadata - spec: Annotated[ - SpecModel4, - Field( - description='The Router enables the configuration and management of routing functions within a network. This resource allows for setting a unique Router ID, configuring VNIs and EVIs with options for automatic allocation, and defining import and export route targets. It also includes advanced configuration options such as BGP settings, including autonomous system numbers, AFI/SAFI options, and route advertisement preferences. Node selectors can be used to constrain the deployment of the router to specific nodes within the network.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status1Model3], - Field( - description='RouterStatus defines the observed state of Router', - title='Status', - ), - ] = None - - -class RouterList(BaseModel): - apiVersion: str - items: Optional[List[RouterModel]] = None - kind: str - - -class VLAN(BaseModel): - apiVersion: str - kind: str - metadata: VLANMetadata - spec: Annotated[ - SpecModel5, - Field( - description='The VLAN enables the configuration and management of VLAN and their association with BridgeDomains. This resource allows for specifying the associated BridgeDomain, selecting interfaces based on label selectors, and configuring VLAN IDs with options for auto-allocation from a VLAN pool. It also supports advanced configurations such as ingress and egress traffic management, and overrides for MAC Duplication Detection actions when enabled in the associated BridgeDomain.', - title='Specification', - ), - ] - status: Annotated[Optional[Status1Model4], Field(title='Status')] = None - - -class VLANList(BaseModel): - apiVersion: str - items: Optional[List[VLAN]] = None - kind: str - - -class VirtualNetwork(BaseModel): - apiVersion: str - kind: str - metadata: VirtualNetworkMetadata - spec: Annotated[ - SpecModel17, - Field( - description='VirtualNetworkSpec defines the desired state of VirtualNetwork', - title='Specification', - ), - ] - status: Annotated[Optional[Status1Model5], Field(title='Status')] = None - - -class VirtualNetworkList(BaseModel): - apiVersion: str - items: Optional[List[VirtualNetwork]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/siteinfo/__init__.py b/pydantic_eda/com/nokia/eda/siteinfo/__init__.py deleted file mode 100644 index 9924993..0000000 --- a/pydantic_eda/com/nokia/eda/siteinfo/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/siteinfo.eda.nokia.com/v1alpha1/siteinfo.json -# timestamp: 2025-05-07T11:44:18+00:00 diff --git a/pydantic_eda/com/nokia/eda/siteinfo/v1alpha1.py b/pydantic_eda/com/nokia/eda/siteinfo/v1alpha1.py deleted file mode 100644 index dac8531..0000000 --- a/pydantic_eda/com/nokia/eda/siteinfo/v1alpha1.py +++ /dev/null @@ -1,100 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/siteinfo.eda.nokia.com/v1alpha1/siteinfo.json -# timestamp: 2025-05-07T11:44:18+00:00 - -from __future__ import annotations - -from typing import Annotated, Dict, List, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Spec(BaseModel): - loginBanner: Annotated[ - Optional[str], - Field( - description='This is the login banner displayed before a user has logged into the Node.', - title='Login Banner', - ), - ] = None - motd: Annotated[ - Optional[str], - Field( - description='This is the MOTD banner displayed after a user has logged into the Node.', - title='MOTD', - ), - ] = None - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Labe selector to select nodes on which to configure the banners.', - title='Node Selector', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of nodes on which to configure the banners.', - title='Nodes', - ), - ] = None - - -class Status(BaseModel): - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of nodes this banner has been applied to', title='Nodes' - ), - ] = None - - -class BannerDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class BannerDeletedResources(RootModel[List[BannerDeletedResourceEntry]]): - root: List[BannerDeletedResourceEntry] - - -class BannerMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Banner(BaseModel): - apiVersion: str - kind: str - metadata: BannerMetadata - spec: Annotated[ - Spec, - Field( - description='BannerSpec allows the configuration of login and MOTD (Message of the Day) banners on selected nodes. The banners can be applied to specific nodes or selected using label selectors.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='BannerStatus defines the observed state of Banner', - title='Status', - ), - ] = None - - -class BannerList(BaseModel): - apiVersion: str - items: Optional[List[Banner]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/system/__init__.py b/pydantic_eda/com/nokia/eda/system/__init__.py deleted file mode 100644 index 142b419..0000000 --- a/pydantic_eda/com/nokia/eda/system/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/system.eda.nokia.com/v1alpha1/system.json -# timestamp: 2025-05-07T11:44:22+00:00 diff --git a/pydantic_eda/com/nokia/eda/system/v1alpha1.py b/pydantic_eda/com/nokia/eda/system/v1alpha1.py deleted file mode 100644 index cf4dd0e..0000000 --- a/pydantic_eda/com/nokia/eda/system/v1alpha1.py +++ /dev/null @@ -1,339 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/system.eda.nokia.com/v1alpha1/system.json -# timestamp: 2025-05-07T11:44:22+00:00 - -from __future__ import annotations - -from typing import Annotated, Any, Dict, List, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Utilization(BaseModel): - criticalThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a critical alarm.\nThis value must be greater than the majorThreshold.', - ge=1, - le=100, - title='Critical Threshold', - ), - ] = 95 - fallingDelta: Annotated[ - Optional[int], - Field( - description='The delta in which a triggered threshold must drop below to clear an alarm.\nFor example, with a criticalThreshold of 90 and a fallingDelta of 5, the critical alarm will clear when the utilization drops below 85.', - ge=1, - le=25, - title='Falling Delta', - ), - ] = 5 - majorThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a major alarm.\nThis value must be greater than the minorThreshold.', - ge=1, - le=100, - title='Major Threshold', - ), - ] = 90 - minorThreshold: Annotated[ - Optional[int], - Field( - description='The minimum average utilization over the last 1 minute to trigger a minor alarm.', - ge=1, - le=100, - title='Minor Threshold', - ), - ] = 80 - - -class Cpu(BaseModel): - enabled: Annotated[ - bool, Field(description='Enable or disable CPU monitoring.', title='Enabled') - ] - utilization: Annotated[ - Optional[Utilization], - Field( - description='Parameters relating to CPU utilization monitoring.', - title='Thresholds', - ), - ] = None - - -class Disk(BaseModel): - enabled: Annotated[ - bool, Field(description='Enable or disable disk monitoring.', title='Enabled') - ] - utilization: Annotated[ - Optional[Utilization], - Field( - description='Parameters relating to disk utilization monitoring.', - title='Thresholds', - ), - ] = None - - -class Memory(BaseModel): - enabled: Annotated[ - bool, Field(description='Enable or disable memory monitoring.', title='Enabled') - ] - utilization: Annotated[ - Optional[Utilization], - Field( - description='Parameters relating to memory utilization monitoring.', - title='Thresholds', - ), - ] = None - - -class Spec(BaseModel): - cpu: Annotated[ - Optional[Cpu], - Field( - description='CPU monitoring for targets matching this Monitor.', title='CPU' - ), - ] = None - disk: Annotated[ - Optional[Disk], - Field( - description='Disk monitoring for targets matching this Monitor.', - title='Disk', - ), - ] = None - memory: Annotated[ - Optional[Memory], - Field( - description='Memory monitoring for targets matching this Monitor.', - title='Memory', - ), - ] = None - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Selector to use when including TopoNodes to monitor.', - title='Node Selector', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field(description='References to TopoNodes to monitor.', title='Nodes'), - ] = None - - -class Status(BaseModel): - nodes: Annotated[ - Optional[List[str]], - Field(description='TopoNodes being monitored.', title='Nodes'), - ] = None - - -class SpecModel(BaseModel): - nodes: Annotated[ - Optional[List[str]], - Field( - description='List of TopoNodes monitored by this instance', title='Nodes' - ), - ] = None - - -class MonitorAggregateStateDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class MonitorAggregateStateDeletedResources( - RootModel[List[MonitorAggregateStateDeletedResourceEntry]] -): - root: List[MonitorAggregateStateDeletedResourceEntry] - - -class MonitorAggregateStateMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class MonitorSpec(BaseModel): - cpu: Annotated[ - Optional[Cpu], - Field( - description='CPU monitoring for targets matching this Monitor.', title='CPU' - ), - ] = None - disk: Annotated[ - Optional[Disk], - Field( - description='Disk monitoring for targets matching this Monitor.', - title='Disk', - ), - ] = None - memory: Annotated[ - Optional[Memory], - Field( - description='Memory monitoring for targets matching this Monitor.', - title='Memory', - ), - ] = None - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Selector to use when including TopoNodes to monitor.', - title='Node Selector', - ), - ] = None - nodes: Annotated[ - Optional[List[str]], - Field(description='References to TopoNodes to monitor.', title='Nodes'), - ] = None - - -class SpecModel1(BaseModel): - monitorSpec: Annotated[ - MonitorSpec, Field(description='The spec of the input Monitor') - ] - node: Annotated[str, Field(description='Reference to the TopoNode being monitored')] - operatingSystem: Annotated[ - str, Field(description='The operating system of the TopoNode being monitored') - ] - version: Annotated[ - str, Field(description='The version of the TopoNode being monitored') - ] - - -class MonitorStateDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class MonitorStateDeletedResources(RootModel[List[MonitorStateDeletedResourceEntry]]): - root: List[MonitorStateDeletedResourceEntry] - - -class MonitorStateMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class MonitorDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class MonitorDeletedResources(RootModel[List[MonitorDeletedResourceEntry]]): - root: List[MonitorDeletedResourceEntry] - - -class MonitorMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class Monitor(BaseModel): - apiVersion: str - kind: str - metadata: MonitorMetadata - spec: Annotated[ - Spec, - Field( - description='MonitorSpec defines the desired state of Monitor', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='MonitorStatus defines the observed state of Monitor', - title='Status', - ), - ] = None - - -class MonitorAggregateState(BaseModel): - apiVersion: str - kind: str - metadata: MonitorAggregateStateMetadata - spec: Annotated[ - SpecModel, - Field( - description='MonitorAggregateStateSpec defines the desired state of MonitorAggregateState', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='MonitorAggregateStateStatus defines the observed state of MonitorAggregateState', - title='Status', - ), - ] = None - - -class MonitorAggregateStateList(BaseModel): - apiVersion: str - items: Optional[List[MonitorAggregateState]] = None - kind: str - - -class MonitorList(BaseModel): - apiVersion: str - items: Optional[List[Monitor]] = None - kind: str - - -class MonitorState(BaseModel): - apiVersion: str - kind: str - metadata: MonitorStateMetadata - spec: Annotated[ - SpecModel1, - Field( - description='MonitorStateSpec defines the desired state of MonitorState', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='MonitorStateStatus defines the observed state of MonitorState', - title='Status', - ), - ] = None - - -class MonitorStateList(BaseModel): - apiVersion: str - items: Optional[List[MonitorState]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/timing/__init__.py b/pydantic_eda/com/nokia/eda/timing/__init__.py deleted file mode 100644 index 4dcd91b..0000000 --- a/pydantic_eda/com/nokia/eda/timing/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/timing.eda.nokia.com/v1alpha1/timing.json -# timestamp: 2025-05-07T11:44:25+00:00 diff --git a/pydantic_eda/com/nokia/eda/timing/v1alpha1.py b/pydantic_eda/com/nokia/eda/timing/v1alpha1.py deleted file mode 100644 index 9baad79..0000000 --- a/pydantic_eda/com/nokia/eda/timing/v1alpha1.py +++ /dev/null @@ -1,175 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/timing.eda.nokia.com/v1alpha1/timing.json -# timestamp: 2025-05-07T11:44:25+00:00 - -from __future__ import annotations - -from datetime import date -from typing import Annotated, Dict, List, Literal, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Server(BaseModel): - iBurst: Annotated[ - Optional[bool], - Field( - description='Indicates whether this server should enable burst synchronization or not', - title='Enable iBurst', - ), - ] = None - preferred: Annotated[ - Optional[bool], - Field( - description='Indicates whether this server should be preferred or not', - title='Preferred Server', - ), - ] = None - server: Annotated[ - str, - Field( - description='An NTP server can either be an IP address or an FQDN', - title='Server', - ), - ] - - -class Spec(BaseModel): - router: Annotated[ - Optional[str], - Field(description='Router used to reach the NTP servers.', title='Router'), - ] = None - routerKind: Annotated[ - Literal['MANAGEMENTROUTER', 'ROUTER', 'DEFAULTROUTER'], - Field( - description='the Kind of the router used to reach the NTP servers.', - title='Router Kind', - ), - ] - routerSelector: Annotated[ - Optional[List[str]], - Field( - description='Selects router resources based on the defined KIND. Applies to DefaultRouter only. Not supported for Router and ManagementRouter.', - title='Router Selector', - ), - ] = None - servers: Annotated[ - List[Server], - Field( - description='A list of NTP servers, each entry in the list can either be an IP address or an FQDN.', - title='Servers', - ), - ] - sourceInterface: Annotated[ - Optional[str], - Field( - description='Specifies a Interface resource to use as a source of NTP traffic. If none is specified the Node default behavior is used.', - title='Source Interface', - ), - ] = None - sourceInterfaceKind: Annotated[ - Optional[Literal['IRB', 'ROUTED', 'DEFAULT', 'SYSTEM']], - Field( - description='Specifies the source interface Kind to use as a source of NTP traffic.', - title='Source Interface Kind', - ), - ] = None - - -class Node(BaseModel): - node: Annotated[str, Field(description='Reference to Node object', title='Node')] - operatingSystem: Annotated[ - str, Field(description='Operating System of the Node', title='Operating System') - ] - synchronized: Annotated[ - Optional[str], - Field(description='Synchronized state of the Node', title='Synchronized'), - ] = None - - -class Status(BaseModel): - health: Annotated[ - Optional[int], - Field( - description='Indicates the health score of the NTPClient', - title='Health Score', - ), - ] = None - healthScoreReason: Annotated[ - Optional[str], - Field( - description='Indicates the reason for the health score', - title='Health Score Reason', - ), - ] = None - lastChange: Annotated[ - Optional[date], - Field( - description='The time when the state of the resource last changed', - title='Last Change', - ), - ] = None - nodes: Annotated[ - Optional[List[Node]], - Field( - description='List of nodes which are not synchronized', - title='Unsynchronized Nodes', - ), - ] = None - operationalState: Annotated[ - Optional[str], - Field( - description='Operational state of the NTPClient', title='Operational State' - ), - ] = None - - -class NTPClientDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - namespace: Optional[str] = None - transactionId: Optional[int] = None - - -class NTPClientDeletedResources(RootModel[List[NTPClientDeletedResourceEntry]]): - root: List[NTPClientDeletedResourceEntry] - - -class NTPClientMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - namespace: str - - -class NTPClient(BaseModel): - apiVersion: str - kind: str - metadata: NTPClientMetadata - spec: Annotated[ - Spec, - Field( - description='The NTP client allows for configuring NTP servers and the source of NTP traffic in order for the devices to synchronize their clocks.', - title='Specification', - ), - ] - status: Annotated[ - Optional[Status], - Field( - description='NTPClientStatus defines the observed state of NTPClient', - title='Status', - ), - ] = None - - -class NTPClientList(BaseModel): - apiVersion: str - items: Optional[List[NTPClient]] = None - kind: str diff --git a/pydantic_eda/com/nokia/eda/topologies/__init__.py b/pydantic_eda/com/nokia/eda/topologies/__init__.py deleted file mode 100644 index f4ab115..0000000 --- a/pydantic_eda/com/nokia/eda/topologies/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/topologies.eda.nokia.com/v1alpha1/topologies.json -# timestamp: 2025-05-07T11:44:28+00:00 diff --git a/pydantic_eda/com/nokia/eda/topologies/v1alpha1.py b/pydantic_eda/com/nokia/eda/topologies/v1alpha1.py deleted file mode 100644 index ad011bc..0000000 --- a/pydantic_eda/com/nokia/eda/topologies/v1alpha1.py +++ /dev/null @@ -1,682 +0,0 @@ -# generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/apps/topologies.eda.nokia.com/v1alpha1/topologies.json -# timestamp: 2025-05-07T11:44:28+00:00 - -from __future__ import annotations - -from typing import Annotated, Any, Dict, List, Optional - -from pydantic import BaseModel, Field, RootModel - - -class Topology(BaseModel): - group: Annotated[ - str, - Field( - description='The group of the application which published the topology this overlay is extending.', - title='Group', - ), - ] - name: Annotated[ - str, - Field( - description='The name of the resource which published the topology this overlay is extending.', - title='Name', - ), - ] - version: Annotated[ - str, - Field( - description='The version of the application which published the topology this overlay is extending.', - title='Version', - ), - ] - - -class Spec(BaseModel): - enabled: Annotated[ - bool, - Field( - description='Enable or disable the generation of the status of this overlay', - title='Enabled', - ), - ] - topology: Annotated[ - Topology, - Field( - description='Reference to the topology that this overlay is extending.', - title='Topology', - ), - ] - uiDescription: Annotated[ - Optional[str], - Field( - description='A description of the overlay to expose in the UI', - title='UI Description', - ), - ] = None - uiDescriptionKey: Annotated[ - Optional[str], - Field( - description='The translation key for the description of the overlay to expose in the UI', - title='UI Description Key', - ), - ] = None - uiName: Annotated[ - Optional[str], - Field( - description='The name of the overlay to expose in the UI', title='UI Name' - ), - ] = None - uiNameKey: Annotated[ - Optional[str], - Field( - description='The translation key for the name of the overlay to expose in the UI', - title='UI Name Key', - ), - ] = None - - -class CPUUtilOverlayDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class CPUUtilOverlayDeletedResources( - RootModel[List[CPUUtilOverlayDeletedResourceEntry]] -): - root: List[CPUUtilOverlayDeletedResourceEntry] - - -class CPUUtilOverlayMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class DeviationOverlayDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class DeviationOverlayDeletedResources( - RootModel[List[DeviationOverlayDeletedResourceEntry]] -): - root: List[DeviationOverlayDeletedResourceEntry] - - -class DeviationOverlayMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class DiskOverlayDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class DiskOverlayDeletedResources(RootModel[List[DiskOverlayDeletedResourceEntry]]): - root: List[DiskOverlayDeletedResourceEntry] - - -class DiskOverlayMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class LldpOverlayDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class LldpOverlayDeletedResources(RootModel[List[LldpOverlayDeletedResourceEntry]]): - root: List[LldpOverlayDeletedResourceEntry] - - -class LldpOverlayMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class MemoryOverlayDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class MemoryOverlayDeletedResources(RootModel[List[MemoryOverlayDeletedResourceEntry]]): - root: List[MemoryOverlayDeletedResourceEntry] - - -class MemoryOverlayMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class Overlay(BaseModel): - enabled: Annotated[ - bool, - Field( - description='Enable or disable the generation of the status of this overlay', - title='Enabled', - ), - ] - key: Annotated[ - str, - Field( - description='A unique key for identifying this overlay within the topology. This is used internally\nonly.', - title='Key', - ), - ] - - -class SpecModel(BaseModel): - enabled: Annotated[ - bool, - Field( - description='Enable or disable the generation of the status of this topology', - title='Enabled', - ), - ] - endpointSubtitle: Annotated[ - Optional[str], - Field( - description='Override the subtitle to show for endpoints in the topology', - title='Endpoint Subtitle', - ), - ] = None - linkSubtitle: Annotated[ - Optional[str], - Field( - description='Override the subtitle to show for links in the topology', - title='Link Subtitle', - ), - ] = None - nodeSubtitle: Annotated[ - Optional[str], - Field( - description='Override the subtitle to show for nodes in the topology', - title='Node Subtitle', - ), - ] = None - overlays: Annotated[ - List[Overlay], - Field( - description='The set of overlays supported with this topology', - title='Overlays', - ), - ] - uiDescription: Annotated[ - Optional[str], - Field( - description='A description of the topology to expose in the UI', - title='UI Description', - ), - ] = None - uiDescriptionKey: Annotated[ - Optional[str], - Field( - description='The translation key for the description of the topology to expose in the UI', - title='UI Description Key', - ), - ] = None - uiName: Annotated[ - Optional[str], - Field( - description='The name of the topology to expose in the UI', title='UI Name' - ), - ] = None - uiNameKey: Annotated[ - Optional[str], - Field( - description='The translation key for the name of the topology to expose in the UI', - title='UI Name Key', - ), - ] = None - - -class GroupSelector(BaseModel): - group: Annotated[ - str, - Field( - description='The group to assign to nodes that match the selector.', - title='Group', - ), - ] - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector to use to match nodes that should be assigned to this group.', - title='Node Selector', - ), - ] = None - - -class TierSelector(BaseModel): - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='Label selector to use to match nodes that should be assigned to this tier.', - title='Node Selector', - ), - ] = None - tier: Annotated[ - int, - Field( - description='The tier to assign to nodes that match the selector.', - title='Tier', - ), - ] - - -class SpecModel1(BaseModel): - groupSelectors: Annotated[ - Optional[List[GroupSelector]], - Field( - description='The set of selectors for assigning nodes to groups', - title='Group Selectors', - ), - ] = None - tierSelectors: Annotated[ - Optional[List[TierSelector]], - Field( - description='The set of selectors for assigning nodes to tiers', - title='Tier Selectors', - ), - ] = None - uiDescription: Annotated[ - Optional[str], - Field( - description='A description of the topology grouping to expose in the UI', - title='UI Description', - ), - ] = None - uiDescriptionKey: Annotated[ - Optional[str], - Field( - description='The translation key for the description of the topology grouping to expose in the UI', - title='UI Description Key', - ), - ] = None - uiName: Annotated[ - Optional[str], - Field( - description='The name of the topology grouping to expose in the UI', - title='UI Name', - ), - ] = None - uiNameKey: Annotated[ - Optional[str], - Field( - description='The translation key for the name of the topology grouping to expose in the UI', - title='UI Name Key', - ), - ] = None - - -class TopologyGroupingDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class TopologyGroupingDeletedResources( - RootModel[List[TopologyGroupingDeletedResourceEntry]] -): - root: List[TopologyGroupingDeletedResourceEntry] - - -class TopologyGroupingMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class TopologyDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class TopologyDeletedResources(RootModel[List[TopologyDeletedResourceEntry]]): - root: List[TopologyDeletedResourceEntry] - - -class TopologyMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class SpecModel2(BaseModel): - enabled: Annotated[ - bool, - Field( - description='Enable or disable the generation of the status of this overlay', - title='Enabled', - ), - ] - topology: Annotated[ - Topology, - Field( - description='Reference to the topology that this overlay is extending.', - title='Topology', - ), - ] - uiDescription: Annotated[ - Optional[str], - Field( - description='A description of the overlay to expose in the UI', - title='UI Description', - ), - ] = None - uiDescriptionKey: Annotated[ - Optional[str], - Field( - description='The translation key for the description of the overlay to expose in the UI', - title='UI Description Key', - ), - ] = None - uiName: Annotated[ - Optional[str], - Field( - description='The name of the overlay to expose in the UI', title='UI Name' - ), - ] = None - uiNameKey: Annotated[ - Optional[str], - Field( - description='The translation key for the name of the overlay to expose in the UI', - title='UI Name Key', - ), - ] = None - - -class TrafficRateOverlayDeletedResourceEntry(BaseModel): - commitTime: Optional[str] = None - hash: Optional[str] = None - name: Optional[str] = None - transactionId: Optional[int] = None - - -class TrafficRateOverlayDeletedResources( - RootModel[List[TrafficRateOverlayDeletedResourceEntry]] -): - root: List[TrafficRateOverlayDeletedResourceEntry] - - -class TrafficRateOverlayMetadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ - str, - Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', - ), - ] - - -class CPUUtilOverlay(BaseModel): - apiVersion: str - kind: str - metadata: CPUUtilOverlayMetadata - spec: Annotated[ - Spec, - Field( - description='CPUUtilOverlaySpec defines the desired state of CPUUtilOverlay', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='CPUUtilOverlayStatus defines the observed state of CPUUtilOverlay', - title='Status', - ), - ] = None - - -class CPUUtilOverlayList(BaseModel): - apiVersion: str - items: Optional[List[CPUUtilOverlay]] = None - kind: str - - -class DeviationOverlay(BaseModel): - apiVersion: str - kind: str - metadata: DeviationOverlayMetadata - spec: Annotated[ - Spec, - Field( - description='DeviationOverlaySpec defines the desired state of DeviationOverlay', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='DeviationOverlayStatus defines the observed state of DeviationOverlay', - title='Status', - ), - ] = None - - -class DeviationOverlayList(BaseModel): - apiVersion: str - items: Optional[List[DeviationOverlay]] = None - kind: str - - -class DiskOverlay(BaseModel): - apiVersion: str - kind: str - metadata: DiskOverlayMetadata - spec: Annotated[ - Spec, - Field( - description='DiskOverlaySpec defines the desired state of DiskOverlay', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='DiskOverlayStatus defines the observed state of DiskOverlay', - title='Status', - ), - ] = None - - -class DiskOverlayList(BaseModel): - apiVersion: str - items: Optional[List[DiskOverlay]] = None - kind: str - - -class LldpOverlay(BaseModel): - apiVersion: str - kind: str - metadata: LldpOverlayMetadata - spec: Annotated[ - Spec, - Field( - description='LldpOverlaySpec defines the desired state of lldp', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='LldpOverlayStatus defines the observed state of LldpOverlay', - title='Status', - ), - ] = None - - -class LldpOverlayList(BaseModel): - apiVersion: str - items: Optional[List[LldpOverlay]] = None - kind: str - - -class MemoryOverlay(BaseModel): - apiVersion: str - kind: str - metadata: MemoryOverlayMetadata - spec: Annotated[ - Spec, - Field( - description='MemoryOverlaySpec defines the desired state of MemoryOverlay', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='MemoryOverlayStatus defines the observed state of MemoryOverlay', - title='Status', - ), - ] = None - - -class MemoryOverlayList(BaseModel): - apiVersion: str - items: Optional[List[MemoryOverlay]] = None - kind: str - - -class TopologyModel(BaseModel): - apiVersion: str - kind: str - metadata: TopologyMetadata - spec: Annotated[ - SpecModel, - Field( - description='TopologySpec defines the desired state of Topology', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='TopologyStatus defines the observed state of Topology', - title='Status', - ), - ] = None - - -class TopologyGrouping(BaseModel): - apiVersion: str - kind: str - metadata: TopologyGroupingMetadata - spec: Annotated[ - SpecModel1, - Field( - description='TopologyGroupingSpec defines the desired state of TopologyGrouping', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='TopologyGroupingStatus defines the observed state of TopologyGrouping', - title='Status', - ), - ] = None - - -class TopologyGroupingList(BaseModel): - apiVersion: str - items: Optional[List[TopologyGrouping]] = None - kind: str - - -class TopologyList(BaseModel): - apiVersion: str - items: Optional[List[TopologyModel]] = None - kind: str - - -class TrafficRateOverlay(BaseModel): - apiVersion: str - kind: str - metadata: TrafficRateOverlayMetadata - spec: Annotated[ - SpecModel2, - Field( - description='TrafficRateOverlaySpec defines the desired state of TrafficRateOverlay', - title='Specification', - ), - ] - status: Annotated[ - Optional[Dict[str, Any]], - Field( - description='TrafficRateOverlayStatus defines the observed state of TrafficRateOverlay', - title='Status', - ), - ] = None - - -class TrafficRateOverlayList(BaseModel): - apiVersion: str - items: Optional[List[TrafficRateOverlay]] = None - kind: str diff --git a/pydantic_eda/core.py b/pydantic_eda/core/v1alpha1/models.py similarity index 62% rename from pydantic_eda/core.py rename to pydantic_eda/core/v1alpha1/models.py index ff400d4..b944bc0 100644 --- a/pydantic_eda/core.py +++ b/pydantic_eda/core/v1alpha1/models.py @@ -1,39 +1,40 @@ # generated by datamodel-codegen: -# filename: https://raw.githubusercontent.com/eda-labs/openapi/v25.4.1/core/core.json -# timestamp: 2025-05-07T11:43:07+00:00 +# filename: core.json from __future__ import annotations - -from datetime import datetime from typing import Annotated, Any, Dict, List, Literal, Optional - from pydantic import BaseModel, Field, RootModel +from datetime import datetime class AlarmData(BaseModel): + """ + The information about a single alarm or alarm history + """ + acknowledged: Annotated[ Optional[bool], - Field(description='An indication if the alarm has been acknowledged.'), + Field(description="An indication if the alarm has been acknowledged."), ] = None acknowledgedUntil: Annotated[ Optional[str], - Field(description='Indicates the end time of the acknowledgement.'), + Field(description="Indicates the end time of the acknowledgement."), ] = None cleared: Annotated[ Optional[bool], - Field(description='An indication if the alarm has been cleared.'), + Field(description="An indication if the alarm has been cleared."), ] = None clusterMember: Annotated[ Optional[str], - Field(description='The cluster member that generated this alarm.'), + Field(description="The cluster member that generated this alarm."), ] = None description: Annotated[ - Optional[str], Field(description='A description for the alarm.') + Optional[str], Field(description="A description for the alarm.") ] = None group: Annotated[ Optional[str], Field( - description='Indicates the group of the resource the alarm is present on.' + description="Indicates the group of the resource the alarm is present on." ), ] = None jsPath: Annotated[ @@ -44,88 +45,88 @@ class AlarmData(BaseModel): ] = None kind: Annotated[ Optional[str], - Field(description='Indicates the kind of resource the alarm is present on.'), + Field(description="Indicates the kind of resource the alarm is present on."), ] = None lastAcknowledged: Annotated[ - Optional[str], Field(description='the time this alarm was last acknowledged.') + Optional[str], Field(description="the time this alarm was last acknowledged.") ] = None lastChanged: Annotated[ Optional[str], Field( - description='The last time that the alarm was changed; as provided by the raiser of the alarm.' + description="The last time that the alarm was changed; as provided by the raiser of the alarm." ), ] = None lastSuppressed: Annotated[ - Optional[str], Field(description='the time this alarm was last suppressed.') + Optional[str], Field(description="the time this alarm was last suppressed.") ] = None name: Annotated[ Optional[str], Field( - description='The unique name for the alarm, e.g. InterfaceDown-spine-1-1-ethernet-1-1.' + description="The unique name for the alarm, e.g. InterfaceDown-spine-1-1-ethernet-1-1." ), ] = None namespace: Annotated[ - Optional[str], Field(description='The namespace of the alarm') + Optional[str], Field(description="The namespace of the alarm") ] = None occurrences: Annotated[ Optional[int], Field( - description='The number of occurrences of this alarm (the number of times it has been raised).' + description="The number of occurrences of this alarm (the number of times it has been raised)." ), ] = None parentAlarms: Annotated[ Optional[List[str]], Field( - description='The names of other alarms that is are parents of this alarm. This is used to\nfilter out alarms that are not a root cause.' + description="The names of other alarms that is are parents of this alarm. This is used to\nfilter out alarms that are not a root cause." ), ] = None probableCause: Annotated[ Optional[str], Field( - description='the probable cause for raising the alarm. This field is optional, and\nshould also be a description indicating the primary probable cause of the\nalarm, which may be enriched with relevant information from this specific\nalarm instance. The complete alarm below contains an example.' + description="the probable cause for raising the alarm. This field is optional, and\nshould also be a description indicating the primary probable cause of the\nalarm, which may be enriched with relevant information from this specific\nalarm instance. The complete alarm below contains an example." ), ] = None remedialAction: Annotated[ Optional[str], Field( - description='any remedial actions the user could try to resolve/clear the alarm. This\nfield is optional, and may also be enriched with relevant information\nfrom this specific alarm instance. The complete alarm below contains an\nexample.' + description="any remedial actions the user could try to resolve/clear the alarm. This\nfield is optional, and may also be enriched with relevant information\nfrom this specific alarm instance. The complete alarm below contains an\nexample." ), ] = None resource: Annotated[ Optional[str], - Field(description='The name of the resource that this alarm is present on.'), + Field(description="The name of the resource that this alarm is present on."), ] = None severity: Annotated[ - Optional[Literal['warning', 'minor', 'major', 'critical']], - Field(description='Severity of the alarm'), + Optional[Literal["warning", "minor", "major", "critical"]], + Field(description="Severity of the alarm"), ] = None sourceGroup: Annotated[ Optional[str], Field( - description='Indicates indicates the group of the resource that raised this alarm, e.g. interfaces.eda.nokia.com.' + description="Indicates indicates the group of the resource that raised this alarm, e.g. interfaces.eda.nokia.com." ), ] = None sourceKind: Annotated[ Optional[str], Field( - description='Indicates the Kind of the resource that raised this alarm, e.g. InterfaceState.' + description="Indicates the Kind of the resource that raised this alarm, e.g. InterfaceState." ), ] = None sourceResource: Annotated[ Optional[str], Field( - description='Indicates the the name of the resource that raised this alarm, e.g. spine-1-1-ethernet-1-1.' + description="Indicates the the name of the resource that raised this alarm, e.g. spine-1-1-ethernet-1-1." ), ] = None suppressed: Annotated[ Optional[bool], - Field(description='An indication if the alarm has been suppressed.'), + Field(description="An indication if the alarm has been suppressed."), ] = None suppressedUntil: Annotated[ - Optional[str], Field(description='Indicates the end time of the suppression.') + Optional[str], Field(description="Indicates the end time of the suppression.") ] = None type: Annotated[ - Optional[str], Field(description='A kind for the alarm, e.g. InterfaceDown') + Optional[str], Field(description="A kind for the alarm, e.g. InterfaceDown") ] = None @@ -134,15 +135,15 @@ class AlarmHistoryData(BaseModel): index: Annotated[ Optional[str], Field( - description='The index of the history entry within the entries for a single alarm..' + description="The index of the history entry within the entries for a single alarm.." ), ] = None class AlarmNamespaceAndName(BaseModel): - name: Annotated[Optional[str], Field(description='The name of an alarm')] = None + name: Annotated[Optional[str], Field(description="The name of an alarm")] = None namespace: Annotated[ - Optional[str], Field(description='The namespace of an alarm') + Optional[str], Field(description="The namespace of an alarm") ] = None @@ -150,58 +151,58 @@ class AuthPasswordPolicy(BaseModel): allowUserName: Annotated[ Optional[bool], Field( - description='If true, prevents passwords from being or containing the user name.' + description="If true, prevents passwords from being or containing the user name." ), ] = None digits: Annotated[ Optional[int], Field( - description='Minimum number of digits required in a password. Can be zero.', + description="Minimum number of digits required in a password. Can be zero.", ge=0, ), ] = None forceExpiredPasswordChange: Annotated[ Optional[int], Field( - description='The maximum number of days until a password change is enforced.\nA value of zero means no change is required.', + description="The maximum number of days until a password change is enforced.\nA value of zero means no change is required.", ge=0, ), ] = None hashingAlgorithm: Annotated[ - Optional[Literal['argon2', 'pbkdf2-sha512', 'pbkdf2-sha256', 'pbkdf2']], + Optional[Literal["argon2", "pbkdf2-sha512", "pbkdf2-sha256", "pbkdf2"]], Field( - description='The hashing algorithm to use when hashing stored passwords.' + description="The hashing algorithm to use when hashing stored passwords." ), ] = None length: Annotated[ Optional[int], - Field(description='Minimum password length. This must be at least 1.', ge=1), + Field(description="Minimum password length. This must be at least 1.", ge=1), ] = None lowerCase: Annotated[ Optional[int], Field( - description='Minimum number of lower case characters required in a password. Can be zero.', + description="Minimum number of lower case characters required in a password. Can be zero.", ge=0, ), ] = None maxFailureWaitSeconds: Annotated[ Optional[int], Field( - description='The number of seconds before the users access will be restored, after too many authentication failures.', + description="The number of seconds before the users access will be restored, after too many authentication failures.", ge=0, ), ] = None maxLoginFailure: Annotated[ Optional[int], Field( - description='The number of login/authentication failures before a lockout policy takes effect. Zero means no enforcement.', + description="The number of login/authentication failures before a lockout policy takes effect. Zero means no enforcement.", ge=0, ), ] = None passwordHistory: Annotated[ Optional[int], Field( - description='The number of passwords remembered to enforce no re-use of passwords. Zero means no re-use enforcement.', + description="The number of passwords remembered to enforce no re-use of passwords. Zero means no re-use enforcement.", ge=0, ), ] = None @@ -214,792 +215,216 @@ class AuthPasswordPolicy(BaseModel): resetTimeSeconds: Annotated[ Optional[int], Field( - description='When lockout is not permanent, the count of authentication failures for a user will be reset\nthis many seconds after the last authentication failure.', + description="When lockout is not permanent, the count of authentication failures for a user will be reset\nthis many seconds after the last authentication failure.", ge=0, ), ] = None specialChars: Annotated[ Optional[int], Field( - description='Minimum number of special characters required in a password. Can be zero.', + description="Minimum number of special characters required in a password. Can be zero.", ge=0, ), ] = None upperCase: Annotated[ Optional[int], Field( - description='Minimum number of upper case characters required in a password. Can be zero.', + description="Minimum number of upper case characters required in a password. Can be zero.", ge=0, ), ] = None -class Credentials(BaseModel): - temporary: Annotated[ +class AuthProvider(BaseModel): + auth: Optional[AuthProviderAuth] = None + enabled: Annotated[ Optional[bool], + Field(description="If true, checking/syncing this LDAP provider is enabled."), + ] = None + groupSupport: Optional[AuthProviderGroupSupport] = None + idAttribute: Annotated[ + str, Field( - description='This is true if the password being set is a temporary password. In this case the user\nis required to change the password after they login using the temporary password.' + description="Name of the LDAP attribute, which is used as a unique object identifier (UUID) for objects in LDAP." ), - ] = None - value: Annotated[ - Optional[str], Field(description='The new password for the user.') - ] = None - - -class ErrorIndex(BaseModel): - index: Optional[int] = None - - -class ErrorItem(BaseModel): - error: Optional[Dict[str, Any]] = None - type: Optional[str] = None - - -class ErrorResponse(BaseModel): - code: Annotated[ - int, Field(description='the numeric HTTP error code for the response.') ] - details: Annotated[ - Optional[str], Field(description='The optional details of the error response.') - ] = None - dictionary: Annotated[ - Optional[Dict[str, Any]], + import_: Annotated[ + Optional[bool], Field( - description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + alias="import", + description="If true, the LDAP information will be imported into the EDA (Keycloak) database.", ), ] = None - errors: Annotated[ - Optional[List[ErrorItem]], + name: Annotated[ + str, Field(description="The name to give to the LDAP provider; must be unique.") + ] + pagination: Annotated[ + Optional[bool], + Field(description="Set to true if the LDAP server supports pagination."), + ] = None + periodicSync: Annotated[ + Optional[bool], Field( - description='Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats' + description="If true, periodic synchronization of new changed or newly created LDAP users to Keycloak will occur." ), ] = None - index: Optional[ErrorIndex] = None - internal: Annotated[ + periodicSyncSecs: Annotated[ Optional[int], Field( - description="Internal error code in cases where we don't have an array of errors" + description="If periodic sync is enabled, this is the period in seconds that synchronization will occur." ), ] = None - message: Annotated[ - str, Field(description='The basic text error message for the error response.') + rdnLDAPAttribute: Annotated[ + str, + Field( + description="Name of the LDAP attribute, which is used as RDN (top attribute) of typical user DN. Usually it's the same as the Username LDAP attribute, however it is not required." + ), ] - ref: Annotated[ - Optional[str], + readOnly: Annotated[ + bool, Field( - description='Reference to the error source. Should typically be the URI of the request' + description="If false, changes made to LDAP-mapped attribute via EDA will be synced back to the LDAP server. Otherwise, changes are not made in LDAP." ), - ] = None - type: Annotated[ - Optional[str], + ] + scope: Annotated[ + Optional[Literal["One Level", "Subtree"]], Field( - description='URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code' + description='Must be "One Level" or "Subtree". If "One Level", the search applies only for users in the DNs specified by User DNs. If "Subtree", the search applies to the whole subtree.' ), ] = None - - -class FlowListEntry(BaseModel): - id: Annotated[Optional[int], Field(description='The id of the workflow')] = None - name: Annotated[Optional[str], Field(description='Name of the workflow')] = None - namespace: Annotated[ - Optional[str], Field(description='The namespace in which the workflow ran') - ] = None - parentId: Annotated[ - Optional[int], Field(description='The id of the parent workflow, if any') - ] = None - state: Optional[ - Literal[ - 'waitingToStart', - 'running', - 'waitingForInput', - 'terminated', - 'failed', - 'completed', - 'subflowWaitingForInput', - ] - ] = None - type: Annotated[Optional[str], Field(description='The type of workflow')] = None - - -class FlowListResult(BaseModel): - flows: Optional[List[FlowListEntry]] = None - - -class FlowStage(BaseModel): - completed: Annotated[ - Optional[bool], Field(description='True if the stage has completed') + timeout: Annotated[ + Optional[int], Field(description="LDAP connection timeout in milliseconds") ] = None - hadError: Annotated[ + tls: Annotated[ Optional[bool], - Field(description='True if the stage is complete and there was an error'), + Field(description="If true, encrypts the connection to LDAP using STARTTLS"), ] = None - name: Annotated[Optional[str], Field(description='Name of the flow stage')] = None - skipped: Annotated[ - Optional[bool], Field(description='True if the stage was skipped') - ] = None - started: Annotated[ - Optional[bool], Field(description='True if the stage has started') - ] = None - subFlowIds: Annotated[ - Optional[List[int]], - Field(description='The ids of flows triggered by the stage'), - ] = None - - -class GroupIDs(RootModel[List[str]]): - root: Annotated[ - List[str], Field(title='A list of user group identifiers (uuid values).') + type: Annotated[ + Literal["ldap"], + Field(description='The type of provider. Currently only "ldap" is supported.'), ] - - -class GroupVersionKind(BaseModel): - group: Optional[str] = None - kind: Optional[str] = None - version: Optional[str] = None - - -class HealthServiceStatus(BaseModel): - error: Annotated[ - Optional[str], Field(description='Detailed status if the service is not up.') - ] = None - status: Annotated[ - Literal['UP', 'DOWN'], - Field(description='Health status of the given service. UP or DOWN.'), + url: Annotated[str, Field(description="Connection URL to your LDAP server")] + userDN: Annotated[ + str, + Field( + description="Full DN of LDAP tree where your users are. This DN is the parent of LDAP users." + ), ] - - -class K8SPatchOp(BaseModel): - from_: Annotated[Optional[str], Field(alias='from')] = None - op: str - path: str - value: Optional[Dict[str, Any]] = None - x_permissive: Annotated[Optional[bool], Field(alias='x-permissive')] = None - - -class LabelCompletionResponse(BaseModel): - results: Optional[List[str]] = None - - -class LineSegment(BaseModel): - endLine: Optional[int] = None - startLine: Optional[int] = None - - -class Metadata(BaseModel): - annotations: Optional[Dict[str, str]] = None - labels: Optional[Dict[str, str]] = None - name: Annotated[ + userObjectClasses: Annotated[ str, Field( - max_length=253, - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$', + description="All values of LDAP objectClass attribute for users in LDAP, divided by commas. (e.g. inetOrgPerson, organizationalPerson)." ), ] - namespace: Optional[str] = None - - -class NamespaceData(BaseModel): - description: Annotated[ - Optional[str], Field(description='The description of the namespace') - ] = None - name: Annotated[Optional[str], Field(description='The namespace name')] = None - - -class NamespaceGetResponse(BaseModel): - allNamesapces: Annotated[ - Optional[bool], + userSearchFilter: Annotated[ + Optional[str], Field( - description='If true, the requestor is considered to have permission to access all namespaces' + description="Additional LDAP filter for filtering searched users. Leave this empty if you don't need an additional filter. Make sure that it starts with '(' and ends with ')'." ), ] = None - namespaces: Annotated[ - Optional[List[NamespaceData]], Field(description='The list of namespaces') + usernameAttribute: Annotated[ + str, + Field( + description="Name of the LDAP attribute, which is mapped as EDA username. For many LDAP server vendors it can be 'uid'." + ), + ] + uuid: Annotated[ + Optional[str], + Field( + description="The unique identifier given to the entry when it is created." + ), ] = None + vendor: Annotated[str, Field(description="LDAP vendor (provider).")] -class NsCrGvkName(BaseModel): - gvk: Optional[GroupVersionKind] = None - name: Optional[str] = None - namespace: Optional[str] = None - - -class Patch(RootModel[List[K8SPatchOp]]): - root: List[K8SPatchOp] - +class AuthProviderAuth(BaseModel): + """ + If present, bind to LDAP server with the given credentials. Otherwise do not bind. + """ -class ProviderAuth(BaseModel): bindCredential: Annotated[ - str, Field(description='Credentials to use when binding to an LDAP provider') + str, Field(description="Credentials to use when binding to an LDAP provider") ] bindDN: Annotated[ - str, Field(description='DN to use when binding to an LDAP provider') + str, Field(description="DN to use when binding to an LDAP provider") ] -class QueryCompletion(BaseModel): - completion: Optional[str] = None - token: Optional[str] = None - - -class QueryCompletionResponse(BaseModel): - completions: Annotated[ - Optional[List[QueryCompletion]], - Field(description='Array of possible auto-completion results.'), - ] = None - +class AuthProviderGroupSupport(BaseModel): + """ + Configuration for group import/sync with LDAP. If not present, groups will not synchronized with EDA. + """ -class ResourceRule(BaseModel): - apiGroups: Annotated[ - List[str], + NameLDAPAttribute: Annotated[ + str, Field(description="The LDAP group name attribute") + ] + filter: Annotated[ + Optional[str], Field( - description='The API groups for the resources controlled by the rule.\nAn API group consists of an apiGroup and a version, e.g. "apigroup/version".\nThe API group can be a wildcard ("*"), in which case it will match any API group.\nIn addition, the version can be a wildcard.' + description="Further for filtering when retrieving LDAP groups. Ensure starts and ends with parentheses if using." ), - ] - permissions: Annotated[ - Optional[Literal['none', 'read', 'readWrite']], - Field(description='Permissions for resources specified by the rule.'), ] = None - resources: Annotated[ - List[str], + groupLDAPDN: Annotated[ + str, Field(description="The LDAP DN where groups are found.") + ] + memberAttribute: Annotated[ + Optional[str], Field( - description='Names for the resources controlled by the rule.\nIt can be a wildcard ("*"), in which case it will match any resource\nin the matching API groups.' + description='The group attribute for a members. Usually "member" or "memberUid".' ), - ] - - -class StreamResult(BaseModel): - details: Annotated[ + ] = None + memberOfAttribute: Annotated[ Optional[str], Field( - description='The details for the streaming request; e.g. the query string in the corresponding GET request.' + description='If retrievalStrategy is "memberOf", this is the LDAP user attribute for group memberships.' ), ] = None - stream: Annotated[ + membershipAttributeType: Annotated[ + Optional[Literal["DN", "UID"]], + Field( + description="How users are identified in a group member entry: either DN or UID." + ), + ] = None + membershipUserAttribute: Annotated[ Optional[str], Field( - description='The stream identifier specified in the corresponding streaming GET request.' + description="Only required if membershipAttributeType is UID; then it is the user attribute that should match the group member value." ), ] = None - - -class TableRule(BaseModel): - path: Annotated[ + objectClasses: Annotated[ str, Field( - description='EDB path to which this rule applies. It can end in ".*"\nin which case the final portion of the table path can be anything, if the\nprefix matches. It can end in ".**" in which case the table path can be\nanything if the prefix matches.', - min_length=1, - pattern='^\\\\..*', + description="The LDAP object class or classes used for groups. If more than one, they must be comma-separated." ), ] - permissions: Annotated[ - Literal['none', 'read'], - Field(description='Permissions for the given EDB path.'), - ] + retrievalStrategy: Annotated[ + Optional[Literal["member", "memberOf"]], + Field( + description='The strategy for retrieving groups. Should be "member" to get group membership from the group, or "memberOf" to get group membership from the user.' + ), + ] = None -class TopoAttrMetadata(BaseModel): - type: Optional[str] = None - ui_description: Optional[str] = None - ui_description_key: Optional[str] = None - ui_name: Optional[str] = None - ui_name_key: Optional[str] = None +class AuthProviderTestParams(BaseModel): + action: Annotated[ + Optional[Literal["connection", "authentication"]], + Field(description="The test action to take."), + ] = None + auth: Optional[ProviderAuth] = None + timeout: Annotated[ + Optional[int], Field(description="LDAP connection timeout in milliseconds") + ] = None + tls: Annotated[ + Optional[bool], + Field(description="If true, encrypts the connection to LDAP using STARTTLS"), + ] = None + url: Annotated[ + Optional[str], Field(description="Connection URL to your LDAP server") + ] = None -class TopoLinkEndpoint(BaseModel): - endpoint: Optional[str] = None - node: Optional[str] = None - node_key: Optional[str] = None - - -class TopoNodeGrouping(BaseModel): - group: Optional[str] = None - tier: Optional[int] = None - - -class TopoOverlayBadgeMetadata(BaseModel): - badge_name: Optional[str] = None - badge_path: Optional[str] = None - color: Optional[str] = None - ui_description: Optional[str] = None - ui_description_key: Optional[str] = None - ui_name: Optional[str] = None - ui_name_key: Optional[str] = None - value: Optional[int] = None - - -class TopoOverlayStateMetadata(BaseModel): - color: Optional[str] = None - ui_description: Optional[str] = None - ui_description_key: Optional[str] = None - ui_name: Optional[str] = None - ui_name_key: Optional[str] = None - value: Optional[int] = None - - -class TopoOverlayStateRequest(BaseModel): - badge: Optional[str] = None - status: Optional[str] = None - - -class TopoSchema(BaseModel): - group: Optional[str] = None - kind: Optional[str] = None - version: Optional[str] = None - - -class TopologyStateGroupSelector(BaseModel): - group: Annotated[ - Optional[str], - Field( - description='The group to assign to nodes that match the selector.\n+eda:ui:title="Group"' - ), - ] = None - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='+kubebuilder:validation:Optional\n+eda:ui:title="Node Selector"\n+eda:ui:format="labelselector"\nLabel selector to use to match nodes that should be assigned to this group.' - ), - ] = None - - -class TopologyStateTierSelector(BaseModel): - nodeSelector: Annotated[ - Optional[List[str]], - Field( - description='+kubebuilder:validation:Optional\n+eda:ui:title="Node Selector"\n+eda:ui:format="labelselector"\nLabel selector to use to match nodes that should be assigned to this tier.' - ), - ] = None - tier: Annotated[ - Optional[int], - Field( - description='The tier to assign to nodes that match the selector.\n+eda:ui:title="Tier"' - ), - ] = None - - -class TransactionContent(BaseModel): - apiVersion: Optional[str] = None - kind: Optional[str] = None - metadata: Optional[Metadata] = None - spec: Optional[Dict[str, Any]] = None - - -class TransactionId(BaseModel): - id: Annotated[ - Optional[int], - Field( - description='A transaction identifier; these are assigned by the system to a posted transaction.' - ), - ] = None - - -class TransactionInputResource(BaseModel): - isDelete: Optional[bool] = None - name: Optional[NsCrGvkName] = None - - -class TransactionNodeResult(BaseModel): - errors: Annotated[ - Optional[List[str]], Field(description='Resulting errors for the node') - ] = None - name: Annotated[Optional[str], Field(description='The name of the node')] = None - namespace: Annotated[ - Optional[str], Field(description='The namespace of the node') - ] = None - - -class TransactionNsCrGvkNames(BaseModel): - gvk: Optional[GroupVersionKind] = None - names: Optional[List[str]] = None - namespace: Optional[str] = None - - -class TransactionPatch(BaseModel): - patchOps: Patch - target: NsCrGvkName - - -class TransactionPoolAllocation(BaseModel): - key: Optional[str] = None - poolName: Optional[str] = None - poolTemplate: Optional[str] = None - value: Optional[str] = None - - -class TransactionResultInputResources(BaseModel): - inputCrs: Annotated[ - Optional[List[TransactionInputResource]], - Field(description='List of input resources from the transaction'), - ] = None - limitedAccess: Annotated[ - Optional[bool], - Field( - description='This field is true if the list returned here is not the complete list of input resources in the transaction because the user does not have read-access to some of them' - ), - ] = None - - -class TransactionResultObjectString(BaseModel): - data: Optional[str] = None - - -class TransactionScriptResults(BaseModel): - executionTime: Optional[int] = None - output: Optional[str] = None - - -class TransactionState(BaseModel): - state: Annotated[ - Optional[str], Field(description='The state of the transaction') - ] = None - - -class TransactionStructuredAppError(BaseModel): - message: Optional[str] = None - messageKey: Optional[str] = None - values: Optional[Dict[str, Dict[str, Any]]] = None - - -class TransactionSummaryResult(BaseModel): - commitHash: Annotated[ - Optional[str], Field(description='The git commit hash for the transaction') - ] = None - description: Annotated[ - Optional[str], - Field( - description='The description of the transaction, as posted in the transaction request.' - ), - ] = None - details: Annotated[ - Optional[str], - Field( - description='The type of details available for the transaction, as posted in the transaction request.' - ), - ] = None - dryRun: Annotated[ - Optional[bool], - Field( - description='If true the transaction was not committed and ran in dry run mode.' - ), - ] = None - id: Annotated[Optional[int], Field(description='The transaction identifier')] = None - lastChangeTimestamp: Annotated[ - Optional[str], Field(description='The time that the transaction completed.') - ] = None - state: Annotated[ - Optional[str], Field(description='The state of the transaction.') - ] = None - success: Annotated[ - Optional[bool], Field(description='True if the transaction was successful.') - ] = None - username: Annotated[ - Optional[str], Field(description='The user who posted the transaction.') - ] = None - - -class TransactionSummaryResults(BaseModel): - results: Annotated[ - Optional[List[TransactionSummaryResult]], - Field(description='array of summary-results for transactions'), - ] = None - - -class TransactionValue(BaseModel): - value: Optional[TransactionContent] = None - - -class UrlRule(BaseModel): - path: Annotated[ - str, - Field( - description='The API server URL path to which this rule applies. It can end in "/*"\nin which case the final portion of the URL path can be anything, if the\nprefix matches. It can end in "/**" in which case the URL path can be\nanything if the prefix matches.",', - min_length=1, - pattern='^/.*', - ), - ] - permissions: Annotated[ - Optional[Literal['none', 'read', 'readWrite']], - Field(description='The permissions for the API server URL for the rule.'), - ] = None - - -class UserStatus(BaseModel): - failedLoginSinceSuccessfulLogin: Optional[int] = None - isFederatedUser: Annotated[ - Optional[bool], - Field(description='True if the user comes from a federated LDAP server'), - ] = None - lastFailedLogin: Optional[str] = None - lastSuccessfulLogin: Optional[str] = None - temporarilyDisabled: Optional[bool] = None - - -class UserStorageInFileContent(BaseModel): - file_content: Annotated[ - str, - Field( - alias='file-content', - description='The desired content of the user-storage file. This will be base64 decoded before storing if the request indicates that the content is base64 encoded.', - ), - ] - - -class UserStorageOutDirEntry(BaseModel): - modification_time: Annotated[ - Optional[datetime], - Field( - alias='modification-time', - description='modification type of the item, if a file', - ), - ] = None - name: Annotated[str, Field(description='name of the item within the directory')] - type: Annotated[str, Field(description='type of the item; "file" or "directory"')] - - -class UserStorageOutFileContent(BaseModel): - file_content: Annotated[ - Optional[str], - Field( - alias='file-content', - description='content of the file, will be base64 encoded if the request asked for this', - ), - ] = None - file_deleted: Annotated[ - Optional[bool], - Field( - alias='file-deleted', - description='if present and true, indicates the file has been deleted; used for\nstreamed responses', - ), - ] = None - file_name: Annotated[str, Field(alias='file-name', description='name of the file')] - modification_time: Annotated[ - Optional[datetime], - Field( - alias='modification-time', - description='UTC modification time of the file, as an RFC 3339 date/time.\nNot valid if file-deleted is true (in a streamed response)', - ), - ] = None - - -class Workflow(BaseModel): - cr: Annotated[ - Dict[str, Dict[str, Any]], - Field(description='Custom resource that defines the workflow to execute'), - ] - description: Annotated[ - str, Field(description='Description message for the workflow') - ] - - -class WorkflowId(BaseModel): - id: Annotated[ - Optional[int], - Field( - description='A workflow identifier; these are assigned by the system to a posted workflow.' - ), - ] = None - - -class WorkflowState(BaseModel): - runningState: Optional[str] = None - state: Optional[str] = None - - -class SingleVersionInfo(BaseModel): - builtDate: Annotated[ - Optional[str], Field(description='The build-time for the component.') - ] = None - version: Annotated[ - Optional[str], Field(description='The version string for the component.') - ] = None - - -class VersionInfo(RootModel[Optional[Dict[str, SingleVersionInfo]]]): - root: Optional[Dict[str, SingleVersionInfo]] = None - - -class AuthProviderAuth(BaseModel): - bindCredential: Annotated[ - str, Field(description='Credentials to use when binding to an LDAP provider') - ] - bindDN: Annotated[ - str, Field(description='DN to use when binding to an LDAP provider') - ] - - -class AuthProviderGroupSupport(BaseModel): - NameLDAPAttribute: Annotated[ - str, Field(description='The LDAP group name attribute') - ] - filter: Annotated[ - Optional[str], - Field( - description='Further for filtering when retrieving LDAP groups. Ensure starts and ends with parentheses if using.' - ), - ] = None - groupLDAPDN: Annotated[ - str, Field(description='The LDAP DN where groups are found.') - ] - memberAttribute: Annotated[ - Optional[str], - Field( - description='The group attribute for a members. Usually "member" or "memberUid".' - ), - ] = None - memberOfAttribute: Annotated[ - Optional[str], - Field( - description='If retrievalStrategy is "memberOf", this is the LDAP user attribute for group memberships.' - ), - ] = None - membershipAttributeType: Annotated[ - Optional[Literal['DN', 'UID']], - Field( - description='How users are identified in a group member entry: either DN or UID.' - ), - ] = None - membershipUserAttribute: Annotated[ - Optional[str], - Field( - description='Only required if membershipAttributeType is UID; then it is the user attribute that should match the group member value.' - ), - ] = None - objectClasses: Annotated[ - str, - Field( - description='The LDAP object class or classes used for groups. If more than one, they must be comma-separated.' - ), - ] - retrievalStrategy: Annotated[ - Optional[Literal['member', 'memberOf']], - Field( - description='The strategy for retrieving groups. Should be "member" to get group membership from the group, or "memberOf" to get group membership from the user.' - ), - ] = None - - -class AuthProvider(BaseModel): - auth: Optional[AuthProviderAuth] = None - enabled: Annotated[ - Optional[bool], - Field(description='If true, checking/syncing this LDAP provider is enabled.'), - ] = None - groupSupport: Optional[AuthProviderGroupSupport] = None - idAttribute: Annotated[ - str, - Field( - description='Name of the LDAP attribute, which is used as a unique object identifier (UUID) for objects in LDAP.' - ), - ] - import_: Annotated[ - Optional[bool], - Field( - alias='import', - description='If true, the LDAP information will be imported into the EDA (Keycloak) database.', - ), - ] = None - name: Annotated[ - str, Field(description='The name to give to the LDAP provider; must be unique.') - ] - pagination: Annotated[ - Optional[bool], - Field(description='Set to true if the LDAP server supports pagination.'), - ] = None - periodicSync: Annotated[ - Optional[bool], - Field( - description='If true, periodic synchronization of new changed or newly created LDAP users to Keycloak will occur.' - ), - ] = None - periodicSyncSecs: Annotated[ - Optional[int], - Field( - description='If periodic sync is enabled, this is the period in seconds that synchronization will occur.' - ), - ] = None - rdnLDAPAttribute: Annotated[ - str, - Field( - description="Name of the LDAP attribute, which is used as RDN (top attribute) of typical user DN. Usually it's the same as the Username LDAP attribute, however it is not required." - ), - ] - readOnly: Annotated[ - bool, - Field( - description='If false, changes made to LDAP-mapped attribute via EDA will be synced back to the LDAP server. Otherwise, changes are not made in LDAP.' - ), - ] - scope: Annotated[ - Optional[Literal['One Level', 'Subtree']], - Field( - description='Must be "One Level" or "Subtree". If "One Level", the search applies only for users in the DNs specified by User DNs. If "Subtree", the search applies to the whole subtree.' - ), - ] = None - timeout: Annotated[ - Optional[int], Field(description='LDAP connection timeout in milliseconds') - ] = None - tls: Annotated[ - Optional[bool], - Field(description='If true, encrypts the connection to LDAP using STARTTLS'), - ] = None - type: Annotated[ - Literal['ldap'], - Field(description='The type of provider. Currently only "ldap" is supported.'), - ] - url: Annotated[str, Field(description='Connection URL to your LDAP server')] - userDN: Annotated[ - str, - Field( - description='Full DN of LDAP tree where your users are. This DN is the parent of LDAP users.' - ), - ] - userObjectClasses: Annotated[ - str, - Field( - description='All values of LDAP objectClass attribute for users in LDAP, divided by commas. (e.g. inetOrgPerson, organizationalPerson).' - ), - ] - userSearchFilter: Annotated[ - Optional[str], - Field( - description="Additional LDAP filter for filtering searched users. Leave this empty if you don't need an additional filter. Make sure that it starts with '(' and ends with ')'." - ), - ] = None - usernameAttribute: Annotated[ - str, - Field( - description="Name of the LDAP attribute, which is mapped as EDA username. For many LDAP server vendors it can be 'uid'." - ), - ] - uuid: Annotated[ - Optional[str], - Field( - description='The unique identifier given to the entry when it is created.' - ), - ] = None - vendor: Annotated[str, Field(description='LDAP vendor (provider).')] - - -class AuthProviderTestParams(BaseModel): - action: Annotated[ - Optional[Literal['connection', 'authentication']], - Field(description='The test action to take.'), - ] = None - auth: Optional[ProviderAuth] = None - timeout: Annotated[ - Optional[int], Field(description='LDAP connection timeout in milliseconds') - ] = None - tls: Annotated[ - Optional[bool], - Field(description='If true, encrypts the connection to LDAP using STARTTLS'), - ] = None - url: Annotated[ - Optional[str], Field(description='Connection URL to your LDAP server') - ] = None - - -class AuthProviders(RootModel[List[AuthProvider]]): - root: List[AuthProvider] +class AuthProviders(RootModel[List[AuthProvider]]): + root: List[AuthProvider] class AuthRole(BaseModel): @@ -1007,23 +432,23 @@ class AuthRole(BaseModel): name: Annotated[ str, Field( - pattern='^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$' + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" ), ] namespace: Annotated[ - Optional[str], Field(pattern='^([a-z0-9]([-a-z0-9]*[a-z0-9])?)?$') + Optional[str], Field(pattern="^([a-z0-9]([-a-z0-9]*[a-z0-9])?)?$") ] = None resourceRules: Annotated[ Optional[List[ResourceRule]], - Field(description='Rules for access to resources.'), + Field(description="Rules for access to resources."), ] = None tableRules: Annotated[ Optional[List[TableRule]], - Field(description='Rules for access to EDB tables, including via EQL.'), + Field(description="Rules for access to EDB tables, including via EQL."), ] = None urlRules: Annotated[ Optional[List[UrlRule]], - Field(description='Rules for access to APIServer routes.'), + Field(description="Rules for access to APIServer routes."), ] = None @@ -1038,7 +463,7 @@ class AuthUser(BaseModel): groups: Annotated[ Optional[List[str]], Field( - description='contains the UUIDs of the groups of which the user is a member.' + description="contains the UUIDs of the groups of which the user is a member." ), ] = None lastName: Optional[str] = None @@ -1054,20 +479,20 @@ class AuthUserGroup(BaseModel): full_users: Annotated[ Optional[List[AuthUser]], Field( - alias='full-users', - description='contains the full user definitions of the users who are members of the group, if requested', + alias="full-users", + description="contains the full user definitions of the users who are members of the group, if requested", ), ] = None fullRoles: Annotated[ Optional[List[AuthRole]], Field( - description='contains the full role definitions of the Roles and ClusterRoles associated with the group, if requested' + description="contains the full role definitions of the Roles and ClusterRoles associated with the group, if requested" ), ] = None isFederated: Annotated[ Optional[bool], Field( - description='if true, indicates that the group was imported from a federated LDAP server' + description="if true, indicates that the group was imported from a federated LDAP server" ), ] = None name: Optional[str] = None @@ -1080,7 +505,7 @@ class AuthUserGroup(BaseModel): users: Annotated[ Optional[List[str]], Field( - description='contains the usernames of the users who are members of the group' + description="contains the usernames of the users who are members of the group" ), ] = None uuid: Optional[str] = None @@ -1099,97 +524,306 @@ class CrAnnotation(BaseModel): lines: Optional[List[LineSegment]] = None +class Credentials(BaseModel): + temporary: Annotated[ + Optional[bool], + Field( + description="This is true if the password being set is a temporary password. In this case the user\nis required to change the password after they login using the temporary password." + ), + ] = None + value: Annotated[ + Optional[str], Field(description="The new password for the user.") + ] = None + + +class ErrorIndex(BaseModel): + index: Optional[int] = None + + +class ErrorItem(BaseModel): + error: Optional[Dict[str, Any]] = None + type: Optional[str] = None + + +class ErrorResponse(BaseModel): + """ + Generic error response for REST APIs + """ + + code: Annotated[ + int, Field(description="the numeric HTTP error code for the response.") + ] + details: Annotated[ + Optional[str], Field(description="The optional details of the error response.") + ] = None + dictionary: Annotated[ + Optional[Dict[str, Any]], + Field( + description='Dictionary/map of associated data/information relevant to the error.\nThe error "message" may contain {{name}} escapes that should be substituted\nwith information from this dictionary.' + ), + ] = None + errors: Annotated[ + Optional[List[ErrorItem]], + Field( + description="Collection of errors in cases where more than one exists. This needs to be\nflexible so we can support multiple formats" + ), + ] = None + index: Optional[ErrorIndex] = None + internal: Annotated[ + Optional[int], + Field( + description="Internal error code in cases where we don't have an array of errors" + ), + ] = None + message: Annotated[ + str, Field(description="The basic text error message for the error response.") + ] + ref: Annotated[ + Optional[str], + Field( + description="Reference to the error source. Should typically be the URI of the request" + ), + ] = None + type: Annotated[ + Optional[str], + Field( + description="URI pointing at a document that describes the error and mitigation steps\nIf there is no document, point to the RFC for the HTTP error code" + ), + ] = None + + class FlowGetResponse(BaseModel): error: Annotated[ Optional[str], - Field(description='If no error is present, the flow completed successfully'), + Field(description="If no error is present, the flow completed successfully"), ] = None - id: Annotated[Optional[int], Field(description='The id of the workflow')] = None + id: Annotated[Optional[int], Field(description="The id of the workflow")] = None jsonResult: Annotated[ - Optional[str], Field(description='A JSON representation of the result') + Optional[str], Field(description="A JSON representation of the result") ] = None - log: Annotated[Optional[str], Field(description='Log output from the flow')] = None - name: Annotated[Optional[str], Field(description='Name of the workflow')] = None + log: Annotated[Optional[str], Field(description="Log output from the flow")] = None + name: Annotated[Optional[str], Field(description="Name of the workflow")] = None namespace: Annotated[ - Optional[str], Field(description='The namespace in which the flow ran') + Optional[str], Field(description="The namespace in which the flow ran") ] = None parentId: Annotated[ - Optional[int], Field(description='The id of the parent workflow, if any') + Optional[int], Field(description="The id of the parent workflow, if any") ] = None stages: Annotated[ Optional[List[FlowStage]], - Field(description='The list of stages of the workflow'), + Field(description="The list of stages of the workflow"), ] = None state: Optional[ Literal[ - 'waitingToStart', - 'running', - 'waitingForInput', - 'terminated', - 'failed', - 'completed', - 'subflowWaitingForInput', + "waitingToStart", + "running", + "waitingForInput", + "terminated", + "failed", + "completed", + "subflowWaitingForInput", ] ] = None subflowsWaitingForInput: Annotated[ Optional[List[int]], - Field(description='The ids of any subflows that are waiting for user input'), + Field(description="The ids of any subflows that are waiting for user input"), ] = None - type: Annotated[Optional[str], Field(description='The type of workflow')] = None + type: Annotated[Optional[str], Field(description="The type of workflow")] = None waitForInputPrompt: Annotated[ - Optional[str], Field(description='Set if the state is waiting for input') + Optional[str], Field(description="Set if the state is waiting for input") + ] = None + + +class FlowListEntry(BaseModel): + id: Annotated[Optional[int], Field(description="The id of the workflow")] = None + name: Annotated[Optional[str], Field(description="Name of the workflow")] = None + namespace: Annotated[ + Optional[str], Field(description="The namespace in which the workflow ran") + ] = None + parentId: Annotated[ + Optional[int], Field(description="The id of the parent workflow, if any") + ] = None + state: Optional[ + Literal[ + "waitingToStart", + "running", + "waitingForInput", + "terminated", + "failed", + "completed", + "subflowWaitingForInput", + ] + ] = None + type: Annotated[Optional[str], Field(description="The type of workflow")] = None + + +class FlowListResult(BaseModel): + """ + A list of flows + """ + + flows: Optional[List[FlowListEntry]] = None + + +class FlowStage(BaseModel): + """ + Describes the stage of a workflow + """ + + completed: Annotated[ + Optional[bool], Field(description="True if the stage has completed") + ] = None + hadError: Annotated[ + Optional[bool], + Field(description="True if the stage is complete and there was an error"), + ] = None + name: Annotated[Optional[str], Field(description="Name of the flow stage")] = None + skipped: Annotated[ + Optional[bool], Field(description="True if the stage was skipped") + ] = None + started: Annotated[ + Optional[bool], Field(description="True if the stage has started") + ] = None + subFlowIds: Annotated[ + Optional[List[int]], + Field(description="The ids of flows triggered by the stage"), ] = None class GetLabelCompletionRequest(BaseModel): gvk: Optional[GroupVersionKind] = None limit: Annotated[ - Optional[int], Field(description='The maximum number of results to return') + Optional[int], Field(description="The maximum number of results to return") ] = None namespace: Annotated[ Optional[str], Field( - description='The namespace of the GVK if the CRD is namespaced\nrequired: true if the GVK is namespaced' + description="The namespace of the GVK if the CRD is namespaced\nrequired: true if the GVK is namespaced" ), ] = None value: Annotated[ str, Field( - description='A key value string delimited by =. If the Value does not include an =\nit is assumed to be a Key lookup. If there is an =, everything before\nthe = is assumed to be the key and the lookup will be a value lookup' + description="A key value string delimited by =. If the Value does not include an =\nit is assumed to be a Key lookup. If there is an =, everything before\nthe = is assumed to be the key and the lookup will be a value lookup" ), ] +class GroupIDs(RootModel[List[str]]): + root: Annotated[ + List[str], Field(title="A list of user group identifiers (uuid values).") + ] + + +class GroupVersionKind(BaseModel): + group: Optional[str] = None + kind: Optional[str] = None + version: Optional[str] = None + + class Health(BaseModel): mode: Annotated[ - Literal['ACTIVE', 'STANDBY'], - Field(description='Indication of the activity of this cluster.'), + Literal["ACTIVE", "STANDBY"], + Field(description="Indication of the activity of this cluster."), ] services: Annotated[ Optional[Dict[str, HealthServiceStatus]], Field( - description='Detailed health of the services comprising the EDA cluster. Keyed by the name of the service.' + description="Detailed health of the services comprising the EDA cluster. Keyed by the name of the service." + ), + ] = None + status: Annotated[ + Literal["UP", "DEGRADED", "DOWN"], + Field(description="Overall health status of the EDA cluster."), + ] + timestamp: Annotated[ + datetime, Field(description="Time that the health report was generated.") + ] + + +class HealthServiceStatus(BaseModel): + error: Annotated[ + Optional[str], Field(description="Detailed status if the service is not up.") + ] = None + status: Annotated[ + Literal["UP", "DOWN"], + Field(description="Health status of the given service. UP or DOWN."), + ] + + +class K8SPatchOp(BaseModel): + from_: Annotated[Optional[str], Field(alias="from")] = None + op: str + path: str + value: Optional[Dict[str, Any]] = None + x_permissive: Annotated[Optional[bool], Field(alias="x-permissive")] = None + + +class LabelCompletionResponse(BaseModel): + results: Optional[List[str]] = None + + +class LineSegment(BaseModel): + endLine: Optional[int] = None + startLine: Optional[int] = None + + +class Metadata(BaseModel): + annotations: Optional[Dict[str, str]] = None + labels: Optional[Dict[str, str]] = None + name: Annotated[ + str, + Field( + max_length=253, + pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", + ), + ] + namespace: Optional[str] = None + + +class NamespaceData(BaseModel): + """ + Information about an individual namespace + """ + + description: Annotated[ + Optional[str], Field(description="The description of the namespace") + ] = None + name: Annotated[Optional[str], Field(description="The namespace name")] = None + + +class NamespaceGetResponse(BaseModel): + """ + Body of the non streaming namespace get request + """ + + allNamesapces: Annotated[ + Optional[bool], + Field( + description="If true, the requestor is considered to have permission to access all namespaces" ), ] = None - status: Annotated[ - Literal['UP', 'DEGRADED', 'DOWN'], - Field(description='Overall health status of the EDA cluster.'), - ] - timestamp: Annotated[ - datetime, Field(description='Time that the health report was generated.') - ] + namespaces: Annotated[ + Optional[List[NamespaceData]], Field(description="The list of namespaces") + ] = None class NodeConfigResponse(BaseModel): annotations: Annotated[ Optional[List[CrAnnotation]], - Field(description='The the list of annotations for the node configuration'), + Field(description="The the list of annotations for the node configuration"), ] = None running: Annotated[ - Optional[str], Field(description='The current node configuration for the node') + Optional[str], Field(description="The current node configuration for the node") ] = None +class NsCrGvkName(BaseModel): + gvk: Optional[GroupVersionKind] = None + name: Optional[str] = None + namespace: Optional[str] = None + + class Overlay(BaseModel): endpoint_state: Optional[List[TopoOverlayStateMetadata]] = None group: Optional[str] = None @@ -1208,9 +842,105 @@ class Overlays(RootModel[List[Overlay]]): root: List[Overlay] +class ProviderAuth(BaseModel): + bindCredential: Annotated[ + str, Field(description="Credentials to use when binding to an LDAP provider") + ] + bindDN: Annotated[ + str, Field(description="DN to use when binding to an LDAP provider") + ] + + +class QueryCompletion(BaseModel): + completion: Optional[str] = None + token: Optional[str] = None + + +class QueryCompletionResponse(BaseModel): + """ + The result of a successful query auto-completion request + """ + + completions: Annotated[ + Optional[List[QueryCompletion]], + Field(description="Array of possible auto-completion results."), + ] = None + + +class ResourceRule(BaseModel): + apiGroups: Annotated[ + List[str], + Field( + description='The API groups for the resources controlled by the rule.\nAn API group consists of an apiGroup and a version, e.g. "apigroup/version".\nThe API group can be a wildcard ("*"), in which case it will match any API group.\nIn addition, the version can be a wildcard.' + ), + ] + permissions: Annotated[ + Optional[Literal["none", "read", "readWrite"]], + Field(description="Permissions for resources specified by the rule."), + ] = None + resources: Annotated[ + List[str], + Field( + description='Names for the resources controlled by the rule.\nIt can be a wildcard ("*"), in which case it will match any resource\nin the matching API groups.' + ), + ] + + +class SingleVersionInfo(BaseModel): + builtDate: Annotated[ + Optional[str], Field(description="The build-time for the component.") + ] = None + version: Annotated[ + Optional[str], Field(description="The version string for the component.") + ] = None + + +class StreamResult(BaseModel): + details: Annotated[ + Optional[str], + Field( + description="The details for the streaming request; e.g. the query string in the corresponding GET request." + ), + ] = None + stream: Annotated[ + Optional[str], + Field( + description="The stream identifier specified in the corresponding streaming GET request." + ), + ] = None + + +class TableRule(BaseModel): + """ + A role rule controlling access to a EDB table. Note that + there is never write access to EDB. + """ + + path: Annotated[ + str, + Field( + description='EDB path to which this rule applies. It can end in ".*"\nin which case the final portion of the table path can be anything, if the\nprefix matches. It can end in ".**" in which case the table path can be\nanything if the prefix matches.', + min_length=1, + pattern="^\\\\..*", + ), + ] + permissions: Annotated[ + Literal["none", "read"], + Field(description="Permissions for the given EDB path."), + ] + + +class TopoAttrMetadata(BaseModel): + type: Optional[str] = None + ui_description: Optional[str] = None + ui_description_key: Optional[str] = None + ui_name: Optional[str] = None + ui_name_key: Optional[str] = None + + class TopoElemMetadata(BaseModel): attributes: Optional[Dict[str, TopoAttrMetadata]] = None - schema_: Annotated[Optional[TopoSchema], Field(alias='schema')] = None + schema_: Annotated[Optional[TopoSchema], Field(alias="schema")] = None subtitle: Optional[str] = None subtitle_key: Optional[str] = None @@ -1221,10 +951,15 @@ class TopoEndpoint(BaseModel): labels: Optional[Dict[str, str]] = None name: Optional[str] = None namespace: Optional[str] = None - schema_: Annotated[Optional[TopoSchema], Field(alias='schema')] = None + schema_: Annotated[Optional[TopoSchema], Field(alias="schema")] = None ui_name: Optional[str] = None +class TopoGroupingStateRequest(BaseModel): + name: Optional[str] = None + spec: Optional[TopologyStateGroupingBase] = None + + class TopoLink(BaseModel): attributes: Optional[Dict[str, Dict[str, Any]]] = None cr_name: Optional[str] = None @@ -1236,10 +971,16 @@ class TopoLink(BaseModel): labels: Optional[Dict[str, str]] = None name: Optional[str] = None namespace: Optional[str] = None - schema_: Annotated[Optional[TopoSchema], Field(alias='schema')] = None + schema_: Annotated[Optional[TopoSchema], Field(alias="schema")] = None ui_name: Optional[str] = None +class TopoLinkEndpoint(BaseModel): + endpoint: Optional[str] = None + node: Optional[str] = None + node_key: Optional[str] = None + + class TopoNode(BaseModel): attributes: Optional[Dict[str, Dict[str, Any]]] = None cr_name: Optional[str] = None @@ -1248,8 +989,51 @@ class TopoNode(BaseModel): labels: Optional[Dict[str, str]] = None name: Optional[str] = None namespace: Optional[str] = None - schema_: Annotated[Optional[TopoSchema], Field(alias='schema')] = None + schema_: Annotated[Optional[TopoSchema], Field(alias="schema")] = None + ui_name: Optional[str] = None + + +class TopoNodeGrouping(BaseModel): + group: Optional[str] = None + tier: Optional[int] = None + + +class TopoOverlayBadgeMetadata(BaseModel): + badge_name: Optional[str] = None + badge_path: Optional[str] = None + color: Optional[str] = None + ui_description: Optional[str] = None + ui_description_key: Optional[str] = None + ui_name: Optional[str] = None + ui_name_key: Optional[str] = None + value: Optional[int] = None + + +class TopoOverlayStateMetadata(BaseModel): + color: Optional[str] = None + ui_description: Optional[str] = None + ui_description_key: Optional[str] = None ui_name: Optional[str] = None + ui_name_key: Optional[str] = None + value: Optional[int] = None + + +class TopoOverlayStateRequest(BaseModel): + badge: Optional[str] = None + status: Optional[str] = None + + +TopoSchema = GroupVersionKind + + +class TopoStateRequest(BaseModel): + grouping: Optional[TopoGroupingStateRequest] = None + namespace: Optional[str] = None + overlays: Optional[TopoOverlayStateRequest] = None + + +class Topologies(RootModel[List[Topology]]): + root: List[Topology] class Topology(BaseModel): @@ -1271,7 +1055,27 @@ class TopologyState(BaseModel): nodes: Optional[Dict[str, TopoNode]] = None +class TopologyStateGroupSelector(BaseModel): + group: Annotated[ + Optional[str], + Field( + description='The group to assign to nodes that match the selector.\n+eda:ui:title="Group"' + ), + ] = None + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description='+kubebuilder:validation:Optional\n+eda:ui:title="Node Selector"\n+eda:ui:format="labelselector"\nLabel selector to use to match nodes that should be assigned to this group.' + ), + ] = None + + class TopologyStateGroupingBase(BaseModel): + """ + Embed this type inside your topology tier CRD spec to determine the tiers and the + groups of the nodes in the topology. + """ + groupSelectors: Annotated[ Optional[List[TopologyStateGroupSelector]], Field( @@ -1299,20 +1103,145 @@ class TopologyStateGroupingBase(BaseModel): uiName: Annotated[ Optional[str], Field( - description='The name of the topology grouping to expose in the UI\n+eda:ui:title="UI Name"' + description='The name of the topology grouping to expose in the UI\n+eda:ui:title="UI Name"' + ), + ] = None + uiNameKey: Annotated[ + Optional[str], + Field( + description='The translation key for the name of the topology grouping to expose in the UI\n+eda:ui:title="UI Name Key"' + ), + ] = None + + +class TopologyStateTierSelector(BaseModel): + nodeSelector: Annotated[ + Optional[List[str]], + Field( + description='+kubebuilder:validation:Optional\n+eda:ui:title="Node Selector"\n+eda:ui:format="labelselector"\nLabel selector to use to match nodes that should be assigned to this tier.' + ), + ] = None + tier: Annotated[ + Optional[int], + Field( + description='The tier to assign to nodes that match the selector.\n+eda:ui:title="Tier"' + ), + ] = None + + +class Transaction(BaseModel): + crs: Annotated[ + List[TransactionCr], + Field(description="List of CRs to include in the transaction"), + ] + description: Annotated[ + str, Field(description="Description/commit message for the transaction") + ] + dryRun: Annotated[ + bool, + Field( + description="If true the transaction will not be committed and will run in dry run mode. If false the\ntransaction will be committed" + ), + ] + resultType: Annotated[ + Optional[str], + Field(description="The type of result - errors only, normal, or debug"), + ] = None + retain: Annotated[ + Optional[bool], + Field( + description="retain after results fetched - e.g. after call to get transaction result" + ), + ] = None + + +class TransactionAppError(BaseModel): + rawError: Optional[str] = None + structuredError: Optional[TransactionStructuredAppError] = None + + +class TransactionContent(BaseModel): + apiVersion: Optional[str] = None + kind: Optional[str] = None + metadata: Optional[Metadata] = None + spec: Optional[Dict[str, Any]] = None + + +class TransactionCr(BaseModel): + type: Optional[TransactionType] = None + + +class TransactionDetails(BaseModel): + changedCrs: Annotated[ + Optional[List[TransactionNsCrGvkNames]], + Field(description="List of changed CRs as part of the transaction"), + ] = None + dryRun: Annotated[ + Optional[bool], Field(description="True if the transaction was not committed") + ] = None + generalErrors: Annotated[ + Optional[List[str]], + Field(description="List of general errors while running the transaction"), + ] = None + inputCrs: Annotated[ + Optional[List[TransactionInputResource]], + Field(description="List of input CRs from the transaction"), + ] = None + intentsRun: Annotated[ + Optional[List[TransactionIntentResult]], + Field(description="List of intents which ran as part of the transaction"), + ] = None + nodesWithConfigChanges: Annotated[ + Optional[List[TransactionNodeResult]], + Field( + description="List of nodes with configuration changes from the transaction" + ), + ] = None + state: Annotated[ + Optional[str], Field(description="The state of the transaction") + ] = None + success: Annotated[ + Optional[bool], Field(description="True if the CR was successfully applied") + ] = None + + +class TransactionExecutionResult(BaseModel): + changedCrs: Annotated[ + Optional[List[TransactionNsCrGvkNames]], + Field(description="List of changed CRs as part of the transaction"), + ] = None + executionSummary: Annotated[ + Optional[str], + Field(description="Information about time taken during processing"), + ] = None + generalErrors: Annotated[ + Optional[List[str]], + Field(description="List of general errors while running the transaction"), + ] = None + intentsRun: Annotated[ + Optional[List[TransactionIntentResult]], + Field(description="List of intents which ran as part of the transaction"), + ] = None + nodesWithConfigChanges: Annotated[ + Optional[List[TransactionNodeResult]], + Field( + description="List of nodes with configuration changes from the transaction" ), ] = None - uiNameKey: Annotated[ - Optional[str], + + +class TransactionId(BaseModel): + id: Annotated[ + Optional[int], Field( - description='The translation key for the name of the topology grouping to expose in the UI\n+eda:ui:title="UI Name Key"' + description="A transaction identifier; these are assigned by the system to a posted transaction." ), ] = None -class TransactionAppError(BaseModel): - rawError: Optional[str] = None - structuredError: Optional[TransactionStructuredAppError] = None +class TransactionInputResource(BaseModel): + isDelete: Optional[bool] = None + name: Optional[NsCrGvkName] = None class TransactionIntentResult(BaseModel): @@ -1323,15 +1252,130 @@ class TransactionIntentResult(BaseModel): script: Optional[TransactionScriptResults] = None +class TransactionNodeResult(BaseModel): + """ + The name of a node with changes from a transaction, and a list + of errors that occurred for the node + """ + + errors: Annotated[ + Optional[List[str]], Field(description="Resulting errors for the node") + ] = None + name: Annotated[Optional[str], Field(description="The name of the node")] = None + namespace: Annotated[ + Optional[str], Field(description="The namespace of the node") + ] = None + + +class TransactionNsCrGvkNames(BaseModel): + gvk: Optional[GroupVersionKind] = None + names: Optional[List[str]] = None + namespace: Optional[str] = None + + +class TransactionPatch(BaseModel): + patchOps: List[K8SPatchOp] + target: NsCrGvkName + + +class TransactionPoolAllocation(BaseModel): + key: Optional[str] = None + poolName: Optional[str] = None + poolTemplate: Optional[str] = None + value: Optional[str] = None + + +class TransactionResultInputResources(BaseModel): + inputCrs: Annotated[ + Optional[List[TransactionInputResource]], + Field(description="List of input resources from the transaction"), + ] = None + limitedAccess: Annotated[ + Optional[bool], + Field( + description="This field is true if the list returned here is not the complete list of input resources in the transaction because the user does not have read-access to some of them" + ), + ] = None + + class TransactionResultObject(BaseModel): after: Optional[TransactionResultObjectString] = None before: Optional[TransactionResultObjectString] = None dataUnavailable: Annotated[ Optional[bool], - Field(description='True if there is no data available for the result'), + Field(description="True if there is no data available for the result"), ] = None format: Annotated[ - Optional[str], Field(description='The format of the response - Text or YAML') + Optional[str], Field(description="The format of the response - Text or YAML") + ] = None + + +class TransactionResultObjectString(BaseModel): + data: Optional[str] = None + + +class TransactionScriptResults(BaseModel): + executionTime: Optional[int] = None + output: Optional[str] = None + + +class TransactionState(BaseModel): + state: Annotated[ + Optional[str], Field(description="The state of the transaction") + ] = None + + +class TransactionStructuredAppError(BaseModel): + message: Optional[str] = None + messageKey: Optional[str] = None + values: Optional[Dict[str, Dict[str, Any]]] = None + + +class TransactionSummaryResult(BaseModel): + """ + Summary of the result of a transaction + """ + + commitHash: Annotated[ + Optional[str], Field(description="The git commit hash for the transaction") + ] = None + description: Annotated[ + Optional[str], + Field( + description="The description of the transaction, as posted in the transaction request." + ), + ] = None + details: Annotated[ + Optional[str], + Field( + description="The type of details available for the transaction, as posted in the transaction request." + ), + ] = None + dryRun: Annotated[ + Optional[bool], + Field( + description="If true the transaction was not committed and ran in dry run mode." + ), + ] = None + id: Annotated[Optional[int], Field(description="The transaction identifier")] = None + lastChangeTimestamp: Annotated[ + Optional[str], Field(description="The time that the transaction completed.") + ] = None + state: Annotated[ + Optional[str], Field(description="The state of the transaction.") + ] = None + success: Annotated[ + Optional[bool], Field(description="True if the transaction was successful.") + ] = None + username: Annotated[ + Optional[str], Field(description="The user who posted the transaction.") + ] = None + + +class TransactionSummaryResults(BaseModel): + results: Annotated[ + Optional[List[TransactionSummaryResult]], + Field(description="array of summary-results for transactions"), ] = None @@ -1343,126 +1387,131 @@ class TransactionType(BaseModel): replace: Optional[TransactionValue] = None -class UserStorageOutDirContent(BaseModel): - directory_path: Annotated[ +class TransactionValue(BaseModel): + value: Optional[TransactionContent] = None + + +class UrlRule(BaseModel): + path: Annotated[ str, Field( - alias='directory-path', - description='path for the directory within the users storage', + description='The API server URL path to which this rule applies. It can end in "/*"\nin which case the final portion of the URL path can be anything, if the\nprefix matches. It can end in "/**" in which case the URL path can be\nanything if the prefix matches.",', + min_length=1, + pattern="^/.*", ), ] - entries: Annotated[ - List[UserStorageOutDirEntry], - Field(description='array of entries for the items in the directory'), - ] - - -class WorkflowResult(BaseModel): - errorMessage: Optional[str] = None - resultMessage: Optional[str] = None - state: Optional[WorkflowState] = None - success: Optional[bool] = None - + permissions: Annotated[ + Optional[Literal["none", "read", "readWrite"]], + Field(description="The permissions for the API server URL for the rule."), + ] = None -class TopoGroupingStateRequest(BaseModel): - name: Optional[str] = None - spec: Optional[TopologyStateGroupingBase] = None +class UserStatus(BaseModel): + failedLoginSinceSuccessfulLogin: Optional[int] = None + isFederatedUser: Annotated[ + Optional[bool], + Field(description="True if the user comes from a federated LDAP server"), + ] = None + lastFailedLogin: Optional[str] = None + lastSuccessfulLogin: Optional[str] = None + temporarilyDisabled: Optional[bool] = None -class TopoStateRequest(BaseModel): - grouping: Optional[TopoGroupingStateRequest] = None - namespace: Optional[str] = None - overlays: Optional[TopoOverlayStateRequest] = None +class UserStorageInFileContent(BaseModel): + file_content: Annotated[ + str, + Field( + alias="file-content", + description="The desired content of the user-storage file. This will be base64 decoded before storing if the request indicates that the content is base64 encoded.", + ), + ] -class Topologies(RootModel[List[Topology]]): - root: List[Topology] +class UserStorageOutDirContent(BaseModel): + directory_path: Annotated[ + str, + Field( + alias="directory-path", + description="path for the directory within the users storage", + ), + ] + entries: Annotated[ + List[UserStorageOutDirEntry], + Field(description="array of entries for the items in the directory"), + ] -class TransactionCr(BaseModel): - type: Optional[TransactionType] = None +class UserStorageOutDirEntry(BaseModel): + """ + user-storage directory entry + """ -class TransactionDetails(BaseModel): - changedCrs: Annotated[ - Optional[List[TransactionNsCrGvkNames]], - Field(description='List of changed CRs as part of the transaction'), - ] = None - dryRun: Annotated[ - Optional[bool], Field(description='True if the transaction was not committed') - ] = None - generalErrors: Annotated[ - Optional[List[str]], - Field(description='List of general errors while running the transaction'), - ] = None - inputCrs: Annotated[ - Optional[List[TransactionInputResource]], - Field(description='List of input CRs from the transaction'), - ] = None - intentsRun: Annotated[ - Optional[List[TransactionIntentResult]], - Field(description='List of intents which ran as part of the transaction'), - ] = None - nodesWithConfigChanges: Annotated[ - Optional[List[TransactionNodeResult]], + modification_time: Annotated[ + Optional[datetime], Field( - description='List of nodes with configuration changes from the transaction' + alias="modification-time", + description="modification type of the item, if a file", ), ] = None - state: Annotated[ - Optional[str], Field(description='The state of the transaction') - ] = None - success: Annotated[ - Optional[bool], Field(description='True if the CR was successfully applied') - ] = None + name: Annotated[str, Field(description="name of the item within the directory")] + type: Annotated[str, Field(description='type of the item; "file" or "directory"')] -class TransactionExecutionResult(BaseModel): - changedCrs: Annotated[ - Optional[List[TransactionNsCrGvkNames]], - Field(description='List of changed CRs as part of the transaction'), - ] = None - executionSummary: Annotated[ +class UserStorageOutFileContent(BaseModel): + file_content: Annotated[ Optional[str], - Field(description='Information about time taken during processing'), - ] = None - generalErrors: Annotated[ - Optional[List[str]], - Field(description='List of general errors while running the transaction'), + Field( + alias="file-content", + description="content of the file, will be base64 encoded if the request asked for this", + ), ] = None - intentsRun: Annotated[ - Optional[List[TransactionIntentResult]], - Field(description='List of intents which ran as part of the transaction'), + file_deleted: Annotated[ + Optional[bool], + Field( + alias="file-deleted", + description="if present and true, indicates the file has been deleted; used for\nstreamed responses", + ), ] = None - nodesWithConfigChanges: Annotated[ - Optional[List[TransactionNodeResult]], + file_name: Annotated[str, Field(alias="file-name", description="name of the file")] + modification_time: Annotated[ + Optional[datetime], Field( - description='List of nodes with configuration changes from the transaction' + alias="modification-time", + description="UTC modification time of the file, as an RFC 3339 date/time.\nNot valid if file-deleted is true (in a streamed response)", ), ] = None -class Transaction(BaseModel): - crs: Annotated[ - List[TransactionCr], - Field(description='List of CRs to include in the transaction'), +class VersionInfo(RootModel[Optional[Dict[str, SingleVersionInfo]]]): + root: Optional[Dict[str, SingleVersionInfo]] = None + + +class Workflow(BaseModel): + cr: Annotated[ + Dict[str, Dict[str, Any]], + Field(description="Custom resource that defines the workflow to execute"), ] description: Annotated[ - str, Field(description='Description/commit message for the transaction') - ] - dryRun: Annotated[ - bool, - Field( - description='If true the transaction will not be committed and will run in dry run mode. If false the\ntransaction will be committed' - ), + str, Field(description="Description message for the workflow") ] - resultType: Annotated[ - Optional[str], - Field(description='The type of result - errors only, normal, or debug'), - ] = None - retain: Annotated[ - Optional[bool], + + +class WorkflowId(BaseModel): + id: Annotated[ + Optional[int], Field( - description='retain after results fetched - e.g. after call to get transaction result' + description="A workflow identifier; these are assigned by the system to a posted workflow." ), ] = None + + +class WorkflowResult(BaseModel): + errorMessage: Optional[str] = None + resultMessage: Optional[str] = None + state: Optional[WorkflowState] = None + success: Optional[bool] = None + + +class WorkflowState(BaseModel): + runningState: Optional[str] = None + state: Optional[str] = None diff --git a/pyproject.toml b/pyproject.toml index 0a1705b..3c01765 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,18 +1,13 @@ [project] name = "pydantic-eda" -version = "0.1.0" +version = "0.3.0" description = "Pydantic models for EDA OpenAPI specification" readme = "README.md" requires-python = "~=3.12" dependencies = ["pydantic>=2.10.6"] [dependency-groups] -dev = [ - "datamodel-code-generator[http]>=0.26.5", - "httpx>=0.28.1", - "rich>=13.9.4", - "ruff>=0.9.3", -] +dev = ["datamodel-code-generator[http]>=0.30.1", "rich>=13.9.4", "ruff>=0.9.3"] [build-system] requires = ["hatchling"] diff --git a/uv.lock b/uv.lock index 617d4b2..a4a3726 100644 --- a/uv.lock +++ b/uv.lock @@ -89,7 +89,7 @@ wheels = [ [[package]] name = "datamodel-code-generator" -version = "0.26.5" +version = "0.30.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "argcomplete" }, @@ -99,12 +99,12 @@ dependencies = [ { name = "isort" }, { name = "jinja2" }, { name = "packaging" }, - { name = "pydantic", extra = ["email"] }, + { name = "pydantic" }, { name = "pyyaml" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/63/e4/53153452235a387112df40f67aaf24072d4b5e33aa7bb385004f4c4baf38/datamodel_code_generator-0.26.5.tar.gz", hash = "sha256:c4a94a7dbf7972129882732d9bcee44c9ae090f57c82edd58d237b9d48c40dd0", size = 92586 } +sdist = { url = "https://files.pythonhosted.org/packages/ef/bc/627a77eafcf7101c9f5710130b2def98593709a8d29676e4a58f09cd2a23/datamodel_code_generator-0.30.1.tar.gz", hash = "sha256:d125012face4cd1eca6c9300297a1f5775a9d5ff8fc3f68d34d0944a7beea105", size = 446630 } wheels = [ - { url = "https://files.pythonhosted.org/packages/5a/d8/ead3e857d4048947fe92a731d6b1f257dcb267cc8b8918d3b72598c9b728/datamodel_code_generator-0.26.5-py3-none-any.whl", hash = "sha256:e32f986b9914a2b45093947043aa0192d704650be93151f78acf5c95676601ce", size = 114982 }, + { url = "https://files.pythonhosted.org/packages/e1/b3/01aab190372914399bbc77f89ac3b24b439c3d97a52a6198f1cd1396ef3a/datamodel_code_generator-0.30.1-py3-none-any.whl", hash = "sha256:9601dfa3da8aa8d8d54e182059f78836b1768a807d5c26df798db12d4054c8f3", size = 118045 }, ] [package.optional-dependencies] @@ -112,28 +112,6 @@ http = [ { name = "httpx" }, ] -[[package]] -name = "dnspython" -version = "2.7.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b5/4a/263763cb2ba3816dd94b08ad3a33d5fdae34ecb856678773cc40a3605829/dnspython-2.7.0.tar.gz", hash = "sha256:ce9c432eda0dc91cf618a5cedf1a4e142651196bbcd2c80e89ed5a907e5cfaf1", size = 345197 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/68/1b/e0a87d256e40e8c888847551b20a017a6b98139178505dc7ffb96f04e954/dnspython-2.7.0-py3-none-any.whl", hash = "sha256:b4c34b7d10b51bcc3a5071e7b8dee77939f1e878477eeecc965e9835f63c6c86", size = 313632 }, -] - -[[package]] -name = "email-validator" -version = "2.2.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "dnspython" }, - { name = "idna" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/48/ce/13508a1ec3f8bb981ae4ca79ea40384becc868bfae97fd1c942bb3a001b1/email_validator-2.2.0.tar.gz", hash = "sha256:cb690f344c617a714f22e66ae771445a1ceb46821152df8e165c5f9a364582b7", size = 48967 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d7/ee/bf0adb559ad3c786f12bcbc9296b3f5675f529199bef03e2df281fa1fadb/email_validator-2.2.0-py3-none-any.whl", hash = "sha256:561977c2d73ce3611850a06fa56b414621e0c8faa9d66f2611407d87465da631", size = 33521 }, -] - [[package]] name = "genson" version = "1.3.0" @@ -328,11 +306,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f4/3c/8cc1cc84deffa6e25d2d0c688ebb80635dfdbf1dbea3e30c541c8cf4d860/pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584", size = 431696 }, ] -[package.optional-dependencies] -email = [ - { name = "email-validator" }, -] - [[package]] name = "pydantic-core" version = "2.27.2" @@ -375,7 +348,7 @@ wheels = [ [[package]] name = "pydantic-eda" version = "0.1.0" -source = { virtual = "." } +source = { editable = "." } dependencies = [ { name = "pydantic" }, ] @@ -393,7 +366,7 @@ requires-dist = [{ name = "pydantic", specifier = ">=2.10.6" }] [package.metadata.requires-dev] dev = [ - { name = "datamodel-code-generator", extras = ["http"], specifier = ">=0.26.5" }, + { name = "datamodel-code-generator", extras = ["http"], specifier = ">=0.30.1" }, { name = "httpx", specifier = ">=0.28.1" }, { name = "rich", specifier = ">=13.9.4" }, { name = "ruff", specifier = ">=0.9.3" },