waiters.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. func (c *RDS) WaitUntilDBInstanceAvailable(input *DescribeDBInstancesInput) error {
  7. waiterCfg := waiter.Config{
  8. Operation: "DescribeDBInstances",
  9. Delay: 30,
  10. MaxAttempts: 60,
  11. Acceptors: []waiter.WaitAcceptor{
  12. {
  13. State: "success",
  14. Matcher: "pathAll",
  15. Argument: "DBInstances[].DBInstanceStatus",
  16. Expected: "available",
  17. },
  18. {
  19. State: "failure",
  20. Matcher: "pathAny",
  21. Argument: "DBInstances[].DBInstanceStatus",
  22. Expected: "deleted",
  23. },
  24. {
  25. State: "failure",
  26. Matcher: "pathAny",
  27. Argument: "DBInstances[].DBInstanceStatus",
  28. Expected: "deleting",
  29. },
  30. {
  31. State: "failure",
  32. Matcher: "pathAny",
  33. Argument: "DBInstances[].DBInstanceStatus",
  34. Expected: "failed",
  35. },
  36. {
  37. State: "failure",
  38. Matcher: "pathAny",
  39. Argument: "DBInstances[].DBInstanceStatus",
  40. Expected: "incompatible-restore",
  41. },
  42. {
  43. State: "failure",
  44. Matcher: "pathAny",
  45. Argument: "DBInstances[].DBInstanceStatus",
  46. Expected: "incompatible-parameters",
  47. },
  48. },
  49. }
  50. w := waiter.Waiter{
  51. Client: c,
  52. Input: input,
  53. Config: waiterCfg,
  54. }
  55. return w.Wait()
  56. }
  57. func (c *RDS) WaitUntilDBInstanceDeleted(input *DescribeDBInstancesInput) error {
  58. waiterCfg := waiter.Config{
  59. Operation: "DescribeDBInstances",
  60. Delay: 30,
  61. MaxAttempts: 60,
  62. Acceptors: []waiter.WaitAcceptor{
  63. {
  64. State: "success",
  65. Matcher: "pathAll",
  66. Argument: "DBInstances[].DBInstanceStatus",
  67. Expected: "deleted",
  68. },
  69. {
  70. State: "success",
  71. Matcher: "error",
  72. Argument: "",
  73. Expected: "DBInstanceNotFound",
  74. },
  75. {
  76. State: "failure",
  77. Matcher: "pathAny",
  78. Argument: "DBInstances[].DBInstanceStatus",
  79. Expected: "creating",
  80. },
  81. {
  82. State: "failure",
  83. Matcher: "pathAny",
  84. Argument: "DBInstances[].DBInstanceStatus",
  85. Expected: "modifying",
  86. },
  87. {
  88. State: "failure",
  89. Matcher: "pathAny",
  90. Argument: "DBInstances[].DBInstanceStatus",
  91. Expected: "rebooting",
  92. },
  93. {
  94. State: "failure",
  95. Matcher: "pathAny",
  96. Argument: "DBInstances[].DBInstanceStatus",
  97. Expected: "resetting-master-credentials",
  98. },
  99. },
  100. }
  101. w := waiter.Waiter{
  102. Client: c,
  103. Input: input,
  104. Config: waiterCfg,
  105. }
  106. return w.Wait()
  107. }