Permalink
...
Checking mergeability…
Don’t worry, you can still create the pull request.
Comparing changes
Open a pull request
3
contributors
Unified
Split
Showing
with
1,444 additions
and 465 deletions.
- +20 −0 .travis.yml
- +24 −0 AUTHORS.md
- +100 −0 CONTRIBUTING.md
- +36 −4 README.md
- +1 −1 aws/attempt_test.go
- +1 −1 aws/aws_test.go
- +78 −0 ec2/blockdevicemappings_test.go
- +70 −64 ec2/ec2.go
- +12 −10 ec2/ec2_test.go
- +12 −7 ec2/ec2i_test.go
- +154 −104 ec2/ec2t_test.go
- +375 −91 ec2/ec2test/server.go
- +5 −2 ec2/export_test.go
- +5 −5 ec2/networkinterfaces.go
- +273 −54 ec2/networkinterfaces_test.go
- +2 −2 ec2/privateips.go
- +2 −2 ec2/privateips_test.go
- +69 −50 ec2/responses_test.go
- +25 −3 ec2/subnets.go
- +35 −10 ec2/subnets_test.go
- +3 −3 ec2/vpc.go
- +2 −2 ec2/vpc_test.go
- +1 −1 exp/mturk/export_test.go
- +1 −1 exp/mturk/mturk.go
- +3 −3 exp/mturk/mturk_test.go
- +1 −1 exp/mturk/sign.go
- +2 −2 exp/mturk/sign_test.go
- +1 −1 exp/sdb/export_test.go
- +1 −1 exp/sdb/sdb.go
- +3 −3 exp/sdb/sdb_test.go
- +1 −1 exp/sdb/sign.go
- +2 −2 exp/sdb/sign_test.go
- +1 −1 exp/sns/sign.go
- +1 −1 exp/sns/sns.go
- +3 −3 exp/sns/sns_test.go
- +6 −1 iam/iam.go
- +8 −3 iam/iam_test.go
- +8 −3 iam/iami_test.go
- +8 −3 iam/iamt_test.go
- +6 −1 iam/iamtest/server.go
- +5 −0 iam/responses_test.go
- +6 −1 iam/sign.go
- +6 −1 s3/export_test.go
- +5 −0 s3/multi.go
- +6 −1 s3/multi_test.go
- +5 −0 s3/responses_test.go
- +1 −1 s3/s3.go
- +8 −3 s3/s3_test.go
- +8 −3 s3/s3i_test.go
- +8 −3 s3/s3t_test.go
- +1 −1 s3/s3test/server.go
- +6 −1 s3/sign.go
- +7 −2 s3/sign_test.go
- +5 −0 testutil/http.go
- +6 −1 testutil/suite.go
View
20
.travis.yml
| @@ -0,0 +1,20 @@ | ||
| +sudo: false | ||
| +language: go | ||
| + | ||
| +go: | ||
| + - 1.2 | ||
| + - 1.4 | ||
| + | ||
| +install: | ||
| + - go get gopkg.in/check.v1 | ||
| + | ||
| +before_script: | ||
| + - export DEFAULT_TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR | ||
| + - export TRAVIS_BUILD_DIR=$HOME/gopath/src/gopkg.in/amz.v2 | ||
| + - mkdir -p $TRAVIS_BUILD_DIR | ||
| + - mv -vfT $DEFAULT_TRAVIS_BUILD_DIR $TRAVIS_BUILD_DIR | ||
| + | ||
| +script: | ||
| + - go build ./... | ||
| + - go test -v ./... | ||
| + - FIXED=$(go fmt ./... | wc -l); if [ $FIXED -gt 0 ]; then echo "gofmt - $FIXED file(s) not formatted correctly, please run gofmt to fix this." && exit 1; fi |
View
24
AUTHORS.md
| @@ -0,0 +1,24 @@ | ||
| +goamz Authors | ||
| +============= | ||
| + | ||
| +This file contains a list of people who contributed relevant code to the project. | ||
| + | ||
| +Anyone with knowledge of Amazon Web Services API who wants to get | ||
| +involved in the project maintenance, code reviews, issues triage, and | ||
| +helping goamz users and community members in general, please consider | ||
| +contacting one of the project's [maintainers](https://github.com/orgs/go-amz/people) and request to become one. Check [CONTRIBUTING.md](CONTRIBUTING.md) for details. | ||
| + | ||
| +Please, keep the list sorted. | ||
| + | ||
| +Full name | E-mail | GitHub account | ||
| +----------|--------|--------------- | ||
| +Andrew Wilkins | andrew.wilkins {at} canonical.com | [@axw](http://github.com/axw) | ||
| +Dave Cheney | dave.cheney {at} canonical.com | [@davecheney](http://github.com/davecheney) | ||
| +Dimiter Naydenov | dimiter.naydenov {at} canonical.com | [@dimitern](http://github.com/dimitern) | ||
| +Francisco Souza | f {at} souza.cc | [@fsouza](https://github.com/fsouza) | ||
| +Gustavo Niemeyer | gustavo.niemeyer {at} canonical.com | [@niemeyer](http://github.com/niemeyer) (project founder) | ||
| +Ian Booth | ian.booth {at} canonical.com | [@wallyworld](http://github.com/wallyworld) | ||
| +Katherine Cox-Buday | katherine.cox-buday {at} canonical.com | [@katco-](http://github.com/katco-) | ||
| +Martin Packman | martin.packman {at} canonical.com | [@bz2](http://github.com/bz2) | ||
| +Nathan Youngman | git {at} nathany.com | [@nathany](https://github.com/nathany) | ||
| +Roger Peppe | roger.peppe {at} canonical.com | [@rogpeppe](http://github.com/rogpeppe) |
View
100
CONTRIBUTING.md
| @@ -0,0 +1,100 @@ | ||
| +Contributing to goamz | ||
| +===================== | ||
| + | ||
| +We encourage everyone who is familiar with the [Amazon Web Services | ||
| +API](http://aws.amazon.com/documentation/) and is willing to support | ||
| +and improve the project to become a contributor. Current list of | ||
| +official maintainers can be found on the [go-amz People](https://github.com/orgs/go-amz/people) list. Current and past contributors list is in the [AUTHORS.md](AUTHORS.md) file. | ||
| + | ||
| +This file contains instructions and guidelines for contributors. | ||
| + | ||
| +Code of conduct | ||
| +--------------- | ||
| + | ||
| +We are committed to providing a friendly, safe and welcoming environment | ||
| +for all users and community members. Please, review the [Ubuntu Code of Conduct](https://launchpad.net/codeofconduct/1.1), | ||
| +which covers the most important aspects we expect from contributors: | ||
| + | ||
| + * Be considerate - treat others nicely, everybody can provide valuable contributions. | ||
| + * Be respectful of others, even if you don't agree with them. Keep an open mind. | ||
| + * Be collaborative - this is essential in an open source community. | ||
| + * When we disagree, we consult others - it's important to solve disagreements constructively. | ||
| + * When unsure, ask for help. | ||
| + * Step down considerately - if you need to leave the project, minimize disruption. | ||
| + | ||
| +Ways to contribute | ||
| +------------------ | ||
| + | ||
| +There are several ways to contribute to the project: | ||
| + | ||
| + * Join the [goamz Google Group](https://groups.google.com/forum/#!forum/goamz) to ask questions and get help. | ||
| + * Report [issues](https://github.com/go-amz/amz/issues/new) you might have. | ||
| + * Please, make sure there is no existing [known issue](https://github.com/go-amz/amz/issues) when reporting a new one. | ||
| + * Propose a patch or a bug fix by opening a [pull request](https://help.github.com/articles/creating-a-pull-request/). Check GitHub help on [how to collaborate](https://help.github.com/categories/collaborating/). | ||
| + * Give feedback for [known issues](https://github.com/go-amz/amz/issues/) or proposed [pull requests](https://github.com/go-amz/amz/pulls). | ||
| + | ||
| +For some of those things you will need a [GitHub account](https://github.com/signup/free), if you don't have one. | ||
| + | ||
| +Contributing a patch | ||
| +-------------------- | ||
| + | ||
| +Found a bug or want to suggest an improvement? | ||
| +Great! Here are the steps anyone can follow to propose a bug fix or patch. | ||
| + | ||
| + * [Fork](https://help.github.com/articles/fork-a-repo/) the go-amz/amz repository. | ||
| + * If you think you found a bug, please check the existing [issues](https://github.com/go-amz/amz/issues) to see if it's a known problem. | ||
| + * Otherwise, [open a new issue](https://github.com/go-amz/amz/issues/new) for it. | ||
| + * Clone your forked repository locally: | ||
| +``` | ||
| +$ git clone https://github.com/<your-github-username>/amz | ||
| +``` | ||
| + * For the unit tests, you will need [gocheck](https://github.com/go-check/check): | ||
| +``` | ||
| +$ go get gopkg.in/check.v1 | ||
| +``` | ||
| + * Create a feature branch for your contribution. Make your changes there. | ||
| + * It's recommended to try keeping your changes as small as possible. | ||
| + * Split bigger changes in several pull request to make the code review easier. | ||
| + * Be sure to write tests for your code changes and run them before proposing: | ||
| +``` | ||
| +$ go test -gocheck.v | ||
| +``` | ||
| + * Push your feature branch to your fork. | ||
| + * Open a pull request with a description of your change. | ||
| + * A maintainer should notice your pull request and do a code review. You can also ask a [maintainer](https://github.com/orgs/go-amz/people) for review. | ||
| + * Reply to comments, fix issues, push your changes. | ||
| + * Depending on the size of the patch, this process can be repeated a few times. | ||
| + * Once you get an approval and the CI tests pass, ask a maintainer to merge your patch. | ||
| + | ||
| +Becoming an official maintainer | ||
| +------------------------------- | ||
| + | ||
| +Thanks for considering becoming a maintainer of goamz! It's not | ||
| +required to be a maintainer to contribute, but if you find yourself | ||
| +frequently proposing patches and can dedicate some of your time to | ||
| +help, please consider following the following procedure. | ||
| + | ||
| + * You need a [GitHub account](https://github.com/signup/free) if you don't have one. | ||
| + * Review and sign the Canonical [Contributor License Agreement](http://www.ubuntu.com/legal/contributors/). | ||
| + * For any questions about the CLA, you might find the [CLA FAQ](http://www.ubuntu.com/legal/contributors/licence-agreement-faq) page useful. | ||
| + * Request to become a maintainer by contacting the [existing maintainers](https://github.com/orgs/go-amz/people). | ||
| + * You're welcome to add your name to the [AUTHORS.md](AUTHORS.md) list once approved. | ||
| + | ||
| +General guidelines | ||
| +------------------ | ||
| + | ||
| +The following list is not exhaustive or in any particular order. It | ||
| +providers things to keep in mind when contributing to goamz. Be | ||
| +reasonable and considerate and please ask for help, if something is | ||
| +not clear. | ||
| + | ||
| + * Commit early, commit often. | ||
| + * Use `git rebase` before proposing your changes to squash minor commits. Let's keep the commit log cleaner. | ||
| + * **Do not** rebase commits you already pushed, even when in your own fork. Others might depend on them. | ||
| + * Write new tests and update existing ones when changing the code. All changes should have tests, when possible. | ||
| + * Use `go fmt` to format your code before pushing. | ||
| + * Document exported types, functions, constants, variables, etc. | ||
| + * See the excellent [Effective Go](http://golang.org/doc/effective_go.html) style guide, which we use. | ||
| + * When reporting issues, provide the necessary information to reproduce the issue. | ||
| + | ||
| +Thanks for your interest in goamz! |
View
40
README.md
| @@ -3,20 +3,25 @@ goamz | ||
| Go package to interact with Amazon Web Services | ||
| +[](https://travis-ci.org/go-amz/amz) | ||
| +[](http://godoc.org/gopkg.in/amz.v2) | ||
| + | ||
| +**NOTE**: This is a stable branch, which is NOT compatible with the original goamz source from [Launchpad](https://launchpad.net/goamz/trunk). If you want the same features as in the original source, except for the changed import paths, use the `v1` branch. | ||
| + | ||
| Instructions | ||
| ------------ | ||
| Install the package with: | ||
| - go get gopkg.in/amz.v1/... | ||
| + go get gopkg.in/amz.v2/... | ||
| Import it with: | ||
| - import "gopkg.in/amz.v1/<package>" | ||
| + import "gopkg.in/amz.v2/<package>" | ||
| Example: | ||
| - import "gopkg.in/amz.v1/ec2" | ||
| + import "gopkg.in/amz.v2/ec2" | ||
| and use _ec2_ as the package name inside the code. | ||
| The same applies to the other sub-packages: _aws_, _s3_, etc. | ||
| @@ -27,4 +32,31 @@ For more details, visit the project page: | ||
| and the API documentation: | ||
| -* https://gopkg.in/amz.v1 | ||
| +* https://gopkg.in/amz.v2 | ||
| + | ||
| +Users Group | ||
| +----------- | ||
| + | ||
| +In addition to contacting directly one of the [maintainers](https://github.com/orgs/go-amz/people), users are encouraged to discuss goamz topics on the project's [Google Group](https://groups.google.com/forum/#!forum/goamz). | ||
| + | ||
| +Issues | ||
| +------ | ||
| + | ||
| +Please report bugs by opening an [issue](https://github.com/go-amz/amz/issues). | ||
| + | ||
| +Contributing | ||
| +------------ | ||
| + | ||
| +Contributors are most welcome! | ||
| +Please have a look at [CONTRIBUTING.md](CONTRIBUTING.md) for details. | ||
| + | ||
| +Authors | ||
| +------- | ||
| + | ||
| +List of people who made relevant contributions to goamz can be found in [AUTHORS.md](AUTHORS.md). | ||
| + | ||
| +License | ||
| +------- | ||
| + | ||
| +goamz is licensed under LGPLv3, but includes an exception that allows | ||
| +linking code statically. See the [LICENSE](LICENSE) for details. | ||
View
2
aws/attempt_test.go
| @@ -5,7 +5,7 @@ import ( | ||
| . "gopkg.in/check.v1" | ||
| - "gopkg.in/amz.v1/aws" | ||
| + "gopkg.in/amz.v2/aws" | ||
| ) | ||
| func (S) TestAttemptTiming(c *C) { | ||
View
2
aws/aws_test.go
| @@ -7,7 +7,7 @@ import ( | ||
| . "gopkg.in/check.v1" | ||
| - "gopkg.in/amz.v1/aws" | ||
| + "gopkg.in/amz.v2/aws" | ||
| ) | ||
| func Test(t *testing.T) { | ||
View
78
ec2/blockdevicemappings_test.go
| @@ -0,0 +1,78 @@ | ||
| +// | ||
| +// goamz - Go packages to interact with the Amazon Web Services. | ||
| +// | ||
| +// https://wiki.ubuntu.com/goamz | ||
| +// | ||
| +// Copyright (c) 2015 Canonical Ltd. | ||
| +// | ||
| + | ||
| +package ec2_test | ||
| + | ||
| +import ( | ||
| + "time" | ||
| + | ||
| + . "gopkg.in/check.v1" | ||
| + | ||
| + "gopkg.in/amz.v2/aws" | ||
| + "gopkg.in/amz.v2/ec2" | ||
| +) | ||
| + | ||
| +// Block device mapping tests run against either a local test server or | ||
| +// live on EC2. | ||
| + | ||
| +func (s *ServerTests) TestBlockDeviceMappings(c *C) { | ||
| + blockDeviceMappings := []ec2.BlockDeviceMapping{{ | ||
| + DeviceName: "/dev/sda1", | ||
| + VolumeSize: 8, | ||
| + DeleteOnTermination: true, | ||
| + }, { | ||
| + VirtualName: "ephemeral0", | ||
| + DeviceName: "/dev/sdb", | ||
| + }} | ||
| + | ||
| + instList, err := s.ec2.RunInstances(&ec2.RunInstances{ | ||
| + ImageId: imageId, | ||
| + InstanceType: "t1.micro", | ||
| + BlockDeviceMappings: blockDeviceMappings, | ||
| + }) | ||
| + c.Assert(err, IsNil) | ||
| + inst := instList.Instances[0] | ||
| + c.Assert(inst, NotNil) | ||
| + instId := inst.InstanceId | ||
| + defer terminateInstances(c, s.ec2, []string{instId}) | ||
| + | ||
| + // Block device mappings are not (typically?) included in the initial | ||
| + // RunInstanceResp, so we must periodically DescribeInstances. | ||
| + testAttempt := aws.AttemptStrategy{ | ||
| + Total: 5 * time.Minute, | ||
| + Delay: 5 * time.Second, | ||
| + } | ||
| + var list *ec2.InstancesResp | ||
| + done := false | ||
| + for a := testAttempt.Start(); !done && a.Next(); { | ||
| + c.Logf("waiting for block device mappings to be processed") | ||
| + list, err = s.ec2.Instances([]string{instId}, nil) | ||
| + if err != nil { | ||
| + c.Fatalf("Instances returned: %v", err) | ||
| + return | ||
| + } | ||
| + inst = list.Reservations[0].Instances[0] | ||
| + if len(inst.BlockDeviceMappings) == 0 { | ||
| + c.Logf("BlockDeviceMappings is empty, retrying") | ||
| + continue | ||
| + } | ||
| + done = true | ||
| + } | ||
| + if !done { | ||
| + c.Fatalf("timeout while waiting for block device mappings") | ||
| + } | ||
| + | ||
| + // There should be one item for /dev/sda1; ephemeral devices | ||
| + // should not show up. | ||
| + c.Assert(inst.BlockDeviceMappings, HasLen, 1) | ||
| + c.Assert(inst.BlockDeviceMappings[0].DeviceName, Equals, "/dev/sda1") | ||
| + c.Assert(inst.BlockDeviceMappings[0].DeleteOnTermination, Equals, true) | ||
| + c.Assert(inst.BlockDeviceMappings[0].AttachTime, Not(Equals), "") | ||
| + c.Assert(inst.BlockDeviceMappings[0].Status, Not(Equals), "") | ||
| + c.Assert(inst.BlockDeviceMappings[0].VolumeId, Not(Equals), "") | ||
| +} |
Oops, something went wrong.