Skip Menu |

This queue is for tickets about the Net-Amazon-EC2 CPAN distribution.

Report information
The Basics
Id: 32523
Status: resolved
Priority: 0/
Queue: Net-Amazon-EC2

People
Owner: Nobody in particular
Requestors: cpan [...] natecarlson.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.05
Fixed in: (no value)



Subject: Issues with print $inst->instance_id
I'm trying out Net::Amazon::EC2 0.05, and having some issues with the example provided in the documentation: Show quoted text
--- code snippet --- use Net::Amazon::EC2; my $ec2 = Net::Amazon::EC2->new( AWSAccessKeyId => '<id>', SecretAccessKey => '<key>', debug => '1', ); my $running_instances = $ec2->describe_instances; foreach my $inst (@{$running_instances}) { print $inst->instance_id . "\n"; }
--- end of code ---
--- output --- QUERY TO SIGN: ActionDescribeInstancesAWSAccessKeyId<>SignatureVersion1Timestamp2008-01-22T17:45:47.000ZVersion2007-08-29 GENERATED QUERY URL: http://ec2.amazonaws.com?AWSAccessKeyId=<>&Signature=<>&Version=2007-08-29&Timestamp=2008-01-22T17%3A45%3A47.000Z&Action=DescribeInstances&SignatureVersion=1 Can't locate object method "instance_id" via package "Net::Amazon::EC2::ReservationInfo" at ./start-hadoop-node.pl line 24. --- end of output --- Also, the documented sample should probably trap errors when creating an instance - ie, if the instance type of the ami is m1.large, and you run: my $instance = $ec2->run_instances(ImageId => 'ami-XXXXXXXX', MinCount => 1, MaxCount => 1); the error is not trapped.
From: cpan [...] natecarlson.com
On Tue Jan 22 12:47:45 2008, npc wrote: Show quoted text
> my $running_instances = $ec2->describe_instances; > foreach my $inst (@{$running_instances}) { > print $inst->instance_id . "\n"; > }
looks like describe_instances is actually returning an array of reservations, ie: foreach my $inst (@{$running_instances}) { print $inst->reservation_id . ":" . $inst->owner_id . "\n"; } gives a list of reservations.
This bug has been fixed