]>
git.proxmox.com Git - pve-manager.git/blob - PVE/API2.pm
6544ab62b75e710de1cdec7a4780160d2b98fdb9
9 use base
qw(PVE::RESTHandler);
12 use PVE
::API2
::Cluster
;
15 use PVE
::API2
::AccessControl
;
16 use PVE
::API2
::Storage
::Config
;
18 __PACKAGE__-
>register_method ({
19 subclass
=> "PVE::API2::Cluster",
23 __PACKAGE__-
>register_method ({
24 subclass
=> "PVE::API2::Nodes",
28 __PACKAGE__-
>register_method ({
29 subclass
=> "PVE::API2::Storage::Config",
33 __PACKAGE__-
>register_method ({
34 subclass
=> "PVE::API2::AccessControl",
38 __PACKAGE__-
>register_method ({
39 subclass
=> "PVE::API2::Pool",
43 __PACKAGE__-
>register_method ({
47 permissions
=> { user
=> 'all' },
48 description
=> "Directory index.",
50 additionalProperties
=> 0,
58 subdir
=> { type
=> 'string' },
61 links
=> [ { rel
=> 'child', href
=> "{subdir}" } ],
64 my ($resp, $param) = @_;
66 my $res = [ { subdir
=> 'version' } ];
68 my $ma = PVE
::API2-
>method_attributes();
70 foreach my $info (@$ma) {
71 next if !$info->{subclass
};
73 my $subpath = $info->{match_re
}->[0];
75 push @$res, { subdir
=> $subpath };
81 __PACKAGE__-
>register_method ({
85 permissions
=> { user
=> 'all' },
86 description
=> "API version details. The result also includes the global datacenter confguration.",
88 additionalProperties
=> 0,
94 version
=> { type
=> 'string' },
95 release
=> { type
=> 'string' },
96 repoid
=> { type
=> 'string' },
100 my ($resp, $param) = @_;
102 my $res = PVE
::Cluster
::cfs_read_file
('datacenter.cfg');
104 my $vi = PVE
::pvecfg
::version_info
();
105 foreach my $k (qw(version release repoid)) {
106 $res->{$k} = $vi->{$k};