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