API-Eulerian
view release on metacpan or search on metacpan
2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or an
equivalent medium, or placing the modifications on a major archive site
such as ftp.uu.net, or by allowing the Copyright Holder to include your
modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict with
standard executables, which must also be provided, and provide a separate
manual page for each non-standard executable that clearly documents how it
differs from the Standard Version.
lib/API/Eulerian/EDW/Peer/Rest.pm view on Meta::CPAN
my ( $self, $command ) = @_;
my $response;
my $status;
# Create headers
$status = $self->headers();
if( ! $status->error() ) {
my $url = $self->url() . '/edw/jobs';
# Post Job create request to remote host
$status = API::Eulerian::EDW::Request->post(
$url, $status->{ headers }, $self->body( $command )
);
if( ! $status->error() ) {
$self->uuid(
API::Eulerian::EDW::Request->json(
$status->{ response }
)->{ data }->[ 0 ]
);
}
lib/API/Eulerian/EDW/Peer/Rest.pm view on Meta::CPAN
my $status;
# Get HTTP request headers
$status = $self->headers();
if( ! $status->error() ) {
my $headers = $status->{ headers };
my $url = $self->url() . '/edw/store';
my $cmd = "DROP $what\@$site FROM $from TO $to;";
delete $status->{ headers };
# Send Cancel request to remote host
$status = API::Eulerian::EDW::Request->post(
$url, $headers, $self->body( $cmd )
);
}
return $status;
}
#
# End Up module properly
#
1;
lib/API/Eulerian/EDW/Peer/Thin.pm view on Meta::CPAN
sub create
{
my ( $self, $command ) = @_;
my $response;
my $status;
# Get Valid Headers
$status = $self->headers();
if( ! $status->error() ) {
# Post new JOB to Eulerian Data Warehouse Platform
$status = API::Eulerian::EDW::Request->post(
$self->url(), $status->{ headers }, $command, 'text/plain'
);
if( ! $status->error() ) {
my $json = API::Eulerian::EDW::Request->json( $status->{ response } );
if( defined( $json ) && $json->{ status }->[ 1 ] != 0 ) {
$status = API::Eulerian::EDW::Status->new();
$status->error( 1 );
$status->msg( $json->{ status }->[ 0 ] );
$status->code( $json->{ status }->[ 1 ] );
}
lib/API/Eulerian/EDW/Peer/Thin.pm view on Meta::CPAN
my ( $self ) = @_;
my $status;
# Get Valid Headers
$status = $self->headers();
if( ! $status->error() && exists( $self->{ uuid } ) ) {
my $uuid = $self->{ uuid };
my $command = "KILL $uuid;";
# Post new JOB to Eulerian Data Warehouse Platform
$status = API::Eulerian::EDW::Request->post(
$self->url(), $status->{ headers }, $command, 'text/plain'
);
}
return $status;
}
#
# End Up module properly
#
lib/API/Eulerian/EDW/Request.pm view on Meta::CPAN
# @brief Do HTTP Post on given URL.
#
# @param $class - API::Eulerian::EDW::HTTP class.
# @param $url - Remote URL.
# @param $headers - HTTP::Headers.
# @param $what - Request Data.
# @param $type - Request Data Type.
#
# @return API::Eulerian::EDW::Status instance.
#
sub post
{
my ( $class, $url, $headers, $what, $type ) = @_;
return $class->_request( 'POST', $url, $headers, $what, $type );
}
#
# @brief Send HTTP request on given url.
#
# @param $class - API::Eulerian::EDW Request class.
# @param $method - HTTP method.
# @param $url - Remote URL.
lib/API/Eulerian/EDW/Request.pm view on Meta::CPAN
my $endpoint;
my $request;
# Ensure default type
$type = $type || 'application/json';
# Sanity check POST arguments
if( $method eq 'POST' ) {
if( ! ( defined( $what ) && defined( $type ) ) ) {
$status->error( 1 );
$status->msg( "Mandatory argument to post request is/are missing" );
$status->code( 400 );
return $status;
} else {
# Setup Content_Length and Content_Type
$headers->push_header( Content_Length => length( $what ) );
$headers->push_header( Content_Type => $type );
}
}
# Create HTTP Request
lib/API/Eulerian/EDW/Request.pm view on Meta::CPAN
=back
=head3 output
=over 4
=item * API::Eulerian::EDW::Status. On success a new entry named 'response' is inserted into the status.
=back
=head2 post()
I<Send HTTP POST request on given url>
=head3 input
=over 4
=item * url : Remote url.
=item * headers : HTTP headers.
( run in 1.211 second using v1.01-cache-2.11-cpan-ceb78f64989 )