Vendor aws-sdk-go (dep ensure) (#178)
This commit is contained in:
4859
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
generated
vendored
Normal file
4859
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
140
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
generated
vendored
Normal file
140
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface/interface.go
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloudwatchiface provides an interface to enable mocking the Amazon CloudWatch service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package cloudwatchiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/cloudwatch"
|
||||
)
|
||||
|
||||
// CloudWatchAPI provides an interface to enable mocking the
|
||||
// cloudwatch.CloudWatch service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // Amazon CloudWatch.
|
||||
// func myFunc(svc cloudwatchiface.CloudWatchAPI) bool {
|
||||
// // Make svc.DeleteAlarms request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := cloudwatch.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockCloudWatchClient struct {
|
||||
// cloudwatchiface.CloudWatchAPI
|
||||
// }
|
||||
// func (m *mockCloudWatchClient) DeleteAlarms(input *cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockCloudWatchClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type CloudWatchAPI interface {
|
||||
DeleteAlarms(*cloudwatch.DeleteAlarmsInput) (*cloudwatch.DeleteAlarmsOutput, error)
|
||||
DeleteAlarmsWithContext(aws.Context, *cloudwatch.DeleteAlarmsInput, ...request.Option) (*cloudwatch.DeleteAlarmsOutput, error)
|
||||
DeleteAlarmsRequest(*cloudwatch.DeleteAlarmsInput) (*request.Request, *cloudwatch.DeleteAlarmsOutput)
|
||||
|
||||
DeleteDashboards(*cloudwatch.DeleteDashboardsInput) (*cloudwatch.DeleteDashboardsOutput, error)
|
||||
DeleteDashboardsWithContext(aws.Context, *cloudwatch.DeleteDashboardsInput, ...request.Option) (*cloudwatch.DeleteDashboardsOutput, error)
|
||||
DeleteDashboardsRequest(*cloudwatch.DeleteDashboardsInput) (*request.Request, *cloudwatch.DeleteDashboardsOutput)
|
||||
|
||||
DescribeAlarmHistory(*cloudwatch.DescribeAlarmHistoryInput) (*cloudwatch.DescribeAlarmHistoryOutput, error)
|
||||
DescribeAlarmHistoryWithContext(aws.Context, *cloudwatch.DescribeAlarmHistoryInput, ...request.Option) (*cloudwatch.DescribeAlarmHistoryOutput, error)
|
||||
DescribeAlarmHistoryRequest(*cloudwatch.DescribeAlarmHistoryInput) (*request.Request, *cloudwatch.DescribeAlarmHistoryOutput)
|
||||
|
||||
DescribeAlarmHistoryPages(*cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool) error
|
||||
DescribeAlarmHistoryPagesWithContext(aws.Context, *cloudwatch.DescribeAlarmHistoryInput, func(*cloudwatch.DescribeAlarmHistoryOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeAlarms(*cloudwatch.DescribeAlarmsInput) (*cloudwatch.DescribeAlarmsOutput, error)
|
||||
DescribeAlarmsWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, ...request.Option) (*cloudwatch.DescribeAlarmsOutput, error)
|
||||
DescribeAlarmsRequest(*cloudwatch.DescribeAlarmsInput) (*request.Request, *cloudwatch.DescribeAlarmsOutput)
|
||||
|
||||
DescribeAlarmsPages(*cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool) error
|
||||
DescribeAlarmsPagesWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, func(*cloudwatch.DescribeAlarmsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeAlarmsForMetric(*cloudwatch.DescribeAlarmsForMetricInput) (*cloudwatch.DescribeAlarmsForMetricOutput, error)
|
||||
DescribeAlarmsForMetricWithContext(aws.Context, *cloudwatch.DescribeAlarmsForMetricInput, ...request.Option) (*cloudwatch.DescribeAlarmsForMetricOutput, error)
|
||||
DescribeAlarmsForMetricRequest(*cloudwatch.DescribeAlarmsForMetricInput) (*request.Request, *cloudwatch.DescribeAlarmsForMetricOutput)
|
||||
|
||||
DisableAlarmActions(*cloudwatch.DisableAlarmActionsInput) (*cloudwatch.DisableAlarmActionsOutput, error)
|
||||
DisableAlarmActionsWithContext(aws.Context, *cloudwatch.DisableAlarmActionsInput, ...request.Option) (*cloudwatch.DisableAlarmActionsOutput, error)
|
||||
DisableAlarmActionsRequest(*cloudwatch.DisableAlarmActionsInput) (*request.Request, *cloudwatch.DisableAlarmActionsOutput)
|
||||
|
||||
EnableAlarmActions(*cloudwatch.EnableAlarmActionsInput) (*cloudwatch.EnableAlarmActionsOutput, error)
|
||||
EnableAlarmActionsWithContext(aws.Context, *cloudwatch.EnableAlarmActionsInput, ...request.Option) (*cloudwatch.EnableAlarmActionsOutput, error)
|
||||
EnableAlarmActionsRequest(*cloudwatch.EnableAlarmActionsInput) (*request.Request, *cloudwatch.EnableAlarmActionsOutput)
|
||||
|
||||
GetDashboard(*cloudwatch.GetDashboardInput) (*cloudwatch.GetDashboardOutput, error)
|
||||
GetDashboardWithContext(aws.Context, *cloudwatch.GetDashboardInput, ...request.Option) (*cloudwatch.GetDashboardOutput, error)
|
||||
GetDashboardRequest(*cloudwatch.GetDashboardInput) (*request.Request, *cloudwatch.GetDashboardOutput)
|
||||
|
||||
GetMetricData(*cloudwatch.GetMetricDataInput) (*cloudwatch.GetMetricDataOutput, error)
|
||||
GetMetricDataWithContext(aws.Context, *cloudwatch.GetMetricDataInput, ...request.Option) (*cloudwatch.GetMetricDataOutput, error)
|
||||
GetMetricDataRequest(*cloudwatch.GetMetricDataInput) (*request.Request, *cloudwatch.GetMetricDataOutput)
|
||||
|
||||
GetMetricStatistics(*cloudwatch.GetMetricStatisticsInput) (*cloudwatch.GetMetricStatisticsOutput, error)
|
||||
GetMetricStatisticsWithContext(aws.Context, *cloudwatch.GetMetricStatisticsInput, ...request.Option) (*cloudwatch.GetMetricStatisticsOutput, error)
|
||||
GetMetricStatisticsRequest(*cloudwatch.GetMetricStatisticsInput) (*request.Request, *cloudwatch.GetMetricStatisticsOutput)
|
||||
|
||||
ListDashboards(*cloudwatch.ListDashboardsInput) (*cloudwatch.ListDashboardsOutput, error)
|
||||
ListDashboardsWithContext(aws.Context, *cloudwatch.ListDashboardsInput, ...request.Option) (*cloudwatch.ListDashboardsOutput, error)
|
||||
ListDashboardsRequest(*cloudwatch.ListDashboardsInput) (*request.Request, *cloudwatch.ListDashboardsOutput)
|
||||
|
||||
ListMetrics(*cloudwatch.ListMetricsInput) (*cloudwatch.ListMetricsOutput, error)
|
||||
ListMetricsWithContext(aws.Context, *cloudwatch.ListMetricsInput, ...request.Option) (*cloudwatch.ListMetricsOutput, error)
|
||||
ListMetricsRequest(*cloudwatch.ListMetricsInput) (*request.Request, *cloudwatch.ListMetricsOutput)
|
||||
|
||||
ListMetricsPages(*cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool) error
|
||||
ListMetricsPagesWithContext(aws.Context, *cloudwatch.ListMetricsInput, func(*cloudwatch.ListMetricsOutput, bool) bool, ...request.Option) error
|
||||
|
||||
PutDashboard(*cloudwatch.PutDashboardInput) (*cloudwatch.PutDashboardOutput, error)
|
||||
PutDashboardWithContext(aws.Context, *cloudwatch.PutDashboardInput, ...request.Option) (*cloudwatch.PutDashboardOutput, error)
|
||||
PutDashboardRequest(*cloudwatch.PutDashboardInput) (*request.Request, *cloudwatch.PutDashboardOutput)
|
||||
|
||||
PutMetricAlarm(*cloudwatch.PutMetricAlarmInput) (*cloudwatch.PutMetricAlarmOutput, error)
|
||||
PutMetricAlarmWithContext(aws.Context, *cloudwatch.PutMetricAlarmInput, ...request.Option) (*cloudwatch.PutMetricAlarmOutput, error)
|
||||
PutMetricAlarmRequest(*cloudwatch.PutMetricAlarmInput) (*request.Request, *cloudwatch.PutMetricAlarmOutput)
|
||||
|
||||
PutMetricData(*cloudwatch.PutMetricDataInput) (*cloudwatch.PutMetricDataOutput, error)
|
||||
PutMetricDataWithContext(aws.Context, *cloudwatch.PutMetricDataInput, ...request.Option) (*cloudwatch.PutMetricDataOutput, error)
|
||||
PutMetricDataRequest(*cloudwatch.PutMetricDataInput) (*request.Request, *cloudwatch.PutMetricDataOutput)
|
||||
|
||||
SetAlarmState(*cloudwatch.SetAlarmStateInput) (*cloudwatch.SetAlarmStateOutput, error)
|
||||
SetAlarmStateWithContext(aws.Context, *cloudwatch.SetAlarmStateInput, ...request.Option) (*cloudwatch.SetAlarmStateOutput, error)
|
||||
SetAlarmStateRequest(*cloudwatch.SetAlarmStateInput) (*request.Request, *cloudwatch.SetAlarmStateOutput)
|
||||
|
||||
WaitUntilAlarmExists(*cloudwatch.DescribeAlarmsInput) error
|
||||
WaitUntilAlarmExistsWithContext(aws.Context, *cloudwatch.DescribeAlarmsInput, ...request.WaiterOption) error
|
||||
}
|
||||
|
||||
var _ CloudWatchAPI = (*cloudwatch.CloudWatch)(nil)
|
||||
42
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/doc.go
generated
vendored
Normal file
42
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/doc.go
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package cloudwatch provides the client and types for making API
|
||||
// requests to Amazon CloudWatch.
|
||||
//
|
||||
// Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the
|
||||
// applications you run on AWS in real time. You can use CloudWatch to collect
|
||||
// and track metrics, which are the variables you want to measure for your resources
|
||||
// and applications.
|
||||
//
|
||||
// CloudWatch alarms send notifications or automatically change the resources
|
||||
// you are monitoring based on rules that you define. For example, you can monitor
|
||||
// the CPU usage and disk reads and writes of your Amazon EC2 instances. Then,
|
||||
// use this data to determine whether you should launch additional instances
|
||||
// to handle increased load. You can also use this data to stop under-used instances
|
||||
// to save money.
|
||||
//
|
||||
// In addition to monitoring the built-in metrics that come with AWS, you can
|
||||
// monitor your own custom metrics. With CloudWatch, you gain system-wide visibility
|
||||
// into resource utilization, application performance, and operational health.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01 for more information on this service.
|
||||
//
|
||||
// See cloudwatch package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatch/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact Amazon CloudWatch with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Amazon CloudWatch client CloudWatch for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatch/#New
|
||||
package cloudwatch
|
||||
66
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go
generated
vendored
Normal file
66
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/errors.go
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeDashboardInvalidInputError for service response error code
|
||||
// "InvalidParameterInput".
|
||||
//
|
||||
// Some part of the dashboard data is invalid.
|
||||
ErrCodeDashboardInvalidInputError = "InvalidParameterInput"
|
||||
|
||||
// ErrCodeDashboardNotFoundError for service response error code
|
||||
// "ResourceNotFound".
|
||||
//
|
||||
// The specified dashboard does not exist.
|
||||
ErrCodeDashboardNotFoundError = "ResourceNotFound"
|
||||
|
||||
// ErrCodeInternalServiceFault for service response error code
|
||||
// "InternalServiceError".
|
||||
//
|
||||
// Request processing has failed due to some unknown error, exception, or failure.
|
||||
ErrCodeInternalServiceFault = "InternalServiceError"
|
||||
|
||||
// ErrCodeInvalidFormatFault for service response error code
|
||||
// "InvalidFormat".
|
||||
//
|
||||
// Data was not syntactically valid JSON.
|
||||
ErrCodeInvalidFormatFault = "InvalidFormat"
|
||||
|
||||
// ErrCodeInvalidNextToken for service response error code
|
||||
// "InvalidNextToken".
|
||||
//
|
||||
// The next token specified is invalid.
|
||||
ErrCodeInvalidNextToken = "InvalidNextToken"
|
||||
|
||||
// ErrCodeInvalidParameterCombinationException for service response error code
|
||||
// "InvalidParameterCombination".
|
||||
//
|
||||
// Parameters were used together that cannot be used together.
|
||||
ErrCodeInvalidParameterCombinationException = "InvalidParameterCombination"
|
||||
|
||||
// ErrCodeInvalidParameterValueException for service response error code
|
||||
// "InvalidParameterValue".
|
||||
//
|
||||
// The value of an input parameter is bad or out-of-range.
|
||||
ErrCodeInvalidParameterValueException = "InvalidParameterValue"
|
||||
|
||||
// ErrCodeLimitExceededFault for service response error code
|
||||
// "LimitExceeded".
|
||||
//
|
||||
// The quota for alarms for this customer has already been reached.
|
||||
ErrCodeLimitExceededFault = "LimitExceeded"
|
||||
|
||||
// ErrCodeMissingRequiredParameterException for service response error code
|
||||
// "MissingParameter".
|
||||
//
|
||||
// An input parameter that is required is missing.
|
||||
ErrCodeMissingRequiredParameterException = "MissingParameter"
|
||||
|
||||
// ErrCodeResourceNotFound for service response error code
|
||||
// "ResourceNotFound".
|
||||
//
|
||||
// The named resource does not exist.
|
||||
ErrCodeResourceNotFound = "ResourceNotFound"
|
||||
)
|
||||
93
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
generated
vendored
Normal file
93
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/query"
|
||||
)
|
||||
|
||||
// CloudWatch provides the API operation methods for making requests to
|
||||
// Amazon CloudWatch. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// CloudWatch methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type CloudWatch struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "monitoring" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the CloudWatch client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a CloudWatch client from just a session.
|
||||
// svc := cloudwatch.New(mySession)
|
||||
//
|
||||
// // Create a CloudWatch client with additional configuration
|
||||
// svc := cloudwatch.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudWatch {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudWatch {
|
||||
svc := &CloudWatch{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2010-08-01",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(query.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a CloudWatch operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *CloudWatch) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
56
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go
generated
vendored
Normal file
56
vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package cloudwatch
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilAlarmExists uses the CloudWatch API operation
|
||||
// DescribeAlarms to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *CloudWatch) WaitUntilAlarmExists(input *DescribeAlarmsInput) error {
|
||||
return c.WaitUntilAlarmExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilAlarmExistsWithContext is an extended version of WaitUntilAlarmExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *CloudWatch) WaitUntilAlarmExistsWithContext(ctx aws.Context, input *DescribeAlarmsInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilAlarmExists",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "length(MetricAlarms[]) > `0`",
|
||||
Expected: true,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeAlarmsInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeAlarmsRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
Reference in New Issue
Block a user