sul
use namespace::autoclean;
use HTTP::Tiny 0.014;
use URI::Escape qw(uri_escape);
use JSON::MaybeXS qw(JSON);
use Hash::MultiValue;
use Try::Tiny;
use Carp qw(croak);
use Moo;
use Type::Utils qw(
$trailing;
$url .= '?'.$self->_http->www_form_urlencode(\%args) if %args;
$url;
}
my $json = JSON->new->utf8->allow_nonref;
sub _prep_request {
my $callback = pop @_;
my ($self, $pat
gs,
);
}
sub _prep_response {
my ($self, $resp, %args) = @_;
my $data;
$data = $json->decode($resp->content) if length $resp->content > 0;
my $meta = try { Consul::Meta->new(%{$
d $acl;
$$self->_api_exec($$self->_acl_endpoint."/create", 'PUT', %args, _content => $acl->to_json(), sub{
Consul::API::ACL::Success->new($_[0])
});
}
sub update {
my ($self, $acl
d $acl;
$$self->_api_exec($$self->_acl_endpoint."/update", 'PUT', %args, _content => $acl->to_json());
}
sub destroy {
my ($self, $id, %args) = @_;
croak 'usage: $acl->destroy($id, [%args
'0.027';
use namespace::autoclean;
use Moo;
use Types::Standard qw(Str);
use Carp qw(croak);
use JSON::MaybeXS;
has name => ( is => 'ro', isa => Str );
has id => ( is
=> ( is => 'ro', isa => Str );
sub to_json { shift->_json }
has _json => ( is => 'lazy', isa => Str );
sub _build__json {
my ($self) = @_;
encode_json({
defined $self->name ? (
amespace::autoclean;
use Moo;
use Types::Standard qw(Str ArrayRef Enum);
use Carp qw(croak);
use JSON::MaybeXS;
has name => ( is => 'ro', isa => Str );
has behavior => ( is => 'ro', isa => E
=> ( is => 'ro', isa => Str );
sub to_json { shift->_json }
has _json => ( is => 'lazy', isa => Str );
sub _build__json {
my ($self) = @_;
encode_json({
defined $self->lock_delay ? (
pace::autoclean;
use Moo;
use Types::Standard qw(Str Int Bool ArrayRef);
use Carp qw(croak);
use JSON::MaybeXS;
has name => ( is => 'ro', isa => Str, required => 1 );
has id
&& !$C) || (!$A && !$B && $C)
}
sub to_json { shift->_json }
has _json => ( is => 'lazy', isa => Str );
sub _build__json {
my ($self) = @_;
encode_json({
Name => $self->name,
api_exec($$self->_session_endpoint."/create", 'PUT', %args, ($session ? (_content => $session->to_json) : ()), sub {
$_[0]->{ID}
});
}
sub destroy {
my ($self, $id, %args) = @_;
c
$$self->_api_exec($$self->_agent_endpoint."/check/register", 'PUT', %args, _content => $check->to_json);
return;
}
sub check_deregister {
my ($self, $check_id, %args) = @_;
croak 'usage:
lf->_api_exec($$self->_agent_endpoint."/service/register", 'PUT', %args, _content => $service->to_json);
return;
}
sub service_deregister {
my ($self, $service_id, %args) = @_;
croak 'usa
, or docker_container_id are set';
}
sub _to_json_hash { %{shift->_json_hash} }
has _json_hash => ( is => 'lazy', isa => HashRef[Str] );
sub _build__json_hash {
my ($self) = @_;
{
Nam
qw(Str);
use JSON::MaybeXS;
has script => ( is => 'ro', isa => Str, required => 1 );
has interval => ( is => 'ro', isa => Str, required => 1 );
sub to_json { shift->_json }
has _json => ( is => '
lazy', isa => Str );
sub _build__json {
my ($self) = @_;
encode_json({
$self->_to_json_hash,
Script => $self->script,
Interval => $self->interval,
});
}
with qw(