SPAM: [PATCH pve-network 03/16] ipam: change verify URL (now common to Nautobot and Netbox)
Lou Lecrivain
lou.lecrivain at wdz.de
Wed Nov 27 17:17:50 CET 2024
+ minimal module
Signed-off-by: lou lecrivain <lou.lecrivain at wdz.de>
---
src/PVE/Network/SDN/Ipams/NautobotPlugin.pm | 22 ---------------------
src/PVE/Network/SDN/Ipams/NetboxPlugin.pm | 2 +-
2 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/src/PVE/Network/SDN/Ipams/NautobotPlugin.pm b/src/PVE/Network/SDN/Ipams/NautobotPlugin.pm
index 03bd3de..6597bfe 100644
--- a/src/PVE/Network/SDN/Ipams/NautobotPlugin.pm
+++ b/src/PVE/Network/SDN/Ipams/NautobotPlugin.pm
@@ -12,26 +12,4 @@ sub type {
return 'nautobot';
}
-sub verify_api {
- my ($class, $plugin_config) = @_;
-
- my $url = $plugin_config->{url};
- my $token = $plugin_config->{token};
- my $headers = [ 'Authorization' => "token $token", 'Accept' => "application/json; indent=4" ];
-
- eval {
- PVE::Network::SDN::api_request("GET", "$url/ipam/namespaces", $headers);
- };
- if ($@) {
- die "Can't connect to nautobot api: $@";
- }
-}
-
-# helpers
-sub on_update_hook {
- my ($class, $plugin_config) = @_;
-
- PVE::Network::SDN::Ipams::NautobotPlugin::verify_api($class, $plugin_config);
-}
-
1;
diff --git a/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm b/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
index d923269..7efccaf 100644
--- a/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
+++ b/src/PVE/Network/SDN/Ipams/NetboxPlugin.pm
@@ -240,7 +240,7 @@ sub verify_api {
eval {
- PVE::Network::SDN::api_request("GET", "$url/ipam/aggregates/", $headers);
+ PVE::Network::SDN::api_request("GET", "$url/ipam/prefixes/", $headers);
};
if ($@) {
die "Can't connect to netbox api: $@";
--
2.39.5
More information about the pve-devel
mailing list