Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4686)

Issue 54570048: ec2: Add VPC NetworkInterface-related APIs (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by dimitern
Modified:
10 years, 2 months ago
Reviewers:
mp+204912, niemeyer, rog
Visibility:
Public.

Description

ec2: Add VPC NetworkInterface-related APIs Added the following new API calls: - CreateNetworkInterface - DeleteNetworkInterface - NetworkInterfaces - AttachNetworkInterface - DetachNetworkInterface (and related types/responses) Modified existing calls/types: - SecurityGroupInfo now includes VPCId field - Add CreateSecurityGroupVPC call that does the same as CreateSecurityGroup, but sets the VPCId, to create a VPC group This enables us to handle VPC NICs with goamz and partially handle private IP addresses for them. Next, we'll add more VPC-related stuff to Instances. Tested live on EC2, extended ec2test package as needed. Added a couple of test helpers: createSubnet, and deleteSubnets, used to make sure we wait for the events to happen when running against live EC2 servers, and we don't leave stuff around after the tests. With these the live tests pass and clean up properly. https://code.launchpad.net/~dimitern/goamz/nic-api-calls/+merge/204912 Requires: https://code.launchpad.net/~dimitern/goamz/subnets-api-calls/+merge/204640 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : ec2: Add VPC NetworkInterface-related APIs #

Total comments: 14

Patch Set 3 : ec2: Add VPC NetworkInterface-related APIs #

Patch Set 4 : ec2: Add VPC NetworkInterface-related APIs #

Total comments: 16

Patch Set 5 : ec2: Add VPC NetworkInterface-related APIs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1085 lines, -40 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M ec2/ec2.go View 1 2 3 4 2 chunks +16 lines, -3 lines 0 comments Download
M ec2/ec2_test.go View 1 chunk +21 lines, -11 lines 0 comments Download
M ec2/ec2t_test.go View 1 2 3 4 1 chunk +5 lines, -1 line 0 comments Download
M ec2/ec2test/server.go View 1 2 3 4 9 chunks +243 lines, -0 lines 0 comments Download
A ec2/networkinterfaces.go View 1 2 3 4 1 chunk +223 lines, -0 lines 0 comments Download
A ec2/networkinterfaces_test.go View 1 2 3 4 1 chunk +365 lines, -0 lines 0 comments Download
M ec2/responses_test.go View 1 chunk +148 lines, -0 lines 0 comments Download
M ec2/subnets_test.go View 1 2 3 4 3 chunks +62 lines, -25 lines 0 comments Download

Messages

Total messages: 7
dimitern
Please take a look.
10 years, 2 months ago (2014-02-05 13:39:04 UTC) #1
dimitern
Please take a look.
10 years, 2 months ago (2014-02-05 14:08:45 UTC) #2
rog
LGTM with some minor suggestions below. Thanks! https://codereview.appspot.com/54570048/diff/20001/ec2/ec2.go File ec2/ec2.go (right): https://codereview.appspot.com/54570048/diff/20001/ec2/ec2.go#newcode635 ec2/ec2.go:635: // CreateSecurityGroup ...
10 years, 2 months ago (2014-02-05 15:17:35 UTC) #3
dimitern
Please take a look. https://codereview.appspot.com/54570048/diff/20001/ec2/ec2.go File ec2/ec2.go (right): https://codereview.appspot.com/54570048/diff/20001/ec2/ec2.go#newcode635 ec2/ec2.go:635: // CreateSecurityGroup run a CreateSecurityGroup ...
10 years, 2 months ago (2014-02-06 11:49:28 UTC) #4
dimitern
Please take a look.
10 years, 2 months ago (2014-02-07 12:56:27 UTC) #5
niemeyer
LGTM https://codereview.appspot.com/54570048/diff/60001/ec2/ec2.go File ec2/ec2.go (right): https://codereview.appspot.com/54570048/diff/60001/ec2/ec2.go#newcode637 ec2/ec2.go:637: // the provided name and description. Would you ...
10 years, 2 months ago (2014-02-12 14:22:37 UTC) #6
dimitern
10 years, 2 months ago (2014-02-12 14:50:35 UTC) #7
*** Submitted:

ec2: Add VPC NetworkInterface-related APIs

Added the following new API calls:
- CreateNetworkInterface
- DeleteNetworkInterface
- NetworkInterfaces
- AttachNetworkInterface
- DetachNetworkInterface
(and related types/responses)

Modified existing calls/types:
- SecurityGroupInfo now includes VPCId field
- Add CreateSecurityGroupVPC call that does
the same as CreateSecurityGroup, but sets
the VPCId, to create a VPC group

This enables us to handle VPC NICs with
goamz and partially handle private IP
addresses for them. Next, we'll add more
VPC-related stuff to Instances.

Tested live on EC2, extended ec2test package
as needed.

Added a couple of test helpers: createSubnet,
and deleteSubnets, used to make sure we wait
for the events to happen when running against
live EC2 servers, and we don't leave stuff
around after the tests. With these the live
tests pass and clean up properly.

R=rog, niemeyer
CC=
https://codereview.appspot.com/54570048

https://codereview.appspot.com/54570048/diff/60001/ec2/ec2.go
File ec2/ec2.go (right):

https://codereview.appspot.com/54570048/diff/60001/ec2/ec2.go#newcode637
ec2/ec2.go:637: // the provided name and description.
On 2014/02/12 14:22:38, niemeyer wrote:
> Would you mind to update this to be slightly more sane:
> 
> // CreateSecurityGroup creates a security group with the provided name
> // and description.

Done.

https://codereview.appspot.com/54570048/diff/60001/ec2/networkinterfaces.go
File ec2/networkinterfaces.go (right):

https://codereview.appspot.com/54570048/diff/60001/ec2/networkinterfaces.go#n...
ec2/networkinterfaces.go:8: // Written by Gustavo Niemeyer
<gustavo.niemeyer@canonical.com>
On 2014/02/12 14:22:38, niemeyer wrote:
> Please drop this line.

Done.

https://codereview.appspot.com/54570048/diff/60001/ec2/networkinterfaces.go#n...
ec2/networkinterfaces.go:52: // NetworkInterface describes a network interface
for AWS VPC.
On 2014/02/12 14:22:38, niemeyer wrote:
> s/ AWS//

Done.

https://codereview.appspot.com/54570048/diff/60001/ec2/networkinterfaces.go#n...
ec2/networkinterfaces.go:78: // Only the SubnetId is required, the rest are
optional.
On 2014/02/12 14:22:38, niemeyer wrote:
> // SubnetId is the only required field.
> 
> This already implies that the rest is optional.

Done.

https://codereview.appspot.com/54570048/diff/60001/ec2/networkinterfaces.go#n...
ec2/networkinterfaces.go:81: // PrivateIPs slice. Only one of them can be set as
primary.
On 2014/02/12 14:22:38, niemeyer wrote:
> // Only one provided PrivateIP may be set as primary.
> 
> It's implicit that one or more may be provided.

Done.

https://codereview.appspot.com/54570048/diff/60001/ec2/networkinterfaces.go#n...
ec2/networkinterfaces.go:93: SecondaryPrivateIPsCount int
On 2014/02/12 14:22:38, niemeyer wrote:
> s/IPsCount/IPCount/?  That seems to read better, and also matches the plural
> form used by the underlying EC2 parameter.

Done. Also, as agreed on IRC, I'll rename NetworkInterfaceOptions to
CreateNetworkInterface.

https://codereview.appspot.com/54570048/diff/60001/ec2/networkinterfaces.go#n...
ec2/networkinterfaces.go:163: // interfaces to the matching ids or filtering
rules.
On 2014/02/12 14:22:38, niemeyer wrote:
> // NetworkInterfaces returns a list of network interfaces.
> //
> // If the ids or filter parameters are provided, only matching interfaces
> // are returned. 

Done.

https://codereview.appspot.com/54570048/diff/60001/ec2/subnets_test.go
File ec2/subnets_test.go (right):

https://codereview.appspot.com/54570048/diff/60001/ec2/subnets_test.go#newcode94
ec2/subnets_test.go:94: // Subnet tests to run against either a local test
server or live on EC2.
On 2014/02/12 14:22:38, niemeyer wrote:
> s/ to// -- the original sentence was correct ("These tests run against...")

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b