goamz

Differences between revisions 1 and 10 (spanning 9 versions)
Revision 1 as of 2011-01-31 22:58:39
Size: 2629
Editor: 189-10-154-68
Comment:
Revision 10 as of 2012-06-07 01:25:40
Size: 2990
Editor: 201-11-228-215
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 10: 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 12: 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 17: 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 22: Line 34:
    http://goneat.org/pkg/goamz   * http://godoc.labix.org/goamz
Line 26: Line 38:
Here is a simple example which connects to !ZooKeeper, waits for the session to
be established,
and attempts to create a node:
Here is a simple example which connects to AWS and creates an instance (make sure you shut it down afterwards):
Line 32: Line 43:
    "goamz"     "launchpad.net/goamz/aws"
    "launchpad.net/goamz/ec2"
Line 36: Line 48:
    auth, err := goamz.EnvAuth()     auth, err := aws.EnvAuth()
Line 40: Line 52:
    ec2 := goamz.NewEC2(auth, goamz.USEast)     e := ec2.New(auth, aws.USEast)
Line 42: Line 54:
    options := goamz.RunInstances{     options := ec2.RunInstances{
Line 46: Line 58:
    resp, err := ec2.RunInstances(&options)     resp, err := e.RunInstances(&options)
Line 62: Line 74:
To obtain the source code, use [[http://bazaar.canonical.com|Bazaar]] to download it from Launchpad: To obtain the source code, use [[http://bazaar.canonical.com|Bazaar]] to download projects from Launchpad:
Line 75: Line 87:
Use goinstall with the following command: Just use "go get" with any of the available packages. For example:
Line 77: Line 89:
$ gointall launchpad.net/goamz $ go get launchpad.net/goamz/ec2
$ go get launchpad.net/goamz/s3
Line 87: Line 100:
Then run gotest as usual: Then run go test as usual:
Line 89: Line 102:
$ gotest $ go test launchpad.net/goamz/...
Line 97: Line 110:
== Mailing list ==

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

    http://groups.google.com/group/goamz
Line 100: Line 119:

== Contact ==

This project is being developed under the [[https://launchpad.net/ensemble|Ensemble]] project at [[http://www.canonical.com|Canonical]].

To get in touch, send a message to the Ensemble mailing list at: <ensemble@lists.ubuntu.com>

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)