waiters.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package ecs
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. func (c *ECS) WaitUntilServicesInactive(input *DescribeServicesInput) error {
  7. waiterCfg := waiter.Config{
  8. Operation: "DescribeServices",
  9. Delay: 15,
  10. MaxAttempts: 40,
  11. Acceptors: []waiter.WaitAcceptor{
  12. {
  13. State: "failure",
  14. Matcher: "pathAny",
  15. Argument: "failures[].reason",
  16. Expected: "MISSING",
  17. },
  18. {
  19. State: "success",
  20. Matcher: "pathAny",
  21. Argument: "services[].status",
  22. Expected: "INACTIVE",
  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 *ECS) WaitUntilServicesStable(input *DescribeServicesInput) error {
  34. waiterCfg := waiter.Config{
  35. Operation: "DescribeServices",
  36. Delay: 15,
  37. MaxAttempts: 40,
  38. Acceptors: []waiter.WaitAcceptor{
  39. {
  40. State: "failure",
  41. Matcher: "pathAny",
  42. Argument: "failures[].reason",
  43. Expected: "MISSING",
  44. },
  45. {
  46. State: "failure",
  47. Matcher: "pathAny",
  48. Argument: "services[].status",
  49. Expected: "DRAINING",
  50. },
  51. {
  52. State: "failure",
  53. Matcher: "pathAny",
  54. Argument: "services[].status",
  55. Expected: "INACTIVE",
  56. },
  57. {
  58. State: "success",
  59. Matcher: "path",
  60. Argument: "services | [@[?length(deployments)!=`1`], @[?desiredCount!=runningCount]][] | length(@) == `0`",
  61. Expected: true,
  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 *ECS) WaitUntilTasksRunning(input *DescribeTasksInput) error {
  73. waiterCfg := waiter.Config{
  74. Operation: "DescribeTasks",
  75. Delay: 6,
  76. MaxAttempts: 100,
  77. Acceptors: []waiter.WaitAcceptor{
  78. {
  79. State: "failure",
  80. Matcher: "pathAny",
  81. Argument: "tasks[].lastStatus",
  82. Expected: "STOPPED",
  83. },
  84. {
  85. State: "failure",
  86. Matcher: "pathAny",
  87. Argument: "failures[].reason",
  88. Expected: "MISSING",
  89. },
  90. {
  91. State: "success",
  92. Matcher: "pathAll",
  93. Argument: "tasks[].lastStatus",
  94. Expected: "RUNNING",
  95. },
  96. },
  97. }
  98. w := waiter.Waiter{
  99. Client: c,
  100. Input: input,
  101. Config: waiterCfg,
  102. }
  103. return w.Wait()
  104. }
  105. func (c *ECS) WaitUntilTasksStopped(input *DescribeTasksInput) error {
  106. waiterCfg := waiter.Config{
  107. Operation: "DescribeTasks",
  108. Delay: 6,
  109. MaxAttempts: 100,
  110. Acceptors: []waiter.WaitAcceptor{
  111. {
  112. State: "success",
  113. Matcher: "pathAll",
  114. Argument: "tasks[].lastStatus",
  115. Expected: "STOPPED",
  116. },
  117. },
  118. }
  119. w := waiter.Waiter{
  120. Client: c,
  121. Input: input,
  122. Config: waiterCfg,
  123. }
  124. return w.Wait()
  125. }