File Coverage

blib/lib/Net/Proxmox/VE/Nodes.pm
Criterion Covered Total %
statement 12 323 3.7
branch 0 396 0.0
condition n/a
subroutine 4 42 9.5
pod 38 38 100.0
total 54 799 6.7


line stmt bran cond sub pod time code
1             #!/bin/false
2             # vim: softtabstop=4 tabstop=4 shiftwidth=4 ft=perl expandtab smarttab
3             # PODNAME: Net::Proxmox::VE::Nodes
4             # ABSTRACT: Functions for the 'nodes' portion of the API
5              
6 2     2   235156 use strict;
  2         3  
  2         92  
7 2     2   10 use warnings;
  2         4  
  2         163  
8              
9             package Net::Proxmox::VE::Nodes;
10             $Net::Proxmox::VE::Nodes::VERSION = '0.44';
11 2     2   15 use parent 'Exporter';
  2         4  
  2         35  
12              
13 2     2   727 use Net::Proxmox::VE::Exception;
  2         5  
  2         8372  
14              
15             our @EXPORT = qw( nodes get_node );
16              
17              
18             my $BASEPATH = '/nodes';
19              
20             sub nodes {
21              
22 0 0   0 1   my $self = shift or return;
23              
24 0           return $self->_get( $BASEPATH, undef );
25              
26             }
27              
28              
29             sub get_node {
30              
31 0 0   0 1   my $self = shift or return;
32              
33 0 0         my $node = shift
34             or Net::Proxmox::VE::Exception->throw('No node for get_node()');
35 0 0         Net::Proxmox::VE::Exception->throw('node must be a scalar for get_node()')
36             if ref $node;
37              
38 0           return $self->get( $BASEPATH, $node );
39              
40             }
41              
42              
43             sub get_node_aplinfo {
44              
45 0 0   0 1   my $self = shift or return;
46              
47 0 0         my $node = shift
48             or Net::Proxmox::VE::Exception->throw('No node for get_node_aplinfo()');
49 0 0         Net::Proxmox::VE::Exception->throw(
50             'node must be a scalar for get_node_aplinfo()')
51             if ref $node;
52              
53 0           return $self->get( $BASEPATH, $node, 'aplinfo' );
54              
55             }
56              
57              
58             sub create_node_aplinfo {
59              
60 0 0   0 1   my $self = shift or return;
61              
62 0 0         my $node = shift
63             or
64             Net::Proxmox::VE::Exception->throw('No node for create_node_aplinfo()');
65 0 0         Net::Proxmox::VE::Exception->throw(
66             'node must be a scalar for create_node_aplinfo()')
67             if ref $node;
68              
69 0           my @p = @_;
70              
71 0 0         Net::Proxmox::VE::Exception->throw('No arguments for create_node_aplinfo()')
72             unless @p;
73 0           my %args;
74              
75 0 0         if ( @p == 1 ) {
76 0 0         Net::Proxmox::VE::Exception->throw(
77             'Single argument not a hash for create_node_aplinfo()')
78             unless ref $node eq 'HASH';
79 0           %args = %{ $p[0] };
  0            
80             }
81             else {
82 0 0         Net::Proxmox::VE::Exception->throw(
83             'Odd number of arguments for create_node_aplinfo()')
84             if ( scalar @p % 2 != 0 );
85 0           %args = @p;
86             }
87              
88 0           return $self->post( $BASEPATH, $node, 'aplinfo', \%args );
89              
90             }
91              
92              
93             sub get_node_dns {
94              
95 0 0   0 1   my $self = shift or return;
96              
97 0 0         my $node = shift
98             or Net::Proxmox::VE::Exception->throw('No node for get_node_dns()');
99 0 0         Net::Proxmox::VE::Exception->throw(
100             'node must be a scalar for get_node_dns()')
101             if ref $node;
102              
103 0           return $self->get( $BASEPATH, $node, 'dns' );
104              
105             }
106              
107              
108             sub update_node_dns {
109              
110 0 0   0 1   my $self = shift or return;
111              
112 0 0         my $node = shift
113             or Net::Proxmox::VE::Exception->throw('No node for update_node_dns()');
114 0 0         Net::Proxmox::VE::Exception->throw(
115             'node must be a scalar for update_node_dns()')
116             if ref $node;
117              
118 0           my @p = @_;
119              
120 0 0         Net::Proxmox::VE::Exception->throw('No arguments for update_node_dns()')
121             unless @p;
122 0           my %args;
123              
124 0 0         if ( @p == 1 ) {
125 0 0         Net::Proxmox::VE::Exception->throw(
126             'Single argument not a hash for update_node_dns()')
127             unless ref $node eq 'HASH';
128 0           %args = %{ $p[0] };
  0            
129             }
130             else {
131 0 0         Net::Proxmox::VE::Exception->throw(
132             'Odd number of arguments for update_node_dns()')
133             if ( scalar @p % 2 != 0 );
134 0           %args = @p;
135             }
136              
137 0           return $self->put( $BASEPATH, $node, 'dns', \%args );
138              
139             }
140              
141              
142             sub get_node_rrd {
143              
144 0 0   0 1   my $self = shift or return;
145              
146 0 0         my $node = shift
147             or Net::Proxmox::VE::Exception->throw('No node for get_node_rrd()');
148 0 0         Net::Proxmox::VE::Exception->throw(
149             'node must be a scalar for get_node_rrd()')
150             if ref $node;
151              
152 0           my @p = @_;
153              
154 0 0         Net::Proxmox::VE::Exception->throw('No arguments for get_node_rrd()')
155             unless @p;
156 0           my %args;
157              
158 0 0         if ( @p == 1 ) {
159 0 0         Net::Proxmox::VE::Exception->throw(
160             'Single argument not a hash for get_node_rrd()')
161             unless ref $node eq 'HASH';
162 0           %args = %{ $p[0] };
  0            
163             }
164             else {
165 0 0         Net::Proxmox::VE::Exception->throw(
166             'Odd number of arguments for get_node_rrd()')
167             if ( scalar @p % 2 != 0 );
168 0           %args = @p;
169             }
170              
171 0           return $self->get( $BASEPATH, $node, 'rrd', \%args );
172              
173             }
174              
175              
176             sub get_node_rrddata {
177              
178 0 0   0 1   my $self = shift or return;
179              
180 0 0         my $node = shift
181             or Net::Proxmox::VE::Exception->throw('No node for get_node_rrddata()');
182 0 0         Net::Proxmox::VE::Exception->throw(
183             'node must be a scalar for get_node_rrddata()')
184             if ref $node;
185              
186 0           my @p = @_;
187              
188 0 0         Net::Proxmox::VE::Exception->throw('No arguments for get_node_rrddata()')
189             unless @p;
190 0           my %args;
191              
192 0 0         if ( @p == 1 ) {
193 0 0         Net::Proxmox::VE::Exception->throw(
194             'Single argument not a hash for get_node_rrddata()')
195             unless ref $node eq 'HASH';
196 0           %args = %{ $p[0] };
  0            
197             }
198             else {
199 0 0         Net::Proxmox::VE::Exception->throw(
200             'Odd number of arguments for get_node_rrddata()')
201             if ( scalar @p % 2 != 0 );
202 0           %args = @p;
203             }
204              
205 0           return $self->get( $BASEPATH, $node, 'rrddata', \%args );
206              
207             }
208              
209              
210             sub get_node_status {
211              
212 0 0   0 1   my $self = shift or return;
213              
214 0 0         my $node = shift
215             or Net::Proxmox::VE::Exception->throw('No node for get_node_status()');
216 0 0         Net::Proxmox::VE::Exception->throw(
217             'node must be a scalar for get_node_status()')
218             if ref $node;
219              
220 0           return $self->get( $BASEPATH, $node, 'status' );
221              
222             }
223              
224              
225             sub update_node_status {
226              
227 0 0   0 1   my $self = shift or return;
228              
229 0 0         my $node = shift
230             or Net::Proxmox::VE::Exception->throw('No node for update_node_status()');
231 0 0         Net::Proxmox::VE::Exception->throw(
232             'node must be a scalar for update_node_status()')
233             if ref $node;
234              
235 0           my @p = @_;
236              
237 0 0         Net::Proxmox::VE::Exception->throw('No arguments for update_node_status()')
238             unless @p;
239 0           my %args;
240              
241 0 0         if ( @p == 1 ) {
242 0 0         Net::Proxmox::VE::Exception->throw(
243             'Single argument not a hash for update_node_status()')
244             unless ref $node eq 'HASH';
245 0           %args = %{ $p[0] };
  0            
246             }
247             else {
248 0 0         Net::Proxmox::VE::Exception->throw(
249             'Odd number of arguments for update_node_status()')
250             if ( scalar @p % 2 != 0 );
251 0           %args = @p;
252             }
253              
254 0           return $self->post( $BASEPATH, $node, 'status', \%args );
255              
256             }
257              
258              
259             sub get_node_subscription {
260              
261 0 0   0 1   my $self = shift or return;
262              
263 0 0         my $node = shift
264             or
265             Net::Proxmox::VE::Exception->throw('No node for get_node_subscription()');
266 0 0         Net::Proxmox::VE::Exception->throw(
267             'node must be a scalar for get_node_subscription()')
268             if ref $node;
269              
270 0           return $self->get( $BASEPATH, $node, 'subscription' );
271              
272             }
273              
274              
275             sub create_node_subscription {
276              
277 0 0   0 1   my $self = shift or return;
278              
279 0 0         my $node = shift
280             or Net::Proxmox::VE::Exception->throw(
281             'No node for create_node_subscription()');
282 0 0         Net::Proxmox::VE::Exception->throw(
283             'node must be a scalar for create_node_subscription()')
284             if ref $node;
285              
286 0           my @p = @_;
287              
288 0 0         Net::Proxmox::VE::Exception->throw(
289             'No arguments for create_node_subscription()')
290             unless @p;
291 0           my %args;
292              
293 0 0         if ( @p == 1 ) {
294 0 0         Net::Proxmox::VE::Exception->throw(
295             'Single argument not a hash for create_node_subscription()')
296             unless ref $node eq 'HASH';
297 0           %args = %{ $p[0] };
  0            
298             }
299             else {
300 0 0         Net::Proxmox::VE::Exception->throw(
301             'Odd number of arguments for create_node_subscription()')
302             if ( scalar @p % 2 != 0 );
303 0           %args = @p;
304             }
305              
306 0           return $self->post( $BASEPATH, $node, 'subscription', \%args );
307              
308             }
309              
310              
311             sub update_node_subscription_key {
312              
313 0 0   0 1   my $self = shift or return;
314              
315 0 0         my $node = shift
316             or Net::Proxmox::VE::Exception->throw(
317             'No node for update_node_subscription_key()');
318 0 0         Net::Proxmox::VE::Exception->throw(
319             'node must be a scalar for update_node_subscription_key()')
320             if ref $node;
321              
322 0           my @p = @_;
323              
324 0 0         Net::Proxmox::VE::Exception->throw(
325             'No arguments for update_node_subscription_key()')
326             unless @p;
327 0           my %args;
328              
329 0 0         if ( @p == 1 ) {
330 0 0         Net::Proxmox::VE::Exception->throw(
331             'Single argument not a hash for update_node_subscription_key()')
332             unless ref $node eq 'HASH';
333 0           %args = %{ $p[0] };
  0            
334             }
335             else {
336 0 0         Net::Proxmox::VE::Exception->throw(
337             'Odd number of arguments for update_node_subscription_key()')
338             if ( scalar @p % 2 != 0 );
339 0           %args = @p;
340             }
341              
342 0           return $self->put( $BASEPATH, $node, 'subscription', \%args );
343              
344             }
345              
346              
347             sub get_node_syslog {
348              
349 0 0   0 1   my $self = shift or return;
350              
351 0 0         my $node = shift
352             or Net::Proxmox::VE::Exception->throw('No node for get_node_syslog()');
353 0 0         Net::Proxmox::VE::Exception->throw(
354             'node must be a scalar for get_node_syslog()')
355             if ref $node;
356              
357 0           my @p = @_;
358              
359 0 0         Net::Proxmox::VE::Exception->throw('No arguments for get_node_syslog()')
360             unless @p;
361 0           my %args;
362              
363 0 0         if ( @p == 1 ) {
364 0 0         Net::Proxmox::VE::Exception->throw(
365             'Single argument not a hash for get_node_syslog()')
366             unless ref $node eq 'HASH';
367 0           %args = %{ $p[0] };
  0            
368             }
369             else {
370 0 0         Net::Proxmox::VE::Exception->throw(
371             'Odd number of arguments for get_node_syslog()')
372             if ( scalar @p % 2 != 0 );
373 0           %args = @p;
374             }
375              
376 0           return $self->get( $BASEPATH, $node, 'syslog', \%args );
377              
378             }
379              
380              
381             sub get_node_time {
382              
383 0 0   0 1   my $self = shift or return;
384              
385 0 0         my $node = shift
386             or Net::Proxmox::VE::Exception->throw('No node for get_node_time()');
387 0 0         Net::Proxmox::VE::Exception->throw(
388             'node must be a scalar for get_node_time()')
389             if ref $node;
390              
391 0           return $self->get( $BASEPATH, $node, 'time' );
392              
393             }
394              
395              
396             sub update_node_time {
397              
398 0 0   0 1   my $self = shift or return;
399              
400 0 0         my $node = shift
401             or Net::Proxmox::VE::Exception->throw('No node for update_node_time()');
402 0 0         Net::Proxmox::VE::Exception->throw(
403             'node must be a scalar for update_node_time()')
404             if ref $node;
405              
406 0           my @p = @_;
407              
408 0 0         Net::Proxmox::VE::Exception->throw('No arguments for update_node_time()')
409             unless @p;
410 0           my %args;
411              
412 0 0         if ( @p == 1 ) {
413 0 0         Net::Proxmox::VE::Exception->throw(
414             'Single argument not a hash for update_node_time()')
415             unless ref $node eq 'HASH';
416 0           %args = %{ $p[0] };
  0            
417             }
418             else {
419 0 0         Net::Proxmox::VE::Exception->throw(
420             'Odd number of arguments for update_node_time()')
421             if ( scalar @p % 2 != 0 );
422 0           %args = @p;
423             }
424              
425 0           return $self->put( $BASEPATH, $node, 'time', \%args );
426              
427             }
428              
429              
430             sub get_node_ubcfailcnt {
431              
432 0 0   0 1   my $self = shift or return;
433              
434 0 0         my $node = shift
435             or
436             Net::Proxmox::VE::Exception->throw('No node for get_node_ubcfailcnt()');
437 0 0         Net::Proxmox::VE::Exception->throw(
438             'node must be a scalar for get_node_ubcfailcnt()')
439             if ref $node;
440              
441 0           return $self->get( $BASEPATH, $node, 'ubcfailcnt' );
442              
443             }
444              
445              
446             sub get_node_version {
447              
448 0 0   0 1   my $self = shift or return;
449              
450 0 0         my $node = shift
451             or Net::Proxmox::VE::Exception->throw('No node for get_node_version()');
452 0 0         Net::Proxmox::VE::Exception->throw(
453             'node must be a scalar for get_node_version()')
454             if ref $node;
455              
456 0           return $self->get( $BASEPATH, $node, 'version' );
457              
458             }
459              
460              
461             sub create_node_vncshell {
462              
463 0 0   0 1   my $self = shift or return;
464              
465 0 0         my $node = shift
466             or
467             Net::Proxmox::VE::Exception->throw('No node for create_node_vncshell()');
468 0 0         Net::Proxmox::VE::Exception->throw(
469             'node must be a scalar for create_node_vncshell()')
470             if ref $node;
471              
472 0           return $self->post( $BASEPATH, $node, 'vncshell' );
473              
474             }
475              
476              
477             sub create_node_vzdump {
478              
479 0 0   0 1   my $self = shift or return;
480              
481 0 0         my $node = shift
482             or Net::Proxmox::VE::Exception->throw('No node for create_node_vzdump()');
483 0 0         Net::Proxmox::VE::Exception->throw(
484             'node must be a scalar for create_node_vzdump()')
485             if ref $node;
486              
487 0           my @p = @_;
488              
489 0 0         Net::Proxmox::VE::Exception->throw('No arguments for create_node_vzdump()')
490             unless @p;
491 0           my %args;
492              
493 0 0         if ( @p == 1 ) {
494 0 0         Net::Proxmox::VE::Exception->throw(
495             'Single argument not a hash for create_node_vzdump()')
496             unless ref $node eq 'HASH';
497 0           %args = %{ $p[0] };
  0            
498             }
499             else {
500 0 0         Net::Proxmox::VE::Exception->throw(
501             'Odd number of arguments for create_node_vzdump()')
502             if ( scalar @p % 2 != 0 );
503 0           %args = @p;
504             }
505              
506 0           return $self->post( $BASEPATH, $node, 'dns', \%args );
507              
508             }
509              
510              
511             sub nodes_network {
512              
513 0 0   0 1   my $self = shift or return;
514              
515 0 0         my $node = shift
516             or Net::Proxmox::VE::Exception->throw('No node for nodes_network()');
517 0 0         Net::Proxmox::VE::Exception->throw(
518             'node must be a scalar for nodes_network()')
519             if ref $node;
520              
521 0           my @p = @_;
522              
523 0 0         Net::Proxmox::VE::Exception->throw('No arguments for nodes_network()')
524             unless @p;
525 0           my %args;
526              
527 0 0         if ( @p == 1 ) {
528 0 0         Net::Proxmox::VE::Exception->throw(
529             'Single argument not a hash for nodes_network()')
530             unless ref $node eq 'HASH';
531 0           %args = %{ $p[0] };
  0            
532             }
533             else {
534 0 0         Net::Proxmox::VE::Exception->throw(
535             'Odd number of arguments for nodes_network()')
536             if ( scalar @p % 2 != 0 );
537 0           %args = @p;
538             }
539              
540 0           return $self->get( $BASEPATH, $node, 'network', \%args );
541              
542             }
543              
544              
545             sub create_node_network {
546              
547 0 0   0 1   my $self = shift or return;
548              
549 0 0         my $node = shift
550             or
551             Net::Proxmox::VE::Exception->throw('No node for create_node_network()');
552 0 0         Net::Proxmox::VE::Exception->throw(
553             'node must be a scalar for create_node_network()')
554             if ref $node;
555              
556 0           my @p = @_;
557              
558 0 0         Net::Proxmox::VE::Exception->throw('No arguments for create_node_network()')
559             unless @p;
560 0           my %args;
561              
562 0 0         if ( @p == 1 ) {
563 0 0         Net::Proxmox::VE::Exception->throw(
564             'Single argument not a hash for create_node_network()')
565             unless ref $node eq 'HASH';
566 0           %args = %{ $p[0] };
  0            
567             }
568             else {
569 0 0         Net::Proxmox::VE::Exception->throw(
570             'Odd number of arguments for create_node_network()')
571             if ( scalar @p % 2 != 0 );
572 0           %args = @p;
573             }
574              
575 0           return $self->post( $BASEPATH, $node, 'network', \%args );
576              
577             }
578              
579              
580             sub revert_nodes_network {
581              
582 0 0   0 1   my $self = shift or return;
583              
584 0 0         my $node = shift
585             or
586             Net::Proxmox::VE::Exception->throw('No node for revert_nodes_network()');
587 0 0         Net::Proxmox::VE::Exception->throw(
588             'node must be a scalar for revert_nodes_network()')
589             if ref $node;
590              
591 0           return $self->delete( $BASEPATH, $node );
592              
593             }
594              
595              
596             sub get_node_network_iface {
597              
598 0 0   0 1   my $self = shift or return;
599              
600 0 0         my $node = shift
601             or Net::Proxmox::VE::Exception->throw(
602             'No node for get_node_network_iface()');
603 0 0         my $b = shift
604             or Net::Proxmox::VE::Exception->throw(
605             'No iface for get_node_network_iface()');
606              
607 0 0         Net::Proxmox::VE::Exception->throw(
608             'node must be a scalar for get_node_network_iface()')
609             if ref $node;
610 0 0         Net::Proxmox::VE::Exception->throw(
611             'iface must be a scalar for get_node_network_iface()')
612             if ref $b;
613              
614 0           return $self->get( $BASEPATH, $node, 'network', $b );
615              
616             }
617              
618              
619             sub update_node_network_iface {
620              
621 0 0   0 1   my $self = shift or return;
622              
623 0 0         my $node = shift
624             or Net::Proxmox::VE::Exception->throw(
625             'No node for update_node_network_iface()');
626 0 0         my $b = shift
627             or Net::Proxmox::VE::Exception->throw(
628             'No iface for update_node_network_iface()');
629              
630 0 0         Net::Proxmox::VE::Exception->throw(
631             'node must be a scalar for update_node_network_iface()')
632             if ref $node;
633 0 0         Net::Proxmox::VE::Exception->throw(
634             'iface must be a scalar for update_node_network_iface()')
635             if ref $b;
636              
637 0           my @p = @_;
638              
639 0 0         Net::Proxmox::VE::Exception->throw(
640             'No arguments for update_node_network_iface()')
641             unless @p;
642 0           my %args;
643              
644 0 0         if ( @p == 1 ) {
645 0 0         Net::Proxmox::VE::Exception->throw(
646             'Single argument not a hash for update_node_network_iface()')
647             unless ref $node eq 'HASH';
648 0           %args = %{ $p[0] };
  0            
649             }
650             else {
651 0 0         Net::Proxmox::VE::Exception->throw(
652             'Odd number of arguments for update_node_network_iface()')
653             if ( scalar @p % 2 != 0 );
654 0           %args = @p;
655             }
656              
657 0           return $self->post( $BASEPATH, $node, 'network', $b, \%args );
658              
659             }
660              
661              
662             sub delete_nodes_network_iface {
663              
664 0 0   0 1   my $self = shift or return;
665              
666 0 0         my $node = shift
667             or Net::Proxmox::VE::Exception->throw(
668             'No node for delete_nodes_network_iface()');
669 0 0         my $iface = shift
670             or Net::Proxmox::VE::Exception->throw(
671             'No iface for delete_nodes_network_iface()');
672              
673 0 0         Net::Proxmox::VE::Exception->throw(
674             'node must be a scalar for delete_nodes_network_iface()')
675             if ref $node;
676 0 0         Net::Proxmox::VE::Exception->throw(
677             'iface must be a scalar for delete_nodes_network_iface()')
678             if ref $iface;
679              
680 0           return $self->get( $BASEPATH, $node, 'network', $iface );
681              
682             }
683              
684              
685             sub nodes_openvz {
686              
687 0 0   0 1   my $self = shift or return;
688              
689 0 0         my $node = shift
690             or Net::Proxmox::VE::Exception->throw('No node for nodes_openvz()');
691 0 0         Net::Proxmox::VE::Exception->throw(
692             'node must be a scalar for nodes_openvz()')
693             if ref $node;
694              
695 0           return $self->get( $BASEPATH, $node, 'openvz' );
696              
697             }
698              
699              
700             sub create_node_openvz {
701              
702 0 0   0 1   my $self = shift or return;
703              
704 0 0         my $node = shift
705             or Net::Proxmox::VE::Exception->throw('No node for create_node_openvz()');
706 0 0         Net::Proxmox::VE::Exception->throw(
707             'node must be a scalar for create_node_openvz()')
708             if ref $node;
709              
710 0           my @p = @_;
711              
712 0 0         Net::Proxmox::VE::Exception->throw('No arguments for create_node_openvz()')
713             unless @p;
714 0           my %args;
715              
716 0 0         if ( @p == 1 ) {
717 0 0         Net::Proxmox::VE::Exception->throw(
718             'Single argument not a hash for create_node_openvz()')
719             unless ref $node eq 'HASH';
720 0           %args = %{ $p[0] };
  0            
721             }
722             else {
723 0 0         Net::Proxmox::VE::Exception->throw(
724             'Odd number of arguments for create_node_openvz()')
725             if ( scalar @p % 2 != 0 );
726 0           %args = @p;
727             }
728              
729 0           return $self->get( $BASEPATH, $node, 'openvz', \%args );
730              
731             }
732              
733              
734             sub get_node_openvz {
735              
736 0 0   0 1   my $self = shift or return;
737              
738 0 0         my $node = shift
739             or Net::Proxmox::VE::Exception->throw('No node for get_node_openvz()');
740 0 0         Net::Proxmox::VE::Exception->throw(
741             'node must be a scalar for get_node_openvz()')
742             if ref $node;
743              
744 0 0         my $vmid = shift
745             or Net::Proxmox::VE::Exception->throw('No vmid for get_node_openvz()');
746 0 0         Net::Proxmox::VE::Exception->throw(
747             'vmid must be a scalar for get_node_openvz()')
748             if ref $vmid;
749              
750 0           return $self->get( $BASEPATH, $node, 'openvz', $vmid );
751              
752             }
753              
754              
755             sub delete_nodes_openvz {
756              
757 0 0   0 1   my $self = shift or return;
758              
759 0 0         my $node = shift
760             or
761             Net::Proxmox::VE::Exception->throw('No node for delete_nodes_openvz()');
762 0 0         Net::Proxmox::VE::Exception->throw(
763             'node must be a scalar for delete_nodes_openvz()')
764             if ref $node;
765              
766 0 0         my $vmid = shift
767             or
768             Net::Proxmox::VE::Exception->throw('No node for delete_nodes_openvz()');
769 0 0         Net::Proxmox::VE::Exception->throw(
770             'vmid must be a scalar for delete_nodes_openvz()')
771             if ref $vmid;
772              
773 0           return $self->delete( $BASEPATH, $node, 'openvz', $vmid );
774              
775             }
776              
777              
778             sub get_node_openvz_status {
779              
780 0 0   0 1   my $self = shift or return;
781              
782 0 0         my $node = shift
783             or Net::Proxmox::VE::Exception->throw(
784             'No node for get_node_openvz_status()');
785 0 0         Net::Proxmox::VE::Exception->throw(
786             'node must be a scalar for get_node_openvz_status()')
787             if ref $node;
788              
789 0 0         my $vmid = shift
790             or Net::Proxmox::VE::Exception->throw(
791             'No node for get_node_openvz_status()');
792 0 0         Net::Proxmox::VE::Exception->throw(
793             'node must be a scalar for get_node_openvz_status()')
794             if ref $vmid;
795              
796 0           return $self->get( $BASEPATH, $node, 'openvz', $vmid, 'status' );
797              
798             }
799              
800              
801             sub get_node_openvz_status_current {
802              
803 0 0   0 1   my $self = shift or return;
804              
805 0 0         my $node = shift
806             or Net::Proxmox::VE::Exception->throw(
807             'No node for get_node_openvz_status_current()');
808 0 0         Net::Proxmox::VE::Exception->throw(
809             'node must be a scalar for get_node_openvz_status_current()')
810             if ref $node;
811              
812 0 0         my $vmid = shift
813             or Net::Proxmox::VE::Exception->throw(
814             'No node for get_node_openvz_status_current()');
815 0 0         Net::Proxmox::VE::Exception->throw(
816             'node must be a scalar for get_node_openvz_status_current()')
817             if ref $vmid;
818              
819 0           return $self->get( $BASEPATH, $node, 'openvz', $vmid, 'status', 'current' );
820              
821             }
822              
823              
824             sub create_node_openvz_status_mount {
825              
826 0 0   0 1   my $self = shift or return;
827              
828 0 0         my $node = shift
829             or Net::Proxmox::VE::Exception->throw(
830             'No node for create_node_openvz_status_mount()');
831 0 0         Net::Proxmox::VE::Exception->throw(
832             'node must be a scalar for create_node_openvz_status_mount()')
833             if ref $node;
834              
835 0 0         my $vmid = shift
836             or Net::Proxmox::VE::Exception->throw(
837             'No node for create_node_openvz_status_mount()');
838 0 0         Net::Proxmox::VE::Exception->throw(
839             'node must be a scalar for create_node_openvz_status_mount()')
840             if ref $vmid;
841              
842 0           return $self->post( $BASEPATH, $node, 'openvz', $vmid, 'status', 'mount' );
843              
844             }
845              
846              
847             sub create_node_openvz_status_shutdown {
848              
849 0 0   0 1   my $self = shift or return;
850              
851 0 0         my $node = shift
852             or Net::Proxmox::VE::Exception->throw(
853             'No node for create_node_openvz_status_shutdown()');
854 0 0         Net::Proxmox::VE::Exception->throw(
855             'node must be a scalar for create_node_openvz_status_shutdown()')
856             if ref $node;
857              
858 0 0         my $vmid = shift
859             or Net::Proxmox::VE::Exception->throw(
860             'No vmid for create_node_openvz_status_shutdown()');
861 0 0         Net::Proxmox::VE::Exception->throw(
862             'vmid must be a scalar for create_node_openvz_status_shutdown()')
863             if ref $vmid;
864              
865 0           my @p = @_;
866 0 0         Net::Proxmox::VE::Exception->throw(
867             'No arguments for create_node_openvz_status_shutdown()')
868             unless @p;
869 0           my %args;
870              
871 0 0         if ( @p == 1 ) {
872 0 0         Net::Proxmox::VE::Exception->throw(
873             'Single argument not a hash for create_node_openvz_status_shutdown()'
874             ) unless ref $node eq 'HASH';
875 0           %args = %{ $p[0] };
  0            
876             }
877             else {
878 0 0         Net::Proxmox::VE::Exception->throw(
879             'Odd number of arguments for create_node_openvz_status_shutdown()')
880             if ( scalar @p % 2 != 0 );
881 0           %args = @p;
882             }
883              
884 0           return $self->post( $BASEPATH, $node, 'openvz', $vmid, 'status',
885             'shutdown', \%args );
886              
887             }
888              
889              
890             sub create_node_openvz_status_start {
891              
892 0 0   0 1   my $self = shift or return;
893              
894 0 0         my $node = shift
895             or Net::Proxmox::VE::Exception->throw(
896             'No node for create_node_openvz_status_start()');
897 0 0         Net::Proxmox::VE::Exception->throw(
898             'node must be a scalar for create_node_openvz_status_start()')
899             if ref $node;
900              
901 0 0         my $vmid = shift
902             or Net::Proxmox::VE::Exception->throw(
903             'No vmid for create_node_openvz_status_start()');
904 0 0         Net::Proxmox::VE::Exception->throw(
905             'vmid must be a scalar for create_node_openvz_status_start()')
906             if ref $vmid;
907              
908 0           return $self->post( $BASEPATH, $node, 'openvz', $vmid, 'status', 'start' );
909              
910             }
911              
912              
913             sub create_node_openvz_status_stop {
914              
915 0 0   0 1   my $self = shift or return;
916              
917 0 0         my $node = shift
918             or Net::Proxmox::VE::Exception->throw(
919             'No node for create_node_openvz_status_stop()');
920 0 0         Net::Proxmox::VE::Exception->throw(
921             'node must be a scalar for create_node_openvz_status_stop()')
922             if ref $node;
923              
924 0 0         my $vmid = shift
925             or Net::Proxmox::VE::Exception->throw(
926             'No vmid for create_node_openvz_status_stop()');
927 0 0         Net::Proxmox::VE::Exception->throw(
928             'vmid must be a scalar for create_node_openvz_status_stop()')
929             if ref $vmid;
930              
931 0           return $self->post( $BASEPATH, $node, 'openvz', $vmid, 'status', 'start' );
932              
933             }
934              
935              
936             sub get_node_openvz_status_ubc {
937              
938 0 0   0 1   my $self = shift or return;
939              
940 0 0         my $node = shift
941             or Net::Proxmox::VE::Exception->throw(
942             'No node for get_node_openvz_status_ubc()');
943 0 0         Net::Proxmox::VE::Exception->throw(
944             'node must be a scalar for get_node_openvz_status_ubc()')
945             if ref $node;
946              
947 0 0         my $vmid = shift
948             or Net::Proxmox::VE::Exception->throw(
949             'No vmid for get_node_openvz_status_ubc()');
950 0 0         Net::Proxmox::VE::Exception->throw(
951             'vmid must be a scalar for get_node_openvz_status_ubc()')
952             if ref $vmid;
953              
954 0           return $self->post( $BASEPATH, $node, 'openvz', $vmid, 'status', 'ubc' );
955              
956             }
957              
958              
959             sub get_node_openvz_status_umount {
960              
961 0 0   0 1   my $self = shift or return;
962              
963 0 0         my $node = shift
964             or Net::Proxmox::VE::Exception->throw(
965             'No node for get_node_openvz_status_umount()');
966 0 0         Net::Proxmox::VE::Exception->throw(
967             'node must be a scalar for get_node_openvz_status_umount()')
968             if ref $node;
969              
970 0 0         my $vmid = shift
971             or Net::Proxmox::VE::Exception->throw(
972             'No vmid for get_node_openvz_status_umount()');
973 0 0         Net::Proxmox::VE::Exception->throw(
974             'vmid must be a scalar for get_node_openvz_status_umount()')
975             if ref $vmid;
976              
977 0           return $self->post( $BASEPATH, $node, 'openvz', $vmid, 'status', 'umount' );
978              
979             }
980              
981              
982             1;
983              
984             __END__
985              
986             =pod
987              
988             =encoding UTF-8
989              
990             =head1 NAME
991              
992             Net::Proxmox::VE::Nodes - Functions for the 'nodes' portion of the API
993              
994             =head1 VERSION
995              
996             version 0.44
997              
998             =head1 SYNOPSIS
999              
1000             # assuming $obj is a Net::Proxmox::VE object
1001              
1002             my @nodes = $obj->nodes();
1003              
1004             =head1 METHODS
1005              
1006             =head2 nodes
1007              
1008             Returns the 'Cluster node index'
1009              
1010             Note: Accessible by all authententicated users.
1011              
1012             =head2 get_node
1013              
1014             Gets a single node details
1015              
1016             $ok = $obj->get_nodes( $node )
1017              
1018             Where $Where I<$node> is a string in pve-node format
1019              
1020             Note: Accessible by all authententicated users.
1021              
1022             =head2 get_node_aplinfo
1023              
1024             Gets a single nodes list of appliances
1025              
1026             $ok = $obj->get_node_aplinfo( $node )
1027              
1028             Where I<$node> is a string in pve-node format
1029              
1030             Note: Accessible by all authententicated users.
1031              
1032             =head2 create_node_aplinfo
1033              
1034             Create (upload) appliance templates.
1035              
1036             $ok = $obj->download_nodes_aplinfo( $node, \%args )
1037              
1038             Where I<$node> is a string in pve-node format
1039              
1040             I<%args> may items contain from the following list
1041              
1042             =over 4
1043              
1044             =item storage
1045              
1046             String. The storage to be used in pve-storage-id format. Required.
1047              
1048             =item template
1049              
1050             Data. The actual template. Required.
1051              
1052             =back
1053              
1054             Note: required permissions are ["perm","/storage/{storage}",["Datastore.AllocateTemplate"]]
1055              
1056             =head2 get_node_dns
1057              
1058             Get DNS settings.
1059              
1060             $ok = $obj->get_node_dns( $node )
1061              
1062             Where I<$node> is a string in pve-node format
1063              
1064             Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
1065              
1066             =head2 update_node_dns
1067              
1068             Updates (writes) DNS settings.
1069              
1070             $ok = $obj->update_node_dns( $node, \%args )
1071              
1072             Where I<$node> is a string in pve-node format
1073              
1074             I<%args> may items contain from the following list
1075              
1076             =over 4
1077              
1078             =item search
1079              
1080             String. Search domain for host-name lookup. Required.
1081              
1082             =back
1083              
1084             Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
1085              
1086             =head2 get_node_rrd
1087              
1088             Get nodes RRD statistics (returns PNG).
1089              
1090             $ok = $obj->get_node_rrd( $node, \%args )
1091              
1092             Where I<$node> is a string in pve-node format
1093              
1094             I<%args> may items contain from the following list
1095              
1096             =over 4
1097              
1098             =item ds
1099              
1100             String. The list of datasources you wish to see, in pve-configid-list format. Required.
1101              
1102             =item timeframe
1103              
1104             Enum. Is either hour, day, week, month or year. Required.
1105              
1106             =item cf
1107              
1108             Enum. Is either AVERAGE or MAX. Controls the RRD consolidation function. Optional.
1109              
1110             =back
1111              
1112             Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
1113              
1114             =head2 get_node_rrddata
1115              
1116             Get nodes RRD statistics.
1117              
1118             $ok = $obj->get_node_rrddata( $node, \%args )
1119              
1120             Where I<$node> is a string in pve-node format
1121              
1122             I<%args> may items contain from the following list
1123              
1124             =over 4
1125              
1126             =item timeframe
1127              
1128             Enum. Is either hour, day, week, month or year. Required.
1129              
1130             =item cf
1131              
1132             Enum. Is either AVERAGE or MAX. Controls the RRD consolidation function. Optional.
1133              
1134             =back
1135              
1136             Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
1137              
1138             =head2 get_node_status
1139              
1140             Gets node status
1141              
1142             $ok = $obj->get_node_status( $node )
1143              
1144             Where I<$node> is a string in pve-node format
1145              
1146             Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
1147              
1148             =head2 update_node_status
1149              
1150             Reboot or shutdown a node
1151              
1152             $ok = $obj->updates_nodes_status( $node, \%args )
1153              
1154             Where I<$node> is a string in pve-node format
1155              
1156             I<%args> may items contain from the following list
1157              
1158             =over 4
1159              
1160             =item command
1161              
1162             Enum. Either reboot or shutdown. Specifies the command. Required.
1163              
1164             =back
1165              
1166             Note: required permissions are ["perm","/nodes/{node}",["Sys.PowerMgmt"]]
1167              
1168             =head2 get_node_subscription
1169              
1170             Read nodes subscription info
1171              
1172             $ok = $obj->get_node_subscription( $node )
1173              
1174             Where I<$node> is a string in pve-node format
1175              
1176             Note: Root only.
1177              
1178             =head2 create_node_subscription
1179              
1180             Create/update nodes subscription info
1181              
1182             $ok = $obj->create_node_subscription( $node, \%args )
1183              
1184             Where I<$node> is a string in pve-node format
1185              
1186             I<%args> may items contain from the following list
1187              
1188             =over 4
1189              
1190             =item force
1191              
1192             Boolean. Always connect to the server, even if we have up to date info inside local cache. Optional.
1193              
1194             =back
1195              
1196             Note: Root only.
1197              
1198             =head2 update_node_subscription_key
1199              
1200             Updates/sets subscription key
1201              
1202             $ok = $obj->update_node_subscription_key( $node, \%args )
1203              
1204             Where I<$node> is a string in pve-node format
1205              
1206             I<%args> may items contain from the following list
1207              
1208             =over 4
1209              
1210             =item key
1211              
1212             Boolean. Proxmox VE subscription key. Required.
1213              
1214             =back
1215              
1216             Note: Root only.
1217              
1218             =head2 get_node_syslog
1219              
1220             Reads system log
1221              
1222             $ok = $obj->get_node_syslog( $node, \%args )
1223              
1224             Where I<$node> is a string in pve-node format
1225              
1226             Note: required permissions are ["perm","/nodes/{node}",["Sys.Syslog"]]
1227              
1228             =head2 get_node_time
1229              
1230             Read server time and time zone settings
1231              
1232             $ok = $obj->get_node_time( $node )
1233              
1234             Where I<$node> is a string in pve-node format
1235              
1236             Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
1237              
1238             =head2 update_node_time
1239              
1240             Updates time zone
1241              
1242             $ok = $obj->update_node_time( $node, \%args )
1243              
1244             Where I<$node> is a string in pve-node format
1245              
1246             I<%args> may items contain from the following list
1247              
1248             =over 4
1249              
1250             =item timezone
1251              
1252             String. Time zone to be used, see '/usr/share/zoneinfo/zone.tab'. Required.
1253              
1254             =back
1255              
1256             Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
1257              
1258             =head2 get_node_ubcfailcnt
1259              
1260             Get user_beancounters failcnt for all active containers.
1261              
1262             $ok = $obj->get_node_ubcfailcnt( $node )
1263              
1264             Where I<$node> is a string in pve-node format
1265              
1266             Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
1267              
1268             =head2 get_node_version
1269              
1270             Get user_beancounters failcnt for all active containers.
1271              
1272             $ok = $obj->get_node_version( $node )
1273              
1274             Where I<$node> is a string in pve-node format
1275              
1276             Note: Accessible by all authententicated users.
1277              
1278             =head2 create_node_vncshell
1279              
1280             Creates a VNC Shell proxy.
1281              
1282             $ok = $obj->create_node_vncshell( $node )
1283              
1284             Where I<$node> is a string in pve-node format
1285              
1286             Note: Restricted to users on realm 'pam'. Required permissions are ["perm","/nodes/{node}",["Sys.Console"]]
1287              
1288             =head2 create_node_vzdump
1289              
1290             Create backup.
1291              
1292             $ok = $obj->create_node_vzdump( $node, \%args )
1293              
1294             Where I<$node> is a string in pve-node format
1295              
1296             I<%args> may items contain from the following list
1297              
1298             =over 4
1299              
1300             =item all
1301              
1302             Boolean. Backup all known VMs on this host. Optional.
1303              
1304             =item bwlimit
1305              
1306             Integer. Limit I/O bandwidth (KBytes per second). Optional.
1307              
1308             =item compress
1309              
1310             Enum. Either 0, 1, gzip or lzo. Comress dump file. Optional
1311              
1312             =item dumpdir
1313              
1314             String. Store resulting files to specified directory. Optional.
1315              
1316             =item exclude
1317              
1318             String. Exclude specified VMs (assumes --all) in pve-vmid-list. Optional.
1319              
1320             =item exclude-path
1321              
1322             String. Exclude certain files/directories (regex) in string-alist. Optional.
1323              
1324             =item ionice
1325              
1326             Integer. Set CFQ ionice priority. Optional.
1327              
1328             =item lockwait
1329              
1330             Integer. Maximal time to wait for the global lock (minutes). Optional.
1331              
1332             =item mailto
1333              
1334             String. List of email addresses in string-list format. Optional.
1335              
1336             =item maxfiles
1337              
1338             Integer. Maximal number of backup files per vm. Optional.
1339              
1340             =item mode
1341              
1342             Enum. A value from snapshot, suspend or stop. Backup mode. Optional.
1343              
1344             =item quiet
1345              
1346             Boolean. Be quiet. Optional.
1347              
1348             =item remove
1349              
1350             Boolean. Remove old backup files if there are more than 'maxfiles' backup files. Optional.
1351              
1352             =item script
1353              
1354             String. Use specified hook script. Optional.
1355              
1356             =item size
1357              
1358             Integer. LVM snapshot size in MB. Optional.
1359              
1360             =item stdexcludes
1361              
1362             Boolean. Exclude temporary files and logs. Optional.
1363              
1364             =item stdout
1365              
1366             Boolean. Write tar to stdout rather than to a file. Optional.
1367              
1368             =item stopwait
1369              
1370             Integer. Maximal time to wait until a VM is stopped (minutes). Optional.
1371              
1372             =item storage
1373              
1374             String. Store resulting file to this storage, in pve-storage-id format. Optional.
1375              
1376             =item tmpdir
1377              
1378             String. Store temporary files to specified directory. Optional.
1379              
1380             =item vmid
1381              
1382             String. The ID of the VM you want to backup in pve-vm-list format. Optional.
1383              
1384             =back
1385              
1386             Note: The user needs 'VM.Backup' permissions on any VM, and 'Datastore.AllocateSpace' on the backup storage.
1387              
1388             =head2 nodes_network
1389              
1390             List available networks on the node
1391              
1392             $ok = $obj->nodes_network( $node, \%args )
1393              
1394             Where I<$node> is a string in pve-node format
1395              
1396             I<%args> may items contain from the following list
1397              
1398             =over 4
1399              
1400             =item type
1401              
1402             Enum. One of bond, bridge, alias or eth. Only list specific interface types. Optional.
1403              
1404             =back
1405              
1406             Note: Accessible by all authententicated users.
1407              
1408             =head2 create_node_network
1409              
1410             Create network device configuration
1411              
1412             $ok = $obj->create_node_network( $node, \%args )
1413              
1414             Where I<$node> is a string in pve-node format
1415              
1416             I<%args> may items contain from the following list
1417              
1418             =over 4
1419              
1420             =item iface
1421              
1422             String. The network interface name in pve-iface format. Required.
1423              
1424             =item address
1425              
1426             String. The ipv4 network address. Optional.
1427              
1428             =item autostart
1429              
1430             Boolean. Automatically start interface on boot. Optional.
1431              
1432             =item bond_mode
1433              
1434             Enum. Either of balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb or balance-alb. Specifies the bonding mode. Optional.
1435              
1436             =item bridge_ports
1437              
1438             String. Specify the interfaces you want to add to your bridge in pve-iface-list format. Optional.
1439              
1440             =item gateway
1441              
1442             String. Default ipv4 gateway address. Optional.
1443              
1444             =item netmask
1445              
1446             String. Network mask for ipv4. Optional.
1447              
1448             =item slaves
1449              
1450             String. Specify the interfaces used by the bonding device in pve-iface-list format. Optional.
1451              
1452             =back
1453              
1454             Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
1455              
1456             =head2 revert_nodes_network
1457              
1458             Revert network configuration changes.
1459              
1460             $ok = $obj->revert_nodes_network( $node )
1461              
1462             Where I<$node> is a string in pve-node format
1463              
1464             Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
1465              
1466             =head2 get_node_network_iface
1467              
1468             Read network device configuration
1469              
1470             $ok = $obj->get_node_network_iface( $node, 'iface')
1471              
1472             Where I<$node> is a string in pve-node format, iface is a string in pve-iface format
1473              
1474             Note: required permissions are ["perm","/nodes/{node}",["Sys.Audit"]]
1475              
1476             =head2 update_node_network_iface
1477              
1478             Create network device configuration
1479              
1480             $ok = $obj->update_node_network_iface( $node, 'iface',
1481              
1482             Where I<$node> is a string in pve-node format, iface is a string in pve-iface format
1483              
1484             I<%args> may items contain from the following list
1485              
1486             =over 4
1487              
1488             =item address
1489              
1490             String. The ipv4 network address. Optional.
1491              
1492             =item autostart
1493              
1494             Boolean. Automatically start interface on boot. Optional.
1495              
1496             =item bond_mode
1497              
1498             Enum. Either of balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb or balance-alb. Specifies the bonding mode. Optional.
1499              
1500             =item delete
1501              
1502             String. Settings you want to delete in pve-configid-list format. Optional.
1503              
1504             =item bridge_ports
1505              
1506             String. Specify the interfaces you want to add to your bridge in pve-iface-list format. Optional.
1507              
1508             =item gateway
1509              
1510             String. Default ipv4 gateway address. Optional.
1511              
1512             =item netmask
1513              
1514             String. Network mask for ipv4. Optional.
1515              
1516             =item slaves
1517              
1518             String. Specify the interfaces used by the bonding device in pve-iface-list format. Optional.
1519              
1520             =back
1521              
1522             Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
1523              
1524             =head2 delete_nodes_network_iface
1525              
1526             Delete network device configuration
1527              
1528             $ok = $obj->delete_nodes_network_iface( $node, $iface )
1529              
1530             Where I<$node> is a string in pve-node format
1531              
1532             Where I<$iface> is a string in pve-iface format
1533              
1534             Note: required permissions are ["perm","/nodes/{node}",["Sys.Modify"]]
1535              
1536             =head2 nodes_openvz
1537              
1538             OpenVZ container index (per node).
1539              
1540             $ok = $obj->nodes_openvz( $node )
1541              
1542             Where I<$node> is a string in pve-node format
1543              
1544             Note: Only lists VMs where you have VM.Audit permissons on /vms/<vmid>.
1545              
1546             =head2 create_node_openvz
1547              
1548             Create or restore a container.
1549              
1550             $ok = $obj->create_node_openvz( $node, \%args )
1551              
1552             Where I<$node> is a string in pve-node format
1553              
1554             I<%args> may items contain from the following list
1555              
1556             =over 4
1557              
1558             =item ostemplate
1559              
1560             String. The OS template or backup file. Required.
1561              
1562             =item vmid
1563              
1564             Integer. The unique ID of the vm in pve-vmid format. Required.
1565              
1566             =item cpus
1567              
1568             Integer. The number of CPUs for this container. Optional.
1569              
1570             =item cpuunits
1571              
1572             Integer. CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to weights of all the other running VMs.\n\nNOTE: You can disable fair-scheduler configuration by setting this to 0. Optional.
1573              
1574             =item description
1575              
1576             String. Container description. Only used in the web interface. Optional.
1577              
1578             =item disk
1579              
1580             Number. Amount of disk space for the VM in GB. A zero indicates no limit. Optional.
1581              
1582             =item force
1583              
1584             Boolean. Allow to overwrite existing container. Optional.
1585              
1586             =item hostname
1587              
1588             String. Set a host name for the container. Optional.
1589              
1590             =item ip_address
1591              
1592             String. Specifies the address the container will be assigned. Optional.
1593              
1594             =item memory
1595              
1596             Integer. Amount of RAM for the VM in MB. Optional.
1597              
1598             =item nameserver
1599              
1600             String. Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain or nameserver. Optional.
1601              
1602             =item netif
1603              
1604             String. Specifies network interfaces for the container in pve-openvz-netif format. Optional.
1605              
1606             =item onboot
1607              
1608             Boolean. Specifies weather a VM will be started during the system bootup. Optional.
1609              
1610             =item password
1611              
1612             String. Sets root password insider the container. Optional.
1613              
1614             =item pool
1615              
1616             String. Add the VM to a specified pool in pve-poolid format. Optional.
1617              
1618             =item quotatime
1619              
1620             Integer. Set quota grace period (seconds). Optional.
1621              
1622             =item quotaugidlimit
1623              
1624             Integer. Set maximum number of user/group IDs in a container for which disk quota inside the container will be accounted. If this value is set to 0, user and group quotas inside the container will not. Optional.
1625              
1626             =item restore
1627              
1628             Boolean. Mark this as a restore task. Optional.
1629              
1630             =item searchdomain
1631              
1632             String. Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain or nameserver. Optional.
1633              
1634             =item storage
1635              
1636             String. Target storage in pve-storage-id. Optional.
1637              
1638             =item swap
1639              
1640             Integer. Amount of SWAP for the VM in MB. Optional
1641              
1642             =back
1643              
1644             Note: You need 'VM.Allocate' permissions on /vms/{vmid} or on the VM pool /pool/{pool}, and 'Datastore.AllocateSpace' on the storage.
1645              
1646             required permissions are ["or",["perm","/vms/{vmid}",["VM.Allocate"]],["perm","/pool/{pool}",["VM.Allocate"],"require_param","pool"]]
1647              
1648             =head2 get_node_openvz
1649              
1650             Gets an openvz nodes details
1651              
1652             $ok = $obj->get_node_openvz( $node, $vmid )
1653              
1654             Where I<$node> is a string in pve-node format
1655              
1656             Where I<$vmid> is an integer in pve-vmid format
1657              
1658             Note: Accessible by all authententicated users.
1659              
1660             =head2 delete_nodes_openvz
1661              
1662             Destroy the container (also delete all uses files).
1663              
1664             $ok = $obj->delete_nodes_openvz( $node, $vmid )
1665              
1666             Where I<$node> is a string in pve-node format
1667              
1668             Where I<$vmid> is an integer in pve-vmid format
1669              
1670             Note: required permissions are ["perm","/vms/{vmid}",["VM.Allocate"]]
1671              
1672             =head2 get_node_openvz_status
1673              
1674             Directory index
1675              
1676             $ok = $obj->get_node_openvz_status( $node, $vmid )
1677              
1678             Where I<$node> is a string in pve-node format
1679              
1680             Where I<$vmid> is an integer in pve-vmid format
1681              
1682             Note: Accessible by all authententicated users.
1683              
1684             =head2 get_node_openvz_status_current
1685              
1686             Get virtual machine status.
1687              
1688             $ok = $obj->get_node_openvz_status_current( $node, $vmid )
1689              
1690             Where I<$node> is a string in pve-node format
1691              
1692             Where I<$vmid> is an integer in pve-vmid format
1693              
1694             Note: required permissions are ["perm","/vms/{vmid}",["VM.Audit"]]
1695              
1696             =head2 create_node_openvz_status_mount
1697              
1698             Mounts container private area.
1699              
1700             $ok = $obj->create_node_openvz_status_mount( $node, $vmid )
1701              
1702             Where I<$node> is a string in pve-node format
1703              
1704             Where I<$vmid> is an integer in pve-vmid format
1705              
1706             Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
1707              
1708             =head2 create_node_openvz_status_shutdown
1709              
1710             Shutdown the container.
1711              
1712             $ok = $obj->create_node_openvz_status_shutdown( $node, $vmid, \%args )
1713              
1714             Where I<$node> is a string in pve-node format
1715              
1716             Where I<$vmid> is an integer in pve-vmid format
1717              
1718             I<%args> may items contain from the following list
1719              
1720             =over 4
1721              
1722             =item forceStop
1723              
1724             Boolean. Make sure the container stops. Note the capital S. Optional.
1725              
1726             =item timeout
1727              
1728             Integer. Wait maximal timeout seconds
1729              
1730             =back
1731              
1732             Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
1733              
1734             =head2 create_node_openvz_status_start
1735              
1736             Start the container.
1737              
1738             $ok = $obj->create_node_openvz_status_start( $node, $vmid )
1739              
1740             Where I<$node> is a string in pve-node format
1741              
1742             Where I<$vmid> is an integer in pve-vmid format
1743              
1744             Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
1745              
1746             =head2 create_node_openvz_status_stop
1747              
1748             Stop the container.
1749              
1750             $ok = $obj->create_node_openvz_status_stop( $node, $vmid )
1751              
1752             Where I<$node> is a string in pve-node format
1753              
1754             Where I<$vmid> is an integer in pve-vmid format
1755              
1756             Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
1757              
1758             =head2 get_node_openvz_status_ubc
1759              
1760             Get container user_beancounters.
1761              
1762             $ok = $obj->get_node_openvz_status_ubc( $node, $vmid )
1763              
1764             Where I<$node> is a string in pve-node format
1765              
1766             Where I<$vmid> is an integer in pve-vmid format
1767              
1768             Note: required permissions are ["perm","/vms/{vmid}",["VM.Audit"]]
1769              
1770             =head2 get_node_openvz_status_umount
1771              
1772             Unmounts container private area.
1773              
1774             $ok = $obj->get_node_openvz_status_umount( $node, $vmid )
1775              
1776             Where I<$node> is a string in pve-node format
1777              
1778             Where I<$vmid> is an integer in pve-vmid format
1779              
1780             Note: required permissions are ["perm","/vms/{vmid}",["VM.PowerMgmt"]]
1781              
1782             =head1 SEE ALSO
1783              
1784             L<Net::Proxmox::VE>
1785              
1786             =head1 AUTHOR
1787              
1788             Dean Hamstead <dean@fragfest.com.au>
1789              
1790             =head1 COPYRIGHT AND LICENSE
1791              
1792             This software is Copyright (c) 2026 by Dean Hamstead.
1793              
1794             This is free software, licensed under:
1795              
1796             The MIT (X11) License
1797              
1798             =cut