]>
git.proxmox.com Git - pve-storage.git/blob - PVE/API2/Storage/Scan.pm
1 package PVE
::API2
::Storage
::Scan
;
8 use HTTP
::Status
qw(:constants);
9 use PVE
::JSONSchema
qw(get_standard_option);
13 use base
qw(PVE::RESTHandler);
15 __PACKAGE__-
>register_method ({
19 description
=> "Index of available scan methods",
21 additionalProperties
=> 0,
23 node
=> get_standard_option
('pve-node'),
30 properties
=> { method => { type
=> 'string'} },
32 links
=> [ { rel
=> 'child', href
=> "{method}" } ],
39 { method => 'iscsi' },
47 __PACKAGE__-
>register_method ({
51 description
=> "Scan remote NFS server.",
55 additionalProperties
=> 0,
57 node
=> get_standard_option
('pve-node'),
58 server
=> { type
=> 'string', format
=> 'pve-storage-server' },
66 path
=> { type
=> 'string'},
67 options
=> { type
=> 'string'},
74 my $server = $param->{server
};
75 my $res = PVE
::Storage
::scan_nfs
($server);
78 foreach my $k (keys %$res) {
79 push @$data, { path
=> $k, options
=> $res->{$k} };
84 __PACKAGE__-
>register_method ({
88 description
=> "Scan remote iSCSI server.",
92 additionalProperties
=> 0,
94 node
=> get_standard_option
('pve-node'),
95 portal
=> { type
=> 'string', format
=> 'pve-storage-portal-dns' },
103 target
=> { type
=> 'string'},
104 portal
=> { type
=> 'string'},
111 my $res = PVE
::Storage
::scan_iscsi
($param->{portal
});
114 foreach my $k (keys %$res) {
115 push @$data, { target
=> $k, portal
=> join(',', @{$res->{$k}}) };
121 __PACKAGE__-
>register_method ({
125 description
=> "List local LVM volume groups.",
129 additionalProperties
=> 0,
131 node
=> get_standard_option
('pve-node'),
139 vg
=> { type
=> 'string'},
146 my $res = PVE
::Storage
::lvm_vgs
();
147 return PVE
::RESTHandler
::hash_to_array
($res, 'vg');
150 __PACKAGE__-
>register_method ({
154 description
=> "List local USB devices.",
158 additionalProperties
=> 0,
160 node
=> get_standard_option
('pve-node'),
168 busnum
=> { type
=> 'integer'},
169 devnum
=> { type
=> 'integer'},
170 port
=> { type
=> 'integer'},
171 usbpath
=> { type
=> 'string', optional
=> 1},
172 level
=> { type
=> 'integer'},
173 class => { type
=> 'integer'},
174 vendid
=> { type
=> 'string'},
175 prodid
=> { type
=> 'string'},
176 speed
=> { type
=> 'string'},
178 product
=> { type
=> 'string', optional
=> 1 },
179 serial
=> { type
=> 'string', optional
=> 1 },
180 manufacturer
=> { type
=> 'string', optional
=> 1 },
187 return PVE
::Storage
::scan_usb
();