1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package eks
4
5import (
6	"time"
7
8	"github.com/aws/aws-sdk-go/aws"
9	"github.com/aws/aws-sdk-go/aws/request"
10)
11
12// WaitUntilAddonActive uses the Amazon EKS API operation
13// DescribeAddon to wait for a condition to be met before returning.
14// If the condition is not met within the max attempt window, an error will
15// be returned.
16func (c *EKS) WaitUntilAddonActive(input *DescribeAddonInput) error {
17	return c.WaitUntilAddonActiveWithContext(aws.BackgroundContext(), input)
18}
19
20// WaitUntilAddonActiveWithContext is an extended version of WaitUntilAddonActive.
21// With the support for passing in a context and options to configure the
22// Waiter and the underlying request options.
23//
24// The context must be non-nil and will be used for request cancellation. If
25// the context is nil a panic will occur. In the future the SDK may create
26// sub-contexts for http.Requests. See https://golang.org/pkg/context/
27// for more information on using Contexts.
28func (c *EKS) WaitUntilAddonActiveWithContext(ctx aws.Context, input *DescribeAddonInput, opts ...request.WaiterOption) error {
29	w := request.Waiter{
30		Name:        "WaitUntilAddonActive",
31		MaxAttempts: 60,
32		Delay:       request.ConstantWaiterDelay(10 * time.Second),
33		Acceptors: []request.WaiterAcceptor{
34			{
35				State:   request.FailureWaiterState,
36				Matcher: request.PathWaiterMatch, Argument: "addon.status",
37				Expected: "CREATE_FAILED",
38			},
39			{
40				State:   request.SuccessWaiterState,
41				Matcher: request.PathWaiterMatch, Argument: "addon.status",
42				Expected: "ACTIVE",
43			},
44		},
45		Logger: c.Config.Logger,
46		NewRequest: func(opts []request.Option) (*request.Request, error) {
47			var inCpy *DescribeAddonInput
48			if input != nil {
49				tmp := *input
50				inCpy = &tmp
51			}
52			req, _ := c.DescribeAddonRequest(inCpy)
53			req.SetContext(ctx)
54			req.ApplyOptions(opts...)
55			return req, nil
56		},
57	}
58	w.ApplyOptions(opts...)
59
60	return w.WaitWithContext(ctx)
61}
62
63// WaitUntilAddonDeleted uses the Amazon EKS API operation
64// DescribeAddon to wait for a condition to be met before returning.
65// If the condition is not met within the max attempt window, an error will
66// be returned.
67func (c *EKS) WaitUntilAddonDeleted(input *DescribeAddonInput) error {
68	return c.WaitUntilAddonDeletedWithContext(aws.BackgroundContext(), input)
69}
70
71// WaitUntilAddonDeletedWithContext is an extended version of WaitUntilAddonDeleted.
72// With the support for passing in a context and options to configure the
73// Waiter and the underlying request options.
74//
75// The context must be non-nil and will be used for request cancellation. If
76// the context is nil a panic will occur. In the future the SDK may create
77// sub-contexts for http.Requests. See https://golang.org/pkg/context/
78// for more information on using Contexts.
79func (c *EKS) WaitUntilAddonDeletedWithContext(ctx aws.Context, input *DescribeAddonInput, opts ...request.WaiterOption) error {
80	w := request.Waiter{
81		Name:        "WaitUntilAddonDeleted",
82		MaxAttempts: 60,
83		Delay:       request.ConstantWaiterDelay(10 * time.Second),
84		Acceptors: []request.WaiterAcceptor{
85			{
86				State:   request.FailureWaiterState,
87				Matcher: request.PathWaiterMatch, Argument: "addon.status",
88				Expected: "DELETE_FAILED",
89			},
90			{
91				State:    request.SuccessWaiterState,
92				Matcher:  request.ErrorWaiterMatch,
93				Expected: "ResourceNotFoundException",
94			},
95		},
96		Logger: c.Config.Logger,
97		NewRequest: func(opts []request.Option) (*request.Request, error) {
98			var inCpy *DescribeAddonInput
99			if input != nil {
100				tmp := *input
101				inCpy = &tmp
102			}
103			req, _ := c.DescribeAddonRequest(inCpy)
104			req.SetContext(ctx)
105			req.ApplyOptions(opts...)
106			return req, nil
107		},
108	}
109	w.ApplyOptions(opts...)
110
111	return w.WaitWithContext(ctx)
112}
113
114// WaitUntilClusterActive uses the Amazon EKS API operation
115// DescribeCluster to wait for a condition to be met before returning.
116// If the condition is not met within the max attempt window, an error will
117// be returned.
118func (c *EKS) WaitUntilClusterActive(input *DescribeClusterInput) error {
119	return c.WaitUntilClusterActiveWithContext(aws.BackgroundContext(), input)
120}
121
122// WaitUntilClusterActiveWithContext is an extended version of WaitUntilClusterActive.
123// With the support for passing in a context and options to configure the
124// Waiter and the underlying request options.
125//
126// The context must be non-nil and will be used for request cancellation. If
127// the context is nil a panic will occur. In the future the SDK may create
128// sub-contexts for http.Requests. See https://golang.org/pkg/context/
129// for more information on using Contexts.
130func (c *EKS) WaitUntilClusterActiveWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.WaiterOption) error {
131	w := request.Waiter{
132		Name:        "WaitUntilClusterActive",
133		MaxAttempts: 40,
134		Delay:       request.ConstantWaiterDelay(30 * time.Second),
135		Acceptors: []request.WaiterAcceptor{
136			{
137				State:   request.FailureWaiterState,
138				Matcher: request.PathWaiterMatch, Argument: "cluster.status",
139				Expected: "DELETING",
140			},
141			{
142				State:   request.FailureWaiterState,
143				Matcher: request.PathWaiterMatch, Argument: "cluster.status",
144				Expected: "FAILED",
145			},
146			{
147				State:   request.SuccessWaiterState,
148				Matcher: request.PathWaiterMatch, Argument: "cluster.status",
149				Expected: "ACTIVE",
150			},
151		},
152		Logger: c.Config.Logger,
153		NewRequest: func(opts []request.Option) (*request.Request, error) {
154			var inCpy *DescribeClusterInput
155			if input != nil {
156				tmp := *input
157				inCpy = &tmp
158			}
159			req, _ := c.DescribeClusterRequest(inCpy)
160			req.SetContext(ctx)
161			req.ApplyOptions(opts...)
162			return req, nil
163		},
164	}
165	w.ApplyOptions(opts...)
166
167	return w.WaitWithContext(ctx)
168}
169
170// WaitUntilClusterDeleted uses the Amazon EKS API operation
171// DescribeCluster to wait for a condition to be met before returning.
172// If the condition is not met within the max attempt window, an error will
173// be returned.
174func (c *EKS) WaitUntilClusterDeleted(input *DescribeClusterInput) error {
175	return c.WaitUntilClusterDeletedWithContext(aws.BackgroundContext(), input)
176}
177
178// WaitUntilClusterDeletedWithContext is an extended version of WaitUntilClusterDeleted.
179// With the support for passing in a context and options to configure the
180// Waiter and the underlying request options.
181//
182// The context must be non-nil and will be used for request cancellation. If
183// the context is nil a panic will occur. In the future the SDK may create
184// sub-contexts for http.Requests. See https://golang.org/pkg/context/
185// for more information on using Contexts.
186func (c *EKS) WaitUntilClusterDeletedWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.WaiterOption) error {
187	w := request.Waiter{
188		Name:        "WaitUntilClusterDeleted",
189		MaxAttempts: 40,
190		Delay:       request.ConstantWaiterDelay(30 * time.Second),
191		Acceptors: []request.WaiterAcceptor{
192			{
193				State:   request.FailureWaiterState,
194				Matcher: request.PathWaiterMatch, Argument: "cluster.status",
195				Expected: "ACTIVE",
196			},
197			{
198				State:   request.FailureWaiterState,
199				Matcher: request.PathWaiterMatch, Argument: "cluster.status",
200				Expected: "CREATING",
201			},
202			{
203				State:    request.SuccessWaiterState,
204				Matcher:  request.ErrorWaiterMatch,
205				Expected: "ResourceNotFoundException",
206			},
207		},
208		Logger: c.Config.Logger,
209		NewRequest: func(opts []request.Option) (*request.Request, error) {
210			var inCpy *DescribeClusterInput
211			if input != nil {
212				tmp := *input
213				inCpy = &tmp
214			}
215			req, _ := c.DescribeClusterRequest(inCpy)
216			req.SetContext(ctx)
217			req.ApplyOptions(opts...)
218			return req, nil
219		},
220	}
221	w.ApplyOptions(opts...)
222
223	return w.WaitWithContext(ctx)
224}
225
226// WaitUntilNodegroupActive uses the Amazon EKS API operation
227// DescribeNodegroup to wait for a condition to be met before returning.
228// If the condition is not met within the max attempt window, an error will
229// be returned.
230func (c *EKS) WaitUntilNodegroupActive(input *DescribeNodegroupInput) error {
231	return c.WaitUntilNodegroupActiveWithContext(aws.BackgroundContext(), input)
232}
233
234// WaitUntilNodegroupActiveWithContext is an extended version of WaitUntilNodegroupActive.
235// With the support for passing in a context and options to configure the
236// Waiter and the underlying request options.
237//
238// The context must be non-nil and will be used for request cancellation. If
239// the context is nil a panic will occur. In the future the SDK may create
240// sub-contexts for http.Requests. See https://golang.org/pkg/context/
241// for more information on using Contexts.
242func (c *EKS) WaitUntilNodegroupActiveWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.WaiterOption) error {
243	w := request.Waiter{
244		Name:        "WaitUntilNodegroupActive",
245		MaxAttempts: 80,
246		Delay:       request.ConstantWaiterDelay(30 * time.Second),
247		Acceptors: []request.WaiterAcceptor{
248			{
249				State:   request.FailureWaiterState,
250				Matcher: request.PathWaiterMatch, Argument: "nodegroup.status",
251				Expected: "CREATE_FAILED",
252			},
253			{
254				State:   request.SuccessWaiterState,
255				Matcher: request.PathWaiterMatch, Argument: "nodegroup.status",
256				Expected: "ACTIVE",
257			},
258		},
259		Logger: c.Config.Logger,
260		NewRequest: func(opts []request.Option) (*request.Request, error) {
261			var inCpy *DescribeNodegroupInput
262			if input != nil {
263				tmp := *input
264				inCpy = &tmp
265			}
266			req, _ := c.DescribeNodegroupRequest(inCpy)
267			req.SetContext(ctx)
268			req.ApplyOptions(opts...)
269			return req, nil
270		},
271	}
272	w.ApplyOptions(opts...)
273
274	return w.WaitWithContext(ctx)
275}
276
277// WaitUntilNodegroupDeleted uses the Amazon EKS API operation
278// DescribeNodegroup to wait for a condition to be met before returning.
279// If the condition is not met within the max attempt window, an error will
280// be returned.
281func (c *EKS) WaitUntilNodegroupDeleted(input *DescribeNodegroupInput) error {
282	return c.WaitUntilNodegroupDeletedWithContext(aws.BackgroundContext(), input)
283}
284
285// WaitUntilNodegroupDeletedWithContext is an extended version of WaitUntilNodegroupDeleted.
286// With the support for passing in a context and options to configure the
287// Waiter and the underlying request options.
288//
289// The context must be non-nil and will be used for request cancellation. If
290// the context is nil a panic will occur. In the future the SDK may create
291// sub-contexts for http.Requests. See https://golang.org/pkg/context/
292// for more information on using Contexts.
293func (c *EKS) WaitUntilNodegroupDeletedWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.WaiterOption) error {
294	w := request.Waiter{
295		Name:        "WaitUntilNodegroupDeleted",
296		MaxAttempts: 40,
297		Delay:       request.ConstantWaiterDelay(30 * time.Second),
298		Acceptors: []request.WaiterAcceptor{
299			{
300				State:   request.FailureWaiterState,
301				Matcher: request.PathWaiterMatch, Argument: "nodegroup.status",
302				Expected: "DELETE_FAILED",
303			},
304			{
305				State:    request.SuccessWaiterState,
306				Matcher:  request.ErrorWaiterMatch,
307				Expected: "ResourceNotFoundException",
308			},
309		},
310		Logger: c.Config.Logger,
311		NewRequest: func(opts []request.Option) (*request.Request, error) {
312			var inCpy *DescribeNodegroupInput
313			if input != nil {
314				tmp := *input
315				inCpy = &tmp
316			}
317			req, _ := c.DescribeNodegroupRequest(inCpy)
318			req.SetContext(ctx)
319			req.ApplyOptions(opts...)
320			return req, nil
321		},
322	}
323	w.ApplyOptions(opts...)
324
325	return w.WaitWithContext(ctx)
326}
327