waiters.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package redshift
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. func (c *Redshift) WaitUntilClusterAvailable(input *DescribeClustersInput) error {
  7. waiterCfg := waiter.Config{
  8. Operation: "DescribeClusters",
  9. Delay: 60,
  10. MaxAttempts: 30,
  11. Acceptors: []waiter.WaitAcceptor{
  12. {
  13. State: "success",
  14. Matcher: "pathAll",
  15. Argument: "Clusters[].ClusterStatus",
  16. Expected: "available",
  17. },
  18. {
  19. State: "failure",
  20. Matcher: "pathAny",
  21. Argument: "Clusters[].ClusterStatus",
  22. Expected: "deleting",
  23. },
  24. {
  25. State: "retry",
  26. Matcher: "error",
  27. Argument: "",
  28. Expected: "ClusterNotFound",
  29. },
  30. },
  31. }
  32. w := waiter.Waiter{
  33. Client: c,
  34. Input: input,
  35. Config: waiterCfg,
  36. }
  37. return w.Wait()
  38. }
  39. func (c *Redshift) WaitUntilClusterDeleted(input *DescribeClustersInput) error {
  40. waiterCfg := waiter.Config{
  41. Operation: "DescribeClusters",
  42. Delay: 60,
  43. MaxAttempts: 30,
  44. Acceptors: []waiter.WaitAcceptor{
  45. {
  46. State: "success",
  47. Matcher: "error",
  48. Argument: "",
  49. Expected: "ClusterNotFound",
  50. },
  51. {
  52. State: "failure",
  53. Matcher: "pathAny",
  54. Argument: "Clusters[].ClusterStatus",
  55. Expected: "creating",
  56. },
  57. {
  58. State: "failure",
  59. Matcher: "pathList",
  60. Argument: "Clusters[].ClusterStatus",
  61. Expected: "pathAny",
  62. },
  63. },
  64. }
  65. w := waiter.Waiter{
  66. Client: c,
  67. Input: input,
  68. Config: waiterCfg,
  69. }
  70. return w.Wait()
  71. }
  72. func (c *Redshift) WaitUntilClusterRestored(input *DescribeClustersInput) error {
  73. waiterCfg := waiter.Config{
  74. Operation: "DescribeClusters",
  75. Delay: 60,
  76. MaxAttempts: 30,
  77. Acceptors: []waiter.WaitAcceptor{
  78. {
  79. State: "success",
  80. Matcher: "pathAll",
  81. Argument: "Clusters[].RestoreStatus.Status",
  82. Expected: "completed",
  83. },
  84. {
  85. State: "failure",
  86. Matcher: "pathAny",
  87. Argument: "Clusters[].ClusterStatus",
  88. Expected: "deleting",
  89. },
  90. },
  91. }
  92. w := waiter.Waiter{
  93. Client: c,
  94. Input: input,
  95. Config: waiterCfg,
  96. }
  97. return w.Wait()
  98. }
  99. func (c *Redshift) WaitUntilSnapshotAvailable(input *DescribeClusterSnapshotsInput) error {
  100. waiterCfg := waiter.Config{
  101. Operation: "DescribeClusterSnapshots",
  102. Delay: 15,
  103. MaxAttempts: 20,
  104. Acceptors: []waiter.WaitAcceptor{
  105. {
  106. State: "success",
  107. Matcher: "pathAll",
  108. Argument: "Snapshots[].Status",
  109. Expected: "available",
  110. },
  111. {
  112. State: "failure",
  113. Matcher: "pathAny",
  114. Argument: "Snapshots[].Status",
  115. Expected: "failed",
  116. },
  117. {
  118. State: "failure",
  119. Matcher: "pathAny",
  120. Argument: "Snapshots[].Status",
  121. Expected: "deleted",
  122. },
  123. },
  124. }
  125. w := waiter.Waiter{
  126. Client: c,
  127. Input: input,
  128. Config: waiterCfg,
  129. }
  130. return w.Wait()
  131. }