pve-manager/PVE/API2/Hardware.pm
Thomas Lamprecht 3f2300d8b4 api/hardware: fixup: add missing file
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 15:05:52 +01:00

52 lines
929 B
Perl

package PVE::API2::Hardware;
use strict;
use warnings;
use PVE::JSONSchema qw(get_standard_option);
use PVE::RESTHandler;
use PVE::API2::Hardware::PCI;
use base qw(PVE::RESTHandler);
__PACKAGE__->register_method ({
subclass => "PVE::API2::Hardware::PCI",
path => 'pci',
});
__PACKAGE__->register_method ({
name => 'index',
path => '',
method => 'GET',
description => "Index of hardware types",
permissions => {
user => 'all',
},
parameters => {
additionalProperties => 0,
properties => {
node => get_standard_option('pve-node'),
},
},
returns => {
type => 'array',
items => {
type => "object",
properties => { type => { type => 'string'} },
},
links => [ { rel => 'child', href => "{type}" } ],
},
code => sub {
my ($param) = @_;
my $res = [
{ type => 'pci' },
# TODO: move usb scan here (6.0 api change)
];
return $res;
}
});