This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
rule_set.py
62 lines (46 loc) · 1.99 KB
/
rule_set.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 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.models.policy.definitions.rule_set import RuleSet
from catalystwan.models.policy.policy_definition import (
PolicyDefinitionEditResponse,
PolicyDefinitionEndpoints,
PolicyDefinitionGetResponse,
PolicyDefinitionId,
PolicyDefinitionInfo,
PolicyDefinitionPreview,
)
from catalystwan.typed_list import DataSequence
class RuleSetEditPayload(RuleSet, PolicyDefinitionId):
pass
class RuleSetGetResponse(RuleSet, PolicyDefinitionGetResponse):
pass
class ConfigurationPolicyRuleSetDefinition(APIEndpoints, PolicyDefinitionEndpoints):
@post("/template/policy/definition/ruleset")
def create_policy_definition(self, payload: RuleSet) -> PolicyDefinitionId:
...
@delete("/template/policy/definition/ruleset/{id}")
def delete_policy_definition(self, id: UUID) -> None:
...
def edit_multiple_policy_definition(self):
# PUT /template/policy/definition/ruleset/multiple/{id}
...
@put("/template/policy/definition/ruleset/{id}")
def edit_policy_definition(self, id: UUID, payload: RuleSetEditPayload) -> PolicyDefinitionEditResponse:
...
@get("/template/policy/definition/ruleset", "data")
def get_definitions(self) -> DataSequence[PolicyDefinitionInfo]:
...
@get("/template/policy/definition/ruleset/{id}")
def get_policy_definition(self, id: UUID) -> RuleSetGetResponse:
...
@post("/template/policy/definition/ruleset/preview")
def preview_policy_definition(self, payload: RuleSet) -> PolicyDefinitionPreview:
...
@get("/template/policy/definition/ruleset/preview/{id}")
def preview_policy_definition_by_id(self, id: UUID) -> PolicyDefinitionPreview:
...
def save_policy_definition_in_bulk(self):
# PUT /template/policy/definition/ruleset/bulk
...