2017-04-05 09:45:27 +02:00
|
|
|
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
2016-03-11 01:27:37 +01:00
|
|
|
|
|
|
|
package autoscaling
|
|
|
|
|
|
|
|
import (
|
2017-04-05 09:45:27 +02:00
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/aws/aws-sdk-go/aws"
|
|
|
|
"github.com/aws/aws-sdk-go/aws/request"
|
2016-03-11 01:27:37 +01:00
|
|
|
)
|
|
|
|
|
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.
|
2017-09-05 15:21:07 +02:00
|
|
|
// If the condition is not met within the max attempt window, an error will
|
2016-10-17 23:21:08 +02:00
|
|
|
// be returned.
|
2016-03-11 01:27:37 +01:00
|
|
|
func (c *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilGroupExistsWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilGroupExistsWithContext is an extended version of WaitUntilGroupExists.
|
|
|
|
// With the support for passing in a context and options to configure the
|
|
|
|
// Waiter and the underlying request options.
|
|
|
|
//
|
|
|
|
// The context must be non-nil and will be used for request cancellation. If
|
|
|
|
// the context is nil a panic will occur. In the future the SDK may create
|
|
|
|
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
|
|
|
// for more information on using Contexts.
|
|
|
|
func (c *AutoScaling) WaitUntilGroupExistsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilGroupExists",
|
2016-03-11 01:27:37 +01:00
|
|
|
MaxAttempts: 10,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
|
|
|
Acceptors: []request.WaiterAcceptor{
|
2016-03-11 01:27:37 +01:00
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`",
|
2016-04-02 17:17:21 +02:00
|
|
|
Expected: true,
|
2016-03-11 01:27:37 +01:00
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.RetryWaiterState,
|
|
|
|
Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`",
|
2016-04-02 17:17:21 +02:00
|
|
|
Expected: false,
|
2016-03-11 01:27:37 +01:00
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeAutoScalingGroupsInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeAutoScalingGroupsRequest(inCpy)
|
|
|
|
req.SetContext(ctx)
|
|
|
|
req.ApplyOptions(opts...)
|
|
|
|
return req, nil
|
|
|
|
},
|
2016-03-11 01:27:37 +01:00
|
|
|
}
|
2017-04-05 09:45:27 +02:00
|
|
|
w.ApplyOptions(opts...)
|
2016-03-11 01:27:37 +01:00
|
|
|
|
2017-04-05 09:45:27 +02:00
|
|
|
return w.WaitWithContext(ctx)
|
2016-03-11 01:27:37 +01:00
|
|
|
}
|
|
|
|
|
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.
|
2017-09-05 15:21:07 +02:00
|
|
|
// If the condition is not met within the max attempt window, an error will
|
2016-10-17 23:21:08 +02:00
|
|
|
// be returned.
|
2016-03-11 01:27:37 +01:00
|
|
|
func (c *AutoScaling) WaitUntilGroupInService(input *DescribeAutoScalingGroupsInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilGroupInServiceWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilGroupInServiceWithContext is an extended version of WaitUntilGroupInService.
|
|
|
|
// With the support for passing in a context and options to configure the
|
|
|
|
// Waiter and the underlying request options.
|
|
|
|
//
|
|
|
|
// The context must be non-nil and will be used for request cancellation. If
|
|
|
|
// the context is nil a panic will occur. In the future the SDK may create
|
|
|
|
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
|
|
|
// for more information on using Contexts.
|
|
|
|
func (c *AutoScaling) WaitUntilGroupInServiceWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilGroupInService",
|
2016-03-11 01:27:37 +01:00
|
|
|
MaxAttempts: 40,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
|
|
|
Acceptors: []request.WaiterAcceptor{
|
2016-03-11 01:27:37 +01:00
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.PathWaiterMatch, Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)",
|
2016-03-11 01:27:37 +01:00
|
|
|
Expected: false,
|
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.RetryWaiterState,
|
|
|
|
Matcher: request.PathWaiterMatch, Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)",
|
2016-03-11 01:27:37 +01:00
|
|
|
Expected: true,
|
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeAutoScalingGroupsInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeAutoScalingGroupsRequest(inCpy)
|
|
|
|
req.SetContext(ctx)
|
|
|
|
req.ApplyOptions(opts...)
|
|
|
|
return req, nil
|
|
|
|
},
|
2016-03-11 01:27:37 +01:00
|
|
|
}
|
2017-04-05 09:45:27 +02:00
|
|
|
w.ApplyOptions(opts...)
|
2016-03-11 01:27:37 +01:00
|
|
|
|
2017-04-05 09:45:27 +02:00
|
|
|
return w.WaitWithContext(ctx)
|
2016-03-11 01:27:37 +01:00
|
|
|
}
|
|
|
|
|
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.
|
2017-09-05 15:21:07 +02:00
|
|
|
// If the condition is not met within the max attempt window, an error will
|
2016-10-17 23:21:08 +02:00
|
|
|
// be returned.
|
2016-03-11 01:27:37 +01:00
|
|
|
func (c *AutoScaling) WaitUntilGroupNotExists(input *DescribeAutoScalingGroupsInput) error {
|
2017-04-05 09:45:27 +02:00
|
|
|
return c.WaitUntilGroupNotExistsWithContext(aws.BackgroundContext(), input)
|
|
|
|
}
|
|
|
|
|
|
|
|
// WaitUntilGroupNotExistsWithContext is an extended version of WaitUntilGroupNotExists.
|
|
|
|
// With the support for passing in a context and options to configure the
|
|
|
|
// Waiter and the underlying request options.
|
|
|
|
//
|
|
|
|
// The context must be non-nil and will be used for request cancellation. If
|
|
|
|
// the context is nil a panic will occur. In the future the SDK may create
|
|
|
|
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
|
|
|
// for more information on using Contexts.
|
|
|
|
func (c *AutoScaling) WaitUntilGroupNotExistsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error {
|
|
|
|
w := request.Waiter{
|
|
|
|
Name: "WaitUntilGroupNotExists",
|
2016-03-11 01:27:37 +01:00
|
|
|
MaxAttempts: 40,
|
2017-04-05 09:45:27 +02:00
|
|
|
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
|
|
|
Acceptors: []request.WaiterAcceptor{
|
2016-03-11 01:27:37 +01:00
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.SuccessWaiterState,
|
|
|
|
Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`",
|
2016-04-02 17:17:21 +02:00
|
|
|
Expected: false,
|
2016-03-11 01:27:37 +01:00
|
|
|
},
|
|
|
|
{
|
2017-04-05 09:45:27 +02:00
|
|
|
State: request.RetryWaiterState,
|
|
|
|
Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`",
|
2016-04-02 17:17:21 +02:00
|
|
|
Expected: true,
|
2016-03-11 01:27:37 +01:00
|
|
|
},
|
|
|
|
},
|
2017-04-05 09:45:27 +02:00
|
|
|
Logger: c.Config.Logger,
|
|
|
|
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
|
|
|
var inCpy *DescribeAutoScalingGroupsInput
|
|
|
|
if input != nil {
|
|
|
|
tmp := *input
|
|
|
|
inCpy = &tmp
|
|
|
|
}
|
|
|
|
req, _ := c.DescribeAutoScalingGroupsRequest(inCpy)
|
|
|
|
req.SetContext(ctx)
|
|
|
|
req.ApplyOptions(opts...)
|
|
|
|
return req, nil
|
|
|
|
},
|
2016-03-11 01:27:37 +01:00
|
|
|
}
|
2017-04-05 09:45:27 +02:00
|
|
|
w.ApplyOptions(opts...)
|
2016-03-11 01:27:37 +01:00
|
|
|
|
2017-04-05 09:45:27 +02:00
|
|
|
return w.WaitWithContext(ctx)
|
2016-03-11 01:27:37 +01:00
|
|
|
}
|