Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: tsiganenok [...] gmail.com
Cc:
AdminCc:

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



Subject: feature request (release VPC Elastic IP)
Date: Mon, 16 Mar 2015 11:21:27 +0200
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Igor Tsigankov <tsiganenok [...] gmail.com>
Hi, The release_address method isn't working for vpc addresses. Amazon requirement to release ip allocated in vpc is to pass allocation id instead of PublicIp: Amazon EC2 Errors [Request 99774cf3-9e75-4396-845a-a65770e3b017]: [InvalidParameterValue] You must specify an allocation id when releasing a VPC elastic IP address and it can't be used together with ip: Amazon EC2 Errors [Request e61529b6-6d63-42bd-82d5-35eae4a08394]: [InvalidParameterCombination] You may specify public IP or allocation id, but not both in the same call The simplest way to fix is (IMHO) adding another function, following your convention should look something like this: sub release_vpc_address { my $self = shift; my %args = validate( @_, { AllocationId => { type => SCALAR }, }); my $xml = $self->_sign(Action => 'ReleaseAddress', %args); if ( grep { defined && length } $xml->{Errors} ) { return $self->_parse_errors($xml); } else { if ($xml->{return} eq 'true') { return 1; } else { return undef; } } } or updating current function as follows: sub release_address { my $self = shift; my %args = validate( @_, { PublicIp => { type => SCALAR, optional => 1 }, AllocationId => { type => SCALAR, optional => 1 }, }); my $xml = $self->_sign(Action => 'ReleaseAddress', %args); if ( grep { defined && length } $xml->{Errors} ) { return $self->_parse_errors($xml); } else { if ($xml->{return} eq 'true') { return 1; } else { return undef; } } } both checked and found working. Module version used is 0.29. B.R.
Subject: Re: [rt.cpan.org #102798] feature request (release VPC Elastic IP)
Date: Mon, 16 Mar 2015 14:32:36 +0000 (UTC)
To: "bug-Net-Amazon-EC2 [...] rt.cpan.org" <bug-Net-Amazon-EC2 [...] rt.cpan.org>
From: Mark Allen <mrallen1 [...] yahoo.com>
Thanks for the report. Any chance you'd be able to attach those code snippets as diff -u output to this ticket? Thanks. Mark On Monday, March 16, 2015 4:21 AM, Igor Tsigankov via RT <bug-Net-Amazon-EC2@rt.cpan.org> wrote: Mon Mar 16 05:21:37 2015: Request 102798 was acted upon. Transaction: Ticket created by tsiganenok@gmail.com       Queue: Net-Amazon-EC2     Subject: feature request (release VPC Elastic IP)   Broken in: (no value)     Severity: (no value)       Owner: Nobody   Requestors: tsiganenok@gmail.com       Status: new Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=102798 > Hi, The release_address method isn't working for vpc addresses. Amazon requirement to release ip allocated in vpc is to pass allocation id instead of PublicIp: Amazon EC2 Errors [Request 99774cf3-9e75-4396-845a-a65770e3b017]: [InvalidParameterValue] You must specify an allocation id when releasing a VPC elastic IP address and it can't be used together with ip: Amazon EC2 Errors [Request e61529b6-6d63-42bd-82d5-35eae4a08394]: [InvalidParameterCombination] You may specify public IP or allocation id, but not both in the same call The simplest way to fix is (IMHO) adding another function, following your convention should look something like this: sub release_vpc_address {         my $self = shift;         my %args = validate( @_, {                 AllocationId          => { type => SCALAR },         });         my $xml = $self->_sign(Action  => 'ReleaseAddress', %args);         if ( grep { defined && length } $xml->{Errors} ) {                 return $self->_parse_errors($xml);         }         else {                 if ($xml->{return} eq 'true') {                         return 1;                 }                 else {                         return undef;                 }         } } or updating current function as follows: sub release_address {         my $self = shift;         my %args = validate( @_, {                 PublicIp                => { type => SCALAR, optional => 1 },                 AllocationId          => { type => SCALAR, optional => 1 },         });         my $xml = $self->_sign(Action  => 'ReleaseAddress', %args);         if ( grep { defined && length } $xml->{Errors} ) {                 return $self->_parse_errors($xml);         }         else {                 if ($xml->{return} eq 'true') {                         return 1;                 }                 else {                         return undef;                 }         } } both checked and found working. Module version used is 0.29. B.R.
Subject: rt.cpan.org #102798
Date: Wed, 18 Mar 2015 09:27:20 +0200
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Igor Tsigankov <tsiganenok [...] gmail.com>
here the diff --- EC2.pm 2015-03-18 09:16:32.559960673 +0200 +++ EC2.pm.patched 2015-03-18 09:16:01.920244035 +0200 @@ -3745,6 +3745,27 @@ } } +sub release_vpc_address { + my $self = shift; + my %args = validate( @_, { + AllocationId => { type => SCALAR }, + }); + + my $xml = $self->_sign(Action => 'ReleaseAddress', %args); + + if ( grep { defined && length } $xml->{Errors} ) { + return $self->_parse_errors($xml); + } + else { + if ($xml->{return} eq 'true') { + return 1; + } + else { + return undef; + } + } +} + =head2 reset_image_attribute(%params) This method resets an attribute for an AMI to its default state (NOTE: product codes cannot be reset). *B.R.* *Igor.*
Subject: Re: [rt.cpan.org #102798] feature request (release VPC Elastic IP)
Date: Wed, 18 Mar 2015 09:36:16 +0200
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Igor Tsigankov <tsiganenok [...] gmail.com>
I opened another ticket mistakenly, sorry about that (id: 102856), please close it. Here the diff is: --- EC2.pm 2015-03-18 09:16:32.559960673 +0200 +++ EC2.pm.patched 2015-03-18 09:16:01.920244035 +0200 @@ -3745,6 +3745,27 @@ } } +sub release_vpc_address { + my $self = shift; + my %args = validate( @_, { + AllocationId => { type => SCALAR }, + }); + + my $xml = $self->_sign(Action => 'ReleaseAddress', %args); + + if ( grep { defined && length } $xml->{Errors} ) { + return $self->_parse_errors($xml); + } + else { + if ($xml->{return} eq 'true') { + return 1; + } + else { + return undef; + } + } +} + =head2 reset_image_attribute(%params) This method resets an attribute for an AMI to its default state (NOTE: product codes cannot be reset). *B.R.* *Igor.* On Mon, Mar 16, 2015 at 5:33 PM, Mark Allen via RT < bug-Net-Amazon-EC2@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=102798 > > > Thanks for the report. Any chance you'd be able to attach those code > snippets as diff -u output to this ticket? > Thanks. > Mark > > > > On Monday, March 16, 2015 4:21 AM, Igor Tsigankov via RT < > bug-Net-Amazon-EC2@rt.cpan.org> wrote: > > > Mon Mar 16 05:21:37 2015: Request 102798 was acted upon. > Transaction: Ticket created by tsiganenok@gmail.com > Queue: Net-Amazon-EC2 > Subject: feature request (release VPC Elastic IP) > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: tsiganenok@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=102798 > > > > Hi, > > The release_address method isn't working for vpc addresses. > Amazon requirement to release ip allocated in vpc is to pass allocation id > instead of PublicIp: > > Amazon EC2 Errors [Request 99774cf3-9e75-4396-845a-a65770e3b017]: > [InvalidParameterValue] You must specify an allocation id when releasing a > VPC elastic IP address > > and it can't be used together with ip: > > Amazon EC2 Errors [Request e61529b6-6d63-42bd-82d5-35eae4a08394]: > [InvalidParameterCombination] You may specify public IP or allocation id, > but not both in the same call > > The simplest way to fix is (IMHO) adding another function, following your > convention should look something like this: > > sub release_vpc_address { > my $self = shift; > my %args = validate( @_, { > AllocationId => { type => SCALAR }, > }); > > my $xml = $self->_sign(Action => 'ReleaseAddress', %args); > > if ( grep { defined && length } $xml->{Errors} ) { > return $self->_parse_errors($xml); > } > else { > if ($xml->{return} eq 'true') { > return 1; > } > else { > return undef; > } > } > } > > or updating current function as follows: > > sub release_address { > my $self = shift; > my %args = validate( @_, { > PublicIp => { type => SCALAR, optional => 1 > }, > AllocationId => { type => SCALAR, optional => 1 }, > }); > > my $xml = $self->_sign(Action => 'ReleaseAddress', %args); > > if ( grep { defined && length } $xml->{Errors} ) { > return $self->_parse_errors($xml); > } > else { > if ($xml->{return} eq 'true') { > return 1; > } > else { > return undef; > } > } > } > > both checked and found working. > > Module version used is 0.29. > > B.R. > > > > >
Subject: Re: [rt.cpan.org #102798] feature request (release VPC Elastic IP)
Date: Wed, 18 Mar 2015 15:25:42 +0000 (UTC)
To: "bug-Net-Amazon-EC2 [...] rt.cpan.org" <bug-Net-Amazon-EC2 [...] rt.cpan.org>
From: Mark Allen <mrallen1 [...] yahoo.com>
No worries. Thanks for the diff. On Wednesday, March 18, 2015 2:36 AM, Igor Tsigankov via RT <bug-Net-Amazon-EC2@rt.cpan.org> wrote:       Queue: Net-Amazon-EC2 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=102798 > I opened another ticket mistakenly, sorry about that (id: 102856), please close it. Here the diff is: --- EC2.pm 2015-03-18 09:16:32.559960673 +0200 +++ EC2.pm.patched 2015-03-18 09:16:01.920244035 +0200 @@ -3745,6 +3745,27 @@ } } +sub release_vpc_address { + my $self = shift; + my %args = validate( @_, { + AllocationId => { type => SCALAR }, + }); + + my $xml = $self->_sign(Action => 'ReleaseAddress', %args); + + if ( grep { defined && length } $xml->{Errors} ) { + return $self->_parse_errors($xml); + } + else { + if ($xml->{return} eq 'true') { + return 1; + } + else { + return undef; + } + } +} + =head2 reset_image_attribute(%params) This method resets an attribute for an AMI to its default state (NOTE: product codes cannot be reset). *B.R.* *Igor.* On Mon, Mar 16, 2015 at 5:33 PM, Mark Allen via RT < bug-Net-Amazon-EC2@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=102798 > > > Thanks for the report. Any chance you'd be able to attach those code > snippets as diff -u output to this ticket? > Thanks. > Mark > > > >      On Monday, March 16, 2015 4:21 AM, Igor Tsigankov via RT < > bug-Net-Amazon-EC2@rt.cpan.org> wrote: > > >  Mon Mar 16 05:21:37 2015: Request 102798 was acted upon. > Transaction: Ticket created by tsiganenok@gmail.com >      Queue: Net-Amazon-EC2 >    Subject: feature request (release VPC Elastic IP) >  Broken in: (no value) >    Severity: (no value) >      Owner: Nobody >  Requestors: tsiganenok@gmail.com >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=102798 > > > > Hi, > > The release_address method isn't working for vpc addresses. > Amazon requirement to release ip allocated in vpc is to pass allocation id > instead of PublicIp: > > Amazon EC2 Errors [Request 99774cf3-9e75-4396-845a-a65770e3b017]: > [InvalidParameterValue] You must specify an allocation id when releasing a > VPC elastic IP address > > and it can't be used together with ip: > > Amazon EC2 Errors [Request e61529b6-6d63-42bd-82d5-35eae4a08394]: > [InvalidParameterCombination] You may specify public IP or allocation id, > but not both in the same call > > The simplest way to fix is (IMHO) adding another function, following your > convention should look something like this: > > sub release_vpc_address { >        my $self = shift; >        my %args = validate( @_, { >                AllocationId          => { type => SCALAR }, >        }); > >        my $xml = $self->_sign(Action  => 'ReleaseAddress', %args); > >        if ( grep { defined && length } $xml->{Errors} ) { >                return $self->_parse_errors($xml); >        } >        else { >                if ($xml->{return} eq 'true') { >                        return 1; >                } >                else { >                        return undef; >                } >        } > } > > or updating current function as follows: > > sub release_address { >        my $self = shift; >        my %args = validate( @_, { >                PublicIp                => { type => SCALAR, optional => 1 > }, >                AllocationId          => { type => SCALAR, optional => 1 }, >        }); > >        my $xml = $self->_sign(Action  => 'ReleaseAddress', %args); > >        if ( grep { defined && length } $xml->{Errors} ) { >                return $self->_parse_errors($xml); >        } >        else { >                if ($xml->{return} eq 'true') { >                        return 1; >                } >                else { >                        return undef; >                } >        } > } > > both checked and found working. > > Module version used is 0.29. > > B.R. > > > > >
On Wed Mar 18 03:27:29 2015, tsiganenok@gmail.com wrote: Show quoted text
> here the diff
Applied as 90a61da - should be releasing 0.30 shortly.