2017-04-05 09:45:27 +02:00
|
|
|
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
2016-01-29 20:53:56 +01:00
|
|
|
|
|
|
|
package elasticache
|
|
|
|
|
|
|
|
import (
|
2017-04-05 09:45:27 +02:00
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/aws/aws-sdk-go/aws"
|
|
|
|
"github.com/aws/aws-sdk-go/aws/request"
|
2016-01-29 20:53:56 +01:00
|
|
|
)
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilCacheClusterAvailable uses the Amazon ElastiCache API operation
|
|
|
|
// DescribeCacheClusters to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-01-29 20:53:56 +01:00
|
|
|
func (c *ElastiCache) WaitUntilCacheClusterAvailable(input *DescribeCacheClustersInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilCacheClusterAvailableWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilCacheClusterAvailableWithContext is an extended version of WaitUntilCacheClusterAvailable.
|
|
|
|
// 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 *ElastiCache) WaitUntilCacheClusterAvailableWithContext(ctx aws.Context, input *DescribeCacheClustersInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilCacheClusterAvailable",
|
2016-01-29 20:53:56 +01:00
|
|
|
MaxAttempts: 40,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
|
|
|
Acceptors: []request.WaiterAcceptor{
|
2016-01-29 20:53:56 +01:00
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.PathAllWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "available",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "deleted",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "deleting",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "incompatible-network",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "restore-failed",
|
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeCacheClustersInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeCacheClustersRequest(inCpy)
|
|
|
|
req.SetContext(ctx)
|
|
|
|
req.ApplyOptions(opts...)
|
|
|
|
return req, nil
|
|
|
|
},
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|
2017-04-05 09:45:27 +02:00
|
|
|
w.ApplyOptions(opts...)
|
2016-01-29 20:53:56 +01:00
|
|
|
|
2017-04-05 09:45:27 +02:00
|
|
|
return w.WaitWithContext(ctx)
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilCacheClusterDeleted uses the Amazon ElastiCache API operation
|
|
|
|
// DescribeCacheClusters to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-01-29 20:53:56 +01:00
|
|
|
func (c *ElastiCache) WaitUntilCacheClusterDeleted(input *DescribeCacheClustersInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilCacheClusterDeletedWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilCacheClusterDeletedWithContext is an extended version of WaitUntilCacheClusterDeleted.
|
|
|
|
// 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 *ElastiCache) WaitUntilCacheClusterDeletedWithContext(ctx aws.Context, input *DescribeCacheClustersInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilCacheClusterDeleted",
|
2016-01-29 20:53:56 +01:00
|
|
|
MaxAttempts: 40,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
|
|
|
Acceptors: []request.WaiterAcceptor{
|
2016-01-29 20:53:56 +01:00
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.PathAllWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "deleted",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.ErrorWaiterMatch,
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "CacheClusterNotFound",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "available",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "creating",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "incompatible-network",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "modifying",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "restore-failed",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "CacheClusters[].CacheClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "snapshotting",
|
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeCacheClustersInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeCacheClustersRequest(inCpy)
|
|
|
|
req.SetContext(ctx)
|
|
|
|
req.ApplyOptions(opts...)
|
|
|
|
return req, nil
|
|
|
|
},
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|
2017-04-05 09:45:27 +02:00
|
|
|
w.ApplyOptions(opts...)
|
2016-01-29 20:53:56 +01:00
|
|
|
|
2017-04-05 09:45:27 +02:00
|
|
|
return w.WaitWithContext(ctx)
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilReplicationGroupAvailable uses the Amazon ElastiCache API operation
|
|
|
|
// DescribeReplicationGroups to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-01-29 20:53:56 +01:00
|
|
|
func (c *ElastiCache) WaitUntilReplicationGroupAvailable(input *DescribeReplicationGroupsInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilReplicationGroupAvailableWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilReplicationGroupAvailableWithContext is an extended version of WaitUntilReplicationGroupAvailable.
|
|
|
|
// 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 *ElastiCache) WaitUntilReplicationGroupAvailableWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilReplicationGroupAvailable",
|
2016-01-29 20:53:56 +01:00
|
|
|
MaxAttempts: 40,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
|
|
|
Acceptors: []request.WaiterAcceptor{
|
2016-01-29 20:53:56 +01:00
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.PathAllWaiterMatch, Argument: "ReplicationGroups[].Status",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "available",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "ReplicationGroups[].Status",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "deleted",
|
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeReplicationGroupsInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeReplicationGroupsRequest(inCpy)
|
|
|
|
req.SetContext(ctx)
|
|
|
|
req.ApplyOptions(opts...)
|
|
|
|
return req, nil
|
|
|
|
},
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|
2017-04-05 09:45:27 +02:00
|
|
|
w.ApplyOptions(opts...)
|
2016-01-29 20:53:56 +01:00
|
|
|
|
2017-04-05 09:45:27 +02:00
|
|
|
return w.WaitWithContext(ctx)
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilReplicationGroupDeleted uses the Amazon ElastiCache API operation
|
|
|
|
// DescribeReplicationGroups to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-01-29 20:53:56 +01:00
|
|
|
func (c *ElastiCache) WaitUntilReplicationGroupDeleted(input *DescribeReplicationGroupsInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilReplicationGroupDeletedWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilReplicationGroupDeletedWithContext is an extended version of WaitUntilReplicationGroupDeleted.
|
|
|
|
// 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 *ElastiCache) WaitUntilReplicationGroupDeletedWithContext(ctx aws.Context, input *DescribeReplicationGroupsInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilReplicationGroupDeleted",
|
2016-01-29 20:53:56 +01:00
|
|
|
MaxAttempts: 40,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
|
|
|
Acceptors: []request.WaiterAcceptor{
|
2016-01-29 20:53:56 +01:00
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.PathAllWaiterMatch, Argument: "ReplicationGroups[].Status",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "deleted",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "ReplicationGroups[].Status",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "available",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.ErrorWaiterMatch,
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "ReplicationGroupNotFoundFault",
|
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeReplicationGroupsInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeReplicationGroupsRequest(inCpy)
|
|
|
|
req.SetContext(ctx)
|
|
|
|
req.ApplyOptions(opts...)
|
|
|
|
return req, nil
|
|
|
|
},
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|
2017-04-05 09:45:27 +02:00
|
|
|
w.ApplyOptions(opts...)
|
2016-01-29 20:53:56 +01:00
|
|
|
|
2017-04-05 09:45:27 +02:00
|
|
|
return w.WaitWithContext(ctx)
|
2016-01-29 20:53:56 +01:00
|
|
|
}
|