Graylog::API;
{
$Net::Graylog::API::VERSION = '0.7';
}
use strict;
use warnings;
use Furl;
use JSON;
use Moo;
use URI::Escape::XS qw/uri_escape/;
use Data::Printer;
use namespace::clean;
# -------
headers => [
'Accept' => 'application/json',
'content-type' => 'application/json',
],
timeout => $self->timeout,
);
"url [$method] $url" if ( $ENV{DEBUG} );
my $headers; #= [ 'Content-type' => ['application/json'] ] ;
my $res = $self->_furl->request(
method => uc($method),
url => $ur
le
Digest::MD5
Compress::Zlib
Encode
Carp
URI::Escape
URI::Escape::XS
JSON::XS
);
my $cmd = {
map{
$_.(' 'x(25-length($_))) => sub { my $x=shift; sub{ system("
ema
type_int type_str type_number type_hash type_array type_maybe type_bool type_null
/;
use JSON;
use B;
use Data::Dumper;
use Scalar::Util qw/blessed/;
sub match_schema {
local @_ERRORS;
rent qw/ThaiSchema::Base/;
sub is_bool { 1 }
use JSON;
sub match {
my ($self, $value) = @_;
return 0 unless defined $value;
return 1 if JSON::is_bool($value);
return 1 if ref($value) e
tion allows only JSON::true, JSON::false, C<\1>, and C<\0>.
=back
=head1 OPTIONS
=over 4
=item $STRICT
You can check a type more strictly.
This option is useful for checking JSON types.
=item $
;
}
use strict;
use warnings;
use POSIX qw(strftime);
use Data::Printer;
use Furl;
use JSON::Tiny qw(encode_json);
use Sys::Hostname;
use Data::UUID;
use POSIX qw(strftime);
# use Mo qw( default is
# headers => [
# 'Accept' => 'application/json',
# 'content-type' => 'application/json',
# ],
timeout => $self->timeout,
);
# }
my $status = $self->_furl->post( $self->url, [ 'Content-Type' => 'application/json' ], encode_json( \%data ) );
return ( $status->is_success, $status->code );
}
# -------------------
package CloudCron::TargetInput;
use Moose;
use JSON;
has command => (is => 'ro', isa => 'Str', required => 1);
has env => (is => 'ro', isa => 'HashRef[Str]', required => 0, default => sub { {} })
(is => 'ro', isa => 'Str', required => 0, default => sub { 'shell' });
sub json {
my $self = shift;
return to_json({
command => $self->command,
env => $self->env,
{
my $self = shift; $self->chdir( $self->appldir );
my $ignores = "LICENSE\nMANIFEST\nMETA.json\nMETA.yml\nREADME\nREADME.md";
$self->run_cmd( "svn propset svn:ignore '${ignores}' ." );
package CloudCronCLI::Remove;
use MooseX::App::Command;
use Paws;
use JSON;
use CloudDeploy::Utils;
use CloudCron::AWS::CloudWatch;
command_short_description q(Delete a crontab queue or
use CloudCron::Compiler;
use CloudCron::TargetQueue;
use CloudCron::AWS::CloudWatch;
use JSON;
command_short_description q(Deploy a crontab file into AWS);
command_long_description q(Par
caping single and double quotes and C<\n \r \t \0>. Utf-8 symbols are pretty valid for javascript/json.
=item * C<fix_ampersands> filter is not implemented, because it's marked as depricated and will
:Rendering';
=head1 Description
Renders templates. Uses a list stored in the index file F<index.json> which
by default is in the F<~/.module_provision> directory
=head1 Configuration and Environmen
de = $self->init_templates;
Initialise the F<.module_provision> directory and create the F<index.json> file
=head2 render_template
$target = $self->render_template( $template, $target );
Render
onKey => 'QM6T3KHX');
my $data = $client->listSearches(user => '475425');
=cut
use Moo;
use JSON;
use URI::Escape;
use REST::Client;
use Data::Dumper;
use POSIX qw(strftime);
use Carp;
use Log::
ponse = $self->_zotero_get_request('/itemTypes');
return undef unless $response;
decode_json $response->responseContent;
}
=head2 itemTypes()
Get all item fields. Returns a Perl array.
=c
onse = $self->_zotero_get_request('/itemFields');
return undef unless $response;
decode_json $response->responseContent;
}
=head2 itemTypes($type)
Get all valid fields for an item type. Re
$self->{level}--;
return;
}
sub is_literal_number {
my $self = shift;
# Stolen from JSON::Tiny
return B::svref_2object(\$_[0])->FLAGS & (B::SVp_IOK | B::SVp_NOK)
&& 0 + $
ints
Returns the hashref of API endpoints, loading them on first call from the C<share/endpoints.json> file.
=head2 endpoint
Processes the given endpoint as a template, using the named parameters
p
ravis token.
=head2 mime_type
MIME type to use for requests. Hardcoded default to C<travis-ci.2+json>.
=head2 base_uri
Base URI for Travis requests.
Hardcoded to the B<private> Travis CI server,
.com/json/$ip";
my $response = $self->dispatch(url => $url ,method => 'GET');
my $status = $response->status_line;
my $json_response = $response->decoded_content;
return $json_res
e 'missing access_key' };
has base_url => 'https://api.cloudcheckr.com/api';
has format => 'json';
has _ua => sub { Mojo::UserAgent->new };
sub get {
my ($self, $cb) = (shift, ref $_[-
ojo::CloudCheckr->new(access_key => '...');
say $cc->get(account => 'get_accounts_v2')->result->json('/accounts_and_users/0/account_name');
=head1 DESCRIPTION
A simple interface to the CloudChec
;
$cc = $cc->format($format);
The response format from the CloudCheckr API, defaults to json.
# Set the format to XML
$cc->format('xml');
=head1 METHODS
L<Mojo::CloudCheckr> inherits
as 'template_index' => is => 'lazy', isa => NonEmptySimpleStr,
default => 'index.json';
has 'test_env_vars' => is => 'lazy', isa => ArrayRef,
documentation => 'Set these
=item C<template_index>
Name of the file containing the index of templates. Defaults to F<index.json>
=item C<test_env_vars>
Array reference. Set these environment vars to true when testing. Defau
= io $self->distname.'-'.$self->dist_version;
my $path = $dir ? $dir->catfile( 'META.json' ) : 'META.json';
return CPAN::Meta->load_file( "${path}" );
}
1;
__END__
=pod
=encoding utf-8
=
ead2 load_meta
$cpan_meta_object = $self->load_meta( $optional_directory );
Loads the F<META.json> file and returns and object
=head1 Diagnostics
None
=head1 Dependencies
=over 3
=item L<Cla
irectory F<~/.module_provision> is created and
populated with templates and an index file F<index.json>. The author
name, id, and email are derived from the system (the environment
variables C<AUTHOR>
can be
overridden by the values in the configuration file
F<~/.module_provision/module_provision.json>
If the default builder (C<MB>) is used, then the project file
F<Build.PL> loads C<inc::Bob> whi
ration and Environment
The configuration file defaults to
F<~/.module_provision/module_provision.json>. All of the attributes
listed in L<Module::Provision::Config> can be set from the
configuration
=> $params,
onProgress => sub {
my $resp;
# Must eval json decode, because json string could be chunked,
# so decode could launch exception and breaks im
# see https://github.com/alambike/eixo-docker/issues/4
eval{
$resp = JSON->new->utf8->decode($_[0]);
};
if($resp->{"error"}){
treamer> - brilliant. beautiful. insane. extensive. excessive. try it.
L<JSON::XS> - no, really. If it's just plain data, JSON is a great option.
=head1 AUTHOR
mst - Matt S. Trout <mst@shadowcat.co