waiters.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. // WaitUntilClusterRunning uses the Amazon EMR API operation
  7. // DescribeCluster 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 *EMR) WaitUntilClusterRunning(input *DescribeClusterInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeCluster",
  13. Delay: 30,
  14. MaxAttempts: 60,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "path",
  19. Argument: "Cluster.Status.State",
  20. Expected: "RUNNING",
  21. },
  22. {
  23. State: "success",
  24. Matcher: "path",
  25. Argument: "Cluster.Status.State",
  26. Expected: "WAITING",
  27. },
  28. {
  29. State: "failure",
  30. Matcher: "path",
  31. Argument: "Cluster.Status.State",
  32. Expected: "TERMINATING",
  33. },
  34. {
  35. State: "failure",
  36. Matcher: "path",
  37. Argument: "Cluster.Status.State",
  38. Expected: "TERMINATED",
  39. },
  40. {
  41. State: "failure",
  42. Matcher: "path",
  43. Argument: "Cluster.Status.State",
  44. Expected: "TERMINATED_WITH_ERRORS",
  45. },
  46. },
  47. }
  48. w := waiter.Waiter{
  49. Client: c,
  50. Input: input,
  51. Config: waiterCfg,
  52. }
  53. return w.Wait()
  54. }
  55. // WaitUntilStepComplete uses the Amazon EMR API operation
  56. // DescribeStep to wait for a condition to be met before returning.
  57. // If the condition is not meet within the max attempt window an error will
  58. // be returned.
  59. func (c *EMR) WaitUntilStepComplete(input *DescribeStepInput) error {
  60. waiterCfg := waiter.Config{
  61. Operation: "DescribeStep",
  62. Delay: 30,
  63. MaxAttempts: 60,
  64. Acceptors: []waiter.WaitAcceptor{
  65. {
  66. State: "success",
  67. Matcher: "path",
  68. Argument: "Step.Status.State",
  69. Expected: "COMPLETED",
  70. },
  71. {
  72. State: "failure",
  73. Matcher: "path",
  74. Argument: "Step.Status.State",
  75. Expected: "FAILED",
  76. },
  77. {
  78. State: "failure",
  79. Matcher: "path",
  80. Argument: "Step.Status.State",
  81. Expected: "CANCELLED",
  82. },
  83. },
  84. }
  85. w := waiter.Waiter{
  86. Client: c,
  87. Input: input,
  88. Config: waiterCfg,
  89. }
  90. return w.Wait()
  91. }