~surma/goamz/put-headers

« back to all changes in this revision

Viewing changes to ec2/ec2.go

  • Committer: Gustavo Niemeyer
  • Date: 2013-10-04 17:12:46 UTC
  • mfrom: (37.1.2 run-with-devices)
  • Revision ID: gustavo@niemeyer.net-20131004171246-efk7aix6irtazp2m
ec2: support RunInstances with BlockDeviceMappings

R=dfc, nate.finch
CC=
https://codereview.appspot.com/9860044

Show diffs side-by-side

added added

removed removed

Lines of Context:
209
209
        DisableAPITermination bool
210
210
        ShutdownBehavior      string
211
211
        PrivateIPAddress      string
 
212
        BlockDeviceMappings   []BlockDeviceMapping
212
213
}
213
214
 
214
215
// Response to a RunInstances request.
278
279
                        j++
279
280
                }
280
281
        }
 
282
        for i, b := range options.BlockDeviceMappings {
 
283
                n := strconv.Itoa(i + 1)
 
284
                if b.DeviceName != "" {
 
285
                        params["BlockDeviceMapping."+n+".DeviceName"] = b.DeviceName
 
286
                }
 
287
                if b.VirtualName != "" {
 
288
                        params["BlockDeviceMapping."+n+".VirtualName"] = b.VirtualName
 
289
                }
 
290
                if b.SnapshotId != "" {
 
291
                        params["BlockDeviceMapping."+n+".Ebs.SnapshotId"] = b.SnapshotId
 
292
                }
 
293
                if b.VolumeType != "" {
 
294
                        params["BlockDeviceMapping."+n+".Ebs.VolumeType"] = b.VolumeType
 
295
                }
 
296
                if b.VolumeSize > 0 {
 
297
                        params["BlockDeviceMapping."+n+".Ebs.VolumeSize"] = strconv.FormatInt(b.VolumeSize, 10)
 
298
                }
 
299
                if b.IOPS > 0 {
 
300
                        params["BlockDeviceMapping."+n+".Ebs.Iops"] = strconv.FormatInt(b.IOPS, 10)
 
301
                }
 
302
                if b.DeleteOnTermination {
 
303
                        params["BlockDeviceMapping."+n+".Ebs.DeleteOnTermination"] = "true"
 
304
                }
 
305
        }
281
306
        token, err := clientToken()
282
307
        if err != nil {
283
308
                return nil, err
432
457
        VirtualName         string `xml:"virtualName"`
433
458
        SnapshotId          string `xml:"ebs>snapshotId"`
434
459
        VolumeType          string `xml:"ebs>volumeType"`
435
 
        VolumeSize          int64  `xml:"ebs>volumeSize"`
 
460
        VolumeSize          int64  `xml:"ebs>volumeSize"` // Size is given in GB
436
461
        DeleteOnTermination bool   `xml:"ebs>deleteOnTermination"`
437
462
 
438
463
        // The number of I/O operations per second (IOPS) that the volume supports.