]> git.proxmox.com Git - pve-network.git/blob - PVE/API2/NetworkConfig.pm
api2: add networkconfig
[pve-network.git] / PVE / API2 / NetworkConfig.pm
1 package PVE::API2::NetworkConfig;
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::Transport;
14 use PVE::API2::Network::Vnet;
15
16 use base qw(PVE::RESTHandler);
17
18 __PACKAGE__->register_method ({
19 subclass => "PVE::API2::Network::Transport",
20 path => 'transport',
21 });
22
23 __PACKAGE__->register_method ({
24 subclass => "PVE::API2::Network::Vnet",
25 path => 'vnet',
26 });
27
28 __PACKAGE__->register_method({
29 name => 'index',
30 path => '',
31 method => 'GET',
32 description => "Directory index.",
33 permissions => {
34 check => ['perm', '/', [ 'Sys.Audit' ]],
35 },
36 parameters => {
37 additionalProperties => 0,
38 properties => {},
39 },
40 returns => {
41 type => 'array',
42 items => {
43 type => "object",
44 properties => {
45 id => { type => 'string' },
46 },
47 },
48 links => [ { rel => 'child', href => "{id}" } ],
49 },
50 code => sub {
51 my ($param) = @_;
52
53 my $res = [
54 { id => 'transport' },
55 { id => 'vnet' },
56 ];
57
58 return $res;
59 }});
60
61
62 1;