]> git.proxmox.com Git - pve-manager.git/commitdiff
api2 : cluster: add sdn api endpoint
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 21 Aug 2019 03:22:36 +0000 (05:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 3 Sep 2019 08:28:55 +0000 (10:28 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/API2/Cluster.pm

index 47a89d2130b8831885bf62807ae730cc6d51db61..ba9bef275871982bc05da4ec4422e748559cd066 100644 (file)
@@ -27,6 +27,12 @@ use PVE::API2::Firewall::Cluster;
 use PVE::API2::HAConfig;
 use PVE::API2::ReplicationConfig;
 
+my $have_sdn;
+eval {
+    require PVE::API2::Network::SDN;
+    $have_sdn = 1;
+};
+
 use base qw(PVE::RESTHandler);
 
 __PACKAGE__->register_method ({
@@ -64,6 +70,13 @@ __PACKAGE__->register_method ({
     path => 'ceph',
 });
 
+if ($have_sdn) {
+    __PACKAGE__->register_method ({
+       subclass => "PVE::API2::Network::SDN",
+       path => 'sdn',
+    });
+}
+
 my $dc_schema = PVE::Cluster::get_datacenter_schema();
 my $dc_properties = { 
     delete => {
@@ -113,6 +126,10 @@ __PACKAGE__->register_method ({
            { name => 'ceph' },
            ];
 
+       if ($have_sdn) {
+           push(@{$result}, { name => 'sdn' });
+       }
+
        return $result;
     }});