This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #685 from cisco-open/extended_community_list_v1_model
Extended community list v1 model
- Loading branch information
Showing
5 changed files
with
110 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
catalystwan/endpoints/configuration/policy/list/extended_community.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright 2023 Cisco Systems, Inc. and its affiliates | ||
|
||
# mypy: disable-error-code="empty-body" | ||
from uuid import UUID | ||
|
||
from catalystwan.endpoints import APIEndpoints, delete, get, post, put | ||
from catalystwan.endpoints.configuration.policy.abstractions import PolicyListEndpoints | ||
from catalystwan.models.policy.list.communities import ( | ||
ExtendedCommunityList, | ||
ExtendedCommunityListEditPayload, | ||
ExtendedCommunityListInfo, | ||
) | ||
from catalystwan.models.policy.policy_list import InfoTag, PolicyListId, PolicyListPreview | ||
from catalystwan.typed_list import DataSequence | ||
|
||
|
||
class ConfigurationPolicyExtendedCommunityList(APIEndpoints, PolicyListEndpoints): | ||
@post("/template/policy/list/extcommunity") | ||
def create_policy_list(self, payload: ExtendedCommunityList) -> PolicyListId: | ||
... | ||
|
||
@delete("/template/policy/list/extcommunity/{id}") | ||
def delete_policy_list(self, id: UUID) -> None: | ||
... | ||
|
||
@delete("/template/policy/list/extcommunity") | ||
def delete_policy_lists_with_info_tag(self, params: InfoTag) -> None: | ||
... | ||
|
||
@put("/template/policy/list/extcommunity/{id}") | ||
def edit_policy_list(self, id: UUID, payload: ExtendedCommunityListEditPayload) -> None: | ||
... | ||
|
||
@get("/template/policy/list/extcommunity/{id}") | ||
def get_lists_by_id(self, id: UUID) -> ExtendedCommunityListInfo: | ||
... | ||
|
||
@get("/template/policy/list/extcommunity", "data") | ||
def get_policy_lists(self) -> DataSequence[ExtendedCommunityListInfo]: | ||
... | ||
|
||
@get("/template/policy/list/extcommunity/filtered", "data") | ||
def get_policy_lists_with_info_tag(self, params: InfoTag) -> DataSequence[ExtendedCommunityListInfo]: | ||
... | ||
|
||
@post("/template/policy/list/extcommunity/preview") | ||
def preview_policy_list(self, payload: ExtendedCommunityList) -> PolicyListPreview: | ||
... | ||
|
||
@get("/template/policy/list/extcommunity/preview/{id}") | ||
def preview_policy_list_by_id(self, id: UUID) -> PolicyListPreview: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters