summaryrefslogtreecommitdiff
path: root/PVE/API2/Network/SDN.pm
diff options
context:
space:
mode:
authorAlexandre Derumier <aderumier@odiso.com>2019-09-30 11:03:39 +0200
committerThomas Lamprecht <t.lamprecht@proxmox.com>2019-10-17 19:25:49 +0200
commit5645bbd1952f57ff5daeabbc90a9950c0088630b (patch)
tree8bc991e666ff333f114519ae0f3b99c246d611da /PVE/API2/Network/SDN.pm
parent20e19696547f3e1e0690a980fb61d30cec0635cd (diff)
api2 : sdn : add role and type to index
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Diffstat (limited to 'PVE/API2/Network/SDN.pm')
-rw-r--r--PVE/API2/Network/SDN.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/PVE/API2/Network/SDN.pm b/PVE/API2/Network/SDN.pm
index 36d293d..b6dd23e 100644
--- a/PVE/API2/Network/SDN.pm
+++ b/PVE/API2/Network/SDN.pm
@@ -61,7 +61,10 @@ __PACKAGE__->register_method ({
type => 'array',
items => {
type => "object",
- properties => { sdn => { type => 'string'} },
+ properties => { sdn => { type => 'string'},
+ type => { type => 'string'},
+ role => { type => 'string'}
+ },
},
links => [ { rel => 'child', href => "{sdn}" } ],
},
@@ -82,6 +85,12 @@ __PACKAGE__->register_method ({
my $scfg = &$api_sdn_config($cfg, $sdnid);
next if $param->{type} && $param->{type} ne $scfg->{type};
+
+ my $plugin_config = $cfg->{ids}->{$sdnid};
+ my $plugin = PVE::Network::SDN::Plugin->lookup($plugin_config->{type});
+ my $pd = $plugin->plugindata();
+ my $role = $pd->{role};
+ $scfg->{role} = $role;
push @$res, $scfg;
}