Net-AppDynamics-REST

 view release on metacpan or  search on metacpan

lib/Net/AppDynamics/REST.pm  view on Meta::CPAN

package Net::AppDynamics::REST;

use Modern::Perl;
use Moo;
use MooX::Types::MooseLike::Base qw(:all);
use AnyEvent::HTTP::MultiGet;
use JSON qw();
use Data::Dumper;
use Carp qw(croak);
use MIME::Base64 qw();
use URI::Escape;
use HTTP::Request;
use HTTP::Headers;
use Ref::Util qw(is_plain_arrayref);
use URI::Escape;
use namespace::clean;
use DateTime;

BEGIN {
  with 'HTTP::MultiGet::Role';
}

=head1 NAME

Net::AppDynamics::REST - AppDynamics AnyEvent Friendly REST Client

=head1 SYNOPSIS

  use Net::AppDynamics::REST;
  use AnyEvent;

  my $cv=AnyEvent->condvar;
  my $obj=Net::AppDynamics::REST->new(PASS=>'password',USER=>'Username',SERVER=>'SERVERNAME');

  # to get a list of applications in a non blocking context
  my $resut=$obj->list_applications;

  # get a list of applications in a non blocking context
  $cv->begin;
  $obj->que_list_applications(sub {
    my ($self,$id,$result,$request,$response)=@_;
    $cv->end;
  });
  $obj->agent->run_next;
  $cv->recv;

=head1 DESCRIPTION

Appdynamics AnyEvent friendly Rest client.

=head1 OO Declarations

Required

  USER: Sets the user appd
  PASS: Sets the password
  SERVER: Sets the server

Optional

  logger: sets the logging object
  CUSTOMER: default customer1
  PORT: default 8090
  PROTO: default http
  use_oauth: 0
    # boolean value when set to true, the PASS option is assumed to be required for OAUTH.
  cache_max_age: how long to keep the cache for in seconds
    default value is 3600
  agent: Gets/Sets the AnyEvent::HTTP::MultiGet object we will use
  oauth_slack: 10
    # how much slack we give oauth before we regenerate our token

For Internal use



( run in 0.869 second using v1.01-cache-2.11-cpan-39bf76dae61 )