1
0
Fork 0
mirror of https://github.com/Luzifer/share.git synced 2024-12-21 11:01:17 +00:00
share/vendor/github.com/aws/aws-sdk-go/service/sagemaker/waiters.go

332 lines
12 KiB
Go
Raw Normal View History

2017-12-02 14:25:54 +00:00
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sagemaker
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
// WaitUntilEndpointDeleted uses the SageMaker API operation
2017-12-02 14:25:54 +00:00
// DescribeEndpoint to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *SageMaker) WaitUntilEndpointDeleted(input *DescribeEndpointInput) error {
return c.WaitUntilEndpointDeletedWithContext(aws.BackgroundContext(), input)
2017-12-02 14:25:54 +00:00
}
// WaitUntilEndpointDeletedWithContext is an extended version of WaitUntilEndpointDeleted.
2017-12-02 14:25:54 +00:00
// 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 *SageMaker) WaitUntilEndpointDeletedWithContext(ctx aws.Context, input *DescribeEndpointInput, opts ...request.WaiterOption) error {
2017-12-02 14:25:54 +00:00
w := request.Waiter{
Name: "WaitUntilEndpointDeleted",
MaxAttempts: 60,
Delay: request.ConstantWaiterDelay(30 * time.Second),
2017-12-02 14:25:54 +00:00
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.ErrorWaiterMatch,
Expected: "ValidationException",
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "EndpointStatus",
Expected: "Failed",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeEndpointInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeEndpointRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilEndpointInService uses the SageMaker API operation
2017-12-02 14:25:54 +00:00
// DescribeEndpoint to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *SageMaker) WaitUntilEndpointInService(input *DescribeEndpointInput) error {
return c.WaitUntilEndpointInServiceWithContext(aws.BackgroundContext(), input)
2017-12-02 14:25:54 +00:00
}
// WaitUntilEndpointInServiceWithContext is an extended version of WaitUntilEndpointInService.
2017-12-02 14:25:54 +00:00
// 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 *SageMaker) WaitUntilEndpointInServiceWithContext(ctx aws.Context, input *DescribeEndpointInput, opts ...request.WaiterOption) error {
2017-12-02 14:25:54 +00:00
w := request.Waiter{
Name: "WaitUntilEndpointInService",
2017-12-02 14:25:54 +00:00
MaxAttempts: 120,
Delay: request.ConstantWaiterDelay(30 * time.Second),
2017-12-02 14:25:54 +00:00
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "EndpointStatus",
Expected: "InService",
2017-12-02 14:25:54 +00:00
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "EndpointStatus",
Expected: "Failed",
},
{
State: request.FailureWaiterState,
2017-12-02 14:25:54 +00:00
Matcher: request.ErrorWaiterMatch,
Expected: "ValidationException",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeEndpointInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeEndpointRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilNotebookInstanceDeleted uses the SageMaker API operation
2017-12-02 14:25:54 +00:00
// DescribeNotebookInstance to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *SageMaker) WaitUntilNotebookInstanceDeleted(input *DescribeNotebookInstanceInput) error {
return c.WaitUntilNotebookInstanceDeletedWithContext(aws.BackgroundContext(), input)
2017-12-02 14:25:54 +00:00
}
// WaitUntilNotebookInstanceDeletedWithContext is an extended version of WaitUntilNotebookInstanceDeleted.
2017-12-02 14:25:54 +00:00
// 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 *SageMaker) WaitUntilNotebookInstanceDeletedWithContext(ctx aws.Context, input *DescribeNotebookInstanceInput, opts ...request.WaiterOption) error {
2017-12-02 14:25:54 +00:00
w := request.Waiter{
Name: "WaitUntilNotebookInstanceDeleted",
MaxAttempts: 60,
Delay: request.ConstantWaiterDelay(30 * time.Second),
2017-12-02 14:25:54 +00:00
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.ErrorWaiterMatch,
Expected: "ValidationException",
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "NotebookInstanceStatus",
Expected: "Failed",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeNotebookInstanceInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeNotebookInstanceRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilNotebookInstanceInService uses the SageMaker API operation
2017-12-02 14:25:54 +00:00
// DescribeNotebookInstance to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *SageMaker) WaitUntilNotebookInstanceInService(input *DescribeNotebookInstanceInput) error {
return c.WaitUntilNotebookInstanceInServiceWithContext(aws.BackgroundContext(), input)
2017-12-02 14:25:54 +00:00
}
// WaitUntilNotebookInstanceInServiceWithContext is an extended version of WaitUntilNotebookInstanceInService.
2017-12-02 14:25:54 +00:00
// 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 *SageMaker) WaitUntilNotebookInstanceInServiceWithContext(ctx aws.Context, input *DescribeNotebookInstanceInput, opts ...request.WaiterOption) error {
2017-12-02 14:25:54 +00:00
w := request.Waiter{
Name: "WaitUntilNotebookInstanceInService",
MaxAttempts: 60,
Delay: request.ConstantWaiterDelay(30 * time.Second),
2017-12-02 14:25:54 +00:00
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "NotebookInstanceStatus",
Expected: "InService",
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "NotebookInstanceStatus",
Expected: "Failed",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeNotebookInstanceInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeNotebookInstanceRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilNotebookInstanceStopped uses the SageMaker API operation
2017-12-02 14:25:54 +00:00
// DescribeNotebookInstance to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *SageMaker) WaitUntilNotebookInstanceStopped(input *DescribeNotebookInstanceInput) error {
return c.WaitUntilNotebookInstanceStoppedWithContext(aws.BackgroundContext(), input)
2017-12-02 14:25:54 +00:00
}
// WaitUntilNotebookInstanceStoppedWithContext is an extended version of WaitUntilNotebookInstanceStopped.
2017-12-02 14:25:54 +00:00
// 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 *SageMaker) WaitUntilNotebookInstanceStoppedWithContext(ctx aws.Context, input *DescribeNotebookInstanceInput, opts ...request.WaiterOption) error {
2017-12-02 14:25:54 +00:00
w := request.Waiter{
Name: "WaitUntilNotebookInstanceStopped",
MaxAttempts: 60,
Delay: request.ConstantWaiterDelay(30 * time.Second),
2017-12-02 14:25:54 +00:00
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "NotebookInstanceStatus",
Expected: "Stopped",
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "NotebookInstanceStatus",
Expected: "Failed",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeNotebookInstanceInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeNotebookInstanceRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilTrainingJobCompletedOrStopped uses the SageMaker API operation
2017-12-02 14:25:54 +00:00
// DescribeTrainingJob to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *SageMaker) WaitUntilTrainingJobCompletedOrStopped(input *DescribeTrainingJobInput) error {
return c.WaitUntilTrainingJobCompletedOrStoppedWithContext(aws.BackgroundContext(), input)
2017-12-02 14:25:54 +00:00
}
// WaitUntilTrainingJobCompletedOrStoppedWithContext is an extended version of WaitUntilTrainingJobCompletedOrStopped.
2017-12-02 14:25:54 +00:00
// 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 *SageMaker) WaitUntilTrainingJobCompletedOrStoppedWithContext(ctx aws.Context, input *DescribeTrainingJobInput, opts ...request.WaiterOption) error {
2017-12-02 14:25:54 +00:00
w := request.Waiter{
Name: "WaitUntilTrainingJobCompletedOrStopped",
MaxAttempts: 180,
2017-12-02 14:25:54 +00:00
Delay: request.ConstantWaiterDelay(120 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "TrainingJobStatus",
Expected: "Completed",
},
{
State: request.SuccessWaiterState,
2017-12-02 14:25:54 +00:00
Matcher: request.PathWaiterMatch, Argument: "TrainingJobStatus",
Expected: "Stopped",
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "TrainingJobStatus",
Expected: "Failed",
2017-12-02 14:25:54 +00:00
},
{
State: request.FailureWaiterState,
Matcher: request.ErrorWaiterMatch,
Expected: "ValidationException",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeTrainingJobInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeTrainingJobRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}