|
@@ -3,6 +3,7 @@ package cloudwatch
|
|
|
import (
|
|
import (
|
|
|
"context"
|
|
"context"
|
|
|
"errors"
|
|
"errors"
|
|
|
|
|
+ "fmt"
|
|
|
"regexp"
|
|
"regexp"
|
|
|
"sort"
|
|
"sort"
|
|
|
"strconv"
|
|
"strconv"
|
|
@@ -144,6 +145,10 @@ func (e *CloudWatchExecutor) executeQuery(ctx context.Context, parameters *simpl
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if endTime.Before(startTime) {
|
|
|
|
|
+ return nil, fmt.Errorf("Invalid time range: End time can't be before start time")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
params := &cloudwatch.GetMetricStatisticsInput{
|
|
params := &cloudwatch.GetMetricStatisticsInput{
|
|
|
Namespace: aws.String(query.Namespace),
|
|
Namespace: aws.String(query.Namespace),
|
|
|
MetricName: aws.String(query.MetricName),
|
|
MetricName: aws.String(query.MetricName),
|