-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateendpoint.py
More file actions
54 lines (47 loc) · 1.47 KB
/
createendpoint.py
File metadata and controls
54 lines (47 loc) · 1.47 KB
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
import requests
from akamai.edgegrid import EdgeRc, EdgeGridAuth
session = requests.Session()
edgerc = EdgeRc('~/.edgerc')
section = 'default'
hostname = edgerc.get(section, 'host')
session.auth = EdgeGridAuth.from_edgerc(edgerc, section)
with open("/home/aaron/BOTMANPROJECT/FILES/OPERATORIDS.txt", 'r') as file:
List = open("/home/aaron/BOTMANPROJECT/FILES/OPERATORIDS.txt").readlines()
name_length = len(List)
for i in range(name_length):
file = open('/home/aaron/BOTMANPROJECT/FILES/OPERATORIDS.txt')
linenumber = int(i)
Operatorid = file.readlines()
print(Operatorid[i])
NewOperatorid = (Operatorid[i])
jsonparam = {
"telemetryTypeStates": {
"inline": {
"enabled": False
},
"nativeSdk": {
"enabled": False,
"disabledAction": "monitor"
},
"standard": {
"enabled": True,
}
},
"traffic": {
"standardTelemetry": {
"aggressiveAction": "monitor",
"strictAction": "monitor",
"overrideThresholds": False
}
},
"apiEndPointId": 845900,
"operationId": (NewOperatorid)
}
payload = jsonparam
params = {
'accountSwitchKey':'B-F-F2JX4L:1-8BYUX'
}
path = "/appsec/v1/configs/75451/versions/473/security-policies/TRDO_193032/transactional-endpoints/bot-protection"
response = session.post('https://' + hostname + path, json=payload, params=params)
jsonresponse = response.json()
print(jsonresponse)