ref_get::VERSION = '0.001';
# VERSION
# AUTHORITY
## use critic
use strictures 2;
use JSON qw(to_json from_json);
use MooseX::App::Command;
extends qw(App::nioscli);
command_short_description 'Get
$self->nios_client->get( path => $self->ref );
$response->is_success
? print(
to_json( from_json( $response->{_content} ), { utf8 => 1, pretty => 1 } ) )
: die( $response->{'_content'}
able;
$App::nioscli::Roles::Listable::VERSION = '0.001';
## use critic
use strictures 2;
use JSON qw(to_json);
use MooseX::App::Role;
use Data::Dumper;
option 'max-results' => (
is => 'ro',
isa
@results =
map { $_->is_success ? @{ $_->content->{result} } : [] } @{$response};
print to_json( \@results, { utf8 => 1, pretty => 1 } );
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
App
host_record::VERSION = '0.001';
# VERSION
# AUTHORITY
## use critic
use strictures 2;
use JSON qw(from_json);
use MooseX::App::Command;
extends qw(App::nioscli);
command_short_description 'Create
push( @{ $payload->{ipv4addrs} }, { ipv4addr => $_ } );
}
$payload->{extattrs} = from_json( $self->extattrs ) if defined $self->extattrs;
return $payload;
}
);
has 'exe' => (
is
te_a_record::VERSION = '0.001';
# VERSION
# AUTHORITY
## use critic
use strictures 2;
use JSON qw(from_json);
use MooseX::App::Command;
extends qw(App::nioscli::Commands::create_host_record);
comm
name => $self->name,
ipv4addr => $self->address
};
$payload->{extattrs} = from_json( $self->extattrs ) if defined $self->extattrs;
return $payload;
}
);
has 'exe' => (
is
:ref_update::VERSION = '0.001';
# VERSION
# AUTHORITY
## use critic
use strictures 2;
use JSON qw(from_json);
use MooseX::App::Command;
extends qw(App::nioscli);
command_short_description 'Update
ence';
parameter 'ref' => (
is => 'ro',
isa => 'Str',
required => 1
);
option 'json' => (
is => 'ro',
isa => 'Str',
required => 1
);
sub run {
my $self = shi
esponse = $self->nios_client->update(
path => $self->ref,
payload => from_json( $self->json )
);
$response->is_success
? print( $response->{'_content'} )
: die( $response->{'_c
:ref_delete::VERSION = '0.001';
# VERSION
# AUTHORITY
## use critic
use strictures 2;
use JSON qw(from_json);
use MooseX::App::Command;
extends qw(App::nioscli);
command_short_description 'Delete
name_record::VERSION = '0.001';
# VERSION
# AUTHORITY
## use critic
use strictures 2;
use JSON qw(from_json);
use MooseX::App::Command;
extends qw(App::nioscli);
command_short_description 'Create
=> $self->name,
canonical => $self->canonical
};
$payload->{extattrs} = from_json( $self->extattrs ) if defined $self->extattrs;
return $payload;
}
);
has 'path' => (
de