summaryrefslogtreecommitdiff
path: root/temp/test4.py
diff options
context:
space:
mode:
Diffstat (limited to 'temp/test4.py')
-rw-r--r--temp/test4.py124
1 files changed, 124 insertions, 0 deletions
diff --git a/temp/test4.py b/temp/test4.py
new file mode 100644
index 00000000..d325049e
--- /dev/null
+++ b/temp/test4.py
@@ -0,0 +1,124 @@
+import requests
+import json
+a = """
+191053
+191053
+191061
+191061
+191069
+191069
+191077
+191077
+191101
+191101
+191109
+191109
+191117
+191117
+191125
+191125
+191133
+191133
+191141
+191141
+191149
+191149
+191157
+191157
+191165
+191165
+191173
+191173
+191181
+191181
+191189
+191189
+191197
+191197
+191205
+191205
+191213
+191213
+191221
+191221
+191229
+191229
+191237
+191237
+191245
+191245
+191253
+191253
+191261
+191261
+191269
+191269
+191277
+191277
+191293
+191293
+191301
+191301
+191311
+191311
+191317
+191317
+191325
+191325
+191333
+191333
+191341
+191341
+191349
+191349
+191357
+191357
+191365
+191365
+191373
+191373
+191381
+191381
+191391
+191391
+191409
+191409
+191413
+191413
+191421
+191421
+191429
+191429"""
+#print(a)
+b = a.split()
+c = ",".join(b)
+#print(b)
+#print(c)
+
+req_header = {
+ "Content-Type":"application/x-www-form-urlencoded"
+}
+data = {
+ "username": "zcw",
+ "password": "rmj7HMJYgTq9KlZyhOGj4Q=="
+}
+r_login = requests.post(url="http://192.168.44.72/v1/user/login", headers=req_header, data=data)
+
+token = r_login.json()["data"]["token"]
+print(token)
+
+del_header = {
+ "Content-Type": "application/json",
+ "Authorization": token
+}
+del_data_json = {
+ "refuseCode": "true",
+ "objectIds": b,
+ "objectType": "apn",
+ "vsysId": 1
+}
+del_data = json.dumps(del_data_json)
+
+r_del = requests.delete(url="http://192.168.44.72/v1/policy/object", headers=del_header, data=del_data)
+print(r_del.status_code)
+print(r_del.text) \ No newline at end of file