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

Commit

Permalink
UX2Config rework
Browse files Browse the repository at this point in the history
  • Loading branch information
sbasan committed Feb 23, 2024
1 parent a2f1bb4 commit 146508f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions catalystwan/models/configuration/config_migration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from datetime import datetime
from typing import List, Literal, Optional, Union
from typing import List, Literal, Union
from uuid import UUID

from pydantic import BaseModel, ConfigDict, Field
Expand All @@ -9,7 +9,6 @@
from catalystwan.api.template_api import DeviceTemplateInformation, FeatureTemplateInformation
from catalystwan.endpoints.configuration_feature_profile import ConfigurationFeatureProfile
from catalystwan.endpoints.configuration_group import ConfigGroup
from catalystwan.exceptions import ManagerHTTPError
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
Expand Down Expand Up @@ -55,6 +54,12 @@ class UX1Templates(BaseModel):
devices: List[DeviceTemplateInformation] = Field(default=[])


class ConfigGroupPreset(BaseModel):
config_group_name: str = Field(serialization_alias="name", validation_alias="name")
solution: Literal["sdwan"] = "sdwan"
profile_parcels: List[AnyParcel] = Field(serialization_alias="profileParcels", validation_alias="profileParcels")


class UX1Config(BaseModel):
# All UX1 Configuration items - Mega Model
model_config = ConfigDict(populate_by_name=True)
Expand All @@ -66,16 +71,11 @@ class UX2Config(BaseModel):
# All UX2 Configuration items - Mega Model
model_config = ConfigDict(populate_by_name=True)
# TODO: config group name
config_groups: List[ConfigGroup] = Field(
default=[], serialization_alias="configurationGroups", validation_alias="configurationGroups"
)
policy_groups: List[ConfigGroup] = Field(
default=[], serialization_alias="policyGroups", validation_alias="policyGroups"
)
profile_parcels: List[AnyParcel] = Field(
default=[], serialization_alias="profileParcels", validation_alias="profileParcels"
config_group_presets: List[ConfigGroupPreset] = Field(
default=[], serialization_alias="configGroupPresets", validation_alias="configGroupPresets"
)


class ConfigGroupCreator:
"""
Creates a configuration group and attach feature profiles for migrating UX1 templates to UX2.
Expand Down

0 comments on commit 146508f

Please sign in to comment.