clientwrapper

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HAPObjectNotFoundExceptionCode   = "ObjectNotFoundException"
	HAPInternalServiceExceptionCode  = "InternalServiceException"
	HAPConcurrentUpdateExceptionCode = "ConcurrentUpdateException"
	HAPValidationExceptionCode       = "ValidationException"
	HDPendingMessage                 = "The status should be in 'InService' to register it as a scalable target"
)

Provides error codes and messages

View Source
const (
	DescribeTrainingJob404Code          = "ValidationException"
	DescribeTrainingJob404MessagePrefix = "Requested resource not found"
	StopTrainingJob404Code              = "ValidationException"
	StopTrainingJob404MessagePrefix     = "Requested resource not found"

	DescribeProcessingJob404Code          = "ValidationException"
	DescribeProcessingJob404MessagePrefix = "Could not find requested job"

	DescribeHyperParameterTuningJob404Code          = "ResourceNotFound"
	DescribeHyperParameterTuningJob404MessagePrefix = "Amazon SageMaker can't find a tuning job"
	StopHyperParameterTuningJob404Code              = "ResourceNotFound"
	StopHyperParameterTuningJob404MessagePrefix     = "Amazon SageMaker can't find a tuning job"

	DeleteEndpoint404MessagePrefix                        = "Could not find endpoint"
	DeleteEndpoint404Code                                 = "ValidationException"
	DeleteEndpointInProgressMessagePrefix                 = "Cannot update in-progress endpoint"
	DeleteEndpointInProgressCode                          = "ValidationException"
	DescribeEndpoint404MessagePrefix                      = "Could not find endpoint"
	DescribeEndpoint404Code                               = "ValidationException"
	UpdateEndpoint404MessagePrefix                        = "Could not find endpoint"
	UpdateEndpoint404Code                                 = "ValidationException"
	UpdateEndpointUnableToFindEndpointConfigMessagePrefix = "Could not find endpoint configuration"
	UpdateEndpointUnableToFindEndpointConfigCode          = "ValidationException"

	DescribeEndpointConfig404MessagePrefix = "Could not find endpoint configuration"
	DescribeEndpointConfig404Code          = "ValidationException"
	DeleteEndpointConfig404MessagePrefix   = "Could not find endpoint configuration"
	DeleteEndpointConfig404Code            = "ValidationException"

	DescribeModel404MessagePrefix = "Could not find model"
	DescribeModel404Code          = "ValidationException"
	DeleteModel404MessagePrefix   = "Could not find model"
	DeleteModel404Code            = "ValidationException"
)

Provides the prefixes and error codes relating to each endpoint

Variables

This section is empty.

Functions

func IsDeleteEndpoint404Error

func IsDeleteEndpoint404Error(err error) bool

IsDeleteEndpoint404Error determines whether the given error is equivalent to an HTTP 404 status code.

func IsDeleteEndpointConfig404Error

func IsDeleteEndpointConfig404Error(err error) bool

IsDeleteEndpointConfig404Error determines whether the given error is equivalent to an HTTP 404 status code.

func IsDeleteHAP404Error added in v1.2.0

func IsDeleteHAP404Error(err error) bool

IsDeleteHAP404Error determines whether the given error HAPObjectNotFoundExceptionCode, used for deletion.

func IsDeleteModel404Error

func IsDeleteModel404Error(err error) bool

IsDeleteModel404Error determines whether the given error is equivalent to an HTTP 404 status code.

func IsDescribeHAP404Error added in v1.2.0

func IsDescribeHAP404Error(err error) bool

IsDescribeHAP404Error detects if the error is a HAPValidationExceptionCode

func IsHAPConcurrentUpdateExceptionError added in v1.2.0

func IsHAPConcurrentUpdateExceptionError(err error) bool

IsHAPConcurrentUpdateExceptionError detects if the error is a ConcurrentUpdateException

func IsHAPInternalServiceExceptionError added in v1.2.0

func IsHAPInternalServiceExceptionError(err error) bool

IsHAPInternalServiceExceptionError detects if the error is an InternalServiceException

func IsHDPendingError added in v1.2.0

func IsHDPendingError(err error) bool

IsHDPendingError is for the special case when the HD is in creating/updating status and HAP throws a validationException. Status is set to reconciling.

func IsRecoverableError added in v1.2.0

func IsRecoverableError(err error) bool

IsRecoverableError determines if type of error is trasient and can be resolved without user intervention by reconciling Before using this method determine if all other errors for your use-case can be categorized as non-recoverable Check SageMaker common errors and errors section for each APIs used in your operator. Example: Processing Create API specific errors: https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html#API_CreateProcessingJob_Errors and SageMaker Common errors: https://docs.aws.amazon.com/sagemaker/latest/APIReference/CommonErrors.html and

func IsStopHyperParameterTuningJob404Error

func IsStopHyperParameterTuningJob404Error(err error) bool

IsStopHyperParameterTuningJob404Error determines whether the given error is equivalent to an HTTP 404 status code.

func IsStopTrainingJob404Error

func IsStopTrainingJob404Error(err error) bool

IsStopTrainingJob404Error determines whether the given error is equivalent to an HTTP 404 status code.

func IsUpdateEndpoint404Error

func IsUpdateEndpoint404Error(err error) bool

IsUpdateEndpoint404Error determines whether the given error is equivalent to an HTTP 404 status code.

Types

type ApplicationAutoscalingClientWrapper added in v1.2.0

ApplicationAutoscalingClientWrapper interface for ApplicationAutoscalingClient wrapper

func NewApplicationAutoscalingClientWrapper added in v1.2.0

func NewApplicationAutoscalingClientWrapper(innerClient applicationautoscalingiface.ApplicationAutoScalingAPI) ApplicationAutoscalingClientWrapper

NewApplicationAutoscalingClientWrapper creates a ApplicationAutoscaling wrapper around an existing client.

type ApplicationAutoscalingClientWrapperProvider added in v1.2.0

type ApplicationAutoscalingClientWrapperProvider func(aws.Config) ApplicationAutoscalingClientWrapper

ApplicationAutoscalingClientWrapperProvider defines a function that returns a ApplicationAutoscaling client. Used for mocking.

type SageMakerClientWrapper

type SageMakerClientWrapper interface {
	DescribeTrainingJob(ctx context.Context, trainingJobName string) (*sagemaker.DescribeTrainingJobOutput, error)
	CreateTrainingJob(ctx context.Context, trainingJob *sagemaker.CreateTrainingJobInput) (*sagemaker.CreateTrainingJobOutput, error)
	StopTrainingJob(ctx context.Context, trainingJobName string) (*sagemaker.StopTrainingJobOutput, error)

	DescribeProcessingJob(ctx context.Context, processingJobName string) (*sagemaker.DescribeProcessingJobOutput, error)
	CreateProcessingJob(ctx context.Context, processingJob *sagemaker.CreateProcessingJobInput) (*sagemaker.CreateProcessingJobOutput, error)
	StopProcessingJob(ctx context.Context, processingJobName string) (*sagemaker.StopProcessingJobOutput, error)

	DescribeHyperParameterTuningJob(ctx context.Context, tuningJobName string) (*sagemaker.DescribeHyperParameterTuningJobOutput, error)
	CreateHyperParameterTuningJob(ctx context.Context, tuningJob *sagemaker.CreateHyperParameterTuningJobInput) (*sagemaker.CreateHyperParameterTuningJobOutput, error)
	StopHyperParameterTuningJob(ctx context.Context, tuningJobName string) (*sagemaker.StopHyperParameterTuningJobOutput, error)

	ListTrainingJobsForHyperParameterTuningJob(ctx context.Context, tuningJobName string, nextToken *string) (*sagemaker.ListTrainingJobsForHyperParameterTuningJobOutput, error)

	DescribeEndpoint(ctx context.Context, endpointName string) (*sagemaker.DescribeEndpointOutput, error)
	CreateEndpoint(ctx context.Context, endpoint *sagemaker.CreateEndpointInput) (*sagemaker.CreateEndpointOutput, error)
	DeleteEndpoint(ctx context.Context, endpointName *string) (*sagemaker.DeleteEndpointOutput, error)
	UpdateEndpoint(ctx context.Context, endpointName, endpointConfigName string, retainAllVariantProperties *bool, excludeRetainedVariantProperties []*sagemaker.VariantProperty) (*sagemaker.UpdateEndpointOutput, error)

	DescribeModel(ctx context.Context, modelName string) (*sagemaker.DescribeModelOutput, error)
	CreateModel(ctx context.Context, model *sagemaker.CreateModelInput) (*sagemaker.CreateModelOutput, error)
	DeleteModel(ctx context.Context, model *sagemaker.DeleteModelInput) (*sagemaker.DeleteModelOutput, error)

	DescribeEndpointConfig(ctx context.Context, endpointConfigName string) (*sagemaker.DescribeEndpointConfigOutput, error)
	CreateEndpointConfig(ctx context.Context, endpointConfig *sagemaker.CreateEndpointConfigInput) (*sagemaker.CreateEndpointConfigOutput, error)
	DeleteEndpointConfig(ctx context.Context, endpointConfig *sagemaker.DeleteEndpointConfigInput) (*sagemaker.DeleteEndpointConfigOutput, error)
}

SageMakerClientWrapper wraps the SageMaker client. "Not Found" errors are handled differently than in the Go SDK; here a method will return a nil pointer and a nil error if there is a 404. This simplifies code that interacts with SageMaker. Other errors are returned normally.

func NewSageMakerClientWrapper

func NewSageMakerClientWrapper(innerClient sagemakeriface.SageMakerAPI) SageMakerClientWrapper

NewSageMakerClientWrapper creates a SageMaker wrapper around an existing client.

type SageMakerClientWrapperProvider

type SageMakerClientWrapperProvider func(aws.Config) SageMakerClientWrapper

SageMakerClientWrapperProvider defines a function that returns a SageMaker client. Used for mocking.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL