waiters.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package emr
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. func (c *EMR) WaitUntilClusterRunning(input *DescribeClusterInput) error {
  7. waiterCfg := waiter.Config{
  8. Operation: "DescribeCluster",
  9. Delay: 30,
  10. MaxAttempts: 60,
  11. Acceptors: []waiter.WaitAcceptor{
  12. {
  13. State: "success",
  14. Matcher: "path",
  15. Argument: "Cluster.Status.State",
  16. Expected: "RUNNING",
  17. },
  18. {
  19. State: "success",
  20. Matcher: "path",
  21. Argument: "Cluster.Status.State",
  22. Expected: "WAITING",
  23. },
  24. {
  25. State: "failure",
  26. Matcher: "path",
  27. Argument: "Cluster.Status.State",
  28. Expected: "TERMINATING",
  29. },
  30. {
  31. State: "failure",
  32. Matcher: "path",
  33. Argument: "Cluster.Status.State",
  34. Expected: "TERMINATED",
  35. },
  36. {
  37. State: "failure",
  38. Matcher: "path",
  39. Argument: "Cluster.Status.State",
  40. Expected: "TERMINATED_WITH_ERRORS",
  41. },
  42. },
  43. }
  44. w := waiter.Waiter{
  45. Client: c,
  46. Input: input,
  47. Config: waiterCfg,
  48. }
  49. return w.Wait()
  50. }
  51. func (c *EMR) WaitUntilStepComplete(input *DescribeStepInput) error {
  52. waiterCfg := waiter.Config{
  53. Operation: "DescribeStep",
  54. Delay: 30,
  55. MaxAttempts: 60,
  56. Acceptors: []waiter.WaitAcceptor{
  57. {
  58. State: "success",
  59. Matcher: "path",
  60. Argument: "Step.Status.State",
  61. Expected: "COMPLETED",
  62. },
  63. {
  64. State: "failure",
  65. Matcher: "path",
  66. Argument: "Step.Status.State",
  67. Expected: "FAILED",
  68. },
  69. {
  70. State: "failure",
  71. Matcher: "path",
  72. Argument: "Step.Status.State",
  73. Expected: "CANCELLED",
  74. },
  75. },
  76. }
  77. w := waiter.Waiter{
  78. Client: c,
  79. Input: input,
  80. Config: waiterCfg,
  81. }
  82. return w.Wait()
  83. }