AWS-Networks

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>

MANIFEST  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.025.
LICENSE
MANIFEST
META.yml
Makefile.PL
README
bin/aws_ip
bin/aws_ips_for_service
dist.ini
lib/AWS/Networks.pm
t/02_test.json
t/02_tests.t
t/pod.t
t/podcoverage.t
t/test_json.json

Makefile.PL  view on Meta::CPAN

    "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,

README  view on Meta::CPAN


      foreach my $cidr (@{ $nets->cidrs }){
        say $cidr
      }

DESCRIPTION
    This module parses the official public IP network information published
    by Amazon Web Services at https://ip-ranges.amazonaws.com/ip-ranges.json

    Please read and understand the information can be found at
    http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html to make
    sense of the data retured by this module.

USAGE
    Instance an object, and use it to filter information of interest to you
    with the attributes and methods provided.

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

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

  say $nets->sync_token->iso8601;

  foreach my $cidr (@{ $nets->cidrs }){
    say $cidr
  }

=head1 DESCRIPTION

This module parses the official public IP network information published by Amazon Web Services at https://ip-ranges.amazonaws.com/ip-ranges.json

Please read and understand the information can be found at http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html to make sense of the data retured by this module.

=head1 USAGE

Instance an object, and use it to filter information of interest to you with the attributes and methods provided.

=head1 METHODS

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

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

t/02_tests.t  view on Meta::CPAN

#!/usr/bin/env perl

use Test::More;
use AWS::Networks;

use File::Slurp;
use JSON;

my $json = read_file('t/02_test.json');
my $net = AWS::Networks->new(
  netinfo => decode_json($json)  
);

cmp_ok($net->sync_token->iso8601, 'eq', '2014-11-20T22:47:08', 'Sync Token OK');

is_deeply(
  [ sort @{ $net->regions } ],
  [ sort qw/ap-northeast-1 ap-southeast-1 ap-southeast-2 cn-north-1 eu-central-1 eu-west-1 sa-east-1 us-east-1 us-gov-west-1 us-west-1 us-west-2 GLOBAL/ ],
  'Regions OK'

t/02_tests.t  view on Meta::CPAN

  ],
  'EC2 Regions'
);

is_deeply(
  [ sort @{ $net->by_service('ROUTE53')->regions } ],
  [ 'GLOBAL' ],
  'Route53 regions'
);

done_testing;

t/pod.t  view on Meta::CPAN

# -*- perl -*-

use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();

t/podcoverage.t  view on Meta::CPAN

# -*- perl -*-

use Test::More;
eval "use Test::Pod::Coverage 1.00";
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
all_pod_coverage_ok();



( run in 0.336 second using v1.01-cache-2.11-cpan-87723dcf8b7 )