AWS-Networks

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.025, CPAN::Meta::Converter version 2.142690'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: AWS-Networks
requires:
  DateTime: '0'
  File::Slurp: '0'
  HTTP::Tiny: '0'
  IO::Socket::SSL: '0'
  JSON: '0'
  Moose: '0'
  Net::CIDR::Set: '0'
version: '0.01'

Makefile.PL  view on Meta::CPAN

    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "AWS-Networks",
  "EXE_FILES" => [
    "bin/aws_ips_for_service",
    "bin/aws_ip"
  ],
  "LICENSE" => "perl",
  "NAME" => "AWS::Networks",
  "PREREQ_PM" => {
    "DateTime" => 0,
    "File::Slurp" => 0,
    "HTTP::Tiny" => 0,
    "IO::Socket::SSL" => 0,
    "JSON" => 0,
    "Moose" => 0,
    "Net::CIDR::Set" => 0
  },
  "TEST_REQUIRES" => {
    "Test::Exception" => 0,
    "Test::More" => 0
  },
  "VERSION" => "0.01",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "DateTime" => 0,
  "ExtUtils::MakeMaker" => 0,
  "File::Slurp" => 0,
  "HTTP::Tiny" => 0,
  "IO::Socket::SSL" => 0,
  "JSON" => 0,
  "Moose" => 0,
  "Net::CIDR::Set" => 0,
  "Test::Exception" => 0,
  "Test::More" => 0
);

README  view on Meta::CPAN

METHODS
  new([ url => 'http....' ])
    Standard Moose constructor. Can specify a custom URL to download a
    document that follows the same schema

  url
    Returns the URL from which the information was retrieved. Returns undef
    on filtered datasets

  sync_token
    Returns a DateTime object created from the current timestamp of the
    syncToken reported from the service

  networks
    Returns an ArrayRef with HashRefs following the following structure:

    { ip_prefix => '0.0.0.0/0', region => '...', service => '...' }

    The keys and values in the HashRefs are the ones returned by the Network
    service

dist.ini  view on Meta::CPAN

allow_dirty = README

[@Filter]
-bundle = @Basic
-remove = Readme

[Prereqs]
JSON        = 0
HTTP::Tiny  = 0
Moose       = 0
DateTime    = 0
IO::Socket::SSL = 0
File::Slurp = 0
Net::CIDR::Set = 0

[Prereqs / TestRequires ]
Test::More      = 0
Test::Exception = 0

lib/AWS/Networks.pm  view on Meta::CPAN

package AWS::Networks;
  use Moose;
  use JSON;
  use HTTP::Tiny;
  use DateTime;

  our $VERSION = '0.01';

  has url => (
    is => 'ro', 
    isa => 'Str|Undef', 
    default => 'https://ip-ranges.amazonaws.com/ip-ranges.json'
  );

  has netinfo => (

lib/AWS/Networks.pm  view on Meta::CPAN

      die "Can't get some properties from derived results" if (not $self->url);
      my $response = HTTP::Tiny->new->get($self->url);
      die "Error downloading URL" unless ($response->{ success });
      return decode_json($response->{ content });
    },
    lazy => 1,
  );

  has sync_token => (
    is => 'ro',
    isa => 'DateTime',
    default => sub {
      return DateTime->from_epoch( epoch => shift->netinfo->{ syncToken } );
    },
    lazy => 1,
  );

  has networks => (
    is => 'ro',
    isa => 'ArrayRef',
    default => sub {
      return shift->netinfo->{ prefixes };
    },

lib/AWS/Networks.pm  view on Meta::CPAN

=head2 new([ url => 'http....' ])

Standard Moose constructor. Can specify a custom URL to download a document that follows the same schema

=head2 url

Returns the URL from which the information was retrieved. Returns undef on filtered datasets

=head2 sync_token

Returns a DateTime object created from the current timestamp of the syncToken reported from the service

=head2 networks

Returns an ArrayRef with HashRefs following the following structure: 

{ ip_prefix => '0.0.0.0/0', region => '...', service => '...' } 

The keys and values in the HashRefs are the ones returned by the Network service

service can be one of: AMAZON | EC2 | CLOUDFRONT | ROUTE53 | ROUTE53_HEALTHCHECKS, but expect



( run in 0.599 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )