summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author赵坤 <[email protected]>2023-10-08 03:07:38 +0000
committer赵坤 <[email protected]>2023-10-08 03:07:38 +0000
commit6b1ccee82bfc6f37eeac9956793fbe5157c948fa (patch)
tree56d933a0ffd10de9aba4a148d1898be6164ef4e6
parent55a4de8579d42ab5b91893c3b6b445b3bb27d1eb (diff)
上传新文件
-rw-r--r--createRule.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/createRule.py b/createRule.py
new file mode 100644
index 0000000..1bc45e6
--- /dev/null
+++ b/createRule.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python3
+# coding=utf-8
+import time
+import requests
+import json
+
+class CreateSecurityRule():
+ def __init__(self, token):
+ self.headers = {"token": ""}
+ self.headers["token"] = token
+ self.ruleJson = {
+ }
+
+ def createRule(self):
+ url = "http://192.168.44.72/v1/policy/object"
+ response = requests.post(url, headers=self.headers, params=self.ruleJson)
+ ruleJsonData = json.loads(response.text)
+ return ruleJsonData
+
+if __name__ == '__main__':
+ securityRule = CreateSecurityRule()
+ time.sleep(1) \ No newline at end of file