mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 18:15:25 +08:00
Cloudwatch: Migrate to aws-sdk-go-v2 (#99643)
This commit is contained in:

committed by
GitHub

parent
35d22dc83d
commit
5bb1d5f2c3
@ -6,11 +6,11 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const defaultLogGroupLimit = int64(50)
|
||||
const defaultLogGroupLimit = int32(50)
|
||||
|
||||
type LogGroupsRequest struct {
|
||||
ResourceRequest
|
||||
Limit int64
|
||||
Limit int32
|
||||
LogGroupNamePrefix, LogGroupNamePattern *string
|
||||
ListAllLogGroups bool
|
||||
}
|
||||
@ -45,11 +45,11 @@ func setIfNotEmptyString(paramValue string) *string {
|
||||
return ¶mValue
|
||||
}
|
||||
|
||||
func getLimit(limit string) int64 {
|
||||
func getLimit(limit string) int32 {
|
||||
logGroupLimit := defaultLogGroupLimit
|
||||
intLimit, err := strconv.ParseInt(limit, 10, 64)
|
||||
if err == nil && intLimit > 0 {
|
||||
logGroupLimit = intLimit
|
||||
logGroupLimit = int32(intLimit)
|
||||
}
|
||||
return logGroupLimit
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package resources
|
||||
|
||||
import "github.com/aws/aws-sdk-go/service/cloudwatch"
|
||||
import (
|
||||
cloudwatchtypes "github.com/aws/aws-sdk-go-v2/service/cloudwatch/types"
|
||||
)
|
||||
|
||||
type Dimension struct {
|
||||
Name string
|
||||
@ -13,7 +15,7 @@ type ResourceResponse[T any] struct {
|
||||
}
|
||||
|
||||
type MetricResponse struct {
|
||||
*cloudwatch.Metric
|
||||
Metric cloudwatchtypes.Metric
|
||||
AccountId *string `json:"accountId,omitempty"`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user