goamz

Differences between revisions 7 and 8
Revision 7 as of 2011-12-10 05:25:23
Size: 2753
Editor: 12
Comment:
Revision 8 as of 2012-03-09 17:31:02
Size: 2999
Editor: 201-66-216-213
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
the Go language with the [[https://launchpad.net/ensemble|Ensemble]] project. the Go language with the [[https://juju.ubuntu.com|juju]] project, but is now
a set of generally adopted and maintained Go packages that talk to several
Amazon Web Services.
Line 11: Line 13:
The API of AWS is very comprehensive, and goamz doesn't even scratch the
surface of it, focusing so far in a few operations to interact with the EC2
and S3 query APIs
. That said, it's fairly well tested, and is the foundation
The API of AWS is very comprehensive, though, and goamz doesn't even scratch
the surface of it. That said, it's fairly well tested, and is the foundation
Line 16: Line 17:

The following packages are available at the moment:

  * launchpad.net/goamz/aws
  * launchpad.net/goamz/ec2
  * launchpad.net/goamz/s3
  * launchpad.net/goamz/exp/mturk
  * launchpad.net/goamz/exp/sdb
  * launchpad.net/goamz/exp/sns

Packages under {{{exp/}}} are still in an experimental or unfinished/unpolished
state.
Line 21: Line 34:
  * http://goneat.org/lp/goamz/aws
  * http://goneat.org/lp/goamz/ec2
  * http://goneat.org/lp/goamz/s3
  * http://goneat.org/launchpad.net/goamz
Line 65: Line 76:
$ bzr branch lp:goamz/aws
$ bzr branch lp:goamz/ec2
$ bzr branch lp:goamz/s3
$ bzr branch lp:goamz
Line 78: Line 87:
Use goinstall with the following commands: Just use "go get" with any of the available packages. For example:
Line 80: Line 89:
$ goinstall launchpad.net/goamz/aws
$ goinstall
launchpad.net/goamz/ec2
$ goinstall launchpad.net/goamz/s3
$ go get launchpad.net/goamz/ec2
$ go get launchpad.net/goamz/s3
Line 92: Line 100:
Then run gotest as usual: Then run go test as usual:
Line 94: Line 102:
$ gotest $ go test launchpad.net/goamz/...

What is it?

The goamz package enables Go programs to interact with the Amazon Web Services.

It was developed within Canonical as part of an experiment related to using the Go language with the juju project, but is now a set of generally adopted and maintained Go packages that talk to several Amazon Web Services.

The API of AWS is very comprehensive, though, and goamz doesn't even scratch the surface of it. That said, it's fairly well tested, and is the foundation in which further calls can easily be integrated. We'll continue extending the API as necessary.

The following packages are available at the moment:

  • launchpad.net/goamz/aws
  • launchpad.net/goamz/ec2
  • launchpad.net/goamz/s3
  • launchpad.net/goamz/exp/mturk
  • launchpad.net/goamz/exp/sdb
  • launchpad.net/goamz/exp/sns

Packages under exp/ are still in an experimental or unfinished/unpolished state.

API documentation

The API documentation is currently available at:

Example

Here is a simple example which connects to AWS and creates an instance (make sure you shut it down afterwards):

package main

import (
    "launchpad.net/goamz/aws"
    "launchpad.net/goamz/ec2"
)

func main() {
    auth, err := aws.EnvAuth()
    if err != nil {
        panic(err.String())
    }
    e := ec2.New(auth, aws.USEast)

    options := ec2.RunInstances{
        ImageId:      "ami-ccf405a5", // Ubuntu Maverick, i386, EBS store
        InstanceType: "t1.micro",
    }
    resp, err := e.RunInstances(&options)
    if err != nil {
        panic(err.String())
    }

    for _, instance := range resp.Instances {
        println("Now running", instance.InstanceId)
    }
    println("Make sure you terminate instances to stop the cash flow.")
}

This example will generate the following output:

Source code

To obtain the source code, use Bazaar to download projects from Launchpad:

$ bzr branch lp:goamz

Reporting bugs

Please report bugs at:

How to build and install goamz

Just use "go get" with any of the available packages. For example:

$ go get launchpad.net/goamz/ec2
$ go get launchpad.net/goamz/s3

Running tests

To run tests, first install gocheck with:

$ goinstall launchpad.net/gocheck

Then run go test as usual:

$ go test launchpad.net/goamz/...

If you want to run integration tests (costs money), set up the EC2 environment variables as usual, and run:

$ gotest -i

Mailing list

To talk about usage and development of goamz, please join the mailing list:

License

goamz is licensed under the LGPL.

goamz (last edited 2015-01-09 12:05:39 by 176-12-31-220)