Merge lp://staging/~benoit-canet/goamz/add-CONTRIBUTING into lp://staging/goamz
Status: | Needs review |
---|---|
Proposed branch: | lp://staging/~benoit-canet/goamz/add-CONTRIBUTING |
Merge into: | lp://staging/goamz |
Diff against target: |
119 lines (+59/-0) 5 files modified
aws/aws.go (+44/-0) exp/sdb/sdb.go (+3/-0) exp/sns/sns.go (+3/-0) iam/iam.go (+3/-0) s3/s3.go (+6/-0) |
To merge this branch: | bzr merge lp://staging/~benoit-canet/goamz/add-CONTRIBUTING |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
goamz maintainers | Pending | ||
Review via email: mp+218959@code.staging.launchpad.net |
Description of the change
Add the Outscale EC2 compatible cloud provider.
This commits define the EC2 endpoint used by Outscale in Outscale
specific regions.
Outscale only implement the EC2 API so other endpoint are left set to "".
This commit takes care of making the code panic in various constructor
when a struct will use an undefined endpoint.
Unmerged revisions
- 51. By Benoît Canet <email address hidden>
-
aws: Add regions for the Outscale EC2 compatible cloud provider.
Outscale only implement EC2 so only the EC2 endpoints are defined for
Outscale's regions.This commit takes care of making the code panic in the various
constructors if the endpoints they use are not defined. - 50. By Dimiter Naydenov
-
ec2: Added (Un)AssignPriva
teIPAddresses APIs Added two new API calls:
- AssignPrivateIPAddresses
- UnassignPrivateIPAddresses They allow adding or removing secondary private
IP addresses to a network interface of an instance.This is the final part of the VPC-related goamz
changes needed to support initial container
networking in juju-core.Added a live-only test for the two new APIs and
a couple of example response tests.Removed ec2.*Status constants, as suggested in
a prereq review, which I omitted previously.R=rog, niemeyer
CC=
https://codereview. appspot. com/54210047 - 49. By Dimiter Naydenov
-
ec2: Added NIC support for RunInstances
This extends RunInstances options to include
a list of NetworkInterfaceSpec options. They
allow specifying NICs to attach to instances
at launch time (either existing or new NICs).It also adds SubnetId, VPCId, SourceDestCheck,
and NetworkInterfaces fields to the Instance
type, so Instances() and RunInstances() can
return the extended VPC-related information
for an instance.If any NetworkInterfac
eSpec options are provided,
or SubnetID is given, RunInstances() will use the
latest AWS API version (2013-10-15), otherwise it
uses the default version (2011-12-15).Modified terminateInstan
ces() test helper to wait
and retry when running against live EC2 servers,
to make sure the instances are really gone and
not left hanging after the test (leaking related
resources with them). In order for this to work
with the local testing server, a slight change
was made - when an instance is terminated, the
next time you fetch it with Instances(), it will
report "terminated" (thus simulating the real
state transition).Added vpc-id and subnet-id filters to ec2test's
Instance and securityGroup types, and also changed
TestGroupFiltering and TestInstanceFiltering to
include tests for them.Test double changed to support VPC security groups
and verify subnet ID in runInstances, as EC2 does.
Added NewInstancesVPC() method with vpcId and subnetId,
so VPC-enabled instances can be created in the test
server.Added a TestRunInstancesVPC live test for the new
functionality (only live, because it's not worth
it to change the test double to create NICs in
runInstances()).R=rog, niemeyer, nate.finch
CC=
https://codereview. appspot. com/60620043 - 48. By Dimiter Naydenov
-
ec2: Add VPC NetworkInterfac
e-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 groupThis 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 - 47. By Dimiter Naydenov
-
ec2: Add support for VPC subnets
Added the following new API calls:
- CreateSubnet
- DeleteSubnet
- Subnets
(and related types/responses)This is the second step on the path to
support VPC networking in goamz, next
APIs for network interfaces will be
added.Tested live on EC2, and extended the
ec2test package as needed.Added a deleteVPCs test helpers which
waits until a VPC is no longer in use
and can be deleted, retrying as needed
when running against live EC2 servers.
This is needed to ensure live tests do
no leave stuff behind (I've run all live
tests several times in a row to make sure
it works).R=rog, gz, niemeyer
CC=
https://codereview. appspot. com/54690048 - 46. By Dimiter Naydenov
-
ec2: Add support for AWS VPCs
Added the following new API calls:
- CreateVPC
- DeleteVPC
- VPCs
(and the associated types/responses).Most new code is in vpc.go and vpc_test.go.
These are needed in order to support VPC-related
operations on EC2, which will come in later follow-ups.
Implementation complexity in ec2test package for the
new calls is minimal.Some changes were needed in order to support these
and the upcoming API calls. For the new ones, AWS API
version 2013-10-15 (latest) is used, while for the
existing calls use the previous API version, as before
(2011-12-15).Added tests, updated test doubles and tested live on
EC2.After running the EC2 live tests numerous times, I
realized some tests are leaking security groups, so
I added a deleteGroups() tests helper that retries
to ensure all groups are deleted. Also improved the
VPC tests to include retrying as well, so the live
tests are more stable and clean up after themselves. - 45. By Dimiter Naydenov
-
ec2: Fixed #1275406 - LocalServerSuite failure
LocalServerSuit
e.TestInstanceI nfo fails due to
the DNSName field being empty, where as the
test expect it populated.
Changed the test to refresh the instance data
after it's started, because DNSName is empty
until the instance state is "started" (according
to AWS docs). In the test suite this is simulated
by getting the instance data again, which includes
the populated DNSName.R=rog, gz, niemeyer
CC=
https://codereview. appspot. com/59620043
Reviewers: mp+218959_ code.launchpad. net,
Message:
Please take a look.
Description:
Add the Outscale EC2 compatible cloud provider.
This commits define the EC2 endpoint used by Outscale in Outscale
specific regions.
Outscale only implement the EC2 API so other endpoint are left set to
"".
This commit takes care of making the code panic in various constructor
when a struct will use an undefined endpoint.
https:/ /code.launchpad .net/~benoit- canet/goamz/ add-CONTRIBUTIN G/+merge/ 218959
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/98130043/
Affected files (+61, -0 lines):
A [revision details]
M aws/aws.go
M exp/sdb/sdb.go
M exp/sns/sns.go
M iam/iam.go
M s3/s3.go
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision: <email address hidden>
Index: aws/aws.go /iam.amazonaws. com",
=== modified file 'aws/aws.go'
--- aws/aws.go 2014-02-12 13:42:33 +0000
+++ aws/aws.go 2014-05-09 10:30:42 +0000
@@ -133,6 +133,47 @@
"https:/
}
+// The following regions are for the Outscale SAS cloud provider. /api-ppd. outscale. com", /api.eu- west-1. outscale. com", /api.us- east-1. outscale. com", Name: APNortheast, Name: APSoutheast,
+// Outscale SAS only implement EC2 so other values are set to "".
+var OscEuWest3 = Region{
+ "osc-eu-west-3",
+ "https:/
+ "",
+ "",
+ false,
+ false,
+ "",
+ "",
+ "",
+ "",
+}
+
+var OscEuWest1 = Region{
+ "osc-eu-west-1",
+ "https:/
+ "",
+ "",
+ false,
+ false,
+ "",
+ "",
+ "",
+ "",
+}
+
+var OscUsEast1 = Region{
+ "osc-us-east-1",
+ "https:/
+ "",
+ "",
+ false,
+ false,
+ "",
+ "",
+ "",
+ "",
+}
+
var Regions = map[string]Region{
APNortheast.
APSoutheast.
@@ -142,6 +183,9 @@
USWest.Name: USWest,
USWest2.Name: USWest2,
SAEast.Name: SAEast,
+ OscEuWest3.Name: OscEuWest3,
+ OscEuWest1.Name: OscEuWest1,
+ OscUsEast1.Name: OscUsEast1,
}
type Auth struct {
Index: iam/iam.go
=== modified file 'iam/iam.go'
--- iam/iam.go 2013-03-02 02:11:38 +0000
+++ iam/iam.go 2014-05-09 10:30:42 +0000
@@ -20,6 +20,9 @@
// New creates a new IAM instance.
func New(auth aws.Auth, region aws.Region) *IAM {
+ if region.IAMEndpoint == "" {
+ panic("The provided region has no IAM endpoint")
+ }
return &IAM{auth, region}
}
Index: s3/s3.go
=== modified file 's3/s3.go'
--- s3/s3.go 2014-02-12 13:42:33 +0000
+++ s3/s3.go 2014-05-09 10:30:42 +0000
@@ -68,6 +68,12 @@
// New creates a new S3. S3BucketEndpoin t == "" {
func New(auth aws.Auth, region aws.Region) *S3 {
+ if region.S3Endpoint == "" {
+ panic("The provided region has no S3 endpoint")
+ }
+ if region.
+ panic("The provided region has no S3 bucket endpoint")
+ }
return &S3{auth, region, 0}
}
Index: exp/sdb/sdb.go
=== modified file 'exp/sdb/sdb.go'
--- exp/sdb/sdb.go 2013-05-23 01:06:45 +0000
+++ exp/sdb/sdb.go 2014-05-09 10:30:42 +0000
@@ -42,6 +42,9 @@
// New creates a new SDB.
func New(auth aws.Auth, region aw...