]>
git.proxmox.com Git - pve-manager.git/blob - PVE/API2.pm
10 use base
qw(PVE::RESTHandler);
13 use PVE
::API2
::Cluster
;
16 use PVE
::API2
::AccessControl
;
17 use PVE
::API2
::Storage
::Config
;
19 __PACKAGE__-
>register_method ({
20 subclass
=> "PVE::API2::Cluster",
24 __PACKAGE__-
>register_method ({
25 subclass
=> "PVE::API2::Nodes",
29 __PACKAGE__-
>register_method ({
30 subclass
=> "PVE::API2::Storage::Config",
34 __PACKAGE__-
>register_method ({
35 subclass
=> "PVE::API2::AccessControl",
39 __PACKAGE__-
>register_method ({
40 subclass
=> "PVE::API2::Pool",
44 __PACKAGE__-
>register_method ({
48 permissions
=> { user
=> 'all' },
49 description
=> "Directory index.",
51 additionalProperties
=> 0,
59 subdir
=> { type
=> 'string' },
62 links
=> [ { rel
=> 'child', href
=> "{subdir}" } ],
65 my ($resp, $param) = @_;
67 my $res = [ { subdir
=> 'version' } ];
69 my $ma = PVE
::API2-
>method_attributes();
71 foreach my $info (@$ma) {
72 next if !$info->{subclass
};
74 my $subpath = $info->{match_re
}->[0];
76 push @$res, { subdir
=> $subpath };
82 __PACKAGE__-
>register_method ({
86 permissions
=> { user
=> 'all' },
87 description
=> "API version details. The result also includes the global datacenter confguration.",
89 additionalProperties
=> 0,
95 version
=> { type
=> 'string' },
96 release
=> { type
=> 'string' },
97 repoid
=> { type
=> 'string' },
101 my ($resp, $param) = @_;
103 my $res = PVE
::Cluster
::cfs_read_file
('datacenter.cfg');
105 my $vi = PVE
::pvecfg
::version_info
();
106 foreach my $k (qw(version release repoid)) {
107 $res->{$k} = $vi->{$k};