waiters.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package elb
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilAnyInstanceInService uses the Elastic Load Balancing API operation
  7. // DescribeInstanceHealth 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 *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeInstanceHealth",
  13. Delay: 15,
  14. MaxAttempts: 40,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "pathAny",
  19. Argument: "InstanceStates[].State",
  20. Expected: "InService",
  21. },
  22. },
  23. }
  24. w := waiter.Waiter{
  25. Client: c,
  26. Input: input,
  27. Config: waiterCfg,
  28. }
  29. return w.Wait()
  30. }
  31. // WaitUntilInstanceDeregistered uses the Elastic Load Balancing API operation
  32. // DescribeInstanceHealth to wait for a condition to be met before returning.
  33. // If the condition is not meet within the max attempt window an error will
  34. // be returned.
  35. func (c *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) error {
  36. waiterCfg := waiter.Config{
  37. Operation: "DescribeInstanceHealth",
  38. Delay: 15,
  39. MaxAttempts: 40,
  40. Acceptors: []waiter.WaitAcceptor{
  41. {
  42. State: "success",
  43. Matcher: "pathAll",
  44. Argument: "InstanceStates[].State",
  45. Expected: "OutOfService",
  46. },
  47. {
  48. State: "success",
  49. Matcher: "error",
  50. Argument: "",
  51. Expected: "InvalidInstance",
  52. },
  53. },
  54. }
  55. w := waiter.Waiter{
  56. Client: c,
  57. Input: input,
  58. Config: waiterCfg,
  59. }
  60. return w.Wait()
  61. }
  62. // WaitUntilInstanceInService uses the Elastic Load Balancing API operation
  63. // DescribeInstanceHealth to wait for a condition to be met before returning.
  64. // If the condition is not meet within the max attempt window an error will
  65. // be returned.
  66. func (c *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error {
  67. waiterCfg := waiter.Config{
  68. Operation: "DescribeInstanceHealth",
  69. Delay: 15,
  70. MaxAttempts: 40,
  71. Acceptors: []waiter.WaitAcceptor{
  72. {
  73. State: "success",
  74. Matcher: "pathAll",
  75. Argument: "InstanceStates[].State",
  76. Expected: "InService",
  77. },
  78. },
  79. }
  80. w := waiter.Waiter{
  81. Client: c,
  82. Input: input,
  83. Config: waiterCfg,
  84. }
  85. return w.Wait()
  86. }