]> git.proxmox.com Git - pve-network.git/blob - PVE/API2/Network/SDN.pm
512e0b2bfe8caef0feb1a055562b066642995c2a
[pve-network.git] / PVE / API2 / Network / SDN.pm
1 package PVE::API2::Network::SDN;
2
3 use strict;
4 use warnings;
5
6 use PVE::SafeSyslog;
7 use PVE::Tools;
8 use PVE::Cluster qw(cfs_lock_file cfs_read_file cfs_write_file);
9 use PVE::RESTHandler;
10 use PVE::RPCEnvironment;
11 use PVE::JSONSchema qw(get_standard_option);
12 use PVE::Exception qw(raise_param_exc);
13 use PVE::API2::Network::SDN::Vnets;
14 use PVE::API2::Network::SDN::Zones;
15 use PVE::API2::Network::SDN::Controllers;
16
17 use base qw(PVE::RESTHandler);
18
19 __PACKAGE__->register_method ({
20 subclass => "PVE::API2::Network::SDN::Vnets",
21 path => 'vnets',
22 });
23
24 __PACKAGE__->register_method ({
25 subclass => "PVE::API2::Network::SDN::Zones",
26 path => 'zones',
27 });
28
29 __PACKAGE__->register_method ({
30 subclass => "PVE::API2::Network::SDN::Controllers",
31 path => 'controllers',
32 });
33
34 __PACKAGE__->register_method({
35 name => 'index',
36 path => '',
37 method => 'GET',
38 description => "Directory index.",
39 permissions => {
40 check => ['perm', '/', [ 'Sys.Audit' ]],
41 },
42 parameters => {
43 additionalProperties => 0,
44 properties => {},
45 },
46 returns => {
47 type => 'array',
48 items => {
49 type => "object",
50 properties => {
51 id => { type => 'string' },
52 },
53 },
54 links => [ { rel => 'child', href => "{id}" } ],
55 },
56 code => sub {
57 my ($param) = @_;
58
59 my $res = [
60 { id => 'vnets' },
61 { id => 'zones' },
62 { id => 'controllers' },
63 ];
64
65 return $res;
66 }});
67
68
69 1;