waiters.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. func (c *ElastiCache) WaitUntilCacheClusterAvailable(input *DescribeCacheClustersInput) error {
  7. waiterCfg := waiter.Config{
  8. Operation: "DescribeCacheClusters",
  9. Delay: 15,
  10. MaxAttempts: 40,
  11. Acceptors: []waiter.WaitAcceptor{
  12. {
  13. State: "success",
  14. Matcher: "pathAll",
  15. Argument: "CacheClusters[].CacheClusterStatus",
  16. Expected: "available",
  17. },
  18. {
  19. State: "failure",
  20. Matcher: "pathAny",
  21. Argument: "CacheClusters[].CacheClusterStatus",
  22. Expected: "deleted",
  23. },
  24. {
  25. State: "failure",
  26. Matcher: "pathAny",
  27. Argument: "CacheClusters[].CacheClusterStatus",
  28. Expected: "deleting",
  29. },
  30. {
  31. State: "failure",
  32. Matcher: "pathAny",
  33. Argument: "CacheClusters[].CacheClusterStatus",
  34. Expected: "incompatible-network",
  35. },
  36. {
  37. State: "failure",
  38. Matcher: "pathAny",
  39. Argument: "CacheClusters[].CacheClusterStatus",
  40. Expected: "restore-failed",
  41. },
  42. },
  43. }
  44. w := waiter.Waiter{
  45. Client: c,
  46. Input: input,
  47. Config: waiterCfg,
  48. }
  49. return w.Wait()
  50. }
  51. func (c *ElastiCache) WaitUntilCacheClusterDeleted(input *DescribeCacheClustersInput) error {
  52. waiterCfg := waiter.Config{
  53. Operation: "DescribeCacheClusters",
  54. Delay: 15,
  55. MaxAttempts: 40,
  56. Acceptors: []waiter.WaitAcceptor{
  57. {
  58. State: "success",
  59. Matcher: "pathAll",
  60. Argument: "CacheClusters[].CacheClusterStatus",
  61. Expected: "deleted",
  62. },
  63. {
  64. State: "success",
  65. Matcher: "error",
  66. Argument: "",
  67. Expected: "CacheClusterNotFound",
  68. },
  69. {
  70. State: "failure",
  71. Matcher: "pathAny",
  72. Argument: "CacheClusters[].CacheClusterStatus",
  73. Expected: "available",
  74. },
  75. {
  76. State: "failure",
  77. Matcher: "pathAny",
  78. Argument: "CacheClusters[].CacheClusterStatus",
  79. Expected: "creating",
  80. },
  81. {
  82. State: "failure",
  83. Matcher: "pathAny",
  84. Argument: "CacheClusters[].CacheClusterStatus",
  85. Expected: "incompatible-network",
  86. },
  87. {
  88. State: "failure",
  89. Matcher: "pathAny",
  90. Argument: "CacheClusters[].CacheClusterStatus",
  91. Expected: "modifying",
  92. },
  93. {
  94. State: "failure",
  95. Matcher: "pathAny",
  96. Argument: "CacheClusters[].CacheClusterStatus",
  97. Expected: "restore-failed",
  98. },
  99. {
  100. State: "failure",
  101. Matcher: "pathAny",
  102. Argument: "CacheClusters[].CacheClusterStatus",
  103. Expected: "snapshotting",
  104. },
  105. },
  106. }
  107. w := waiter.Waiter{
  108. Client: c,
  109. Input: input,
  110. Config: waiterCfg,
  111. }
  112. return w.Wait()
  113. }
  114. func (c *ElastiCache) WaitUntilReplicationGroupAvailable(input *DescribeReplicationGroupsInput) error {
  115. waiterCfg := waiter.Config{
  116. Operation: "DescribeReplicationGroups",
  117. Delay: 15,
  118. MaxAttempts: 40,
  119. Acceptors: []waiter.WaitAcceptor{
  120. {
  121. State: "success",
  122. Matcher: "pathAll",
  123. Argument: "ReplicationGroups[].Status",
  124. Expected: "available",
  125. },
  126. {
  127. State: "failure",
  128. Matcher: "pathAny",
  129. Argument: "ReplicationGroups[].Status",
  130. Expected: "deleted",
  131. },
  132. },
  133. }
  134. w := waiter.Waiter{
  135. Client: c,
  136. Input: input,
  137. Config: waiterCfg,
  138. }
  139. return w.Wait()
  140. }
  141. func (c *ElastiCache) WaitUntilReplicationGroupDeleted(input *DescribeReplicationGroupsInput) error {
  142. waiterCfg := waiter.Config{
  143. Operation: "DescribeReplicationGroups",
  144. Delay: 15,
  145. MaxAttempts: 40,
  146. Acceptors: []waiter.WaitAcceptor{
  147. {
  148. State: "success",
  149. Matcher: "pathAll",
  150. Argument: "ReplicationGroups[].Status",
  151. Expected: "deleted",
  152. },
  153. {
  154. State: "failure",
  155. Matcher: "pathAny",
  156. Argument: "ReplicationGroups[].Status",
  157. Expected: "available",
  158. },
  159. {
  160. State: "success",
  161. Matcher: "error",
  162. Argument: "",
  163. Expected: "ReplicationGroupNotFoundFault",
  164. },
  165. },
  166. }
  167. w := waiter.Waiter{
  168. Client: c,
  169. Input: input,
  170. Config: waiterCfg,
  171. }
  172. return w.Wait()
  173. }