Skip to content

Commit

Permalink
removed vet and v2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
neo7337 committed Apr 7, 2021
1 parent e04cd00 commit 3946ffd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions gov2/cloudwatch/GetMetricData/GetMetricDatav2.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch/types"
)

// CWGetMetricDataAPI defines the interface for the GetMetricData function
Expand Down Expand Up @@ -48,21 +49,21 @@ func main() {
input := &cloudwatch.GetMetricDataInput{
EndTime: aws.Time(time.Unix(time.Now().Unix(), 0)),
StartTime: aws.Time(time.Unix(time.Now().Add(time.Duration(-*diffInMinutes)*time.Minute).Unix(), 0)),
MetricDataQueries: []*cloudwatch.MetricDataQuery{
&cloudwatch.MetricDataQuery{
MetricDataQueries: []types.MetricDataQuery{
types.MetricDataQuery{
Id: aws.String(*id),
MetricStat: &cloudwatch.MetricStat{
Metric: &cloudwatch.Metric{
MetricStat: &types.MetricStat{
Metric: &types.Metric{
Namespace: aws.String(*namespace),
MetricName: aws.String(*metricName),
Dimensions: []*cloudwatch.Dimension{
&cloudwatch.Dimension{
Dimensions: []types.Dimension{
types.Dimension{
Name: aws.String(*dimensionName),
Value: aws.String(*dimensionValue),
},
},
},
Period: aws.Int64(int64(*period)),
Period: aws.Int32(int32(*period)),
Stat: aws.String(*stat),
},
},
Expand Down
15 changes: 8 additions & 7 deletions gov2/cloudwatch/GetMetricData/GetMetricDatav2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch"
"github.com/aws/aws-sdk-go-v2/service/cloudwatch/types"
)

type CWGetMetricDataImpl struct{}
Expand Down Expand Up @@ -69,21 +70,21 @@ func TestGetMetricData(t *testing.T) {
input := &cloudwatch.GetMetricDataInput{
EndTime: aws.Time(time.Unix(time.Now().Unix(), 0)),
StartTime: aws.Time(time.Unix(time.Now().Add(time.Duration(-globalConfig.DiffInMinutes)*time.Minute).Unix(), 0)),
MetricDataQueries: []*cloudwatch.MetricDataQuery{
&cloudwatch.MetricDataQuery{
MetricDataQueries: []types.MetricDataQuery{
types.MetricDataQuery{
Id: aws.String(globalConfig.ID),
MetricStat: &cloudwatch.MetricStat{
Metric: &cloudwatch.Metric{
MetricStat: &types.MetricStat{
Metric: &types.Metric{
Namespace: aws.String(globalConfig.Namespace),
MetricName: aws.String(globalConfig.MetricName),
Dimensions: []*cloudwatch.Dimension{
&cloudwatch.Dimension{
Dimensions: []types.Dimension{
types.Dimension{
Name: aws.String(globalConfig.DimensionName),
Value: aws.String(globalConfig.DimensionValue),
},
},
},
Period: aws.Int64(int64(globalConfig.Period)),
Period: aws.Int32(int32(globalConfig.Period)),
Stat: aws.String(globalConfig.Stat),
},
},
Expand Down

0 comments on commit 3946ffd

Please sign in to comment.