Update modules/parse.py
This commit is contained in:
parent
dee5ddd7ed
commit
8b4cc6c467
1 changed files with 18 additions and 0 deletions
|
|
@ -131,4 +131,22 @@ def run_bgp_dampeningv6_curl_command():
|
||||||
"--form", f"key={VYOS_API_KEY}"
|
"--form", f"key={VYOS_API_KEY}"
|
||||||
]
|
]
|
||||||
response = subprocess.check_output(curl_command, text=True)
|
response = subprocess.check_output(curl_command, text=True)
|
||||||
|
return json.loads(response)
|
||||||
|
|
||||||
|
def run_firewall_ipv4_curl_command():
|
||||||
|
curl_command = [
|
||||||
|
"curl", "-k", "--location", "--request", "POST", f"{VYOS_API_URL}/show",
|
||||||
|
"--form", "data={\"op\": \"show\", \"path\": [\"firewall\", \"ipv4\"]}",
|
||||||
|
"--form", f"key={VYOS_API_KEY}"
|
||||||
|
]
|
||||||
|
response = subprocess.check_output(curl_command, text=True)
|
||||||
|
return json.loads(response)
|
||||||
|
|
||||||
|
def run_firewall_ipv6_curl_command():
|
||||||
|
curl_command = [
|
||||||
|
"curl", "-k", "--location", "--request", "POST", f"{VYOS_API_URL}/show",
|
||||||
|
"--form", "data={\"op\": \"show\", \"path\": [\"firewall\", \"ipv6\"]}",
|
||||||
|
"--form", f"key={VYOS_API_KEY}"
|
||||||
|
]
|
||||||
|
response = subprocess.check_output(curl_command, text=True)
|
||||||
return json.loads(response)
|
return json.loads(response)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue