|
@@ -194,16 +194,16 @@ func parseDimensions(model *simplejson.Json) ([]*cloudwatch.Dimension, error) {
|
|
|
return result, nil
|
|
return result, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func parseStatistics(model *simplejson.Json) ([]*string, []*string, error) {
|
|
|
|
|
- var statistics []*string
|
|
|
|
|
- var extendedStatistics []*string
|
|
|
|
|
|
|
+func parseStatistics(model *simplejson.Json) ([]string, []string, error) {
|
|
|
|
|
+ var statistics []string
|
|
|
|
|
+ var extendedStatistics []string
|
|
|
|
|
|
|
|
for _, s := range model.Get("statistics").MustArray() {
|
|
for _, s := range model.Get("statistics").MustArray() {
|
|
|
if ss, ok := s.(string); ok {
|
|
if ss, ok := s.(string); ok {
|
|
|
if _, isStandard := standardStatistics[ss]; isStandard {
|
|
if _, isStandard := standardStatistics[ss]; isStandard {
|
|
|
- statistics = append(statistics, &ss)
|
|
|
|
|
|
|
+ statistics = append(statistics, ss)
|
|
|
} else {
|
|
} else {
|
|
|
- extendedStatistics = append(extendedStatistics, &ss)
|
|
|
|
|
|
|
+ extendedStatistics = append(extendedStatistics, ss)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
return nil, nil, errors.New("failed to parse")
|
|
return nil, nil, errors.New("failed to parse")
|
|
@@ -269,8 +269,8 @@ func parseQuery(model *simplejson.Json) (*CloudWatchQuery, error) {
|
|
|
Namespace: namespace,
|
|
Namespace: namespace,
|
|
|
MetricName: metricName,
|
|
MetricName: metricName,
|
|
|
Dimensions: dimensions,
|
|
Dimensions: dimensions,
|
|
|
- Statistics: statistics,
|
|
|
|
|
- ExtendedStatistics: extendedStatistics,
|
|
|
|
|
|
|
+ Statistics: aws.StringSlice(statistics),
|
|
|
|
|
+ ExtendedStatistics: aws.StringSlice(extendedStatistics),
|
|
|
Period: period,
|
|
Period: period,
|
|
|
Alias: alias,
|
|
Alias: alias,
|
|
|
}, nil
|
|
}, nil
|