waiters.go 7.0 KB

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