SCRIPTION
This module implements the L<member name restrictions|http://jsonapi.org/format/#document-member-names>
from the {json:api} specification; it can be used by repositories
to implement strict
This task inherits from L<Armadito::Agent::Task:Alerts>. Get Antivirus' alerts and send them as json messages to armadito glpi plugin.
=head1 FUNCTIONS
=head2 run ( $self, %params )
Run the task.
e Armadito::Agent::Task::Alerts;
use strict;
use warnings;
use base 'Armadito::Agent::Task';
use JSON;
use Data::Dumper;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%para
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
my $json_text = to_json( $self->{jobj} );
$self->{logger}->debug($json_text);
my $response = $self->{glpi_client}->sendRequest(
"url" => $self->{glpi_url} . "/api/alerts",
message => $json_te
This task inherits from L<Armadito::Agent::Task:State>. Get Antivirus state and then send it in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
Armadito::Agent::Task:Scan>. Launch an Antivirus on-demand scan and then send a brief report in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
$buff}) || return;
foreach (@{$buff}) {
$data .= join $/, '{"index":{}}', $self->_to_json($_), '';
}
if (_INTERNAL_DEBUG) {
require Data::Dumper;
print Data::Dump
anciate module. Set task's default logger.
=head2 getJobj ( $self )
Return unblessed object for json encapsulation.
=head2 getVersion ( $self )
Return Antivirus' Version.
=head2 getProgramPath (
This task inherits from L<Armadito::Agent::Task:State>. Get Antivirus state and then send it in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
our @ISA = qw(Log::Log4perl::Appender);
use Carp;
use HTTP::Headers();
use HTTP::Request();
use JSON;
use LWP::UserAgent();
use Log::Log4perl;
use MIME::Base64;
use URI;
=head1 NAME
Log::Log4perl:
_type};
} ## end sub type
sub log {
my ($self, %p) = @_;
$self->_send_request($self->_to_json($self->_prepare_body(%p)));
}
sub _init {
my ($self, %p) = @_;
defined($p{nodes})
, $uri) = @_;
my $h = $self->{_headers}->clone;
$h->header('Content-Type' => 'application/json');
my $ui = $uri->userinfo;
if ($ui) {
my $auth = MIME::Base64::encode_base64($u
ten::Yourls;
use strict;
use warnings;
use Carp ();
use File::HomeDir ();
use File::Spec ();
use JSON::MaybeXS;
use Path::Tiny qw(path);
use Scalar::Util qw(blessed);
use URI ();
use base qw( WWW::S
password server signature),
];
return [@{$attrs}];
}
}
# _json_request (static, private)
sub _json_request {
my $url = shift;
Carp::croak("Invalid URI object") unless $ur
ation/json}) {
Carp::croak("Unexpected response: $content");
}
my $json = decode_json($content);
Carp::croak("Invalid data returned: $content") unless $json;
return $json;
}
#
nherits from L<Armadito::Agent::Task:AVConfig>. Get Antivirus configuration and then send it in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
ask inherits from L<Armadito::Agent::Task:Alerts>. Get Armadito Antivirus alerts and send them as json messages to armadito glpi plugin.
=head1 FUNCTIONS
=head2 run ( $self, %params )
Run the task.
:Task:State>. Ask for Armadito Antivirus state using AV's API REST protocol and then send it in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
# ABSTRACT: a {json:api} document building class
package PONAPI::Document;
use strict;
use warnings;
use parent 'PONAPI::Document::Builder::Document';
1;
__END__
=pod
=encoding UTF-8
=head1 NAM
E
PONAPI::Document - a {json:api} document building class
=head1 VERSION
version 0.001002
=head1 SYNOPSIS
use PONAPI::Document;
my $document = PONAPI::Document->new(
version =>
turn a valid {json:api} document
# as a perl hash, which you can later turn into JSON.
my $result = $document->build;
=head1 DESCRIPTION
C<PONAPI::Document> lets you build {json:api} complia
n qw{ POST };
use UNIVERSAL::require;
use URI;
use Encode;
use Data::Dumper;
use URI::Escape;
use JSON;
use Armadito::Agent::HTTP::Client::ArmaditoAV::Event;
use Armadito::Agent::HTTP::Client::Armadi
rmadito-agent',
'Referer' => $url
);
$headers->header( 'Content-Type' => 'application/json' ) if ( $params{method} eq 'POST' );
$headers->header( 'X-Armadito-Token' => $self->{token} )
{
my ( $self, $response ) = @_;
$self->{logger}->info( $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
# Update armadito agent_id
if ( defined( $obj->{token}
rict;
use warnings;
use utf8;
use Carp;
use JSON::MaybeXS qw/JSON/;
our $VERSION = "0.008";
=head1 NAME
Locale::Meta - Multilanguage support loading json structures based on Locale::Wolowitz.
=hea
d1 VERSION
version 0.008
=head1 SYNOPSIS
#in ./i18n/file.json
{
"en": {
"color": {
"trans" : "color"
"meta": {
"searchable": 1,
}
}
},
ency of the
file names as part of the definition of the language, to manage a new json data structure
for the .json files definitions, and also, add a meta field in order to be
able to extend the u
This task inherits from L<Armadito::Agent::Task:Alerts>. Get Antivirus' alerts and send them as json messages to armadito glpi plugin.
=head1 FUNCTIONS
=head2 run ( $self, %params )
Run the task.
ns.
use strict;
use warnings;
use Carp;
use Email::Valid;
use HTTP::Tiny;
use JSON::MaybeXS qw/encode_json decode_json/;
use File::Basename;
use File::MimeInfo;
use MIME::Base64 qw/encode_base64/;
s => {
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'X-Postmark-Server-Token' => $self->{token},
},
content => encode_json($msg),
}
);
# analyze the res
ponse
if ($res->{success}) {
# woooooooooooooeeeeeeeeeeee
return decode_json($res->{content});
} else {
if ($msg->{Attachments}) {
print STDERR $res->{content};
}
croak "Failed sending
Armadito Antivirus on-demand scan using AV's API REST protocol and then send a brief report in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
g2($url) if $self->{logger};
my $headers = HTTP::Headers->new(
'Content-Type' => 'application/json',
'Referer' => $url
);
my $request = HTTP::Request->new(
$params{method} => $url,
$
eURL method. If this is a POST request, a message must be given in params. This should be a valid JSON message.
The following parameters are allowed, as keys of the %params hash :
=over
=item I<url