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

Commit

Permalink
draft: endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sbasan committed Oct 7, 2024
1 parent 46a701a commit 5c0a52a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
50 changes: 50 additions & 0 deletions catalystwan/endpoints/configuration/policy/definition/app_route.py
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:
...
2 changes: 2 additions & 0 deletions catalystwan/endpoints/endpoints_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
)
from catalystwan.endpoints.configuration.policy.definition.aip import ConfigurationPolicyAIPDefinition
from catalystwan.endpoints.configuration.policy.definition.amp import ConfigurationPolicyAMPDefinition
from catalystwan.endpoints.configuration.policy.definition.app_route import ConfigurationPolicyAppRouteDefinition
from catalystwan.endpoints.configuration.policy.definition.control import ConfigurationPolicyControlDefinition
from catalystwan.endpoints.configuration.policy.definition.device_access import (
ConfigurationPolicyDeviceAccessDefinition,
Expand Down Expand Up @@ -151,6 +152,7 @@ def __init__(self, session: ManagerSession):
self.acl_ipv6 = ConfigurationPolicyAclIPv6Definition(session)
self.advanced_inspection_profile = ConfigurationPolicyAIPDefinition(session)
self.advanced_malware_protection = ConfigurationPolicyAMPDefinition(session)
self.app_route = ConfigurationPolicyAppRouteDefinition(session)
self.control = ConfigurationPolicyControlDefinition(session)
self.data = ConfigurationPolicyDataDefinition(session)
self.device_access = ConfigurationPolicyDeviceAccessDefinition(session)
Expand Down

0 comments on commit 5c0a52a

Please sign in to comment.