File: disable-cloudwatch.patch

package info (click to toggle)
golang-github-docker-goamz 0.0~git20160206.0.f0a21f5-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,580 kB
  • sloc: makefile: 66
file content (726 lines) | stat: -rw-r--r-- 22,624 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
Index: golang-github-docker-goamz/cloudwatch/ChangeLog
===================================================================
--- golang-github-docker-goamz.orig/cloudwatch/ChangeLog
+++ /dev/null
@@ -1,7 +0,0 @@
-2013-10-21 Carlos Salguero <cfsalguero@gmail.com>
-
-* Removed Namespace from the constructor as not all AWS API method needs it 
-  and methods like ListMetrics you could need to call the method without a
-  Namespace to list all available metrics
-
-* Added ListMetrics method
Index: golang-github-docker-goamz/cloudwatch/README.md
===================================================================
--- golang-github-docker-goamz.orig/cloudwatch/README.md
+++ /dev/null
@@ -1,104 +0,0 @@
-#GoLang AWS Cloudwatch
-
-## Installation
-Please refer to the project's main page at [https://github.com/docker/goamz](https://github.com/docker/goamz) for instructions about how to install.
-
-## Available methods
-
-<table>
- <tr>
-  <td>GetMetricStatistics</td>
-  <td>Gets statistics for the specified metric.</td>
- </tr>
- <tr>
-  <td>ListMetrics</td>
-  <td>Returns a list of valid metrics stored for the AWS account.</td>
- </tr>
- <tr>
-  <td>PutMetricData</td>
-  <td>Publishes metric data points to Amazon CloudWatch.</td>
- </tr>
- </table>
-
-[Please refer to AWS Cloudwatch's documentation for more info](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Operations.html)
-
-##Examples
-####Get Metric Statistics
-
-```go
-import (
-    "fmt"
-    "time"
-    "os"
-    "github.com/docker/goamz/aws"
-    "github.com/docker/goamz/cloudwatch"
-)
-
-func test_get_metric_statistics() {
-    region := aws.Regions["a_region"]
-    namespace:= "AWS/ELB"
-    dimension  := &cloudwatch.Dimension{
-                                         Name: "LoadBalancerName", 
-                                         Value: "your_value",
-                                       }
-    metricName := "RequestCount"
-    now := time.Now()
-    prev := now.Add(time.Duration(600)*time.Second*-1) // 600 secs = 10 minutes
-
-    auth, err := aws.GetAuth("your_AccessKeyId", "your_SecretAccessKey", "", now)
-    if err != nil {
-       fmt.Printf("Error: %+v\n", err)
-       os.Exit(1)
-    }
-
-    cw, err := cloudwatch.NewCloudWatch(auth, region.CloudWatchServicepoint)
-    request := &cloudwatch.GetMetricStatisticsRequest {
-                Dimensions: []cloudwatch.Dimension{*dimension},
-                EndTime: now,
-                StartTime: prev,
-                MetricName: metricName,
-                Unit: cloudwatch.UnitCount, // Not mandatory
-                Period: 60,
-                Statistics: []string{cloudwatch.StatisticDatapointSum},
-                Namespace: namespace,
-            }
-
-    response, err := cw.GetMetricStatistics(request)
-    if err == nil {
-        fmt.Printf("%+v\n", response)
-    } else {
-        fmt.Printf("Error: %+v\n", err)
-    }
-}
-```
-####List Metrics
-
-```go
-import (
-    "fmt"
-    "time"
-    "os"
-    "github.com/docker/goamz/aws"
-    "github.com/docker/goamz/cloudwatch"
-)
-
-func test_list_metrics() {
-    region := aws.Regions["us-east-1"]  // Any region here
-    now := time.Now()
-
-    auth, err := aws.GetAuth("an AccessKeyId", "a SecretAccessKey", "", now)
-    if err != nil {
-       fmt.Printf("Error: %+v\n", err)
-       os.Exit(1)
-    }
-    cw, err := cloudwatch.NewCloudWatch(auth, region.CloudWatchServicepoint)
-    request := &cloudwatch.ListMetricsRequest{Namespace: "AWS/EC2"}
-
-    response, err := cw.ListMetrics(request)
-    if err == nil {
-        fmt.Printf("%+v\n", response)
-    } else {
-        fmt.Printf("Error: %+v\n", err)
-    }
-}
-```
\ No newline at end of file
Index: golang-github-docker-goamz/cloudwatch/cloudwatch.go
===================================================================
--- golang-github-docker-goamz.orig/cloudwatch/cloudwatch.go
+++ /dev/null
@@ -1,461 +0,0 @@
-/***** BEGIN LICENSE BLOCK *****
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this file,
-# You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# The Initial Developer of the Original Code is the Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2012
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Ben Bangert (bbangert@mozilla.com)
-#
-# ***** END LICENSE BLOCK *****/
-
-package cloudwatch
-
-import (
-	"encoding/xml"
-	"errors"
-	"fmt"
-	"github.com/docker/goamz/aws"
-	"github.com/feyeleanor/sets"
-	"strconv"
-	"time"
-)
-
-// The CloudWatch type encapsulates all the CloudWatch operations in a region.
-type CloudWatch struct {
-	Service aws.AWSService
-}
-
-type Dimension struct {
-	Name  string
-	Value string
-}
-
-type StatisticSet struct {
-	Maximum     float64
-	Minimum     float64
-	SampleCount float64
-	Sum         float64
-}
-
-type MetricDatum struct {
-	Dimensions      []Dimension
-	MetricName      string
-	StatisticValues *StatisticSet
-	Timestamp       time.Time
-	Unit            string
-	Value           float64
-}
-
-type Datapoint struct {
-	Average     float64
-	Maximum     float64
-	Minimum     float64
-	SampleCount float64
-	Sum         float64
-	Timestamp   time.Time
-	Unit        string
-}
-
-type GetMetricStatisticsRequest struct {
-	Dimensions []Dimension
-	EndTime    time.Time
-	StartTime  time.Time
-	MetricName string
-	Unit       string
-	Period     int
-	Statistics []string
-	Namespace  string
-}
-
-type GetMetricStatisticsResult struct {
-	Datapoints []Datapoint `xml:"Datapoints>member"`
-	NextToken  string      `xml:"NextToken"`
-}
-
-type GetMetricStatisticsResponse struct {
-	GetMetricStatisticsResult GetMetricStatisticsResult
-	ResponseMetadata          aws.ResponseMetadata
-}
-
-type Metric struct {
-	Dimensions []Dimension `xml:"Dimensions>member"`
-	MetricName string
-	Namespace  string
-}
-
-type ListMetricsResult struct {
-	Metrics   []Metric `xml:"Metrics>member"`
-	NextToken string
-}
-
-type ListMetricsResponse struct {
-	ListMetricsResult ListMetricsResult
-	ResponseMetadata  aws.ResponseMetadata
-}
-
-type ListMetricsRequest struct {
-	Dimensions []Dimension
-	MetricName string
-	Namespace  string
-	NextToken  string
-}
-
-type AlarmAction struct {
-	ARN string
-}
-
-type MetricAlarm struct {
-	AlarmActions            []AlarmAction
-	AlarmDescription        string
-	AlarmName               string
-	ComparisonOperator      string
-	Dimensions              []Dimension
-	EvaluationPeriods       int
-	InsufficientDataActions []AlarmAction
-	MetricName              string
-	Namespace               string
-	OKActions               []AlarmAction
-	Period                  int
-	Statistic               string
-	Threshold               float64
-	Unit                    string
-}
-
-var attempts = aws.AttemptStrategy{
-	Min:   5,
-	Total: 5 * time.Second,
-	Delay: 200 * time.Millisecond,
-}
-
-const (
-	UnitSeconds            string = "Seconds"
-	UnitMicroseconds       string = "Microseconds"
-	UnitMilliseconds       string = "Milliseconds"
-	UnitBytes              string = "Bytes"
-	UnitKilobytes          string = "Kilobytes"
-	UnitMegabytes          string = "Megabytes"
-	UnitGigabytes          string = "Gigabytes"
-	UnitTerabytes          string = "Terabytes"
-	UnitBits               string = "Bits"
-	UnitKilobits           string = "Kilobits"
-	UnitMegabits           string = "Megabits"
-	UnitGigabits           string = "Gigabits"
-	UnitTerabits           string = "Terabits"
-	UnitPercent            string = "Percent"
-	UnitCount              string = "Count"
-	UnitBytesPerSecond     string = "Bytes/Second"
-	UnitKilobytesPerSecond string = "Kilobytes/Second"
-	UnitMegabytesPerSecond string = "Megabytes/Second"
-	UnitGigabytesPerSecond string = "Gigabytes/Second"
-	UnitTerabytesPerSecond string = "Terabytes/Second"
-	UnitBitsPerSecond      string = "Bits/Second"
-	UnitKilobitsPerSecond  string = "Kilobits/Second"
-	UnitMegabitsPerSecond  string = "Megabits/Second"
-	UnitGigabitsPerSecond  string = "Gigabits/Second"
-	UnitTerabitsPerSecond  string = "Terabits/Second"
-	UnitCountPerSecond     string = "Count/Second"
-	UnitNone               string = "None"
-)
-
-var validUnits = sets.SSet(
-	UnitSeconds,
-	UnitMicroseconds,
-	UnitMilliseconds,
-	UnitBytes,
-	UnitKilobytes,
-	UnitMegabytes,
-	UnitGigabytes,
-	UnitTerabytes,
-	UnitBits,
-	UnitKilobits,
-	UnitMegabits,
-	UnitGigabits,
-	UnitTerabits,
-	UnitPercent,
-	UnitCount,
-	UnitBytesPerSecond,
-	UnitKilobytesPerSecond,
-	UnitMegabytesPerSecond,
-	UnitGigabytesPerSecond,
-	UnitTerabytesPerSecond,
-	UnitBitsPerSecond,
-	UnitKilobitsPerSecond,
-	UnitMegabitsPerSecond,
-	UnitGigabitsPerSecond,
-	UnitTerabitsPerSecond,
-	UnitCountPerSecond,
-	UnitNone,
-)
-
-const (
-	StatisticDatapointAverage     string = "Average"
-	StatisticDatapointSum         string = "Sum"
-	StatisticDatapointSampleCount string = "SampleCount"
-	StatisticDatapointMaximum     string = "Maximum"
-	StatisticDatapointMinimum     string = "Minimum"
-)
-
-var validMetricStatistics = sets.SSet(
-	StatisticDatapointAverage,
-	StatisticDatapointSum,
-	StatisticDatapointSampleCount,
-	StatisticDatapointMaximum,
-	StatisticDatapointMinimum,
-)
-
-const (
-	ComparisonOperatorLessThanThreshold             string = "LessThanThreshold"
-	ComparisonOperatorLessThanOrEqualToThreshold    string = "LessThanOrEqualToThreshold"
-	ComparisonOperatorGreaterThanThreshold          string = "GreaterThanThreshold"
-	ComparisonOperatorGreaterThanOrEqualToThreshold string = "GreaterThanOrEqualToThreshold"
-)
-
-var validComparisonOperators = sets.SSet(
-	ComparisonOperatorLessThanThreshold,
-	ComparisonOperatorLessThanOrEqualToThreshold,
-	ComparisonOperatorGreaterThanThreshold,
-	ComparisonOperatorGreaterThanOrEqualToThreshold,
-)
-
-const (
-	MetricNameCPUUtilization = "CPUUtilization"
-)
-
-// Create a new CloudWatch object for a given namespace
-func NewCloudWatch(auth aws.Auth, region aws.ServiceInfo) (*CloudWatch, error) {
-	service, err := aws.NewService(auth, region)
-	if err != nil {
-		return nil, err
-	}
-	return &CloudWatch{
-		Service: service,
-	}, nil
-}
-
-func (c *CloudWatch) query(method, path string, params map[string]string, resp interface{}) error {
-	// Add basic Cloudwatch param
-	params["Version"] = "2010-08-01"
-
-	r, err := c.Service.Query(method, path, params)
-	if err != nil {
-		return err
-	}
-	defer r.Body.Close()
-
-	if r.StatusCode != 200 {
-		return c.Service.BuildError(r)
-	}
-	err = xml.NewDecoder(r.Body).Decode(resp)
-	return err
-}
-
-// Get statistics for specified metric
-//
-// If the arguments are invalid or the server returns an error, the error will
-// be set and the other values undefined.
-func (c *CloudWatch) GetMetricStatistics(req *GetMetricStatisticsRequest) (result *GetMetricStatisticsResponse, err error) {
-	statisticsSet := sets.SSet(req.Statistics...)
-	// Kick out argument errors
-	switch {
-	case req.EndTime.IsZero():
-		err = errors.New("No endTime specified")
-	case req.StartTime.IsZero():
-		err = errors.New("No startTime specified")
-	case req.MetricName == "":
-		err = errors.New("No metricName specified")
-	case req.Namespace == "":
-		err = errors.New("No Namespace specified")
-	case req.Period < 60 || req.Period%60 != 0:
-		err = errors.New("Period not 60 seconds or a multiple of 60 seconds")
-	case len(req.Statistics) < 1:
-		err = errors.New("No statistics supplied")
-	case validMetricStatistics.Union(statisticsSet).Len() != validMetricStatistics.Len():
-		err = errors.New("Invalid statistic values supplied")
-	case req.Unit != "" && !validUnits.Member(req.Unit):
-		err = errors.New("Unit is not a valid value")
-	}
-	if err != nil {
-		return
-	}
-
-	// Serialize all the params
-	params := aws.MakeParams("GetMetricStatistics")
-	params["EndTime"] = req.EndTime.UTC().Format(time.RFC3339)
-	params["StartTime"] = req.StartTime.UTC().Format(time.RFC3339)
-	params["MetricName"] = req.MetricName
-	params["Namespace"] = req.Namespace
-	params["Period"] = strconv.Itoa(req.Period)
-	if req.Unit != "" {
-		params["Unit"] = req.Unit
-	}
-
-	// Serialize the lists of data
-	for i, d := range req.Dimensions {
-		prefix := "Dimensions.member." + strconv.Itoa(i+1)
-		params[prefix+".Name"] = d.Name
-		params[prefix+".Value"] = d.Value
-	}
-	for i, d := range req.Statistics {
-		prefix := "Statistics.member." + strconv.Itoa(i+1)
-		params[prefix] = d
-	}
-	result = new(GetMetricStatisticsResponse)
-	err = c.query("GET", "/", params, result)
-	return
-}
-
-// Returns a list of valid metrics stored for the AWS account owner.
-// Returned metrics can be used with GetMetricStatistics to obtain statistical data for a given metric.
-
-func (c *CloudWatch) ListMetrics(req *ListMetricsRequest) (result *ListMetricsResponse, err error) {
-
-	// Serialize all the params
-	params := aws.MakeParams("ListMetrics")
-	if req.Namespace != "" {
-		params["Namespace"] = req.Namespace
-	}
-	if req.MetricName != "" {
-		params["MetricName"] = req.MetricName
-	}
-	if len(req.Dimensions) > 0 {
-		for i, d := range req.Dimensions {
-			prefix := "Dimensions.member." + strconv.Itoa(i+1)
-			params[prefix+".Name"] = d.Name
-			if len(d.Value) > 0 {
-				params[prefix+".Value"] = d.Value
-			}
-		}
-	}
-
-	result = new(ListMetricsResponse)
-	err = c.query("GET", "/", params, &result)
-	metrics := result.ListMetricsResult.Metrics
-	if result.ListMetricsResult.NextToken != "" {
-		for result.ListMetricsResult.NextToken != "" && err == nil {
-			params = aws.MakeParams("ListMetrics")
-			params["NextToken"] = result.ListMetricsResult.NextToken
-			result = new(ListMetricsResponse)
-			err = c.query("GET", "/", params, &result)
-			if err == nil {
-				newslice := make([]Metric, len(metrics)+len(result.ListMetricsResult.Metrics))
-				copy(newslice, metrics)
-				copy(newslice[len(metrics):], result.ListMetricsResult.Metrics)
-				metrics = newslice
-			}
-		}
-		result.ListMetricsResult.Metrics = metrics
-	}
-	return
-}
-
-func (c *CloudWatch) PutMetricData(metrics []MetricDatum) (result *aws.BaseResponse, err error) {
-	return c.PutMetricDataNamespace(metrics, "")
-}
-
-func (c *CloudWatch) PutMetricDataNamespace(metrics []MetricDatum, namespace string) (result *aws.BaseResponse, err error) {
-	// Serialize the params
-	params := aws.MakeParams("PutMetricData")
-	if namespace != "" {
-		params["Namespace"] = namespace
-	}
-	for i, metric := range metrics {
-		prefix := "MetricData.member." + strconv.Itoa(i+1)
-		if metric.MetricName == "" {
-			err = fmt.Errorf("No metric name supplied for metric: %d", i)
-			return
-		}
-		params[prefix+".MetricName"] = metric.MetricName
-		if metric.Unit != "" {
-			params[prefix+".Unit"] = metric.Unit
-		}
-		if metric.Value != 0 {
-			params[prefix+".Value"] = strconv.FormatFloat(metric.Value, 'E', 10, 64)
-		} else if metric.StatisticValues == nil {
-			params[prefix+".Value"] = "0"
-		}
-		if !metric.Timestamp.IsZero() {
-			params[prefix+".Timestamp"] = metric.Timestamp.UTC().Format(time.RFC3339)
-		}
-		for j, dim := range metric.Dimensions {
-			dimprefix := prefix + ".Dimensions.member." + strconv.Itoa(j+1)
-			params[dimprefix+".Name"] = dim.Name
-			params[dimprefix+".Value"] = dim.Value
-		}
-		if metric.StatisticValues != nil {
-			statprefix := prefix + ".StatisticValues"
-			params[statprefix+".Maximum"] = strconv.FormatFloat(metric.StatisticValues.Maximum, 'E', 10, 64)
-			params[statprefix+".Minimum"] = strconv.FormatFloat(metric.StatisticValues.Minimum, 'E', 10, 64)
-			params[statprefix+".SampleCount"] = strconv.FormatFloat(metric.StatisticValues.SampleCount, 'E', 10, 64)
-			params[statprefix+".Sum"] = strconv.FormatFloat(metric.StatisticValues.Sum, 'E', 10, 64)
-		}
-	}
-	result = new(aws.BaseResponse)
-	err = c.query("POST", "/", params, result)
-	return
-}
-
-func (c *CloudWatch) PutMetricAlarm(alarm *MetricAlarm) (result *aws.BaseResponse, err error) {
-	// Serialize the params
-	params := aws.MakeParams("PutMetricAlarm")
-
-	switch {
-	case alarm.AlarmName == "":
-		err = errors.New("No AlarmName supplied")
-	case !validComparisonOperators.Member(alarm.ComparisonOperator):
-		err = errors.New("ComparisonOperator is not valid")
-	case alarm.EvaluationPeriods == 0:
-		err = errors.New("No number of EvaluationPeriods specified")
-	case alarm.MetricName == "":
-		err = errors.New("No MetricName specified")
-	case alarm.Namespace == "":
-		err = errors.New("No Namespace specified")
-	case alarm.Period == 0:
-		err = errors.New("No Period over which statistic should apply was specified")
-	case !validMetricStatistics.Member(alarm.Statistic):
-		err = errors.New("Invalid statistic value supplied")
-	case alarm.Threshold == 0:
-		err = errors.New("No Threshold value specified")
-	case alarm.Unit != "" && !validUnits.Member(alarm.Unit):
-		err = errors.New("Unit is not a valid value")
-	}
-	if err != nil {
-		return
-	}
-
-	for i, action := range alarm.AlarmActions {
-		params["AlarmActions.member."+strconv.Itoa(i+1)] = action.ARN
-	}
-	for i, action := range alarm.InsufficientDataActions {
-		params["InsufficientDataActions.member."+strconv.Itoa(i+1)] = action.ARN
-	}
-	for i, action := range alarm.OKActions {
-		params["OKActions.member."+strconv.Itoa(i+1)] = action.ARN
-	}
-	if alarm.AlarmDescription != "" {
-		params["AlarmDescription"] = alarm.AlarmDescription
-	}
-	params["AlarmName"] = alarm.AlarmName
-	params["ComparisonOperator"] = alarm.ComparisonOperator
-	for i, dim := range alarm.Dimensions {
-		dimprefix := "Dimensions.member." + strconv.Itoa(i+1)
-		params[dimprefix+".Name"] = dim.Name
-		params[dimprefix+".Value"] = dim.Value
-	}
-	params["EvaluationPeriods"] = strconv.Itoa(alarm.EvaluationPeriods)
-	params["MetricName"] = alarm.MetricName
-	params["Namespace"] = alarm.Namespace
-	params["Period"] = strconv.Itoa(alarm.Period)
-	params["Statistic"] = alarm.Statistic
-	params["Threshold"] = strconv.FormatFloat(alarm.Threshold, 'E', 10, 64)
-	if alarm.Unit != "" {
-		params["Unit"] = alarm.Unit
-	}
-
-	result = new(aws.BaseResponse)
-	err = c.query("POST", "/", params, result)
-	return
-}
Index: golang-github-docker-goamz/cloudwatch/cloudwatch_test.go
===================================================================
--- golang-github-docker-goamz.orig/cloudwatch/cloudwatch_test.go
+++ /dev/null
@@ -1,119 +0,0 @@
-package cloudwatch_test
-
-import (
-	"github.com/docker/goamz/aws"
-	"github.com/docker/goamz/cloudwatch"
-	"github.com/docker/goamz/testutil"
-	"gopkg.in/check.v1"
-	"testing"
-)
-
-func Test(t *testing.T) {
-	check.TestingT(t)
-}
-
-type S struct {
-	cw *cloudwatch.CloudWatch
-}
-
-var _ = check.Suite(&S{})
-
-var testServer = testutil.NewHTTPServer()
-
-func (s *S) SetUpSuite(c *check.C) {
-	testServer.Start()
-	auth := aws.Auth{AccessKey: "abc", SecretKey: "123"}
-	s.cw, _ = cloudwatch.NewCloudWatch(auth, aws.ServiceInfo{Endpoint: testServer.URL, Signer: aws.V2Signature})
-}
-
-func (s *S) TearDownTest(c *check.C) {
-	testServer.Flush()
-}
-
-func getTestAlarm() *cloudwatch.MetricAlarm {
-	alarm := new(cloudwatch.MetricAlarm)
-
-	alarm.AlarmDescription = "Test Description"
-	alarm.AlarmName = "TestAlarm"
-	alarm.MetricName = "TestMetric"
-	alarm.Namespace = "TestNamespace"
-	alarm.ComparisonOperator = "LessThanThreshold"
-	alarm.Threshold = 1
-	alarm.EvaluationPeriods = 5
-	alarm.Period = 60
-	alarm.Statistic = "Sum"
-
-	return alarm
-}
-
-func (s *S) TestPutAlarm(c *check.C) {
-	testServer.Response(200, nil, "<RequestId>123</RequestId>")
-
-	alarm := getTestAlarm()
-
-	_, err := s.cw.PutMetricAlarm(alarm)
-	c.Assert(err, check.IsNil)
-
-	req := testServer.WaitRequest()
-	c.Assert(req.Method, check.Equals, "POST")
-	c.Assert(req.URL.Path, check.Equals, "/")
-	c.Assert(req.Form["Action"], check.DeepEquals, []string{"PutMetricAlarm"})
-	c.Assert(req.Form["AlarmName"], check.DeepEquals, []string{"TestAlarm"})
-	c.Assert(req.Form["ComparisonOperator"], check.DeepEquals, []string{"LessThanThreshold"})
-	c.Assert(req.Form["EvaluationPeriods"], check.DeepEquals, []string{"5"})
-	c.Assert(req.Form["Threshold"], check.DeepEquals, []string{"1.0000000000E+00"})
-	c.Assert(req.Form["Period"], check.DeepEquals, []string{"60"})
-	c.Assert(req.Form["Statistic"], check.DeepEquals, []string{"Sum"})
-}
-
-func (s *S) TestPutAlarmWithAction(c *check.C) {
-	testServer.Response(200, nil, "<RequestId>123</RequestId>")
-
-	alarm := getTestAlarm()
-
-	var actions []cloudwatch.AlarmAction
-	action := new(cloudwatch.AlarmAction)
-	action.ARN = "123"
-	actions = append(actions, *action)
-
-	alarm.AlarmActions = actions
-
-	_, err := s.cw.PutMetricAlarm(alarm)
-	c.Assert(err, check.IsNil)
-
-	req := testServer.WaitRequest()
-	c.Assert(req.Method, check.Equals, "POST")
-	c.Assert(req.URL.Path, check.Equals, "/")
-	c.Assert(req.Form["Action"], check.DeepEquals, []string{"PutMetricAlarm"})
-	c.Assert(req.Form["AlarmActions.member.1"], check.DeepEquals, []string{"123"})
-	c.Assert(req.Form["AlarmName"], check.DeepEquals, []string{"TestAlarm"})
-	c.Assert(req.Form["ComparisonOperator"], check.DeepEquals, []string{"LessThanThreshold"})
-	c.Assert(req.Form["EvaluationPeriods"], check.DeepEquals, []string{"5"})
-	c.Assert(req.Form["Threshold"], check.DeepEquals, []string{"1.0000000000E+00"})
-	c.Assert(req.Form["Period"], check.DeepEquals, []string{"60"})
-	c.Assert(req.Form["Statistic"], check.DeepEquals, []string{"Sum"})
-}
-
-func (s *S) TestPutAlarmInvalidComapirsonOperator(c *check.C) {
-	testServer.Response(200, nil, "<RequestId>123</RequestId>")
-
-	alarm := getTestAlarm()
-
-	alarm.ComparisonOperator = "LessThan"
-
-	_, err := s.cw.PutMetricAlarm(alarm)
-	c.Assert(err, check.NotNil)
-	c.Assert(err.Error(), check.Equals, "ComparisonOperator is not valid")
-}
-
-func (s *S) TestPutAlarmInvalidStatistic(c *check.C) {
-	testServer.Response(200, nil, "<RequestId>123</RequestId>")
-
-	alarm := getTestAlarm()
-
-	alarm.Statistic = "Count"
-
-	_, err := s.cw.PutMetricAlarm(alarm)
-	c.Assert(err, check.NotNil)
-	c.Assert(err.Error(), check.Equals, "Invalid statistic value supplied")
-}
Index: golang-github-docker-goamz/cloudwatch/README.Debian
===================================================================
--- /dev/null
+++ golang-github-docker-goamz/cloudwatch/README.Debian
@@ -0,0 +1,9 @@
+This module has been moved due to its dependency on a non-free set of
+modules:
+
+* github.com/feyelenaor/slices
+* github.com/feyelenaor/raw
+* github.com/feyelenaor/lists
+
+All the above modules contain the "This software must be used for Good
+and not Evil" license, which is incompatible with Debian.