};
__PACKAGE__->register_method ({
- name => 'index',
+ name => 'index',
path => '',
method => 'GET',
description => "SDN index.",
- permissions => {
+ permissions => {
description => "Only list entries where you have 'SDN.Audit' or 'SDN.Allocate' permissions on '/cluster/sdn/<sdn>'",
user => 'all',
},
parameters => {
additionalProperties => 0,
properties => {
- type => {
+ type => {
description => "Only list sdn of specific type",
- type => 'string',
+ type => 'string',
enum => $sdn_type_enum,
optional => 1,
},
}});
__PACKAGE__->register_method ({
- name => 'read',
+ name => 'read',
path => '{sdn}',
method => 'GET',
description => "Read sdn configuration.",
-# permissions => {
+# permissions => {
# check => ['perm', '/cluster/sdn/{sdn}', ['SDN.Allocate']],
# },
__PACKAGE__->register_method ({
name => 'create',
protected => 1,
- path => '',
+ path => '',
method => 'POST',
description => "Create a new sdn object.",
-# permissions => {
+# permissions => {
# check => ['perm', '/cluster/sdn', ['SDN.Allocate']],
# },
parameters => PVE::Network::SDN::Plugin->createSchema(),
}
PVE::Network::SDN::write_config($cfg);
-
+
}, "create sdn object failed");
return undef;
path => '',
method => 'PUT',
description => "Apply sdn changes.",
-# permissions => {
+# permissions => {
# check => ['perm', '/cluster/sdn', ['SDN.Allocate']],
# },
parameters => {
path => '',
method => 'DELETE',
description => "Revert sdn changes.",
-# permissions => {
+# permissions => {
# check => ['perm', '/cluster/sdn', ['SDN.Allocate']],
# },
parameters => {
path => '{sdn}',
method => 'PUT',
description => "Update sdn object configuration.",
-# permissions => {
+# permissions => {
# check => ['perm', '/cluster/sdn', ['SDN.Allocate']],
# },
parameters => PVE::Network::SDN::Plugin->updateSchema(),
path => '{sdn}',
method => 'DELETE',
description => "Delete sdn object configuration.",
-# permissions => {
+# permissions => {
# check => ['perm', '/cluster/sdn', ['SDN.Allocate']],
# },
parameters => {
additionalProperties => 0,
- properties => {
+ properties => {
sdn => get_standard_option('pve-sdn-id', {
completion => \&PVE::Network::SDN::complete_sdn,
}),
use base qw(PVE::RESTHandler);
__PACKAGE__->register_method ({
- name => 'index',
+ name => 'index',
path => '',
method => 'GET',
description => "List transportzone content.",
-# permissions => {
+# permissions => {
# check => ['perm', '/sdn/{sdn}', ['SDN.Audit'], any => 1],
# },
protected => 1,
proxyto => 'node',
parameters => {
additionalProperties => 0,
- properties => {
+ properties => {
node => get_standard_option('pve-node'),
sdn => get_standard_option('pve-sdn-id', {
completion => \&PVE::Network::SDN::complete_sdn,
type => 'array',
items => {
type => "object",
- properties => {
+ properties => {
vnet => {
description => "Vnet identifier.",
type => 'string',
}
}
- return $res;
+ return $res;
}});
1;
use base qw(PVE::RESTHandler);
__PACKAGE__->register_method ({
- subclass => "PVE::API2::Network::SDN::Content",
+ subclass => "PVE::API2::Network::SDN::Content",
path => '{sdn}/content',
});
__PACKAGE__->register_method ({
- name => 'index',
+ name => 'index',
path => '',
method => 'GET',
description => "Get status for all transportzones.",
- permissions => {
+ permissions => {
description => "Only list entries where you have 'SDN.Audit'",
user => 'all',
},
__PACKAGE__->register_method ({
name => 'diridx',
- path => '{sdn}',
+ path => '{sdn}',
method => 'GET',
description => "",
-# permissions => {
+# permissions => {
# check => ['perm', '/sdn/{sdn}', ['SDN.Audit'], any => 1],
# },
parameters => {
my $res = [
{ subdir => 'content' },
];
-
+
return $res;
}});
},
'peers' => {
description => "peers address list.",
- type => 'string', #fixme: format
+ type => 'string', #fixme: format
},
};
}
foreach my $address (@peers) {
next if $address eq $ifaceip;
push @router_config, "neighbor $address remote-as $asn";
- }
+ }
push @router_config, "!";
push @router_config, "address-family l2vpn evpn";
foreach my $address (@peers) {
my $defaultData = {
propertyList => {
- type => {
+ type => {
description => "Plugin type.",
type => 'string', format => 'pve-configid',
type => 'string',
},
'multicast-address' => {
description => "Multicast address.",
- type => 'string', #fixme: format
+ type => 'string', #fixme: format
},
'unicast-address' => {
description => "Unicast peers address ip list.",
- type => 'string', #fixme: format
+ type => 'string', #fixme: format
},
'vrf' => {
description => "vrf name.",
- type => 'string', #fixme: format
+ type => 'string', #fixme: format
},
'vrf-vxlan' => {
type => 'integer',
# verify that no vnet are associated to this transport
foreach my $id (keys %{$sdn_cfg->{ids}}) {
my $sdn = $sdn_cfg->{ids}->{$id};
- die "transport $transportid is used by vnet $id"
+ die "transport $transportid is used by vnet $id"
if ($sdn->{type} eq 'vnet' && defined($sdn->{transportzone}) && $sdn->{transportzone} eq $transportid);
}
}
# verify that vxlan-allowed don't conflict with another vxlan-allowed transport
- # verify that vxlan-allowed is matching currently vnet tag in this transport
+ # verify that vxlan-allowed is matching currently vnet tag in this transport
my $vxlanallowed = $transport->{'vxlan-allowed'};
if ($vxlanallowed) {
foreach my $id (keys %{$sdn_cfg->{ids}}) {
if (defined($sdn_cfg->{ids}->{$id}->{'vrf-vxlan'}) && $sdn_cfg->{ids}->{$id}->{'vrf-vxlan'} eq $vrfvxlan);
}
}
- }
+ }
}
1;