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

Commit

Permalink
dev: fix parcel models (#855)
Browse files Browse the repository at this point in the history
* fix: route-policy community action entry

* Fix priority type

---------

Co-authored-by: Jakub Krajewski <jakubpkrajewski@gmail.com>
  • Loading branch information
sbasan and jpkrajewski authored Nov 12, 2024
1 parent 7ab5ce3 commit 7540f46
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class SetCommunity(BaseModel):
populate_by_name=True,
)
additive: Union[Global[bool], Default[bool]] = as_default(False)
community: Optional[Union[Global[str], Global[Community], Variable]] = None
community: Optional[Union[Global[List[str]], Variable]] = None


class Accept(BaseModel):
Expand Down Expand Up @@ -333,8 +333,8 @@ def associate_reject_action(self) -> None:
def associate_as_path_action(self, prepend: List[int]) -> None:
self._accept_action.as_path = SetAsPath.from_list(prepend)

def associate_community_action(self, additive: bool, community: str) -> None:
set_community = SetCommunity(additive=as_global(additive), community=as_global(community))
def associate_communities_action(self, additive: bool, communities: List[str]) -> None:
set_community = SetCommunity(additive=as_global(additive), community=as_global(communities))
self._accept_action.community = set_community

def associate_community_variable_action(self, additive: bool, community: str) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from catalystwan.api.configuration_groups.parcel import Default, Global, Variable, _ParcelBase, as_default, as_global

Priority = Literal["information", "debugging", "notice", "warn", "error", "critical", "alert", "emergency"]
Priority = Literal["informational", "debugging", "notice", "warn", "error", "critical", "alert", "emergency"]
TlsVersion = Literal["TLSv1.1", "TLSv1.2"]
AuthType = Literal["Server", "Mutual"]
CypherSuite = Literal[
Expand Down Expand Up @@ -40,7 +40,9 @@ class Server(BaseModel):
source_interface: Union[Global[str], Default[None], Variable] = Field(
default=Default[None](value=None), serialization_alias="sourceInterface", validation_alias="sourceInterface"
)
priority: Union[Global[Priority], Default[Priority], Variable] = Field(default=as_default("information", Priority))
priority: Union[Global[Priority], Default[Priority], Variable] = Field(
default=as_default("informational", Priority)
)
enable_tls: Union[Global[bool], Default[bool], Variable] = Field(
default=as_default(False), serialization_alias="tlsEnable", validation_alias="tlsEnable"
)
Expand Down Expand Up @@ -109,7 +111,7 @@ def add_ipv4_server(
name: str,
vpn: int = 0,
source_interface: Optional[str] = None,
priority: Priority = "information",
priority: Priority = "informational",
enable_tls: bool = False,
custom_profile: bool = False,
profile_properties: Optional[str] = None,
Expand All @@ -127,7 +129,7 @@ def add_ipv6_server(
name: str,
vpn: int = 0,
source_interface: Optional[str] = None,
priority: Priority = "information",
priority: Priority = "informational",
enable_tls: bool = False,
custom_profile: bool = False,
profile_properties: Optional[str] = None,
Expand All @@ -145,7 +147,7 @@ def _create_server_item(
name: str,
vpn: int,
source_interface: Optional[str] = None,
priority: Priority = "information",
priority: Priority = "informational",
enable_tls: bool = False,
custom_profile: bool = False,
profile_properties: Optional[str] = None,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "catalystwan"
version = "0.36.0dev5"
version = "0.36.0dev6"
description = "Cisco Catalyst WAN SDK for Python"
authors = ["kagorski <kagorski@cisco.com>"]
readme = "README.md"
Expand Down

0 comments on commit 7540f46

Please sign in to comment.