Update modules/parse.py

This commit is contained in:
Blackwhitebear8 2025-08-13 15:57:38 +02:00
parent fe5fea4899
commit ca7c114937

View file

@ -114,3 +114,21 @@ def run_bfd_peer_detail_curl_command(peer_ip):
]
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)