Merge lp://staging/~mirtchovski/goamz/ec2 into lp://staging/~gophers/goamz/trunk

Proposed by andrey mirtchovski
Status: Needs review
Proposed branch: lp://staging/~mirtchovski/goamz/ec2
Merge into: lp://staging/~gophers/goamz/trunk
Diff against target: 525 lines (+376/-21)
7 files modified
ec2/ec2.go (+119/-18)
ec2/ec2_test.go (+38/-0)
ec2/ec2i_test.go (+69/-0)
ec2/ec2test/filter.go (+2/-2)
ec2/ec2test/server.go (+1/-1)
ec2/responses_test.go (+16/-0)
ec2/volume.go (+131/-0)
To merge this branch: bzr merge lp://staging/~mirtchovski/goamz/ec2
Reviewer Review Type Date Requested Status
The Go Language Gophers Pending
Review via email: mp+129325@code.staging.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
andrey mirtchovski (mirtchovski) wrote :

This change adds the 'Images' command allowing clients to examine their, as well as public, images available on AWS.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

This is looking great. We just need some testing.

Revision history for this message
andrey mirtchovski (mirtchovski) wrote :

> This is looking great. We just need some testing.

done. PTAL :)

Revision history for this message
andrey mirtchovski (mirtchovski) wrote :
Download full text (3.4 KiB)

Reviewers: mp+129325_code.launchpad.net,

Message:
Please take a look.

Description:

https://code.launchpad.net/~mirtchovski/goamz/ec2/+merge/129325

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/6745044/

Affected files:
   A [revision details]
   M ec2/ec2i_test.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: ec2/ec2i_test.go
=== modified file 'ec2/ec2i_test.go'
--- ec2/ec2i_test.go 2012-10-17 22:47:42 +0000
+++ ec2/ec2i_test.go 2012-10-18 19:44:38 +0000
@@ -203,3 +203,72 @@
    }
   }
  }
+
+// Cost: unknown
+func (s *ClientTests) TestImages(c *C) {
+ filter := ec2.NewFilter()
+ filter.Add("architecture", "i386")
+ filter.Add("image-type", "machine")
+ filter.Add("description", "http://bitnami.org")
+ filter.Add("is-public", "true")
+
+ id := []string{"ami-fd20ff94"}
+
+ resp1, err := s.ec2.Images(id, filter)
+ c.Assert(err, IsNil)
+
+ i0 := resp1.Images[0]
+ c.Check(i0.Id, Equals, "ami-fd20ff94")
+ c.Check(i0.Name,
Equals, "bitnami-webpack-1.0-0-linux-ubuntu-10.04.3-i386-mp-0b295d82-395d-4b81-89df-5ac5f0b66975-ami-3820fc51.1")
+ c.Check(i0.Description, Equals, "http://bitnami.org")
+ c.Check(i0.Type, Equals, "machine")
+ c.Check(i0.State, Equals, "available")
+ c.Check(i0.Location,
Equals, "aws-marketplace/bitnami-webpack-1.0-0-linux-ubuntu-10.04.3-i386-mp-0b295d82-395d-4b81-89df-5ac5f0b66975-ami-3820fc51.1")
+ c.Check(i0.Public, Equals, true)
+ c.Check(i0.Architecture, Equals, "i386")
+ c.Check(i0.Platform, Equals, "")
+ c.Check(i0.ProductCodes, HasLen, 0)
+ c.Check(i0.KernelId, Equals, "i386")
+ c.Check(i0.RamdiskId, Equals, "")
+ c.Check(i0.StateReason, Equals, "")
+ c.Check(i0.OwnerId, Equals, "679593333241")
+ c.Check(i0.OwnerAlias, Equals, "aws-marketplace")
+ c.Check(i0.RootDeviceType, Equals, "ebs")
+ c.Check(i0.RootDeviceName, Equals, "/dev/sda1")
+ c.Check(i0.VirtualizationType, Equals, "paravirtual")
+ c.Check(i0.Hypervisor, Equals, "xen")
+
+ c.Assert(i0.BlockDevices, HasLen, 1)
+ c.Assert(i0.BlockDevices[0].DeviceName, Equals, "/dev/sda1")
+ c.Assert(i0.BlockDevices[0].SnapshotId, Equals, "snap-5d581d27")
+ c.Assert(i0.BlockDevices[0].VolumeSize, Equals, int64(10))
+ c.Assert(i0.BlockDevices[0].DeleteOnTermination, Equals, true)
+ c.Assert(i0.BlockDevices[0].VolumeType, Equals, "")
+ c.Assert(i0.BlockDevices[0].IOPS, Equals, int64(0))
+}
+
+// Cost: unknown
+func (s *ClientTests) TestSnapshots(c *C) {
+ filter := ec2.NewFilter()
+ filter.Add("volume-id", "vol-37ac485e")
+ filter.Add("status", "completed")
+ filter.Add("start-time", "2008-11-19T10:03:00.000Z")
+
+ id := []string{"snap-9df717f4"}
+
+ resp, err := s.ec2.Snapshots(id, filter)
+ c.Assert(err, IsNil)
+ c.Check(resp.Snapshots, HasLen, 1)
+
+ s0 := resp.Snapshots[0]
+ c.Check(s0.Id, Equals, "snap-9df717f4")
+ c.Check(s0.VolumeId, Equals, "vol-37ac485e")
+ c.Check(s0.Status, Equals, "completed")
+ c.Check(s0.StartTime, Equals, "20...

Read more...

Revision history for this message
andrey mirtchovski (mirtchovski) wrote :

here's what my own command returns (pretty-printed). these public images
were the basis for the tests:

   // $ ./aws images -all architecture=i386
description="http://bitnami.org" image-type="machine"
   ec2.Image{
    ImageId:"ami-fd20ff94",

Location:"aws-marketplace/bitnami-webpack-1.0-0-linux-ubuntu-10.04.3-i386-mp-0b295d82-395d-4b81-89df-5ac5f0b66975-ami-3820fc51.1",

    State:"available",
    Owner:"679593333241",
    Public:true,
    Architecture:"i386",
    ImageType:"machine", ProductCodes:[]string(nil),
KernelId:"aki-805ea7e9", RamdiskId:"", Platform:"",
    StateReason:"",
    OwnerAlias:"aws-marketplace",

Name:"bitnami-webpack-1.0-0-linux-ubuntu-10.04.3-i386-mp-0b295d82-395d-4b81-89df-5ac5f0b66975-ami-3820fc51.1",

    Description:"http://bitnami.org",
    RootDeviceType:"ebs",
    RootDeviceName:"/dev/sda1",
    VirtualizationType:"paravirtual",
    Hypervisor:"xen",
    BlockDevices:[]ec2.BlockDeviceMapping{
     ec2.BlockDeviceMapping{
      DeviceName:"/dev/sda1",
      VirtualName:"",
      Ebs:ec2.EbsBlockDevice{
       SnapshotId:"snap-5d581d27",
       VolumeSize:10,
       DeleteOnTermination:true,
       VolumeType:"",
       Iops:0
      }
     }
    }
   }

   // $ ./aws snapshots snapshot-id=snap-9df717f4 status=completed
start-time=2008-11-19T10:03:00.000Z
   ec2.Snapshot{
    SnapshotId:"snap-9df717f4",
    VolumeId:"vol-37ac485e",
    Status:"completed",
    StartTime:"2008-11-19T10:03:00.000Z",
    Progress:"100%",
    OwnerId:"947081328633",
    VolumeSize:"2",
    Description:"1980 US Census (Linux)",
    OwnerAlias:"amazon",
    Tags:[]ec2.Tag(nil)
   }

https://codereview.appspot.com/6745044/

lp://staging/~mirtchovski/goamz/ec2 updated
22. By Dave Cheney

ec2: sort keys before encoding

Fixes issue #1061941.

R=niemeyer
CC=
https://codereview.appspot.com/6734043

23. By Francisco Souza

iam: add iamtest package

For now, it implements two actions: CreateUser and DeleteUser. More actions
will come in future CLs.

R=niemeyer
CC=
https://codereview.appspot.com/6631063

Revision history for this message
andrey mirtchovski (mirtchovski) wrote :
Revision history for this message
andrey mirtchovski (mirtchovski) wrote :

On 2012/11/08 19:17:30, aam wrote:
> Please take a look.

the new thing here is CreateImage and related tests. the rest are
gofmt-induced changes.

https://codereview.appspot.com/6745044/

Revision history for this message
andrey mirtchovski (mirtchovski) wrote :
lp://staging/~mirtchovski/goamz/ec2 updated
24. By Dave Cheney

aws: add ap-southeast-2 region

Welcome to Sydney.

R=TheMue, rog
CC=
https://codereview.appspot.com/6846050

25. By Dave Cheney

s3: add support for 409 responses

Required to fix LP 1042107

R=fwereade, jameinel, rog
CC=
https://codereview.appspot.com/6901061

26. By andrey mirtchovski

Volume management for ec2

27. By andrey mirtchovski

merge

Unmerged revisions

27. By andrey mirtchovski

merge

26. By andrey mirtchovski

Volume management for ec2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches