shift;
$self = __PACKAGE__->new unless blessed($self);
my $data = $self->get('system/df')->json;
my %disk_usage;
for my $type (qw(Volumes Containers Images)) {
my @data = @{$data->{$t
f);
return $self->get('info')->json;
}
sub version {
my $self = shift;
$self = __PACKAGE__->new unless blessed($self);
my $data = $self->get('info')->json;
my $version = $data->{version
shift;
$self = __PACKAGE__->new unless blessed($self);
return $self->post('system/prune')->json;
}
1;
__END__
=encoding utf8
=head1 NAME
Podman::System - Service information.
=head1 SYNOP
ntialsV2;
use Moo;
use Azure::AD::Errors;
use Types::Standard qw/Str Int InstanceOf/;
use JSON::MaybeXS;
use HTTP::Tiny;
our $VERSION = '0.01';
has ua_agent => (
is => 'ro',
is
dentialsFailed',
status => $auth_response->{status}
);
}
my $auth = decode_json($auth_response->{content});
$self->current_creds($auth);
$self->expiration($auth->{expire
dentials;
use Moo;
use Azure::AD::Errors;
use Types::Standard qw/Str Int InstanceOf/;
use JSON::MaybeXS;
use HTTP::Tiny;
our $VERSION = '0.02';
has ua_agent => (is => 'ro', isa => Str,
ntialsFailed',
status => $auth_response->{ status }
);
}
my $auth = decode_json($auth_response->{content});
$self->current_creds($auth);
$self->expiration($auth->{ expir
;
use Moo;
use Azure::AD::Errors;
use Types::Standard qw/Str Int InstanceOf CodeRef/;
use JSON::MaybeXS;
use HTTP::Tiny;
our $VERSION = '0.02';
has ua_agent => (is => 'ro', isa => Str,
viceCodeFailed',
status => $device_response->{ status }
);
}
return decode_json($device_response->{ content });
}
sub get_auth_payload_for {
my ($self, $device_payload)
tAuthTokenFailed',
status => $auth_response->{ status }
);
}
return decode_json($auth_response->{content});
}
sub _refresh {
my $self = shift;
if (not defined $sel
SION
version 0.07
=head1 SYNOPSIS
my $oauth = OAuth::Cmdline::Smartthings->new( );
my $json =
$oauth->http_get( $oauth->base_uri . "/api/smartapps/endpoints" );
=head1 DESCRIPTION
use JSON qw( from_json );
my $oauth = OAuth::Cmdline::Smartthings->new;
my $json = $oauth->http_get(
$oauth->base_uri . "/api/smartapps/endpoints" );
if( !defined $json ) {
die "Can't get endpoints";
}
my $uri = from_json( $json )->[ 0 ]->{ uri } . "/switches";
my $data = $oauth->http_get( $uri );
print "$data\n";
will print something like
[
;
use HTTP::Request::Common;
use URI;
use LWP::UserAgent;
use Log::Log4perl qw(:easy);
use JSON qw( from_json );
use MIME::Base64;
use Moo;
our $VERSION = '0.07'; # VERSION
# ABSTRACT: OAuth2 for com
my $resp = $ua->request($req);
if( $resp->is_success() ) {
my $data =
from_json( $resp->content() );
DEBUG "Token refreshed, will expire in $data->{ expires_in } second
($req);
if( $resp->is_success() ) {
my $json = $resp->content();
DEBUG "Received: [$json]";
my $data = from_json( $json );
return ( $data->{ access_token },
on info about opmbuild commands
use Carp qw(croak);
use OPM::Maker -command;
use HTTP::Tiny;
use JSON::PP;
sub abstract {
return "show version info about opmbuild commands";
}
sub opt_spec {
my $json = _json( $module, $module->VERSION() );
my $response = $ua->post(
'https://fastapi.metacpan.org/v1/file/_search', {
content => $json,
rom_json( $response->{content} );
next CMD if !$dist;
print sprintf " dist: %s\n dist-version: %s\n", $dist, $version;
}
}
}
sub _from_json {
my ($json) =
data from the server:
use OAuth::Cmdline::Automatic;
use LWP::UserAgent;
use JSON qw( from_json );
my $oauth = OAuth::Cmdline::Automatic->new();
my $ua = LWP::UserAgent->new();
on_headers );
if( $resp->is_error ) {
die $resp->message;
}
my $data = from_json( $resp->decoded_content );
for my $device ( @{ $data->{ results } } ) {
printf "%s-v
Inline;
use 5.010001;
use strict 'subs', 'vars';
use warnings;
use Log::ger;
use Data::Dmp;
use JSON::MaybeXS ();
use Module::CoreList::More;
use Module::Path::More qw(module_path);
use Perinci::Sub
ush @l, '$_pci_r->{format} = $_[1];';
} elsif ($co eq 'json') {
push @l, '$_pci_r->{format} = (-t STDOUT) ? "json-pretty" : "json"; ## no critic InputOutput::ProhibitInteractiveTest' . "\n
} elsif ($specmeta->{is_json}) {
push @l, '$_pci_args{\'', $specmeta->{arg}, '\'} = _pci_json()->decode($_[1]);';
sing cryptographic hashes) across networks.
In terms of size the encoding is similar to minified JSON. In terms of
speed this module compares well with other pure Perl encoding modules
with the same
de> was created for a project because none of currently
available serialization formats (Bencode, JSON, MsgPack, Netstrings,
Sereal, YAML, etc) met the requirements of:
=over
=item * Support for und
t::MP>, some pipe such as
L<AnyEvent::ZeroMQ>, use L<AnyEvent::Handle> on both sides to send
e.g. JSON or Storable messages, and so on.
=head2 COMPARISON TO OTHER MODULES
There is an abundance of mo
;
my @bricks = ($rq => $url => { @{$self->{_default_headers}}, @args});
push @bricks, json => $content if defined $content;
$tx = $self->build_tx(@bricks);
if (defined $content
= 'README.md';
my @copy_from_build = (
'cpanfile', 'LICENSE', 'Makefile.PL', 'META.json', $readme,
);
my @copy_from_release = ('Install');
my @allow_dirty
= ( 'dist
, # needs to precede InstallGuide
'CPANFile',
'ContributorsFile',
'MetaJSON',
'MetaYAML',
'Manifest',
[ 'MetaNoIndex' => { directory => [ 'examples',
allows you to handle multiple cases. For example, suppose
that instead of YAML you want to output JSON; you might start with this:
use Data::Tubes qw< pipeline >;
pipeline(
['Source::iter
ta-04.txt >]);
There's a problem though: for more than one input record, the output is
not valid JSON:
{"name":"Foo","nick":"foorious","age":32}
{"name":"Bar","nick":"barious","age":19}
{"n
item *
you still have to figure out how to print out the separator comma!
=back
Unfortunately, JSON is quite picky in the presence of separator commas,
in that it does not allow you to have a trail
foo.bar} eq 'a'".
Note that old bracketing into {} is considered obsolete, as it will clash
with JSON assignments like A = { "key" => "val" }.
COMPATIBILITY WARNING.
Currently, this extension is not
2 JSON representation of OpenTracing data
=head1 DESCRIPTION
See L<https://zipkin.io/zipkin-api/#/default/post_spans> for details on
the current format.
=cut
use JSON::MaybeUTF8 qw(:v1);
use JSON:
qw(JSON);
use Role::Tiny::With;
with qw(OpenTracing::Protocol);
sub new { bless { @_[1..$#_] }, $_[0] }
=head2 bytes_from_span
Returns the given data structure as a bytestream containing
a JSON U
TF-8 representation, as defined by Zipkin, Datadog and
other providers.
The resulting JSON will have at most the following keys:
=over 4
=item * C<id> - the span ID
=item * C<traceId> - the trace
inary Thrift encoding for the Jæger opentracing tool
=item * L<OpenTracing::Protocol::Zipkin> - JSON representation as supported by Zipkin
=back
This module provides a rôle for the encoding/decod
E ALSO
Few similar-task perl modules:
* Storable
* Sereal
* Data::MessagePack
* JSON
=head1 GITHUB REPOSITORY
git@github.com:cade-vs/perl-data-stacker.git
git clone git://gi
ib '../../../../../lib'; # testing
use base qw/REST::Neo4p::Agent/;
use Neo4j::Driver 0.1803;
use JSON::ize;
use REST::Neo4p::Agent::Neo4j::DriverActions;
use REST::Neo4p::Exceptions;
use Try::Tiny;
u
ion.
# Each function returns a Perl data structure that corresponds to (possibly a subset of) the JSON that would
# have been returned by the old Neo4j REST endpoint.
$result_processors{get_node} = s