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

Commit

Permalink
define ux1 actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbasan committed Jul 31, 2024
1 parent a1ab1bd commit 139b0f4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 23 additions & 3 deletions catalystwan/models/policy/definition/traffic_data.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Copyright 2023 Cisco Systems, Inc. and its affiliates

from ipaddress import IPv4Address, IPv4Network
from typing import Any, List, Literal, Optional, Set, Tuple, Union, overload
from typing import List, Literal, Optional, Set, Tuple, Union, overload
from uuid import UUID

from pydantic import ConfigDict, Field
from typing_extensions import Annotated

from catalystwan.models.common import AcceptDropActionType, EncapType, IcmpMsgType, ServiceChainNumber, TLOCColor
from catalystwan.models.policy.policy_definition import (
ActionSet,
AppListEntry,
CFlowDAction,
CountAction,
Expand Down Expand Up @@ -91,7 +92,26 @@
Field(discriminator="field"),
]

TrafficDataPolicySequenceActions = Any # TODO
TrafficDataPolicySequenceActionEntry = Annotated[
Union[
CountAction,
LogAction,
CFlowDAction,
NATAction,
RedirectDNSAction,
TCPOptimizationAction,
DREOptimizationAction,
ServiceNodeGroupAction,
LossProtectionAction,
LossProtectionFECAction,
LossProtectionPacketDuplicationAction,
SecureInternetGatewayAction,
FallBackToRoutingAction,
],
Field(discriminator="type"),
]

TrafficDataPolicySequenceAction = Union[TrafficDataPolicySequenceActionEntry, ActionSet]


class TrafficDataPolicyHeader(PolicyDefinitionBase):
Expand All @@ -108,7 +128,7 @@ class TrafficDataPolicySequence(PolicyDefinitionSequenceBase):
)
base_action: AcceptDropActionType = Field(serialization_alias="baseAction", validation_alias="baseAction")
match: TrafficDataPolicySequenceMatch = TrafficDataPolicySequenceMatch()
actions: List[TrafficDataPolicySequenceActions] = []
actions: List[TrafficDataPolicySequenceAction] = []
model_config = ConfigDict(populate_by_name=True)

def match_app_list(self, app_list_id: UUID) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ def traffic_data(
out_seq.match_tcp()
elif in_match.field == "trafficTo":
out_seq.match_traffic_to(in_match.value)
for in_action in in_seq.actions:
pass
return result


Expand Down

0 comments on commit 139b0f4

Please sign in to comment.