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.FailureWaiterState, 41 Matcher: request.PathWaiterMatch, Argument: "addon.status", 42 Expected: "DEGRADED", 43 }, 44 { 45 State: request.SuccessWaiterState, 46 Matcher: request.PathWaiterMatch, Argument: "addon.status", 47 Expected: "ACTIVE", 48 }, 49 }, 50 Logger: c.Config.Logger, 51 NewRequest: func(opts []request.Option) (*request.Request, error) { 52 var inCpy *DescribeAddonInput 53 if input != nil { 54 tmp := *input 55 inCpy = &tmp 56 } 57 req, _ := c.DescribeAddonRequest(inCpy) 58 req.SetContext(ctx) 59 req.ApplyOptions(opts...) 60 return req, nil 61 }, 62 } 63 w.ApplyOptions(opts...) 64 65 return w.WaitWithContext(ctx) 66} 67 68// WaitUntilAddonDeleted uses the Amazon EKS API operation 69// DescribeAddon to wait for a condition to be met before returning. 70// If the condition is not met within the max attempt window, an error will 71// be returned. 72func (c *EKS) WaitUntilAddonDeleted(input *DescribeAddonInput) error { 73 return c.WaitUntilAddonDeletedWithContext(aws.BackgroundContext(), input) 74} 75 76// WaitUntilAddonDeletedWithContext is an extended version of WaitUntilAddonDeleted. 77// With the support for passing in a context and options to configure the 78// Waiter and the underlying request options. 79// 80// The context must be non-nil and will be used for request cancellation. If 81// the context is nil a panic will occur. In the future the SDK may create 82// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 83// for more information on using Contexts. 84func (c *EKS) WaitUntilAddonDeletedWithContext(ctx aws.Context, input *DescribeAddonInput, opts ...request.WaiterOption) error { 85 w := request.Waiter{ 86 Name: "WaitUntilAddonDeleted", 87 MaxAttempts: 60, 88 Delay: request.ConstantWaiterDelay(10 * time.Second), 89 Acceptors: []request.WaiterAcceptor{ 90 { 91 State: request.FailureWaiterState, 92 Matcher: request.PathWaiterMatch, Argument: "addon.status", 93 Expected: "DELETE_FAILED", 94 }, 95 { 96 State: request.SuccessWaiterState, 97 Matcher: request.ErrorWaiterMatch, 98 Expected: "ResourceNotFoundException", 99 }, 100 }, 101 Logger: c.Config.Logger, 102 NewRequest: func(opts []request.Option) (*request.Request, error) { 103 var inCpy *DescribeAddonInput 104 if input != nil { 105 tmp := *input 106 inCpy = &tmp 107 } 108 req, _ := c.DescribeAddonRequest(inCpy) 109 req.SetContext(ctx) 110 req.ApplyOptions(opts...) 111 return req, nil 112 }, 113 } 114 w.ApplyOptions(opts...) 115 116 return w.WaitWithContext(ctx) 117} 118 119// WaitUntilClusterActive uses the Amazon EKS API operation 120// DescribeCluster to wait for a condition to be met before returning. 121// If the condition is not met within the max attempt window, an error will 122// be returned. 123func (c *EKS) WaitUntilClusterActive(input *DescribeClusterInput) error { 124 return c.WaitUntilClusterActiveWithContext(aws.BackgroundContext(), input) 125} 126 127// WaitUntilClusterActiveWithContext is an extended version of WaitUntilClusterActive. 128// With the support for passing in a context and options to configure the 129// Waiter and the underlying request options. 130// 131// The context must be non-nil and will be used for request cancellation. If 132// the context is nil a panic will occur. In the future the SDK may create 133// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 134// for more information on using Contexts. 135func (c *EKS) WaitUntilClusterActiveWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.WaiterOption) error { 136 w := request.Waiter{ 137 Name: "WaitUntilClusterActive", 138 MaxAttempts: 40, 139 Delay: request.ConstantWaiterDelay(30 * time.Second), 140 Acceptors: []request.WaiterAcceptor{ 141 { 142 State: request.FailureWaiterState, 143 Matcher: request.PathWaiterMatch, Argument: "cluster.status", 144 Expected: "DELETING", 145 }, 146 { 147 State: request.FailureWaiterState, 148 Matcher: request.PathWaiterMatch, Argument: "cluster.status", 149 Expected: "FAILED", 150 }, 151 { 152 State: request.SuccessWaiterState, 153 Matcher: request.PathWaiterMatch, Argument: "cluster.status", 154 Expected: "ACTIVE", 155 }, 156 }, 157 Logger: c.Config.Logger, 158 NewRequest: func(opts []request.Option) (*request.Request, error) { 159 var inCpy *DescribeClusterInput 160 if input != nil { 161 tmp := *input 162 inCpy = &tmp 163 } 164 req, _ := c.DescribeClusterRequest(inCpy) 165 req.SetContext(ctx) 166 req.ApplyOptions(opts...) 167 return req, nil 168 }, 169 } 170 w.ApplyOptions(opts...) 171 172 return w.WaitWithContext(ctx) 173} 174 175// WaitUntilClusterDeleted uses the Amazon EKS API operation 176// DescribeCluster to wait for a condition to be met before returning. 177// If the condition is not met within the max attempt window, an error will 178// be returned. 179func (c *EKS) WaitUntilClusterDeleted(input *DescribeClusterInput) error { 180 return c.WaitUntilClusterDeletedWithContext(aws.BackgroundContext(), input) 181} 182 183// WaitUntilClusterDeletedWithContext is an extended version of WaitUntilClusterDeleted. 184// With the support for passing in a context and options to configure the 185// Waiter and the underlying request options. 186// 187// The context must be non-nil and will be used for request cancellation. If 188// the context is nil a panic will occur. In the future the SDK may create 189// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 190// for more information on using Contexts. 191func (c *EKS) WaitUntilClusterDeletedWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.WaiterOption) error { 192 w := request.Waiter{ 193 Name: "WaitUntilClusterDeleted", 194 MaxAttempts: 40, 195 Delay: request.ConstantWaiterDelay(30 * time.Second), 196 Acceptors: []request.WaiterAcceptor{ 197 { 198 State: request.FailureWaiterState, 199 Matcher: request.PathWaiterMatch, Argument: "cluster.status", 200 Expected: "ACTIVE", 201 }, 202 { 203 State: request.FailureWaiterState, 204 Matcher: request.PathWaiterMatch, Argument: "cluster.status", 205 Expected: "CREATING", 206 }, 207 { 208 State: request.FailureWaiterState, 209 Matcher: request.PathWaiterMatch, Argument: "cluster.status", 210 Expected: "PENDING", 211 }, 212 { 213 State: request.SuccessWaiterState, 214 Matcher: request.ErrorWaiterMatch, 215 Expected: "ResourceNotFoundException", 216 }, 217 }, 218 Logger: c.Config.Logger, 219 NewRequest: func(opts []request.Option) (*request.Request, error) { 220 var inCpy *DescribeClusterInput 221 if input != nil { 222 tmp := *input 223 inCpy = &tmp 224 } 225 req, _ := c.DescribeClusterRequest(inCpy) 226 req.SetContext(ctx) 227 req.ApplyOptions(opts...) 228 return req, nil 229 }, 230 } 231 w.ApplyOptions(opts...) 232 233 return w.WaitWithContext(ctx) 234} 235 236// WaitUntilFargateProfileActive uses the Amazon EKS API operation 237// DescribeFargateProfile to wait for a condition to be met before returning. 238// If the condition is not met within the max attempt window, an error will 239// be returned. 240func (c *EKS) WaitUntilFargateProfileActive(input *DescribeFargateProfileInput) error { 241 return c.WaitUntilFargateProfileActiveWithContext(aws.BackgroundContext(), input) 242} 243 244// WaitUntilFargateProfileActiveWithContext is an extended version of WaitUntilFargateProfileActive. 245// With the support for passing in a context and options to configure the 246// Waiter and the underlying request options. 247// 248// The context must be non-nil and will be used for request cancellation. If 249// the context is nil a panic will occur. In the future the SDK may create 250// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 251// for more information on using Contexts. 252func (c *EKS) WaitUntilFargateProfileActiveWithContext(ctx aws.Context, input *DescribeFargateProfileInput, opts ...request.WaiterOption) error { 253 w := request.Waiter{ 254 Name: "WaitUntilFargateProfileActive", 255 MaxAttempts: 60, 256 Delay: request.ConstantWaiterDelay(10 * time.Second), 257 Acceptors: []request.WaiterAcceptor{ 258 { 259 State: request.FailureWaiterState, 260 Matcher: request.PathWaiterMatch, Argument: "fargateProfile.status", 261 Expected: "CREATE_FAILED", 262 }, 263 { 264 State: request.SuccessWaiterState, 265 Matcher: request.PathWaiterMatch, Argument: "fargateProfile.status", 266 Expected: "ACTIVE", 267 }, 268 }, 269 Logger: c.Config.Logger, 270 NewRequest: func(opts []request.Option) (*request.Request, error) { 271 var inCpy *DescribeFargateProfileInput 272 if input != nil { 273 tmp := *input 274 inCpy = &tmp 275 } 276 req, _ := c.DescribeFargateProfileRequest(inCpy) 277 req.SetContext(ctx) 278 req.ApplyOptions(opts...) 279 return req, nil 280 }, 281 } 282 w.ApplyOptions(opts...) 283 284 return w.WaitWithContext(ctx) 285} 286 287// WaitUntilFargateProfileDeleted uses the Amazon EKS API operation 288// DescribeFargateProfile to wait for a condition to be met before returning. 289// If the condition is not met within the max attempt window, an error will 290// be returned. 291func (c *EKS) WaitUntilFargateProfileDeleted(input *DescribeFargateProfileInput) error { 292 return c.WaitUntilFargateProfileDeletedWithContext(aws.BackgroundContext(), input) 293} 294 295// WaitUntilFargateProfileDeletedWithContext is an extended version of WaitUntilFargateProfileDeleted. 296// With the support for passing in a context and options to configure the 297// Waiter and the underlying request options. 298// 299// The context must be non-nil and will be used for request cancellation. If 300// the context is nil a panic will occur. In the future the SDK may create 301// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 302// for more information on using Contexts. 303func (c *EKS) WaitUntilFargateProfileDeletedWithContext(ctx aws.Context, input *DescribeFargateProfileInput, opts ...request.WaiterOption) error { 304 w := request.Waiter{ 305 Name: "WaitUntilFargateProfileDeleted", 306 MaxAttempts: 60, 307 Delay: request.ConstantWaiterDelay(30 * time.Second), 308 Acceptors: []request.WaiterAcceptor{ 309 { 310 State: request.FailureWaiterState, 311 Matcher: request.PathWaiterMatch, Argument: "fargateProfile.status", 312 Expected: "DELETE_FAILED", 313 }, 314 { 315 State: request.SuccessWaiterState, 316 Matcher: request.ErrorWaiterMatch, 317 Expected: "ResourceNotFoundException", 318 }, 319 }, 320 Logger: c.Config.Logger, 321 NewRequest: func(opts []request.Option) (*request.Request, error) { 322 var inCpy *DescribeFargateProfileInput 323 if input != nil { 324 tmp := *input 325 inCpy = &tmp 326 } 327 req, _ := c.DescribeFargateProfileRequest(inCpy) 328 req.SetContext(ctx) 329 req.ApplyOptions(opts...) 330 return req, nil 331 }, 332 } 333 w.ApplyOptions(opts...) 334 335 return w.WaitWithContext(ctx) 336} 337 338// WaitUntilNodegroupActive uses the Amazon EKS API operation 339// DescribeNodegroup to wait for a condition to be met before returning. 340// If the condition is not met within the max attempt window, an error will 341// be returned. 342func (c *EKS) WaitUntilNodegroupActive(input *DescribeNodegroupInput) error { 343 return c.WaitUntilNodegroupActiveWithContext(aws.BackgroundContext(), input) 344} 345 346// WaitUntilNodegroupActiveWithContext is an extended version of WaitUntilNodegroupActive. 347// With the support for passing in a context and options to configure the 348// Waiter and the underlying request options. 349// 350// The context must be non-nil and will be used for request cancellation. If 351// the context is nil a panic will occur. In the future the SDK may create 352// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 353// for more information on using Contexts. 354func (c *EKS) WaitUntilNodegroupActiveWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.WaiterOption) error { 355 w := request.Waiter{ 356 Name: "WaitUntilNodegroupActive", 357 MaxAttempts: 80, 358 Delay: request.ConstantWaiterDelay(30 * time.Second), 359 Acceptors: []request.WaiterAcceptor{ 360 { 361 State: request.FailureWaiterState, 362 Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", 363 Expected: "CREATE_FAILED", 364 }, 365 { 366 State: request.SuccessWaiterState, 367 Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", 368 Expected: "ACTIVE", 369 }, 370 }, 371 Logger: c.Config.Logger, 372 NewRequest: func(opts []request.Option) (*request.Request, error) { 373 var inCpy *DescribeNodegroupInput 374 if input != nil { 375 tmp := *input 376 inCpy = &tmp 377 } 378 req, _ := c.DescribeNodegroupRequest(inCpy) 379 req.SetContext(ctx) 380 req.ApplyOptions(opts...) 381 return req, nil 382 }, 383 } 384 w.ApplyOptions(opts...) 385 386 return w.WaitWithContext(ctx) 387} 388 389// WaitUntilNodegroupDeleted uses the Amazon EKS API operation 390// DescribeNodegroup to wait for a condition to be met before returning. 391// If the condition is not met within the max attempt window, an error will 392// be returned. 393func (c *EKS) WaitUntilNodegroupDeleted(input *DescribeNodegroupInput) error { 394 return c.WaitUntilNodegroupDeletedWithContext(aws.BackgroundContext(), input) 395} 396 397// WaitUntilNodegroupDeletedWithContext is an extended version of WaitUntilNodegroupDeleted. 398// With the support for passing in a context and options to configure the 399// Waiter and the underlying request options. 400// 401// The context must be non-nil and will be used for request cancellation. If 402// the context is nil a panic will occur. In the future the SDK may create 403// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 404// for more information on using Contexts. 405func (c *EKS) WaitUntilNodegroupDeletedWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.WaiterOption) error { 406 w := request.Waiter{ 407 Name: "WaitUntilNodegroupDeleted", 408 MaxAttempts: 40, 409 Delay: request.ConstantWaiterDelay(30 * time.Second), 410 Acceptors: []request.WaiterAcceptor{ 411 { 412 State: request.FailureWaiterState, 413 Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", 414 Expected: "DELETE_FAILED", 415 }, 416 { 417 State: request.SuccessWaiterState, 418 Matcher: request.ErrorWaiterMatch, 419 Expected: "ResourceNotFoundException", 420 }, 421 }, 422 Logger: c.Config.Logger, 423 NewRequest: func(opts []request.Option) (*request.Request, error) { 424 var inCpy *DescribeNodegroupInput 425 if input != nil { 426 tmp := *input 427 inCpy = &tmp 428 } 429 req, _ := c.DescribeNodegroupRequest(inCpy) 430 req.SetContext(ctx) 431 req.ApplyOptions(opts...) 432 return req, nil 433 }, 434 } 435 w.ApplyOptions(opts...) 436 437 return w.WaitWithContext(ctx) 438} 439