Signed-off-by: Alexandre Derumier <aderum...@odiso.com> --- PVE/API2/Cluster.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/PVE/API2/Cluster.pm b/PVE/API2/Cluster.pm index 8af5f3f0..bfeaf784 100644 --- a/PVE/API2/Cluster.pm +++ b/PVE/API2/Cluster.pm @@ -24,6 +24,12 @@ use PVE::API2::Firewall::Cluster; use PVE::API2::ReplicationConfig; use PVE::API2::ACMEAccount; +my $have_sdn; +eval { + require PVE::API2::Network::SDN; + $have_sdn = 1; +}; + use base qw(PVE::RESTHandler); __PACKAGE__->register_method ({ @@ -56,6 +62,13 @@ __PACKAGE__->register_method ({ path => 'acme', }); +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 => { @@ -105,6 +118,10 @@ __PACKAGE__->register_method ({ { name => 'ceph' }, ]; + if ($have_sdn) { + push(@{$result}, { name => 'sdn' }); + } + return $result; }}); -- 2.20.1 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel