Group
Extension

Matches 16

Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd.pm ( view source; MetaCPAN )
ackage Net::Etcd;

# ABSTRACT: Provide access to the etcd v3 API.

use strict;
use warnings;

use JSON;
use MIME::Base64;
use Types::Standard qw(Str Int Bool HashRef);

use Net::Etcd::Auth;
use Net::E
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/Role/Actions.pm ( view source; MetaCPAN )
e utf8;

package Net::Etcd::Role::Actions;

use strict;
use warnings;

use Moo::Role;
use AE;
use JSON;
use MIME::Base64;
use Types::Standard qw(InstanceOf);
use AnyEvent::HTTP;
use Carp;
use Data::Du
  isa => InstanceOf ['Net::Etcd'],
);

=head2 json_args

arguments that will be sent to the api

=cut

has json_args => ( is => 'lazy', );

sub _build_json_args {
    my ($self) = @_;
    my $args;
  
) {
        unless ( $key =~ /(?:etcd|cb|cv|hold|json_args|endpoint)$/ ) {
            $args->{$key} = $self->{$key};
        }
    }
    return to_json($args);
}

=head2 cb

AnyEvent callback must be
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/Lease.pm ( view source; MetaCPAN )


use Moo;
use Types::Standard qw(Str Int Bool HashRef ArrayRef);
use Data::Dumper;
use Carp;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::Lease

=cut

o
s       => 'ro',
    isa      => Bool,
    coerce => sub { no strict 'refs'; return $_[0] ? JSON::true : JSON::false }
);

=head1 PUBLIC METHODS

=head2 grant

LeaseGrant creates a lease which expires
ng leases.

    $etcd->lease()->leases

=cut

sub leases {
    my $self = shift;
    $self->{endpoint} = '/kv/lease/leases';
    $self->{json_args} = '{}';
    $self->request;
    return $self;
}

1;
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/Member.pm ( view source; MetaCPAN )
{
    my ( $self, $options ) = @_;
    my $cb = pop if ref $_[-1] eq 'CODE';
    $self->{endpoint} = '/cluster/member/list';
    $self->{json_args} = '{}';
    $self->request;
    return $self;
}

1;
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/Maintenance.pm ( view source; MetaCPAN )
y $cb = pop if ref $_[-1] eq 'CODE';
    $self->{endpoint} = '/maintenance/snapshot';
    $self->{json_args} = '{}';
    $self->request;
    return $self;
}

=head2 status

Status gets the status of t
 my $cb = pop if ref $_[-1] eq 'CODE';
    $self->{endpoint} = '/maintenance/status';
    $self->{json_args} = '{}';
    $self->request;
    return $self;
}

=head2 defragment

Defragment defragments 
$cb = pop if ref $_[-1] eq 'CODE';
    $self->{endpoint} = '/maintenance/defragment';
    $self->{json_args} = '{}';
    $self->request;
    return $self;
}

=head2 version

Returns the member version
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/KV/Compare.pm ( view source; MetaCPAN )
o;
use Types::Standard qw(Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use Data::Dumper;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::KV::Compare

=
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/Auth.pm ( view source; MetaCPAN )
use utf8;
package Net::Etcd::Auth;

use strict;
use warnings;

=encoding utf8

=cut

use JSON;
use Carp;
use Types::Standard qw(Str);
use Net::Etcd::Auth::Role;

use Moo;
with 'Net::Etcd::Role::Action
nless ($self->password && $self->name);
    $self->request;
    my $auth;
    eval { $auth = from_json($self->{response}{content}) };
    if ($@) {
        $self->{response}{content} = 'error: ' . $@;
sub enable {
    my ( $self, $options ) = @_;
    $self->{endpoint} = '/auth/enable';
    $self->{json_args} = '{}';
    $self->request;

    # init token
    $self->etcd->auth()->authenticate;
    re
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/Watch.pm ( view source; MetaCPAN )
o;
use Types::Standard qw(Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use Data::Dumper;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::Watch

=cut

o
   is     => 'ro',
    isa    => Bool,
    coerce => sub { no strict 'refs'; return $_[0] ? JSON::true : JSON::false }
);

=head2 filters

filter out put event. filter out delete event. filters filter
   is     => 'ro',
    isa    => Bool,
    coerce => sub { no strict 'refs'; return $_[0] ? JSON::true : JSON::false }
);

=head2 watch_id

watch_id is the watcher id to cancel so that no more events 
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/KV/Range.pm ( view source; MetaCPAN )
 warnings;

use Moo;
use Types::Standard qw(Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::Range

=cut

o
   is     => 'ro',
    isa    => Bool,
    coerce => sub { no strict 'refs'; return $_[0] ? JSON::true : JSON::false }
);


=head2 limit

limit is a limit on the number of keys returned for the reques
   is     => 'ro',
    isa    => Bool,
    coerce => sub { no strict 'refs'; return $_[0] ? JSON::true : JSON::false }
);

=head2 keys_only

keys_only when set returns only the keys and not the values
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/Auth/Role.pm ( view source; MetaCPAN )


use Moo;
use Types::Standard qw(Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use Carp;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::Auth::Role

=c
   return $self;
}

=head2 list

List roles

=cut

sub list {
    my ($self) = @_;
    $self->{endpoint} = '/auth/role/list';
    $self->{json_args} = '{}';
    $self->request;
    return $self;
}
1;
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/KV/Put.pm ( view source; MetaCPAN )
 warnings;

use Moo;
use Types::Standard qw(Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::Put

=cut

our
value pair will be returned in the put response.

=cut

has prev_kv => (
    is     => 'ro',
    isa    => Bool,
    coerce => sub { no strict 'refs'; return $_[0] ? JSON::true : JSON::false }
);

1;
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/Auth/RolePermission.pm ( view source; MetaCPAN )


use Moo;
use Types::Standard qw(Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use Carp;
use JSON;
use Data::Dumper;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Et
sub grant {;
    my ($self) = @_;
    $self->{endpoint} = '/auth/role/grant';
    $self->{json_args} = to_json( {name => $self->name, perm => $self->perm } );
    $self->request;
    return $self;
}

Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/KV/Txn.pm ( view source; MetaCPAN )
s::Standard qw(InstanceOf Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use Data::Dumper;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::KV::Txn

=cut
failure;
    $txn .= '"failure":[ ' . join(',', @$failure) . ']' if defined $failure;
    $self->{json_args} = '{'  . $txn . '}';
#   print STDERR Dumper($self);
    $self->request;
    return $self;
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/KV/Op.pm ( view source; MetaCPAN )
s::Standard qw(InstanceOf Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use Data::Dumper;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::KV::Op

=cut


=head2 create

create op

=cut

#TODO this dirty hack should be a perl data object and then make json.

sub create {
    my $self = shift;
    my @op;
    my $put = $self->request_put;
    my $range 
Put":' . $put->json_args . '}' if defined $put;
    push @op, '{"requestRange":' . $range->json_args . '}' if defined $range;
    push @op, '{"requestDeleteRange":' . $delete_range->json_args . '}' if
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/KV/DeleteRange.pm ( view source; MetaCPAN )
 warnings;

use Moo;
use Types::Standard qw(Str Int Bool HashRef ArrayRef);
use MIME::Base64;
use JSON;

with 'Net::Etcd::Role::Actions';

use namespace::clean;

=head1 NAME

Net::Etcd::DeleteRange

=
   is     => 'ro',
    isa    => Bool,
    coerce => sub { no strict 'refs'; return $_[0] ? JSON::true : JSON::false }
);

=head2 range_end

range_end is the upper bound on the requested range [key, r
Net-Etcd ( H/HE/HEXFUSION/Net-Etcd-0.022.tar.gz, HEXFUSION, 2018; MetaCPAN )
Net-Etcd/lib/Net/Etcd/KV.pm ( view source; MetaCPAN )
 $options ) = @_; 
    my $cb = pop if ref $_[-1] eq 'CODE';
    my $cmp = Net::Etcd::KV::Compare->new(
        %$self,
        ( $options ? %$options : () ),
    );
    return $cmp->json_args;
}

1;

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.