waiters.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elasticache
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilCacheClusterAvailable uses the Amazon ElastiCache API operation
  7. // DescribeCacheClusters to wait for a condition to be met before returning.
  8. // If the condition is not meet within the max attempt window an error will
  9. // be returned.
  10. func (c *ElastiCache) WaitUntilCacheClusterAvailable(input *DescribeCacheClustersInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeCacheClusters",
  13. Delay: 15,
  14. MaxAttempts: 40,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "pathAll",
  19. Argument: "CacheClusters[].CacheClusterStatus",
  20. Expected: "available",
  21. },
  22. {
  23. State: "failure",
  24. Matcher: "pathAny",
  25. Argument: "CacheClusters[].CacheClusterStatus",
  26. Expected: "deleted",
  27. },
  28. {
  29. State: "failure",
  30. Matcher: "pathAny",
  31. Argument: "CacheClusters[].CacheClusterStatus",
  32. Expected: "deleting",
  33. },
  34. {
  35. State: "failure",
  36. Matcher: "pathAny",
  37. Argument: "CacheClusters[].CacheClusterStatus",
  38. Expected: "incompatible-network",
  39. },
  40. {
  41. State: "failure",
  42. Matcher: "pathAny",
  43. Argument: "CacheClusters[].CacheClusterStatus",
  44. Expected: "restore-failed",
  45. },
  46. },
  47. }
  48. w := waiter.Waiter{
  49. Client: c,
  50. Input: input,
  51. Config: waiterCfg,
  52. }
  53. return w.Wait()
  54. }
  55. // WaitUntilCacheClusterDeleted uses the Amazon ElastiCache API operation
  56. // DescribeCacheClusters to wait for a condition to be met before returning.
  57. // If the condition is not meet within the max attempt window an error will
  58. // be returned.
  59. func (c *ElastiCache) WaitUntilCacheClusterDeleted(input *DescribeCacheClustersInput) error {
  60. waiterCfg := waiter.Config{
  61. Operation: "DescribeCacheClusters",
  62. Delay: 15,
  63. MaxAttempts: 40,
  64. Acceptors: []waiter.WaitAcceptor{
  65. {
  66. State: "success",
  67. Matcher: "pathAll",
  68. Argument: "CacheClusters[].CacheClusterStatus",
  69. Expected: "deleted",
  70. },
  71. {
  72. State: "success",
  73. Matcher: "error",
  74. Argument: "",
  75. Expected: "CacheClusterNotFound",
  76. },
  77. {
  78. State: "failure",
  79. Matcher: "pathAny",
  80. Argument: "CacheClusters[].CacheClusterStatus",
  81. Expected: "available",
  82. },
  83. {
  84. State: "failure",
  85. Matcher: "pathAny",
  86. Argument: "CacheClusters[].CacheClusterStatus",
  87. Expected: "creating",
  88. },
  89. {
  90. State: "failure",
  91. Matcher: "pathAny",
  92. Argument: "CacheClusters[].CacheClusterStatus",
  93. Expected: "incompatible-network",
  94. },
  95. {
  96. State: "failure",
  97. Matcher: "pathAny",
  98. Argument: "CacheClusters[].CacheClusterStatus",
  99. Expected: "modifying",
  100. },
  101. {
  102. State: "failure",
  103. Matcher: "pathAny",
  104. Argument: "CacheClusters[].CacheClusterStatus",
  105. Expected: "restore-failed",
  106. },
  107. {
  108. State: "failure",
  109. Matcher: "pathAny",
  110. Argument: "CacheClusters[].CacheClusterStatus",
  111. Expected: "snapshotting",
  112. },
  113. },
  114. }
  115. w := waiter.Waiter{
  116. Client: c,
  117. Input: input,
  118. Config: waiterCfg,
  119. }
  120. return w.Wait()
  121. }
  122. // WaitUntilReplicationGroupAvailable uses the Amazon ElastiCache API operation
  123. // DescribeReplicationGroups to wait for a condition to be met before returning.
  124. // If the condition is not meet within the max attempt window an error will
  125. // be returned.
  126. func (c *ElastiCache) WaitUntilReplicationGroupAvailable(input *DescribeReplicationGroupsInput) error {
  127. waiterCfg := waiter.Config{
  128. Operation: "DescribeReplicationGroups",
  129. Delay: 15,
  130. MaxAttempts: 40,
  131. Acceptors: []waiter.WaitAcceptor{
  132. {
  133. State: "success",
  134. Matcher: "pathAll",
  135. Argument: "ReplicationGroups[].Status",
  136. Expected: "available",
  137. },
  138. {
  139. State: "failure",
  140. Matcher: "pathAny",
  141. Argument: "ReplicationGroups[].Status",
  142. Expected: "deleted",
  143. },
  144. },
  145. }
  146. w := waiter.Waiter{
  147. Client: c,
  148. Input: input,
  149. Config: waiterCfg,
  150. }
  151. return w.Wait()
  152. }
  153. // WaitUntilReplicationGroupDeleted uses the Amazon ElastiCache API operation
  154. // DescribeReplicationGroups to wait for a condition to be met before returning.
  155. // If the condition is not meet within the max attempt window an error will
  156. // be returned.
  157. func (c *ElastiCache) WaitUntilReplicationGroupDeleted(input *DescribeReplicationGroupsInput) error {
  158. waiterCfg := waiter.Config{
  159. Operation: "DescribeReplicationGroups",
  160. Delay: 15,
  161. MaxAttempts: 40,
  162. Acceptors: []waiter.WaitAcceptor{
  163. {
  164. State: "success",
  165. Matcher: "pathAll",
  166. Argument: "ReplicationGroups[].Status",
  167. Expected: "deleted",
  168. },
  169. {
  170. State: "failure",
  171. Matcher: "pathAny",
  172. Argument: "ReplicationGroups[].Status",
  173. Expected: "available",
  174. },
  175. {
  176. State: "success",
  177. Matcher: "error",
  178. Argument: "",
  179. Expected: "ReplicationGroupNotFoundFault",
  180. },
  181. },
  182. }
  183. w := waiter.Waiter{
  184. Client: c,
  185. Input: input,
  186. Config: waiterCfg,
  187. }
  188. return w.Wait()
  189. }