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"
|
|
|
|
)
|
|
|
|
|
2017-12-29 22:41:14 +00:00
|
|
|
// 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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilEndpointDeleted(input *DescribeEndpointInput) error {
|
|
|
|
return c.WaitUntilEndpointDeletedWithContext(aws.BackgroundContext(), input)
|
2017-12-02 14:25:54 +00:00
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilEndpointDeletedWithContext(ctx aws.Context, input *DescribeEndpointInput, opts ...request.WaiterOption) error {
|
2017-12-02 14:25:54 +00:00
|
|
|
w := request.Waiter{
|
2017-12-29 22:41:14 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +00:00
|
|
|
// 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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilEndpointInService(input *DescribeEndpointInput) error {
|
|
|
|
return c.WaitUntilEndpointInServiceWithContext(aws.BackgroundContext(), input)
|
2017-12-02 14:25:54 +00:00
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilEndpointInServiceWithContext(ctx aws.Context, input *DescribeEndpointInput, opts ...request.WaiterOption) error {
|
2017-12-02 14:25:54 +00:00
|
|
|
w := request.Waiter{
|
2017-12-29 22:41:14 +00:00
|
|
|
Name: "WaitUntilEndpointInService",
|
2017-12-02 14:25:54 +00:00
|
|
|
MaxAttempts: 120,
|
2017-12-29 22:41:14 +00:00
|
|
|
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",
|
2017-12-29 22:41:14 +00:00
|
|
|
Expected: "InService",
|
2017-12-02 14:25:54 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
State: request.FailureWaiterState,
|
|
|
|
Matcher: request.PathWaiterMatch, Argument: "EndpointStatus",
|
|
|
|
Expected: "Failed",
|
|
|
|
},
|
|
|
|
{
|
2017-12-29 22:41:14 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +00:00
|
|
|
// 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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilNotebookInstanceDeleted(input *DescribeNotebookInstanceInput) error {
|
|
|
|
return c.WaitUntilNotebookInstanceDeletedWithContext(aws.BackgroundContext(), input)
|
2017-12-02 14:25:54 +00:00
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilNotebookInstanceDeletedWithContext(ctx aws.Context, input *DescribeNotebookInstanceInput, opts ...request.WaiterOption) error {
|
2017-12-02 14:25:54 +00:00
|
|
|
w := request.Waiter{
|
2017-12-29 22:41:14 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +00:00
|
|
|
// 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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilNotebookInstanceInService(input *DescribeNotebookInstanceInput) error {
|
|
|
|
return c.WaitUntilNotebookInstanceInServiceWithContext(aws.BackgroundContext(), input)
|
2017-12-02 14:25:54 +00:00
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilNotebookInstanceInServiceWithContext(ctx aws.Context, input *DescribeNotebookInstanceInput, opts ...request.WaiterOption) error {
|
2017-12-02 14:25:54 +00:00
|
|
|
w := request.Waiter{
|
2017-12-29 22:41:14 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +00:00
|
|
|
// 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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilNotebookInstanceStopped(input *DescribeNotebookInstanceInput) error {
|
|
|
|
return c.WaitUntilNotebookInstanceStoppedWithContext(aws.BackgroundContext(), input)
|
2017-12-02 14:25:54 +00:00
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilNotebookInstanceStoppedWithContext(ctx aws.Context, input *DescribeNotebookInstanceInput, opts ...request.WaiterOption) error {
|
2017-12-02 14:25:54 +00:00
|
|
|
w := request.Waiter{
|
2017-12-29 22:41:14 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +00:00
|
|
|
// 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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilTrainingJobCompletedOrStopped(input *DescribeTrainingJobInput) error {
|
|
|
|
return c.WaitUntilTrainingJobCompletedOrStoppedWithContext(aws.BackgroundContext(), input)
|
2017-12-02 14:25:54 +00:00
|
|
|
}
|
|
|
|
|
2017-12-29 22:41:14 +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.
|
2017-12-29 22:41:14 +00:00
|
|
|
func (c *SageMaker) WaitUntilTrainingJobCompletedOrStoppedWithContext(ctx aws.Context, input *DescribeTrainingJobInput, opts ...request.WaiterOption) error {
|
2017-12-02 14:25:54 +00:00
|
|
|
w := request.Waiter{
|
2017-12-29 22:41:14 +00:00
|
|
|
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",
|
|
|
|
},
|
|
|
|
{
|
2017-12-29 22:41:14 +00:00
|
|
|
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",
|
2017-12-29 22:41:14 +00:00
|
|
|
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)
|
|
|
|
}
|