line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
4
|
|
|
4
|
|
15
|
use utf8; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
30
|
|
2
|
|
|
|
|
|
|
package Etcd3::Lease::Revoke; |
3
|
|
|
|
|
|
|
|
4
|
4
|
|
|
4
|
|
136
|
use strict; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
71
|
|
5
|
4
|
|
|
4
|
|
13
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
81
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
14
|
use Moo; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
14
|
|
8
|
4
|
|
|
4
|
|
820
|
use Types::Standard qw(Str Int Bool HashRef ArrayRef); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
18
|
|
9
|
4
|
|
|
4
|
|
2392
|
use MIME::Base64; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
177
|
|
10
|
4
|
|
|
4
|
|
15
|
use JSON; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
18
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Etcd3::Role::Actions'; |
13
|
|
|
|
|
|
|
|
14
|
4
|
|
|
4
|
|
394
|
use namespace::clean; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
25
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 NAME |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Etcd3::Lease::Revoke |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = '0.005'; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 endpoint |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
/kv/lease/revoke |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has endpoint => ( |
35
|
|
|
|
|
|
|
is => 'ro', |
36
|
|
|
|
|
|
|
isa => Str, |
37
|
|
|
|
|
|
|
default => '/kv/lease/revoke' |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 ID |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
has ID => ( |
47
|
|
|
|
|
|
|
is => 'ro', |
48
|
|
|
|
|
|
|
isa => Int, |
49
|
|
|
|
|
|
|
required => 1, |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 json_args |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
arguments that will be sent to the api |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
has json_args => ( is => 'lazy', ); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub _build_json_args { |
61
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
62
|
0
|
|
|
|
|
|
my $args; |
63
|
0
|
|
|
|
|
|
for my $key ( keys %{$self} ) { |
|
0
|
|
|
|
|
|
|
64
|
0
|
0
|
|
|
|
|
unless ( $key =~ /(?:_client|json_args|endpoint)$/ ) { |
65
|
0
|
|
|
|
|
|
$args->{$key} = $self->{$key}; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
} |
68
|
0
|
|
|
|
|
|
return to_json($args); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 init |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub init { |
76
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
77
|
0
|
|
|
|
|
|
$self->json_args; |
78
|
0
|
|
|
|
|
|
return $self; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |