waiters.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package rds
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilDBInstanceAvailable uses the Amazon RDS API operation
  7. // DescribeDBInstances 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 *RDS) WaitUntilDBInstanceAvailable(input *DescribeDBInstancesInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeDBInstances",
  13. Delay: 30,
  14. MaxAttempts: 60,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "pathAll",
  19. Argument: "DBInstances[].DBInstanceStatus",
  20. Expected: "available",
  21. },
  22. {
  23. State: "failure",
  24. Matcher: "pathAny",
  25. Argument: "DBInstances[].DBInstanceStatus",
  26. Expected: "deleted",
  27. },
  28. {
  29. State: "failure",
  30. Matcher: "pathAny",
  31. Argument: "DBInstances[].DBInstanceStatus",
  32. Expected: "deleting",
  33. },
  34. {
  35. State: "failure",
  36. Matcher: "pathAny",
  37. Argument: "DBInstances[].DBInstanceStatus",
  38. Expected: "failed",
  39. },
  40. {
  41. State: "failure",
  42. Matcher: "pathAny",
  43. Argument: "DBInstances[].DBInstanceStatus",
  44. Expected: "incompatible-restore",
  45. },
  46. {
  47. State: "failure",
  48. Matcher: "pathAny",
  49. Argument: "DBInstances[].DBInstanceStatus",
  50. Expected: "incompatible-parameters",
  51. },
  52. },
  53. }
  54. w := waiter.Waiter{
  55. Client: c,
  56. Input: input,
  57. Config: waiterCfg,
  58. }
  59. return w.Wait()
  60. }
  61. // WaitUntilDBInstanceDeleted uses the Amazon RDS API operation
  62. // DescribeDBInstances to wait for a condition to be met before returning.
  63. // If the condition is not meet within the max attempt window an error will
  64. // be returned.
  65. func (c *RDS) WaitUntilDBInstanceDeleted(input *DescribeDBInstancesInput) error {
  66. waiterCfg := waiter.Config{
  67. Operation: "DescribeDBInstances",
  68. Delay: 30,
  69. MaxAttempts: 60,
  70. Acceptors: []waiter.WaitAcceptor{
  71. {
  72. State: "success",
  73. Matcher: "pathAll",
  74. Argument: "DBInstances[].DBInstanceStatus",
  75. Expected: "deleted",
  76. },
  77. {
  78. State: "success",
  79. Matcher: "error",
  80. Argument: "",
  81. Expected: "DBInstanceNotFound",
  82. },
  83. {
  84. State: "failure",
  85. Matcher: "pathAny",
  86. Argument: "DBInstances[].DBInstanceStatus",
  87. Expected: "creating",
  88. },
  89. {
  90. State: "failure",
  91. Matcher: "pathAny",
  92. Argument: "DBInstances[].DBInstanceStatus",
  93. Expected: "modifying",
  94. },
  95. {
  96. State: "failure",
  97. Matcher: "pathAny",
  98. Argument: "DBInstances[].DBInstanceStatus",
  99. Expected: "rebooting",
  100. },
  101. {
  102. State: "failure",
  103. Matcher: "pathAny",
  104. Argument: "DBInstances[].DBInstanceStatus",
  105. Expected: "resetting-master-credentials",
  106. },
  107. },
  108. }
  109. w := waiter.Waiter{
  110. Client: c,
  111. Input: input,
  112. Config: waiterCfg,
  113. }
  114. return w.Wait()
  115. }