AnyEvent-EC2-Tiny
view release on metacpan or search on metacpan
# We are essentially encoding 'raw' EC2 API calls with a v2
# signature and turning XML responses into Perl data structures
my $xml = $ec2->send(
'RegionName.1' => 'us-east-1',
Action => 'DescribeRegions',
success_cb => sub {
my $xml = shift;
# prints ec2.us-east-1.amazonaws.com
say $xml->{'regionInfo'}{'item'}[0]{'regionEndpoint'};
},
fail_cb => sub {
my $error = shift;
$error->{'type'} # HTTP or XML
$error->{'data'} # hashref to body, errors, xml, headers, etc.
$error->{'text'} # text of the error
},
);
lib/AnyEvent/EC2/Tiny.pm view on Meta::CPAN
# We are essentially encoding 'raw' EC2 API calls with a v2
# signature and turning XML responses into Perl data structures
my $xml = $ec2->send(
'RegionName.1' => 'us-east-1',
Action => 'DescribeRegions',
success_cb => sub {
my $xml = shift;
# prints ec2.us-east-1.amazonaws.com
say $xml->{'regionInfo'}{'item'}[0]{'regionEndpoint'};
},
fail_cb => sub {
my $error = shift;
$error->{'type'} # HTTP or XML
$error->{'data'} # hashref to body, errors, xml, headers, etc.
$error->{'text'} # text of the error
},
);
( run in 0.907 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )