line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VM::HetznerCloud::API::Volumes; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Volumes |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# --- |
6
|
|
|
|
|
|
|
# This class is auto-generated by bin/get_hetzner_info.pl |
7
|
|
|
|
|
|
|
# --- |
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
1840
|
use v5.24; |
|
3
|
|
|
|
|
18
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
20
|
use Moo; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
19
|
|
12
|
3
|
|
|
3
|
|
935
|
use Types::Standard qw(:all); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
20
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
70977
|
use Mojo::Base -strict, -signatures; |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
29
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
extends 'VM::HetznerCloud::APIBase'; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
|
728
|
use utf8; |
|
3
|
|
|
|
|
16
|
|
|
3
|
|
|
|
|
14
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.0.3'; # VERSION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has endpoint => ( is => 'ro', isa => Str, default => sub { 'volumes' } ); |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
0
|
1
|
|
sub list ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $request_params = { |
26
|
|
|
|
|
|
|
'label_selector' => { |
27
|
|
|
|
|
|
|
'in' => 'query', |
28
|
|
|
|
|
|
|
'required' => 0, |
29
|
|
|
|
|
|
|
'validate' => 'string', |
30
|
|
|
|
|
|
|
}, |
31
|
|
|
|
|
|
|
'name' => { |
32
|
|
|
|
|
|
|
'in' => 'query', |
33
|
|
|
|
|
|
|
'required' => 0, |
34
|
|
|
|
|
|
|
'validate' => 'string', |
35
|
|
|
|
|
|
|
}, |
36
|
|
|
|
|
|
|
'sort' => { |
37
|
|
|
|
|
|
|
'in' => 'query', |
38
|
|
|
|
|
|
|
'required' => 0, |
39
|
|
|
|
|
|
|
'validate' => 'string', |
40
|
|
|
|
|
|
|
}, |
41
|
|
|
|
|
|
|
'status' => { |
42
|
|
|
|
|
|
|
'in' => 'query', |
43
|
|
|
|
|
|
|
'required' => 0, |
44
|
|
|
|
|
|
|
'validate' => 'string', |
45
|
|
|
|
|
|
|
}, |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
return $self->_request( '', \%params, $request_params, { type => 'get', oid => '/volumes#get' } ); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
sub create ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my $request_params = {}; |
53
|
0
|
|
|
|
|
|
return $self->_request( '', \%params, $request_params, { type => 'post', oid => '/volumes#post' } ); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
0
|
1
|
|
sub delete ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my $request_params = { |
58
|
|
|
|
|
|
|
'id' => { |
59
|
|
|
|
|
|
|
'in' => 'path', |
60
|
|
|
|
|
|
|
'required' => 1, |
61
|
|
|
|
|
|
|
'validate' => 'int64', |
62
|
|
|
|
|
|
|
}, |
63
|
|
|
|
|
|
|
}; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'delete', oid => '/volumes/{id}#delete' } ); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
0
|
1
|
|
sub get ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
69
|
0
|
|
|
|
|
|
my $request_params = { |
70
|
|
|
|
|
|
|
'id' => { |
71
|
|
|
|
|
|
|
'in' => 'path', |
72
|
|
|
|
|
|
|
'required' => 1, |
73
|
|
|
|
|
|
|
'validate' => 'int64', |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
}; |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'get', oid => '/volumes/{id}#get' } ); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
0
|
1
|
|
sub put ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
my $request_params = { |
82
|
|
|
|
|
|
|
'id' => { |
83
|
|
|
|
|
|
|
'in' => 'path', |
84
|
|
|
|
|
|
|
'required' => 1, |
85
|
|
|
|
|
|
|
'validate' => 'int64', |
86
|
|
|
|
|
|
|
}, |
87
|
|
|
|
|
|
|
}; |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
return $self->_request( '/:id', \%params, $request_params, { type => 'put', oid => '/volumes/{id}#put' } ); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
0
|
1
|
|
sub list_actions ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
my $request_params = { |
94
|
|
|
|
|
|
|
'id' => { |
95
|
|
|
|
|
|
|
'in' => 'path', |
96
|
|
|
|
|
|
|
'required' => 1, |
97
|
|
|
|
|
|
|
'validate' => 'int64', |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
'sort' => { |
100
|
|
|
|
|
|
|
'in' => 'query', |
101
|
|
|
|
|
|
|
'required' => 0, |
102
|
|
|
|
|
|
|
'validate' => 'string', |
103
|
|
|
|
|
|
|
}, |
104
|
|
|
|
|
|
|
'status' => { |
105
|
|
|
|
|
|
|
'in' => 'query', |
106
|
|
|
|
|
|
|
'required' => 0, |
107
|
|
|
|
|
|
|
'validate' => 'string', |
108
|
|
|
|
|
|
|
}, |
109
|
|
|
|
|
|
|
}; |
110
|
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions', \%params, $request_params, { type => 'get', oid => '/volumes/{id}/actions#get' } ); |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
0
|
1
|
|
sub attach ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
my $request_params = { |
116
|
|
|
|
|
|
|
'id' => { |
117
|
|
|
|
|
|
|
'in' => 'path', |
118
|
|
|
|
|
|
|
'required' => 1, |
119
|
|
|
|
|
|
|
'validate' => 'int64', |
120
|
|
|
|
|
|
|
}, |
121
|
|
|
|
|
|
|
}; |
122
|
|
|
|
|
|
|
|
123
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/attach', \%params, $request_params, { type => 'post', oid => '/volumes/{id}/actions/attach#post' } ); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
0
|
1
|
|
sub change_protection ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
|
my $request_params = { |
128
|
|
|
|
|
|
|
'id' => { |
129
|
|
|
|
|
|
|
'in' => 'path', |
130
|
|
|
|
|
|
|
'required' => 1, |
131
|
|
|
|
|
|
|
'validate' => 'int64', |
132
|
|
|
|
|
|
|
}, |
133
|
|
|
|
|
|
|
}; |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/change_protection', \%params, $request_params, { type => 'post', oid => '/volumes/{id}/actions/change_protection#post' } ); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
0
|
|
|
0
|
1
|
|
sub detach ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
139
|
0
|
|
|
|
|
|
my $request_params = { |
140
|
|
|
|
|
|
|
'id' => { |
141
|
|
|
|
|
|
|
'in' => 'path', |
142
|
|
|
|
|
|
|
'required' => 1, |
143
|
|
|
|
|
|
|
'validate' => 'int64', |
144
|
|
|
|
|
|
|
}, |
145
|
|
|
|
|
|
|
}; |
146
|
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/detach', \%params, $request_params, { type => 'post', oid => '/volumes/{id}/actions/detach#post' } ); |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
0
|
|
|
0
|
1
|
|
sub resize ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
151
|
0
|
|
|
|
|
|
my $request_params = { |
152
|
|
|
|
|
|
|
'id' => { |
153
|
|
|
|
|
|
|
'in' => 'path', |
154
|
|
|
|
|
|
|
'required' => 1, |
155
|
|
|
|
|
|
|
'validate' => 'int64', |
156
|
|
|
|
|
|
|
}, |
157
|
|
|
|
|
|
|
}; |
158
|
|
|
|
|
|
|
|
159
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/resize', \%params, $request_params, { type => 'post', oid => '/volumes/{id}/actions/resize#post' } ); |
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
0
|
|
|
0
|
1
|
|
sub get_actions ($self, %params) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
163
|
0
|
|
|
|
|
|
my $request_params = { |
164
|
|
|
|
|
|
|
'action_id' => { |
165
|
|
|
|
|
|
|
'in' => 'path', |
166
|
|
|
|
|
|
|
'required' => 1, |
167
|
|
|
|
|
|
|
'validate' => 'int64', |
168
|
|
|
|
|
|
|
}, |
169
|
|
|
|
|
|
|
'id' => { |
170
|
|
|
|
|
|
|
'in' => 'path', |
171
|
|
|
|
|
|
|
'required' => 1, |
172
|
|
|
|
|
|
|
'validate' => 'int64', |
173
|
|
|
|
|
|
|
}, |
174
|
|
|
|
|
|
|
}; |
175
|
|
|
|
|
|
|
|
176
|
0
|
|
|
|
|
|
return $self->_request( '/:id/actions/:action_id', \%params, $request_params, { type => 'get', oid => '/volumes/{id}/actions/{action_id}#get' } ); |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
1; |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
__END__ |