Update modules/parse.py
This commit is contained in:
parent
fe5fea4899
commit
ca7c114937
1 changed files with 18 additions and 0 deletions
|
|
@ -113,4 +113,22 @@ def run_bfd_peer_detail_curl_command(peer_ip):
|
||||||
"--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_bgp_dampeningv4_curl_command():
|
||||||
|
curl_command = [
|
||||||
|
"curl", "-k", "--location", "--request", "POST", f"{VYOS_API_URL}/show",
|
||||||
|
"--form", "data={\"op\": \"show\", \"path\": [\"bgp\", \"vrf\", \"bgp\", \"ipv4\", \"dampening\", \"dampened-paths\"]}",
|
||||||
|
"--form", f"key={VYOS_API_KEY}"
|
||||||
|
]
|
||||||
|
response = subprocess.check_output(curl_command, text=True)
|
||||||
|
return json.loads(response)
|
||||||
|
|
||||||
|
def run_bgp_dampeningv6_curl_command():
|
||||||
|
curl_command = [
|
||||||
|
"curl", "-k", "--location", "--request", "POST", f"{VYOS_API_URL}/show",
|
||||||
|
"--form", "data={\"op\": \"show\", \"path\": [\"bgp\", \"vrf\", \"bgp\", \"ipv6\", \"dampening\", \"dampened-paths\"]}",
|
||||||
|
"--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