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 redshift
|
|
|
|
|
|
|
|
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
|
|
|
// WaitUntilClusterAvailable uses the Amazon Redshift API operation
|
|
|
|
// DescribeClusters 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 *Redshift) WaitUntilClusterAvailable(input *DescribeClustersInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilClusterAvailableWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilClusterAvailableWithContext is an extended version of WaitUntilClusterAvailable.
|
|
|
|
// 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 *Redshift) WaitUntilClusterAvailableWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilClusterAvailable",
|
2016-01-29 20:53:56 +01:00
|
|
|
MaxAttempts: 30,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(60 * 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: "Clusters[].ClusterStatus",
|
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: "Clusters[].ClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "deleting",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.RetryWaiterState,
|
|
|
|
Matcher: request.ErrorWaiterMatch,
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "ClusterNotFound",
|
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeClustersInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeClustersRequest(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
|
|
|
// WaitUntilClusterDeleted uses the Amazon Redshift API operation
|
|
|
|
// DescribeClusters 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 *Redshift) WaitUntilClusterDeleted(input *DescribeClustersInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilClusterDeletedWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilClusterDeletedWithContext is an extended version of WaitUntilClusterDeleted.
|
|
|
|
// 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 *Redshift) WaitUntilClusterDeletedWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilClusterDeleted",
|
2016-01-29 20:53:56 +01:00
|
|
|
MaxAttempts: 30,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(60 * 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.ErrorWaiterMatch,
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "ClusterNotFound",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "Clusters[].ClusterStatus",
|
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: "Clusters[].ClusterStatus",
|
2016-09-08 16:24:31 +02:00
|
|
|
Expected: "modifying",
|
2016-01-29 20:53:56 +01:00
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeClustersInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeClustersRequest(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
|
|
|
// WaitUntilClusterRestored uses the Amazon Redshift API operation
|
|
|
|
// DescribeClusters 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 *Redshift) WaitUntilClusterRestored(input *DescribeClustersInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilClusterRestoredWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilClusterRestoredWithContext is an extended version of WaitUntilClusterRestored.
|
|
|
|
// 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 *Redshift) WaitUntilClusterRestoredWithContext(ctx aws.Context, input *DescribeClustersInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilClusterRestored",
|
2016-01-29 20:53:56 +01:00
|
|
|
MaxAttempts: 30,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(60 * 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: "Clusters[].RestoreStatus.Status",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "completed",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "Clusters[].ClusterStatus",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "deleting",
|
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeClustersInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeClustersRequest(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
|
|
|
// WaitUntilSnapshotAvailable uses the Amazon Redshift API operation
|
|
|
|
// DescribeClusterSnapshots 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 *Redshift) WaitUntilSnapshotAvailable(input *DescribeClusterSnapshotsInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilSnapshotAvailableWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilSnapshotAvailableWithContext is an extended version of WaitUntilSnapshotAvailable.
|
|
|
|
// 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 *Redshift) WaitUntilSnapshotAvailableWithContext(ctx aws.Context, input *DescribeClusterSnapshotsInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilSnapshotAvailable",
|
2016-01-29 20:53:56 +01:00
|
|
|
MaxAttempts: 20,
|
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: "Snapshots[].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: "Snapshots[].Status",
|
2016-01-29 20:53:56 +01:00
|
|
|
Expected: "failed",
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathAnyWaiterMatch, Argument: "Snapshots[].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 *DescribeClusterSnapshotsInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeClusterSnapshotsRequest(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
|
|
|
}
|