2016-03-11 01:27:37 +01:00
|
|
|
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
|
|
|
|
|
|
|
package autoscaling
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/aws/aws-sdk-go/private/waiter"
|
|
|
|
)
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilGroupExists uses the Auto Scaling API operation
|
|
|
|
// DescribeAutoScalingGroups to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-03-11 01:27:37 +01:00
|
|
|
func (c *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "DescribeAutoScalingGroups",
|
|
|
|
Delay: 5,
|
|
|
|
MaxAttempts: 10,
|
|
|
|
Acceptors: []waiter.WaitAcceptor{
|
|
|
|
{
|
|
|
|
State: "success",
|
2016-04-02 17:17:21 +02:00
|
|
|
Matcher: "path",
|
|
|
|
Argument: "length(AutoScalingGroups) > `0`",
|
|
|
|
Expected: true,
|
2016-03-11 01:27:37 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
State: "retry",
|
2016-04-02 17:17:21 +02:00
|
|
|
Matcher: "path",
|
|
|
|
Argument: "length(AutoScalingGroups) > `0`",
|
|
|
|
Expected: false,
|
2016-03-11 01:27:37 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
w := waiter.Waiter{
|
|
|
|
Client: c,
|
|
|
|
Input: input,
|
|
|
|
Config: waiterCfg,
|
|
|
|
}
|
|
|
|
return w.Wait()
|
|
|
|
}
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilGroupInService uses the Auto Scaling API operation
|
|
|
|
// DescribeAutoScalingGroups to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-03-11 01:27:37 +01:00
|
|
|
func (c *AutoScaling) WaitUntilGroupInService(input *DescribeAutoScalingGroupsInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "DescribeAutoScalingGroups",
|
|
|
|
Delay: 15,
|
|
|
|
MaxAttempts: 40,
|
|
|
|
Acceptors: []waiter.WaitAcceptor{
|
|
|
|
{
|
|
|
|
State: "success",
|
2016-04-02 17:17:21 +02:00
|
|
|
Matcher: "path",
|
2016-03-11 01:27:37 +01:00
|
|
|
Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)",
|
|
|
|
Expected: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
State: "retry",
|
2016-04-02 17:17:21 +02:00
|
|
|
Matcher: "path",
|
2016-03-11 01:27:37 +01:00
|
|
|
Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)",
|
|
|
|
Expected: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
w := waiter.Waiter{
|
|
|
|
Client: c,
|
|
|
|
Input: input,
|
|
|
|
Config: waiterCfg,
|
|
|
|
}
|
|
|
|
return w.Wait()
|
|
|
|
}
|
|
|
|
|
2016-10-17 23:21:08 +02:00
|
|
|
// WaitUntilGroupNotExists uses the Auto Scaling API operation
|
|
|
|
// DescribeAutoScalingGroups to wait for a condition to be met before returning.
|
|
|
|
// If the condition is not meet within the max attempt window an error will
|
|
|
|
// be returned.
|
2016-03-11 01:27:37 +01:00
|
|
|
func (c *AutoScaling) WaitUntilGroupNotExists(input *DescribeAutoScalingGroupsInput) error {
|
|
|
|
waiterCfg := waiter.Config{
|
|
|
|
Operation: "DescribeAutoScalingGroups",
|
|
|
|
Delay: 15,
|
|
|
|
MaxAttempts: 40,
|
|
|
|
Acceptors: []waiter.WaitAcceptor{
|
|
|
|
{
|
|
|
|
State: "success",
|
2016-04-02 17:17:21 +02:00
|
|
|
Matcher: "path",
|
|
|
|
Argument: "length(AutoScalingGroups) > `0`",
|
|
|
|
Expected: false,
|
2016-03-11 01:27:37 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
State: "retry",
|
2016-04-02 17:17:21 +02:00
|
|
|
Matcher: "path",
|
|
|
|
Argument: "length(AutoScalingGroups) > `0`",
|
|
|
|
Expected: true,
|
2016-03-11 01:27:37 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
w := waiter.Waiter{
|
|
|
|
Client: c,
|
|
|
|
Input: input,
|
|
|
|
Config: waiterCfg,
|
|
|
|
}
|
|
|
|
return w.Wait()
|
|
|
|
}
|