]>
git.proxmox.com Git - qemu-server.git/blob - PVE/API2/Qemu/CPU.pm
1 package PVE
::API2
::Qemu
::CPU
;
7 use PVE
::JSONSchema
qw(get_standard_option);
8 use PVE
::QemuServer
::CPUConfig
;
10 use base
qw(PVE::RESTHandler);
12 __PACKAGE__-
>register_method({
16 description
=> 'List all custom and default CPU models.',
19 description
=> 'Only returns custom models when the current user has'
20 . ' Sys.Audit on /nodes.',
23 additionalProperties
=> 0,
25 node
=> get_standard_option
('pve-node'),
35 description
=> "Name of the CPU model. Identifies it for"
36 . " subsequent API calls. Prefixed with"
37 . " 'custom-' for custom models.",
41 description
=> "True if this is a custom CPU model.",
45 description
=> "CPU vendor visible to the guest when this"
46 . " model is selected. Vendor of"
47 . " 'reported-model' in case of custom models.",
51 links
=> [ { rel
=> 'child', href
=> '{name}' } ],
54 my $rpcenv = PVE
::RPCEnvironment
::get
();
55 my $authuser = $rpcenv->get_user();
56 my $include_custom = $rpcenv->check($authuser, "/nodes", ['Sys.Audit'], 1);
58 return PVE
::QemuServer
::CPUConfig
::get_cpu_models
($include_custom);