]>
git.proxmox.com Git - pve-container.git/blob - src/pct
10 use PVE
::RPCEnvironment
;
11 use PVE
::JSONSchema
qw(get_standard_option);
17 use base
qw(PVE::CLIHandler);
19 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
23 die "please run as root\n" if $> != 0;
25 PVE
::INotify
::inotify_init
();
27 my $rpcenv = PVE
::RPCEnvironment-
>init('cli');
28 $rpcenv->init_request();
29 $rpcenv->set_language($ENV{LANG
});
30 $rpcenv->set_user('root@pam');
32 my $nodename = PVE
::INotify
::nodename
();
36 my $status = PVE
::Tools
::upid_read_status
($upid);
37 exit($status eq 'OK' ?
0 : -1);
40 __PACKAGE__-
>register_method ({
44 description
=> "Test only",
46 additionalProperties
=> 0,
50 returns
=> { type
=> 'null' },
62 #test => [ __PACKAGE__, 'test', [], {}, sub {} ],
63 list
=> [ 'PVE::API2::LXC', 'vmlist', [], { node
=> $nodename }, sub {
67 config
=> [ "PVE::API2::LXC", 'vm_config', ['vmid'],
68 { node
=> $nodename }, sub {
70 foreach my $k (sort (keys %$config)) {
71 next if $k eq 'digest';
72 my $v = $config->{$k};
73 if ($k eq 'description') {
74 $v = PVE
::Tools
::encode_text
($v);
79 set
=> [ 'PVE::API2::LXC', 'update_vm', ['vmid'], { node
=> $nodename }],
81 create
=> [ 'PVE::API2::LXC', 'create_vm', ['vmid', 'ostemplate'], { node
=> $nodename }, $upid_exit ],
83 destroy
=> [ 'PVE::API2::LXC', 'destroy_vm', ['vmid'],
84 { node
=> $nodename }, $upid_exit ],
90 PVE
::CLIHandler
::handle_cmd
($cmddef, "pct", $cmd, \
@ARGV, undef, $0);
98 pct - Tool to manage Linux Containers on Proxmox VE
106 Tool to manage linux containers.
108 =include pve_copyright