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

Use AnyPolicyDefinitionInfo / AnyPolicyListInfo in UX1Config #523

Merged
merged 36 commits into from
Mar 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
61bf5c0
phase 1
sbasan Mar 13, 2024
eb50414
separate endpoint from models, add app_probe list
sbasan Mar 13, 2024
19d3d9c
separate app-list
sbasan Mar 13, 2024
c0225c0
separate as-path-list
sbasan Mar 13, 2024
9b08773
separate class-map-list
sbasan Mar 13, 2024
2a303b1
separate community-list, expanded-community-list
sbasan Mar 13, 2024
79ab87c
separate data-ipv6-prefix-list
sbasan Mar 13, 2024
f8d1a98
separate data-prefix-list
sbasan Mar 13, 2024
9c913e7
separate fqdn-list
sbasan Mar 13, 2024
2198dbd
separate geo-location-list
sbasan Mar 13, 2024
22e9bc0
separate ips-signature-list
sbasan Mar 13, 2024
404a299
separate ipv6-prefix-list
sbasan Mar 14, 2024
3b410a7
separate local-app-list
sbasan Mar 14, 2024
19182ad
separate local-domain-list
sbasan Mar 14, 2024
6454e72
separate mirror-list
sbasan Mar 14, 2024
9cb7eb7
separate policer-list
sbasan Mar 14, 2024
9c55b00
separate port-list
sbasan Mar 14, 2024
cd96609
separate preferred-color-group-list
sbasan Mar 14, 2024
f8cde35
separate prefix-list
sbasan Mar 14, 2024
0c33c40
separate protocol-name-list
sbasan Mar 14, 2024
2e7b8eb
separate region-list
sbasan Mar 14, 2024
02d7bfe
separate site-list
sbasan Mar 14, 2024
6645d8e
separate sla-class-list
sbasan Mar 14, 2024
4902258
separate tloc-list
sbasan Mar 14, 2024
d427dff
separate url-lists
sbasan Mar 14, 2024
0579c35
separate vpn-list
sbasan Mar 14, 2024
0db6ed9
separate zone-list
sbasan Mar 14, 2024
f4846ea
move PolicyListBase
sbasan Mar 14, 2024
476f4c5
add copyright
sbasan Mar 14, 2024
1f5db57
separate policy definition models from endpoints
sbasan Mar 14, 2024
935a28d
sort
sbasan Mar 14, 2024
2e5dd90
use AnyPolicyDefinitionInfo, AnyPolicyListInfo in UX1Config
sbasan Mar 14, 2024
801f50d
fix policy_list converter
sbasan Mar 14, 2024
d9f9803
include missing file
sbasan Mar 14, 2024
cd1baf9
remove unused file
sbasan Mar 14, 2024
267269b
include entry definitions within owning policy list
sbasan Mar 14, 2024
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
Prev Previous commit
Next Next commit
separate data-ipv6-prefix-list
sbasan committed Mar 13, 2024
commit 79ab87c36c4c68755339e04c2c5e2b9abd685fbb
Original file line number Diff line number Diff line change
@@ -5,19 +5,15 @@

from catalystwan.endpoints import APIEndpoints, delete, get, post, put
from catalystwan.endpoints.configuration.policy.abstractions import PolicyListEndpoints
from catalystwan.models.policy.lists import DataIPv6PrefixList
from catalystwan.models.policy.policy_list import InfoTag, PolicyListId, PolicyListInfo, PolicyListPreview
from catalystwan.models.policy.list.data_ipv6_prefix import (
DataIPv6PrefixList,
DataIPv6PrefixListEditPayload,
DataIPv6PrefixListInfo,
)
from catalystwan.models.policy.policy_list import InfoTag, PolicyListId, PolicyListPreview
from catalystwan.typed_list import DataSequence


class DataIPv6PrefixListEditPayload(DataIPv6PrefixList, PolicyListId):
pass


class DataIPv6PrefixListInfo(DataIPv6PrefixList, PolicyListInfo):
pass


class ConfigurationPolicyDataIPv6PrefixList(APIEndpoints, PolicyListEndpoints):
@post("/template/policy/list/dataipv6prefix")
def create_policy_list(self, payload: DataIPv6PrefixList) -> PolicyListId:
2 changes: 1 addition & 1 deletion catalystwan/models/policy/__init__.py
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
from catalystwan.models.policy.list.class_map import ClassMapList
from catalystwan.models.policy.list.color import ColorList
from catalystwan.models.policy.list.communities import CommunityList, ExpandedCommunityList
from catalystwan.models.policy.list.data_ipv6_prefix import DataIPv6PrefixList

from .centralized import CentralizedPolicy, TrafficDataDirection
from .definition.access_control_list import AclPolicy
@@ -29,7 +30,6 @@
from .definition.vpn_membership import VPNMembershipPolicy
from .definition.zone_based_firewall import ZoneBasedFWPolicy
from .lists import (
DataIPv6PrefixList,
DataPrefixList,
FQDNList,
GeoLocationList,
22 changes: 22 additions & 0 deletions catalystwan/models/policy/list/data_ipv6_prefix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from ipaddress import IPv6Interface
from typing import List, Literal

from catalystwan.models.policy.lists import PolicyListBase
from catalystwan.models.policy.lists_entries import DataIPv6PrefixListEntry
from catalystwan.models.policy.policy_list import PolicyListId, PolicyListInfo


class DataIPv6PrefixList(PolicyListBase):
type: Literal["dataIpv6Prefix"] = "dataIpv6Prefix"
entries: List[DataIPv6PrefixListEntry] = []

def add_prefix(self, ipv6_prefix: IPv6Interface) -> None:
self._add_entry(DataIPv6PrefixListEntry(ipv6_prefix=ipv6_prefix))


class DataIPv6PrefixListEditPayload(DataIPv6PrefixList, PolicyListId):
pass


class DataIPv6PrefixListInfo(DataIPv6PrefixList, PolicyListInfo):
pass
9 changes: 0 additions & 9 deletions catalystwan/models/policy/lists.py
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
from catalystwan.models.common import InterfaceType, TLOCColor
from catalystwan.models.policy.lists_entries import (
ColorGroupPreference,
DataIPv6PrefixListEntry,
DataPrefixListEntry,
EncapType,
FQDNListEntry,
@@ -121,14 +120,6 @@ class LocalAppList(PolicyListBase):
entries: List[LocalAppListEntry] = []


class DataIPv6PrefixList(PolicyListBase):
type: Literal["dataIpv6Prefix"] = "dataIpv6Prefix"
entries: List[DataIPv6PrefixListEntry] = []

def add_prefix(self, ipv6_prefix: IPv6Interface) -> None:
self._add_entry(DataIPv6PrefixListEntry(ipv6_prefix=ipv6_prefix))


class LocalDomainList(PolicyListBase):
type: Literal["localDomain"] = "localDomain"
entries: List[LocalDomainListEntry] = []