diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/__init__.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/__init__.py index a32092e7..5fe244ee 100644 --- a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/__init__.py +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/__init__.py @@ -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 @@ -55,6 +56,7 @@ IPv6DataPrefixParcel, IPv6PrefixListParcel, LocalDomainParcel, + MirrorParcel, PolicerParcel, PreferredColorGroupParcel, PrefixListParcel, @@ -102,6 +104,7 @@ "IPv6PrefixListParcel", "LocalDomainListEntry", "LocalDomainParcel", + "MirrorParcel", "PolicerEntry", "PolicerParcel", "Preference", diff --git a/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/mirror.py b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/mirror.py new file mode 100644 index 00000000..4af4c560 --- /dev/null +++ b/catalystwan/models/configuration/feature_profile/sdwan/policy_object/policy/mirror.py @@ -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_items=1, max_items=1)