The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Amazon::DirectConnect - Perl interface to the Amazon DirectConnect API

VERSION

Version 0.13 DirectConnect API version 2012-10-25

SYNOPSIS

    use Net::Amazon::DirectConnect;

    my $dc = Net::Amazon::DirectConnect->new(
        region => 'ap-southeast-2',
        access_key_id => 'access key',
        secret_key_id => 'secret key'
    );
    ...

SUBROUTINES/METHODS

new

    use Net::Amazon::DirectConnect;

    my $dc = Net::Amazon::DirectConnect->new(
        region => 'ap-southeast-2',
        access_key_id => 'access key',
        secret_key_id => 'secret key'
    );
    ...

action

Perform action against the Amazon Direct Connect API. Actions are validated against an embedded copy of DirectConnect-2012-10-25.yml for correctness before the call is made.

    # List connections
    my $connections = $dc->action('DescribeConnections');

    foreach my $dxcon (@{$connections->{connections}}) {
        say "$dxcon->{connectionId} -> $dxcon->{connectionName}";

        # List Virtual Interfaces
        my $virtual_interfaces = $dc->action('DescribeVirtualInterfaces', connectionId => $dxcon->{connectionId});
        foreach my $vif (@{$virtual_interfaces->{virtualInterfaces}}) {
            say "  $vif->{connectionId}";
        }
    }

ua

Get or set UserAgent object

    say ref($dc->ua);
    my $ua = my $lwp = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 } );
    $ua->proxy('https', 'http://127.0.0.1:8080');
    $dc->ua($ua);

spec

Get or set YAML::Tiny object

    say ref($dc->spec);
    $dc->spec(YAML::Tiny->read('new-spec.yml'));

region

Get or set AWS region

    $dc->region('ap-southeast-2');
    say $dc->region;

credentials

Set AWS credentials

    $dc->credentials(
        access_key_id => 'MY_ACCESS_KEY',
        secret_key_id => 'MY_SECRET_KEY'
    );

Internal subroutines

_request

Build and sign HTTP::Request object, return if successful or croak if error

_validate

Validate the method and required arguments against the current version of the Direct Connect API (2012-10-25)

AUTHOR

Cameron Daniel, <cameron.daniel at megaport.com>

SUPPORT

You can find documentation for this module with the perldoc command or at https://github.com/megaport/p5-net-amazon-directconnect/

    perldoc Net::Amazon::DirectConnect