2021-03-05 17:07:17 +01:00
package PVE::API2::Capabilities ;
use strict ;
use warnings ;
use PVE::JSONSchema qw( get_standard_option ) ;
use PVE::RESTHandler ;
use PVE::API2::Qemu::Machine ;
use base qw( PVE::RESTHandler ) ;
2021-06-04 15:49:42 +02:00
__PACKAGE__ - > register_method ( {
subclass = > "PVE::API2::Qemu::CPU" ,
path = > 'qemu/cpu' ,
} ) ;
2021-03-05 17:07:17 +01:00
__PACKAGE__ - > register_method ( {
subclass = > "PVE::API2::Qemu::Machine" ,
path = > 'qemu/machines' ,
} ) ;
__PACKAGE__ - > register_method ( {
name = > 'index' ,
path = > '' ,
method = > 'GET' ,
permissions = > { user = > 'all' } ,
description = > "Node capabilities index." ,
parameters = > {
additionalProperties = > 0 ,
properties = > {
node = > get_standard_option ( 'pve-node' ) ,
} ,
} ,
returns = > {
type = > 'array' ,
items = > {
type = > "object" ,
properties = > { } ,
} ,
links = > [ { rel = > 'child' , href = > "{name}" } ] ,
} ,
code = > sub {
my ( $ param ) = @ _ ;
my $ result = [
{ name = > 'qemu' } ,
] ;
return $ result ;
}
} ) ;
__PACKAGE__ - > register_method ( {
name = > 'qemu_caps_index' ,
path = > 'qemu' ,
method = > 'GET' ,
permissions = > { user = > 'all' } ,
description = > "QEMU capabilities index." ,
parameters = > {
additionalProperties = > 0 ,
properties = > {
node = > get_standard_option ( 'pve-node' ) ,
} ,
} ,
returns = > {
type = > 'array' ,
items = > {
type = > "object" ,
properties = > { } ,
} ,
links = > [ { rel = > 'child' , href = > "{name}" } ] ,
} ,
code = > sub {
my ( $ param ) = @ _ ;
my $ result = [
2021-06-04 15:49:42 +02:00
{ name = > 'cpu' } ,
2021-03-05 17:07:17 +01:00
{ name = > 'machines' } ,
] ;
return $ result ;
}
} ) ;
1 ;