waiters.go 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package opsworks
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilAppExists uses the AWS OpsWorks API operation
  7. // DescribeApps 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 *OpsWorks) WaitUntilAppExists(input *DescribeAppsInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeApps",
  13. Delay: 1,
  14. MaxAttempts: 40,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "status",
  19. Argument: "",
  20. Expected: 200,
  21. },
  22. {
  23. State: "failure",
  24. Matcher: "status",
  25. Argument: "",
  26. Expected: 400,
  27. },
  28. },
  29. }
  30. w := waiter.Waiter{
  31. Client: c,
  32. Input: input,
  33. Config: waiterCfg,
  34. }
  35. return w.Wait()
  36. }
  37. // WaitUntilDeploymentSuccessful uses the AWS OpsWorks API operation
  38. // DescribeDeployments to wait for a condition to be met before returning.
  39. // If the condition is not meet within the max attempt window an error will
  40. // be returned.
  41. func (c *OpsWorks) WaitUntilDeploymentSuccessful(input *DescribeDeploymentsInput) error {
  42. waiterCfg := waiter.Config{
  43. Operation: "DescribeDeployments",
  44. Delay: 15,
  45. MaxAttempts: 40,
  46. Acceptors: []waiter.WaitAcceptor{
  47. {
  48. State: "success",
  49. Matcher: "pathAll",
  50. Argument: "Deployments[].Status",
  51. Expected: "successful",
  52. },
  53. {
  54. State: "failure",
  55. Matcher: "pathAny",
  56. Argument: "Deployments[].Status",
  57. Expected: "failed",
  58. },
  59. },
  60. }
  61. w := waiter.Waiter{
  62. Client: c,
  63. Input: input,
  64. Config: waiterCfg,
  65. }
  66. return w.Wait()
  67. }
  68. // WaitUntilInstanceOnline uses the AWS OpsWorks API operation
  69. // DescribeInstances to wait for a condition to be met before returning.
  70. // If the condition is not meet within the max attempt window an error will
  71. // be returned.
  72. func (c *OpsWorks) WaitUntilInstanceOnline(input *DescribeInstancesInput) error {
  73. waiterCfg := waiter.Config{
  74. Operation: "DescribeInstances",
  75. Delay: 15,
  76. MaxAttempts: 40,
  77. Acceptors: []waiter.WaitAcceptor{
  78. {
  79. State: "success",
  80. Matcher: "pathAll",
  81. Argument: "Instances[].Status",
  82. Expected: "online",
  83. },
  84. {
  85. State: "failure",
  86. Matcher: "pathAny",
  87. Argument: "Instances[].Status",
  88. Expected: "setup_failed",
  89. },
  90. {
  91. State: "failure",
  92. Matcher: "pathAny",
  93. Argument: "Instances[].Status",
  94. Expected: "shutting_down",
  95. },
  96. {
  97. State: "failure",
  98. Matcher: "pathAny",
  99. Argument: "Instances[].Status",
  100. Expected: "start_failed",
  101. },
  102. {
  103. State: "failure",
  104. Matcher: "pathAny",
  105. Argument: "Instances[].Status",
  106. Expected: "stopped",
  107. },
  108. {
  109. State: "failure",
  110. Matcher: "pathAny",
  111. Argument: "Instances[].Status",
  112. Expected: "stopping",
  113. },
  114. {
  115. State: "failure",
  116. Matcher: "pathAny",
  117. Argument: "Instances[].Status",
  118. Expected: "terminating",
  119. },
  120. {
  121. State: "failure",
  122. Matcher: "pathAny",
  123. Argument: "Instances[].Status",
  124. Expected: "terminated",
  125. },
  126. {
  127. State: "failure",
  128. Matcher: "pathAny",
  129. Argument: "Instances[].Status",
  130. Expected: "stop_failed",
  131. },
  132. },
  133. }
  134. w := waiter.Waiter{
  135. Client: c,
  136. Input: input,
  137. Config: waiterCfg,
  138. }
  139. return w.Wait()
  140. }
  141. // WaitUntilInstanceRegistered uses the AWS OpsWorks API operation
  142. // DescribeInstances to wait for a condition to be met before returning.
  143. // If the condition is not meet within the max attempt window an error will
  144. // be returned.
  145. func (c *OpsWorks) WaitUntilInstanceRegistered(input *DescribeInstancesInput) error {
  146. waiterCfg := waiter.Config{
  147. Operation: "DescribeInstances",
  148. Delay: 15,
  149. MaxAttempts: 40,
  150. Acceptors: []waiter.WaitAcceptor{
  151. {
  152. State: "success",
  153. Matcher: "pathAll",
  154. Argument: "Instances[].Status",
  155. Expected: "registered",
  156. },
  157. {
  158. State: "failure",
  159. Matcher: "pathAny",
  160. Argument: "Instances[].Status",
  161. Expected: "setup_failed",
  162. },
  163. {
  164. State: "failure",
  165. Matcher: "pathAny",
  166. Argument: "Instances[].Status",
  167. Expected: "shutting_down",
  168. },
  169. {
  170. State: "failure",
  171. Matcher: "pathAny",
  172. Argument: "Instances[].Status",
  173. Expected: "stopped",
  174. },
  175. {
  176. State: "failure",
  177. Matcher: "pathAny",
  178. Argument: "Instances[].Status",
  179. Expected: "stopping",
  180. },
  181. {
  182. State: "failure",
  183. Matcher: "pathAny",
  184. Argument: "Instances[].Status",
  185. Expected: "terminating",
  186. },
  187. {
  188. State: "failure",
  189. Matcher: "pathAny",
  190. Argument: "Instances[].Status",
  191. Expected: "terminated",
  192. },
  193. {
  194. State: "failure",
  195. Matcher: "pathAny",
  196. Argument: "Instances[].Status",
  197. Expected: "stop_failed",
  198. },
  199. },
  200. }
  201. w := waiter.Waiter{
  202. Client: c,
  203. Input: input,
  204. Config: waiterCfg,
  205. }
  206. return w.Wait()
  207. }
  208. // WaitUntilInstanceStopped uses the AWS OpsWorks API operation
  209. // DescribeInstances to wait for a condition to be met before returning.
  210. // If the condition is not meet within the max attempt window an error will
  211. // be returned.
  212. func (c *OpsWorks) WaitUntilInstanceStopped(input *DescribeInstancesInput) error {
  213. waiterCfg := waiter.Config{
  214. Operation: "DescribeInstances",
  215. Delay: 15,
  216. MaxAttempts: 40,
  217. Acceptors: []waiter.WaitAcceptor{
  218. {
  219. State: "success",
  220. Matcher: "pathAll",
  221. Argument: "Instances[].Status",
  222. Expected: "stopped",
  223. },
  224. {
  225. State: "failure",
  226. Matcher: "pathAny",
  227. Argument: "Instances[].Status",
  228. Expected: "booting",
  229. },
  230. {
  231. State: "failure",
  232. Matcher: "pathAny",
  233. Argument: "Instances[].Status",
  234. Expected: "online",
  235. },
  236. {
  237. State: "failure",
  238. Matcher: "pathAny",
  239. Argument: "Instances[].Status",
  240. Expected: "pending",
  241. },
  242. {
  243. State: "failure",
  244. Matcher: "pathAny",
  245. Argument: "Instances[].Status",
  246. Expected: "rebooting",
  247. },
  248. {
  249. State: "failure",
  250. Matcher: "pathAny",
  251. Argument: "Instances[].Status",
  252. Expected: "requested",
  253. },
  254. {
  255. State: "failure",
  256. Matcher: "pathAny",
  257. Argument: "Instances[].Status",
  258. Expected: "running_setup",
  259. },
  260. {
  261. State: "failure",
  262. Matcher: "pathAny",
  263. Argument: "Instances[].Status",
  264. Expected: "setup_failed",
  265. },
  266. {
  267. State: "failure",
  268. Matcher: "pathAny",
  269. Argument: "Instances[].Status",
  270. Expected: "start_failed",
  271. },
  272. {
  273. State: "failure",
  274. Matcher: "pathAny",
  275. Argument: "Instances[].Status",
  276. Expected: "stop_failed",
  277. },
  278. },
  279. }
  280. w := waiter.Waiter{
  281. Client: c,
  282. Input: input,
  283. Config: waiterCfg,
  284. }
  285. return w.Wait()
  286. }
  287. // WaitUntilInstanceTerminated uses the AWS OpsWorks API operation
  288. // DescribeInstances to wait for a condition to be met before returning.
  289. // If the condition is not meet within the max attempt window an error will
  290. // be returned.
  291. func (c *OpsWorks) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error {
  292. waiterCfg := waiter.Config{
  293. Operation: "DescribeInstances",
  294. Delay: 15,
  295. MaxAttempts: 40,
  296. Acceptors: []waiter.WaitAcceptor{
  297. {
  298. State: "success",
  299. Matcher: "pathAll",
  300. Argument: "Instances[].Status",
  301. Expected: "terminated",
  302. },
  303. {
  304. State: "success",
  305. Matcher: "error",
  306. Argument: "",
  307. Expected: "ResourceNotFoundException",
  308. },
  309. {
  310. State: "failure",
  311. Matcher: "pathAny",
  312. Argument: "Instances[].Status",
  313. Expected: "booting",
  314. },
  315. {
  316. State: "failure",
  317. Matcher: "pathAny",
  318. Argument: "Instances[].Status",
  319. Expected: "online",
  320. },
  321. {
  322. State: "failure",
  323. Matcher: "pathAny",
  324. Argument: "Instances[].Status",
  325. Expected: "pending",
  326. },
  327. {
  328. State: "failure",
  329. Matcher: "pathAny",
  330. Argument: "Instances[].Status",
  331. Expected: "rebooting",
  332. },
  333. {
  334. State: "failure",
  335. Matcher: "pathAny",
  336. Argument: "Instances[].Status",
  337. Expected: "requested",
  338. },
  339. {
  340. State: "failure",
  341. Matcher: "pathAny",
  342. Argument: "Instances[].Status",
  343. Expected: "running_setup",
  344. },
  345. {
  346. State: "failure",
  347. Matcher: "pathAny",
  348. Argument: "Instances[].Status",
  349. Expected: "setup_failed",
  350. },
  351. {
  352. State: "failure",
  353. Matcher: "pathAny",
  354. Argument: "Instances[].Status",
  355. Expected: "start_failed",
  356. },
  357. },
  358. }
  359. w := waiter.Waiter{
  360. Client: c,
  361. Input: input,
  362. Config: waiterCfg,
  363. }
  364. return w.Wait()
  365. }