123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package redshift
- import (
- "github.com/aws/aws-sdk-go/private/waiter"
- )
- // 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.
- func (c *Redshift) WaitUntilClusterAvailable(input *DescribeClustersInput) error {
- waiterCfg := waiter.Config{
- Operation: "DescribeClusters",
- Delay: 60,
- MaxAttempts: 30,
- Acceptors: []waiter.WaitAcceptor{
- {
- State: "success",
- Matcher: "pathAll",
- Argument: "Clusters[].ClusterStatus",
- Expected: "available",
- },
- {
- State: "failure",
- Matcher: "pathAny",
- Argument: "Clusters[].ClusterStatus",
- Expected: "deleting",
- },
- {
- State: "retry",
- Matcher: "error",
- Argument: "",
- Expected: "ClusterNotFound",
- },
- },
- }
- w := waiter.Waiter{
- Client: c,
- Input: input,
- Config: waiterCfg,
- }
- return w.Wait()
- }
- // 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.
- func (c *Redshift) WaitUntilClusterDeleted(input *DescribeClustersInput) error {
- waiterCfg := waiter.Config{
- Operation: "DescribeClusters",
- Delay: 60,
- MaxAttempts: 30,
- Acceptors: []waiter.WaitAcceptor{
- {
- State: "success",
- Matcher: "error",
- Argument: "",
- Expected: "ClusterNotFound",
- },
- {
- State: "failure",
- Matcher: "pathAny",
- Argument: "Clusters[].ClusterStatus",
- Expected: "creating",
- },
- {
- State: "failure",
- Matcher: "pathAny",
- Argument: "Clusters[].ClusterStatus",
- Expected: "modifying",
- },
- },
- }
- w := waiter.Waiter{
- Client: c,
- Input: input,
- Config: waiterCfg,
- }
- return w.Wait()
- }
- // 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.
- func (c *Redshift) WaitUntilClusterRestored(input *DescribeClustersInput) error {
- waiterCfg := waiter.Config{
- Operation: "DescribeClusters",
- Delay: 60,
- MaxAttempts: 30,
- Acceptors: []waiter.WaitAcceptor{
- {
- State: "success",
- Matcher: "pathAll",
- Argument: "Clusters[].RestoreStatus.Status",
- Expected: "completed",
- },
- {
- State: "failure",
- Matcher: "pathAny",
- Argument: "Clusters[].ClusterStatus",
- Expected: "deleting",
- },
- },
- }
- w := waiter.Waiter{
- Client: c,
- Input: input,
- Config: waiterCfg,
- }
- return w.Wait()
- }
- // 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.
- func (c *Redshift) WaitUntilSnapshotAvailable(input *DescribeClusterSnapshotsInput) error {
- waiterCfg := waiter.Config{
- Operation: "DescribeClusterSnapshots",
- Delay: 15,
- MaxAttempts: 20,
- Acceptors: []waiter.WaitAcceptor{
- {
- State: "success",
- Matcher: "pathAll",
- Argument: "Snapshots[].Status",
- Expected: "available",
- },
- {
- State: "failure",
- Matcher: "pathAny",
- Argument: "Snapshots[].Status",
- Expected: "failed",
- },
- {
- State: "failure",
- Matcher: "pathAny",
- Argument: "Snapshots[].Status",
- Expected: "deleted",
- },
- },
- }
- w := waiter.Waiter{
- Client: c,
- Input: input,
- Config: waiterCfg,
- }
- return w.Wait()
- }
|