]> git.proxmox.com Git - pve-manager.git/blob - PVE/API2/Hardware.pm
api/hardware: fixup: add missing file
[pve-manager.git] / PVE / API2 / Hardware.pm
1 package PVE::API2::Hardware;
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::Hardware::PCI;
10
11 use base qw(PVE::RESTHandler);
12
13 __PACKAGE__->register_method ({
14 subclass => "PVE::API2::Hardware::PCI",
15 path => 'pci',
16 });
17
18 __PACKAGE__->register_method ({
19 name => 'index',
20 path => '',
21 method => 'GET',
22 description => "Index of hardware types",
23 permissions => {
24 user => 'all',
25 },
26 parameters => {
27 additionalProperties => 0,
28 properties => {
29 node => get_standard_option('pve-node'),
30 },
31 },
32 returns => {
33 type => 'array',
34 items => {
35 type => "object",
36 properties => { type => { type => 'string'} },
37 },
38 links => [ { rel => 'child', href => "{type}" } ],
39 },
40 code => sub {
41 my ($param) = @_;
42
43 my $res = [
44 { type => 'pci' },
45 # TODO: move usb scan here (6.0 api change)
46 ];
47
48 return $res;
49 }
50 });
51