From 326ac5cd2b8f8c7153e5b29264a56eaf74e55899 Mon Sep 17 00:00:00 2001 From: sbasan Date: Fri, 1 Mar 2024 17:46:53 +0100 Subject: [PATCH] model fixes --- .../models/configuration/config_migration.py | 5 ++++- catalystwan/models/configuration/topology_group.py | 13 +++++++++++++ pyproject.toml | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 catalystwan/models/configuration/topology_group.py diff --git a/catalystwan/models/configuration/config_migration.py b/catalystwan/models/configuration/config_migration.py index acd7b58ba..7e977cb51 100644 --- a/catalystwan/models/configuration/config_migration.py +++ b/catalystwan/models/configuration/config_migration.py @@ -8,6 +8,7 @@ from catalystwan.models.configuration.feature_profile.common import FeatureProfileCreationPayload from catalystwan.models.configuration.feature_profile.sdwan.policy_object import AnyPolicyObjectParcel from catalystwan.models.configuration.feature_profile.sdwan.system import AnySystemParcel +from catalystwan.models.configuration.topology_group import TopologyGroup from catalystwan.models.policy import ( AnyPolicyDefinition, AnyPolicyList, @@ -69,9 +70,11 @@ class UX1Config(BaseModel): class UX2Config(BaseModel): - # All UX2 Configuration items - Mega Model # All UX2 Configuration items - Mega Model model_config = ConfigDict(populate_by_name=True) + topology_groups: List[TopologyGroup] = Field( + default=[], serialization_alias="topologyGroups", validation_alias="topologyGroups" + ) config_groups: List[ConfigGroup] = Field( default=[], serialization_alias="configurationGroups", validation_alias="configurationGroups" ) diff --git a/catalystwan/models/configuration/topology_group.py b/catalystwan/models/configuration/topology_group.py new file mode 100644 index 000000000..47ecddb7f --- /dev/null +++ b/catalystwan/models/configuration/topology_group.py @@ -0,0 +1,13 @@ +from typing import List, Literal, Optional +from uuid import UUID + +from pydantic import BaseModel, Field + + +class TopologyGroup(BaseModel): + name: str + solution: Literal["sdwan"] = "sdwan" + profiles: List[UUID] = [] + from_topology_group: Optional[UUID] = Field( + default=None, serialization_alias="fromTopologyGroup", validation_alias="fromTopologyGroup" + ) diff --git a/pyproject.toml b/pyproject.toml index e947c3a0e..7ca314505 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "catalystwan" -version = "0.31.0dev3" +version = "0.31.0dev4" description = "Cisco Catalyst WAN SDK for Python" authors = ["kagorski "] readme = "README.md"