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.
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2024 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 PolicyDefinitionEndpoints | ||
from catalystwan.models.policy.definition.app_route import ( | ||
AppRoutePolicy, | ||
AppRoutePolicyEditPayload, | ||
AppRoutePolicyGetResponse, | ||
) | ||
from catalystwan.models.policy.policy_definition import ( | ||
PolicyDefinitionEditResponse, | ||
PolicyDefinitionId, | ||
PolicyDefinitionInfo, | ||
PolicyDefinitionPreview, | ||
) | ||
from catalystwan.typed_list import DataSequence | ||
|
||
|
||
class ConfigurationPolicyAppRouteDefinition(APIEndpoints, PolicyDefinitionEndpoints): | ||
@post("/template/policy/definition/approute/") | ||
def create_policy_definition(self, payload: AppRoutePolicy) -> PolicyDefinitionId: | ||
... | ||
|
||
@delete("/template/policy/definition/approute/{id}") | ||
def delete_policy_definition(self, id: UUID) -> None: | ||
... | ||
|
||
@put("/template/policy/definition/approute/{id}") | ||
def edit_policy_definition(self, id: UUID, payload: AppRoutePolicyEditPayload) -> PolicyDefinitionEditResponse: | ||
... | ||
|
||
@get("/template/policy/definition/approute", "data") | ||
def get_definitions(self) -> DataSequence[PolicyDefinitionInfo]: | ||
... | ||
|
||
@get("/template/policy/definition/approute/{id}") | ||
def get_policy_definition(self, id: UUID) -> AppRoutePolicyGetResponse: | ||
... | ||
|
||
@post("/template/policy/definition/approute/preview") | ||
def preview_policy_definition(self, payload: AppRoutePolicy) -> PolicyDefinitionPreview: | ||
... | ||
|
||
@get("/template/policy/definition/approute/preview/{id}") | ||
def preview_policy_definition_by_id(self, id: UUID) -> PolicyDefinitionPreview: | ||
... |
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