This repository was archived by the owner on Jul 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
pystackpath/stacks/wafsites/policy_groups Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ cdnsite = sp.stacks().get(stackid).cdnsites().get(cdnsiteid).delete()
71
71
``` python
72
72
cdnsiteid = " 19e1a7b2-068f-491c-a95f-b64eae66dd34"
73
73
cdnsite = sp.stacks().get(stackid).cdnsites().get(cdnsiteid).enable()
74
- cdnsite = cdnsite.enable ()
74
+ cdnsite = cdnsite.disable ()
75
75
```
76
76
77
77
### Purge a cdn resource and check the purge status.
Original file line number Diff line number Diff line change @@ -21,6 +21,26 @@ def get(self, policy_group_id):
21
21
response = self ._client .get (f"{ self ._base_api } /policy_groups/{ policy_group_id } " )
22
22
return self .loaddict (response .json ()["policyGroup" ])
23
23
24
+ def update (self , policy_groups ):
25
+ """
26
+ Update all the policies in the given policy_groups
27
+
28
+ :param policy_groups: List of policy groups
29
+
30
+ Example:
31
+ [
32
+ {
33
+ "id": "d694f10e-7faf-4517-bc5b-265e95c04442",
34
+ "policies": [{ "enabled": false, "id": "S8758188" }]
35
+ }
36
+ ]
37
+
38
+ """
39
+ return self ._client .patch (
40
+ f"{ self ._base_api } /policy_groups" ,
41
+ json = {'policyGroups' : policy_groups }
42
+ )
43
+
24
44
def enable (self ):
25
45
"""
26
46
Enable all policies in a WAF policy group
You can’t perform that action at this time.
0 commit comments