Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #504 from CiscoDevNet/dev/ux-migration-models-fix
Browse files Browse the repository at this point in the history
model fixes
  • Loading branch information
jpkrajewski authored Mar 1, 2024
2 parents 44dd24e + 326ac5c commit 03ab25c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 4 additions & 1 deletion catalystwan/models/configuration/config_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"
)
Expand Down
13 changes: 13 additions & 0 deletions catalystwan/models/configuration/topology_group.py
Original file line number Diff line number Diff line change
@@ -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"
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 03ab25c

Please sign in to comment.