waiters.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package autoscaling
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilGroupExists uses the Auto Scaling API operation
  7. // DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeAutoScalingGroups",
  13. Delay: 5,
  14. MaxAttempts: 10,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "path",
  19. Argument: "length(AutoScalingGroups) > `0`",
  20. Expected: true,
  21. },
  22. {
  23. State: "retry",
  24. Matcher: "path",
  25. Argument: "length(AutoScalingGroups) > `0`",
  26. Expected: false,
  27. },
  28. },
  29. }
  30. w := waiter.Waiter{
  31. Client: c,
  32. Input: input,
  33. Config: waiterCfg,
  34. }
  35. return w.Wait()
  36. }
  37. // WaitUntilGroupInService uses the Auto Scaling API operation
  38. // DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupInService(input *DescribeAutoScalingGroupsInput) error {
  42. waiterCfg := waiter.Config{
  43. Operation: "DescribeAutoScalingGroups",
  44. Delay: 15,
  45. MaxAttempts: 40,
  46. Acceptors: []waiter.WaitAcceptor{
  47. {
  48. State: "success",
  49. Matcher: "path",
  50. Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)",
  51. Expected: false,
  52. },
  53. {
  54. State: "retry",
  55. Matcher: "path",
  56. Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)",
  57. Expected: true,
  58. },
  59. },
  60. }
  61. w := waiter.Waiter{
  62. Client: c,
  63. Input: input,
  64. Config: waiterCfg,
  65. }
  66. return w.Wait()
  67. }
  68. // WaitUntilGroupNotExists uses the Auto Scaling API operation
  69. // DescribeAutoScalingGroups 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 *AutoScaling) WaitUntilGroupNotExists(input *DescribeAutoScalingGroupsInput) error {
  73. waiterCfg := waiter.Config{
  74. Operation: "DescribeAutoScalingGroups",
  75. Delay: 15,
  76. MaxAttempts: 40,
  77. Acceptors: []waiter.WaitAcceptor{
  78. {
  79. State: "success",
  80. Matcher: "path",
  81. Argument: "length(AutoScalingGroups) > `0`",
  82. Expected: false,
  83. },
  84. {
  85. State: "retry",
  86. Matcher: "path",
  87. Argument: "length(AutoScalingGroups) > `0`",
  88. Expected: true,
  89. },
  90. },
  91. }
  92. w := waiter.Waiter{
  93. Client: c,
  94. Input: input,
  95. Config: waiterCfg,
  96. }
  97. return w.Wait()
  98. }