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

dev-uxmt: Mirror model #42

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions catalystwan/models/configuration/feature_profile/parcel.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"class",
"data-ipv6-prefix",
"ipv6-prefix",
"mirror",
"prefix",
"policer",
"preferred-color-group",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .policy.fowarding_class import FowardingClassParcel, FowardingClassQueueEntry
from .policy.ipv6_data_prefix import IPv6DataPrefixEntry, IPv6DataPrefixParcel
from .policy.ipv6_prefix_list import IPv6PrefixListEntry, IPv6PrefixListParcel
from .policy.mirror import MirrorParcel
from .policy.policer import PolicerEntry, PolicerParcel
from .policy.prefered_group_color import Preference, PreferredColorGroupEntry, PreferredColorGroupParcel
from .policy.prefix_list import PrefixListEntry, PrefixListParcel
Expand Down Expand Up @@ -55,6 +56,7 @@
IPv6DataPrefixParcel,
IPv6PrefixListParcel,
LocalDomainParcel,
MirrorParcel,
PolicerParcel,
PreferredColorGroupParcel,
PrefixListParcel,
Expand Down Expand Up @@ -102,6 +104,7 @@
"IPv6PrefixListParcel",
"LocalDomainListEntry",
"LocalDomainParcel",
"MirrorParcel",
"PolicerEntry",
"PolicerParcel",
"Preference",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 Cisco Systems, Inc. and its affiliates

from typing import List, Literal

from pydantic import AliasPath, BaseModel, ConfigDict, Field

from catalystwan.api.configuration_groups.parcel import Global, _ParcelBase


class MirrorEntry(BaseModel):
model_config = ConfigDict(populate_by_name=True)
remote_dest_ip: Global[str] = Field(validation_alias="remoteDestIp", serialization_alias="remoteDestIp")
source_ip: Global[str] = Field(validation_alias="sourceIp", serialization_alias="sourceIp")


class MirrorParcel(_ParcelBase):
type_: Literal["mirror"] = Field(default="mirror", exclude=True)
entries: List[MirrorEntry] = Field(validation_alias=AliasPath("data", "entries"), min_length=1, max_length=1)