AWS-Networks

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

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

  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 => '...' }

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

      my $regions = {};
      map { $regions->{ $_->{ region } } = 1 } @{ $self->networks };
      return [ keys %$regions ];
    },
    lazy => 1,
  );

  sub by_region {
    my ($self, $region) = @_;
    return AWS::Networks->new(
      url => undef,
      sync_token => $self->sync_token,
      networks => [ grep { $_->{ region } eq $region } @{ $self->networks }  ]
    );
  }

  has services => (
    is => 'ro',
    isa => 'ArrayRef',
    default => sub {
      my ($self) = @_;
      my $services = {};
      map { $services->{ $_->{ service } } = 1 } @{ $self->networks };
      return [ keys %$services ];
    },
    lazy => 1,
  );

  sub by_service {
    my ($self, $service) = @_;
    return AWS::Networks->new(
      url => undef,
      sync_token => $self->sync_token,
      networks => [ grep { $_->{ service } eq $service } @{ $self->networks }  ]
    );
  }

  has cidrs => (
    is => 'ro',
    isa => 'ArrayRef',
    default => sub {
      my ($self) = @_;

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

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

=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 => '...' } 



( run in 1.825 second using v1.01-cache-2.11-cpan-d80b1682f3f )