]> git.proxmox.com Git - pve-manager.git/blob - PVE/API2/Capabilities.pm
vdzump: whitespace/extra-lines clean up
[pve-manager.git] / PVE / API2 / Capabilities.pm
1 package PVE::API2::Capabilities;
2
3 use strict;
4 use warnings;
5
6 use PVE::JSONSchema qw(get_standard_option);
7 use PVE::RESTHandler;
8
9 use PVE::API2::Qemu::Machine;
10
11 use base qw(PVE::RESTHandler);
12
13 __PACKAGE__->register_method ({
14 subclass => "PVE::API2::Qemu::CPU",
15 path => 'qemu/cpu',
16 });
17
18 __PACKAGE__->register_method ({
19 subclass => "PVE::API2::Qemu::Machine",
20 path => 'qemu/machines',
21 });
22
23
24 __PACKAGE__->register_method ({
25 name => 'index',
26 path => '',
27 method => 'GET',
28 permissions => { user => 'all' },
29 description => "Node capabilities index.",
30 parameters => {
31 additionalProperties => 0,
32 properties => {
33 node => get_standard_option('pve-node'),
34 },
35 },
36 returns => {
37 type => 'array',
38 items => {
39 type => "object",
40 properties => {},
41 },
42 links => [ { rel => 'child', href => "{name}" } ],
43 },
44 code => sub {
45 my ($param) = @_;
46
47 my $result = [
48 { name => 'qemu' },
49 ];
50
51 return $result;
52 }
53 });
54
55
56 __PACKAGE__->register_method ({
57 name => 'qemu_caps_index',
58 path => 'qemu',
59 method => 'GET',
60 permissions => { user => 'all' },
61 description => "QEMU capabilities index.",
62 parameters => {
63 additionalProperties => 0,
64 properties => {
65 node => get_standard_option('pve-node'),
66 },
67 },
68 returns => {
69 type => 'array',
70 items => {
71 type => "object",
72 properties => {},
73 },
74 links => [ { rel => 'child', href => "{name}" } ],
75 },
76 code => sub {
77 my ($param) = @_;
78
79 my $result = [
80 { name => 'cpu' },
81 { name => 'machines' },
82 ];
83
84 return $result;
85 }
86 });
87
88 1;