File Coverage

blib/lib/Sys/Async/Virt/DomainSnapshot.pm
Criterion Covered Total %
statement 26 90 28.8
branch n/a
condition 0 4 0.0
subroutine 9 22 40.9
pod 11 13 84.6
total 46 129 35.6


line stmt bran cond sub pod time code
1             ####################################################################
2             #
3             # This file was generated using XDR::Parse version v1.0.1
4             # and LibVirt version v12.1.0
5             #
6             # Don't edit this file, use the source template instead
7             #
8             # ANY CHANGES HERE WILL BE LOST !
9             #
10             ####################################################################
11              
12              
13 1     1   43 use v5.26;
  1         4  
14 1     1   4 use warnings;
  1         1  
  1         42  
15 1     1   3 use experimental 'signatures';
  1         2  
  1         5  
16 1     1   101 use Future::AsyncAwait;
  1         1  
  1         4  
17 1     1   35 use Object::Pad;
  1         2  
  1         4  
18              
19             class Sys::Async::Virt::DomainSnapshot v0.6.1;
20              
21 1     1   225 use Carp qw(croak);
  1         1  
  1         46  
22 1     1   4 use Log::Any qw($log);
  1         2  
  1         6  
23              
24 1     1   189 use Protocol::Sys::Virt::Remote::XDR v12.1.0;
  1         10  
  1         144  
25             my $remote = 'Protocol::Sys::Virt::Remote::XDR';
26              
27             use constant {
28 1         1961 XML_SECURE => (1 << 0),
29             LIST_ROOTS => (1 << 0),
30             LIST_DESCENDANTS => (1 << 0),
31             LIST_LEAVES => (1 << 2),
32             LIST_NO_LEAVES => (1 << 3),
33             LIST_METADATA => (1 << 1),
34             LIST_NO_METADATA => (1 << 4),
35             LIST_INACTIVE => (1 << 5),
36             LIST_ACTIVE => (1 << 6),
37             LIST_DISK_ONLY => (1 << 7),
38             LIST_INTERNAL => (1 << 8),
39             LIST_EXTERNAL => (1 << 9),
40             LIST_TOPOLOGICAL => (1 << 10),
41             REVERT_RUNNING => 1 << 0,
42             REVERT_PAUSED => 1 << 1,
43             REVERT_FORCE => 1 << 2,
44             REVERT_RESET_NVRAM => 1 << 3,
45             DELETE_CHILDREN => (1 << 0),
46             DELETE_METADATA_ONLY => (1 << 1),
47             DELETE_CHILDREN_ONLY => (1 << 2),
48 1     1   5 };
  1         2  
49              
50              
51 0     0 0   field $_rpc_id :param :reader;
  0            
52 0     0 0   field $_client :param :reader;
  0            
53              
54 0     0 1   method domain() {
  0            
  0            
55 0           return $_client->_domain_instance( $_rpc_id->{dom} );
56             }
57              
58 0     0 1   method name() {
  0            
  0            
59 0           return $_rpc_id->{name};
60             }
61              
62              
63 0     0 1   method delete($flags = 0) {
  0            
  0            
  0            
64 0   0       return $_client->_call(
65             $remote->PROC_DOMAIN_SNAPSHOT_DELETE,
66             { snap => $_rpc_id, flags => $flags // 0 }, empty => 1 );
67             }
68              
69 0     0 1   async method get_parent($flags = 0) {
  0            
  0            
  0            
  0            
70 0           return await $_client->_call(
71             $remote->PROC_DOMAIN_SNAPSHOT_GET_PARENT,
72             { snap => $_rpc_id, flags => $flags // 0 }, unwrap => 'snap' );
73             }
74              
75 0     0 1   async method get_xml_desc($flags = 0) {
  0            
  0            
  0            
  0            
76 0           return await $_client->_call(
77             $remote->PROC_DOMAIN_SNAPSHOT_GET_XML_DESC,
78             { snap => $_rpc_id, flags => $flags // 0 }, unwrap => 'xml' );
79             }
80              
81 0     0 1   async method has_metadata($flags = 0) {
  0            
  0            
  0            
  0            
82 0           return await $_client->_call(
83             $remote->PROC_DOMAIN_SNAPSHOT_HAS_METADATA,
84             { snap => $_rpc_id, flags => $flags // 0 }, unwrap => 'metadata' );
85             }
86              
87 0     0 1   async method is_current($flags = 0) {
  0            
  0            
  0            
  0            
88 0           return await $_client->_call(
89             $remote->PROC_DOMAIN_SNAPSHOT_IS_CURRENT,
90             { snap => $_rpc_id, flags => $flags // 0 }, unwrap => 'current' );
91             }
92              
93 0     0 1   async method list_all_children($flags = 0) {
  0            
  0            
  0            
  0            
94 0           return await $_client->_call(
95             $remote->PROC_DOMAIN_SNAPSHOT_LIST_ALL_CHILDREN,
96             { snapshot => $_rpc_id, need_results => $remote->DOMAIN_SNAPSHOT_LIST_MAX, flags => $flags // 0 }, unwrap => 'snapshots' );
97             }
98              
99 0     0 1   async method list_children_names($flags = 0) {
  0            
  0            
  0            
  0            
100 0           return await $_client->_call(
101             $remote->PROC_DOMAIN_SNAPSHOT_LIST_CHILDREN_NAMES,
102             { snap => $_rpc_id, maxnames => $remote->DOMAIN_SNAPSHOT_LIST_MAX, flags => $flags // 0 }, unwrap => 'names' );
103             }
104              
105 0     0 1   async method num_children($flags = 0) {
  0            
  0            
  0            
  0            
106 0           return await $_client->_call(
107             $remote->PROC_DOMAIN_SNAPSHOT_NUM_CHILDREN,
108             { snap => $_rpc_id, flags => $flags // 0 }, unwrap => 'num' );
109             }
110              
111 0     0 1   method revert_to_snapshot($flags = 0) {
  0            
  0            
  0            
112 0   0       return $_client->_call(
113             $remote->PROC_DOMAIN_REVERT_TO_SNAPSHOT,
114             { snap => $_rpc_id, flags => $flags // 0 }, empty => 1 );
115             }
116              
117              
118              
119             1;
120              
121              
122             __END__