Skip to content

Instantly share code, notes, and snippets.

@flavianmissi
Created July 9, 2012 21:50
Show Gist options
  • Select an option

  • Save flavianmissi/3079224 to your computer and use it in GitHub Desktop.

Select an option

Save flavianmissi/3079224 to your computer and use it in GitHub Desktop.
Testing goamz against openstack
package main
import (
"fmt"
"launchpad.net/goamz/aws"
"launchpad.net/goamz/ec2"
)
var auth aws.Auth
var region aws.Region
func main() {
auth := aws.Auth{AccessKey: "filtered", SecretKey: "alsofiltered"}
region := aws.Region{EC2Endpoint: "http://openstack-host.com:8773/services/Cloud"}
conn := ec2.New(auth, region)
opts := ec2.RunInstances{
ImageId: "ami-00000021",
InstanceType: "t1.small",
}
resp, err := conn.RunInstances(&opts)
if err != nil {
panic(err)
}
fmt.Println(resp.Instances)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment