File Coverage

blib/lib/Sys/Async/Virt/StoragePool.pm
Criterion Covered Total %
statement 26 137 18.9
branch n/a
condition 0 8 0.0
subroutine 9 32 28.1
pod 21 23 91.3
total 56 200 28.0


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   11 use v5.26;
  1         4  
14 1     1   4 use warnings;
  1         2  
  1         43  
15 1     1   4 use experimental 'signatures';
  1         2  
  1         5  
16 1     1   103 use Future::AsyncAwait;
  1         2  
  1         4  
17 1     1   36 use Object::Pad;
  1         2  
  1         6  
18              
19             class Sys::Async::Virt::StoragePool v0.6.1;
20              
21 1     1   206 use Carp qw(croak);
  1         2  
  1         46  
22 1     1   4 use Log::Any qw($log);
  1         2  
  1         8  
23              
24 1     1   286 use Protocol::Sys::Virt::Remote::XDR v12.1.0;
  1         33  
  1         228  
25             my $remote = 'Protocol::Sys::Virt::Remote::XDR';
26              
27             use constant {
28 1         5434 INACTIVE => 0,
29             BUILDING => 1,
30             RUNNING => 2,
31             DEGRADED => 3,
32             INACCESSIBLE => 4,
33             BUILD_NEW => 0,
34             BUILD_REPAIR => (1 << 0),
35             BUILD_RESIZE => (1 << 1),
36             BUILD_NO_OVERWRITE => (1 << 2),
37             BUILD_OVERWRITE => (1 << 3),
38             DELETE_NORMAL => 0,
39             DELETE_ZEROED => 1 << 0,
40             XML_INACTIVE => (1 << 0),
41             EVENT_DEFINED => 0,
42             EVENT_UNDEFINED => 1,
43             EVENT_STARTED => 2,
44             EVENT_STOPPED => 3,
45             EVENT_CREATED => 4,
46             EVENT_DELETED => 5,
47 1     1   10 };
  1         2  
48              
49              
50 0     0 0   field $_rpc_id :param :reader;
  0            
51 0     0 0   field $_client :param :reader;
  0            
52              
53 0     0 1   method name() {
  0            
  0            
54 0           return $_rpc_id->{name};
55             }
56              
57 0     0 1   method uuid() {
  0            
  0            
58 0           return $_rpc_id->{uuid};
59             }
60              
61 0     0 1   method uuid_string() {
  0            
  0            
62 0           return join( '-', unpack('H8H4H4H4H12', $_rpc_id->{uuid}) );
63             }
64              
65              
66 0     0 1   method build($flags = 0) {
  0            
  0            
  0            
67 0   0       return $_client->_call(
68             $remote->PROC_STORAGE_POOL_BUILD,
69             { pool => $_rpc_id, flags => $flags // 0 }, empty => 1 );
70             }
71              
72 0     0 1   method create($flags = 0) {
  0            
  0            
  0            
73 0   0       return $_client->_call(
74             $remote->PROC_STORAGE_POOL_CREATE,
75             { pool => $_rpc_id, flags => $flags // 0 }, empty => 1 );
76             }
77              
78 0     0 1   method delete($flags = 0) {
  0            
  0            
  0            
79 0   0       return $_client->_call(
80             $remote->PROC_STORAGE_POOL_DELETE,
81             { pool => $_rpc_id, flags => $flags // 0 }, empty => 1 );
82             }
83              
84 0     0 1   method destroy() {
  0            
  0            
85 0           return $_client->_call(
86             $remote->PROC_STORAGE_POOL_DESTROY,
87             { pool => $_rpc_id }, empty => 1 );
88             }
89              
90 0     0 1   async method get_autostart() {
  0            
  0            
  0            
91 0           return await $_client->_call(
92             $remote->PROC_STORAGE_POOL_GET_AUTOSTART,
93             { pool => $_rpc_id }, unwrap => 'autostart' );
94             }
95              
96 0     0 1   method get_info() {
  0            
  0            
97 0           return $_client->_call(
98             $remote->PROC_STORAGE_POOL_GET_INFO,
99             { pool => $_rpc_id } );
100             }
101              
102 0     0 1   async method get_xml_desc($flags = 0) {
  0            
  0            
  0            
  0            
103 0           return await $_client->_call(
104             $remote->PROC_STORAGE_POOL_GET_XML_DESC,
105             { pool => $_rpc_id, flags => $flags // 0 }, unwrap => 'xml' );
106             }
107              
108 0     0 1   async method is_active() {
  0            
  0            
  0            
109 0           return await $_client->_call(
110             $remote->PROC_STORAGE_POOL_IS_ACTIVE,
111             { pool => $_rpc_id }, unwrap => 'active' );
112             }
113              
114 0     0 1   async method is_persistent() {
  0            
  0            
  0            
115 0           return await $_client->_call(
116             $remote->PROC_STORAGE_POOL_IS_PERSISTENT,
117             { pool => $_rpc_id }, unwrap => 'persistent' );
118             }
119              
120 0     0 1   async method list_all_volumes($flags = 0) {
  0            
  0            
  0            
  0            
121 0           return await $_client->_call(
122             $remote->PROC_STORAGE_POOL_LIST_ALL_VOLUMES,
123             { pool => $_rpc_id, need_results => $remote->STORAGE_VOL_LIST_MAX, flags => $flags // 0 }, unwrap => 'vols' );
124             }
125              
126 0     0 1   async method list_volumes() {
  0            
  0            
  0            
127 0           return await $_client->_call(
128             $remote->PROC_STORAGE_POOL_LIST_VOLUMES,
129             { pool => $_rpc_id, maxnames => $remote->STORAGE_VOL_LIST_MAX }, unwrap => 'names' );
130             }
131              
132 0     0 1   async method num_of_volumes() {
  0            
  0            
  0            
133 0           return await $_client->_call(
134             $remote->PROC_STORAGE_POOL_NUM_OF_VOLUMES,
135             { pool => $_rpc_id }, unwrap => 'num' );
136             }
137              
138 0     0 1   method refresh($flags = 0) {
  0            
  0            
  0            
139 0   0       return $_client->_call(
140             $remote->PROC_STORAGE_POOL_REFRESH,
141             { pool => $_rpc_id, flags => $flags // 0 }, empty => 1 );
142             }
143              
144 0     0 1   method set_autostart($autostart) {
  0            
  0            
  0            
145 0           return $_client->_call(
146             $remote->PROC_STORAGE_POOL_SET_AUTOSTART,
147             { pool => $_rpc_id, autostart => $autostart }, empty => 1 );
148             }
149              
150 0     0 1   method undefine() {
  0            
  0            
151 0           return $_client->_call(
152             $remote->PROC_STORAGE_POOL_UNDEFINE,
153             { pool => $_rpc_id }, empty => 1 );
154             }
155              
156 0     0 1   async method vol_create_xml($xml, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
157 0           return await $_client->_call(
158             $remote->PROC_STORAGE_VOL_CREATE_XML,
159             { pool => $_rpc_id, xml => $xml, flags => $flags // 0 }, unwrap => 'vol' );
160             }
161              
162 0     0 1   async method vol_create_xml_from($xml, $clonevol, $flags = 0) {
  0            
  0            
  0            
  0            
  0            
  0            
163 0           return await $_client->_call(
164             $remote->PROC_STORAGE_VOL_CREATE_XML_FROM,
165             { pool => $_rpc_id, xml => $xml, clonevol => $clonevol, flags => $flags // 0 }, unwrap => 'vol' );
166             }
167              
168 0     0 1   async method vol_lookup_by_name($name) {
  0            
  0            
  0            
  0            
169 0           return await $_client->_call(
170             $remote->PROC_STORAGE_VOL_LOOKUP_BY_NAME,
171             { pool => $_rpc_id, name => $name }, unwrap => 'vol' );
172             }
173              
174              
175              
176             1;
177              
178              
179             __END__