From ca7c114937ae6a5931a70c0e5b663472ccb73869 Mon Sep 17 00:00:00 2001 From: Blackwhitebear8 Date: Wed, 13 Aug 2025 15:57:38 +0200 Subject: [PATCH] Update modules/parse.py --- modules/parse.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/parse.py b/modules/parse.py index 882e01b..5b2fa81 100644 --- a/modules/parse.py +++ b/modules/parse.py @@ -113,4 +113,22 @@ def run_bfd_peer_detail_curl_command(peer_ip): "--form", f"key={VYOS_API_KEY}" ] 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) \ No newline at end of file