]>
git.proxmox.com Git - pve-client.git/blob - PVE/APIClient/Commands/start.pm
1 package PVE
::APIClient
::Commands
::start
;
6 use PVE
::APIClient
::Helpers
;
7 use PVE
::JSONSchema
qw(get_standard_option);
11 use base
qw(PVE::CLIHandler);
13 __PACKAGE__-
>register_method ({
17 description
=> "Start a Qemu VM/LinuX Container.",
19 additionalProperties
=> 0,
21 remote
=> get_standard_option
('pveclient-remote-name'),
22 vmid
=> get_standard_option
('pve-vmid'),
25 returns
=> { type
=> 'null'},
29 my $config = PVE
::APIClient
::Config-
>load();
30 my $conn = PVE
::APIClient
::Config-
>remote_conn($config, $param->{remote
});
32 my $resource = PVE
::APIClient
::Helpers
::get_vmid_resource
($conn, $param->{vmid
});
34 my $upid = $conn->post("api2/json/nodes/$resource->{node}/$resource->{type}/$resource->{vmid}/status/start", {});
36 print PVE
::APIClient
::Helpers
::poll_task
($conn, $resource->{node
}, $upid) . "\n";
41 our $cmddef = [ __PACKAGE__
, 'start', ['remote', 'vmid']];