api2: cluster: ressources: add "localnetwork" zone

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2023-06-07 14:03:53 +02:00 committed by Fabian Grünbichler
parent 61cf3e3d9a
commit cdc140f0a3

View File

@ -474,6 +474,20 @@ __PACKAGE__->register_method({
}
}
#add default "localnetwork" zone
if ($rpcenv->check($authuser, "/sdn/zones/localnetwork", [ 'SDN.Audit' ], 1)) {
foreach my $node (@$nodelist) {
my $local_sdn = {
id => "sdn/$node/localnetwork",
sdn => 'localnetwork',
node => $node,
type => 'sdn',
status => 'ok',
};
push @$res, $local_sdn;
}
}
if ($have_sdn) {
if (!$param->{type} || $param->{type} eq 'sdn') {