Interface SageMakerRuntimeClient
-
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
@Generated("software.amazon.awssdk:codegen") @SdkPublicApi @ThreadSafe public interface SageMakerRuntimeClient extends AwsClient
Service client for accessing Amazon SageMaker Runtime. This can be created using the staticbuilder()method.The Amazon SageMaker AI runtime API.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSERVICE_METADATA_IDValue for looking up the service's metadata from theServiceMetadataProvider.static StringSERVICE_NAME
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static SageMakerRuntimeClientBuilderbuilder()Create a builder that can be used to configure and create aSageMakerRuntimeClient.static SageMakerRuntimeClientcreate()Create aSageMakerRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default InvokeEndpointResponseinvokeEndpoint(Consumer<InvokeEndpointRequest.Builder> invokeEndpointRequest)After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.default InvokeEndpointResponseinvokeEndpoint(InvokeEndpointRequest invokeEndpointRequest)After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.default InvokeEndpointAsyncResponseinvokeEndpointAsync(Consumer<InvokeEndpointAsyncRequest.Builder> invokeEndpointAsyncRequest)After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint in an asynchronous manner.default InvokeEndpointAsyncResponseinvokeEndpointAsync(InvokeEndpointAsyncRequest invokeEndpointAsyncRequest)After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint in an asynchronous manner.default SageMakerRuntimeServiceClientConfigurationserviceClientConfiguration()static ServiceMetadataserviceMetadata()-
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
-
-
-
Field Detail
-
SERVICE_NAME
static final String SERVICE_NAME
- See Also:
- Constant Field Values
-
SERVICE_METADATA_ID
static final String SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
- Constant Field Values
-
-
Method Detail
-
invokeEndpoint
default InvokeEndpointResponse invokeEndpoint(InvokeEndpointRequest invokeEndpointRequest) throws InternalFailureException, ServiceUnavailableException, ValidationErrorException, ModelErrorException, InternalDependencyException, ModelNotReadyException, AwsServiceException, SdkClientException, SageMakerRuntimeException
After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.
For an overview of Amazon SageMaker AI, see How It Works.
Amazon SageMaker AI strips all POST headers except those supported by the API. Amazon SageMaker AI might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.
Calls to
InvokeEndpointare authenticated by using Amazon Web Services Signature Version 4. For information, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 API Reference.A customer's model containers must respond to requests within 60 seconds. The model itself can have a maximum processing time of 60 seconds before responding to invocations. If your model is going to take 50-60 seconds of processing time, the SDK socket timeout should be set to be 70 seconds.
Endpoints are scoped to an individual account, and are not public. The URL does not contain the account ID, but Amazon SageMaker AI determines the account ID from the authentication token that is supplied by the caller.
- Parameters:
invokeEndpointRequest-- Returns:
- Result of the InvokeEndpoint operation returned by the service.
- Throws:
InternalFailureException- An internal failure occurred.ServiceUnavailableException- The service is unavailable. Try your call again.ValidationErrorException- Inspect your request and try again.ModelErrorException- Model (owned by the customer in the container) returned 4xx or 5xx error code.InternalDependencyException- Your request caused an exception with an internal dependency. Contact customer support.ModelNotReadyException- Either a serverless endpoint variant's resources are still being provisioned, or a multi-model endpoint is still downloading or loading the target model. Wait and try your request again.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
invokeEndpoint
default InvokeEndpointResponse invokeEndpoint(Consumer<InvokeEndpointRequest.Builder> invokeEndpointRequest) throws InternalFailureException, ServiceUnavailableException, ValidationErrorException, ModelErrorException, InternalDependencyException, ModelNotReadyException, AwsServiceException, SdkClientException, SageMakerRuntimeException
After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.
For an overview of Amazon SageMaker AI, see How It Works.
Amazon SageMaker AI strips all POST headers except those supported by the API. Amazon SageMaker AI might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.
Calls to
InvokeEndpointare authenticated by using Amazon Web Services Signature Version 4. For information, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 API Reference.A customer's model containers must respond to requests within 60 seconds. The model itself can have a maximum processing time of 60 seconds before responding to invocations. If your model is going to take 50-60 seconds of processing time, the SDK socket timeout should be set to be 70 seconds.
Endpoints are scoped to an individual account, and are not public. The URL does not contain the account ID, but Amazon SageMaker AI determines the account ID from the authentication token that is supplied by the caller.
This is a convenience which creates an instance of the
InvokeEndpointRequest.Builderavoiding the need to create one manually viaInvokeEndpointRequest.builder()- Parameters:
invokeEndpointRequest- AConsumerthat will call methods onInvokeEndpointRequest.Builderto create a request.- Returns:
- Result of the InvokeEndpoint operation returned by the service.
- Throws:
InternalFailureException- An internal failure occurred.ServiceUnavailableException- The service is unavailable. Try your call again.ValidationErrorException- Inspect your request and try again.ModelErrorException- Model (owned by the customer in the container) returned 4xx or 5xx error code.InternalDependencyException- Your request caused an exception with an internal dependency. Contact customer support.ModelNotReadyException- Either a serverless endpoint variant's resources are still being provisioned, or a multi-model endpoint is still downloading or loading the target model. Wait and try your request again.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
invokeEndpointAsync
default InvokeEndpointAsyncResponse invokeEndpointAsync(InvokeEndpointAsyncRequest invokeEndpointAsyncRequest) throws InternalFailureException, ServiceUnavailableException, ValidationErrorException, AwsServiceException, SdkClientException, SageMakerRuntimeException
After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint in an asynchronous manner.
Inference requests sent to this API are enqueued for asynchronous processing. The processing of the inference request may or may not complete before you receive a response from this API. The response from this API will not contain the result of the inference request but contain information about where you can locate it.
Amazon SageMaker AI strips all POST headers except those supported by the API. Amazon SageMaker AI might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.
Calls to
InvokeEndpointAsyncare authenticated by using Amazon Web Services Signature Version 4. For information, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 API Reference.- Parameters:
invokeEndpointAsyncRequest-- Returns:
- Result of the InvokeEndpointAsync operation returned by the service.
- Throws:
InternalFailureException- An internal failure occurred.ServiceUnavailableException- The service is unavailable. Try your call again.ValidationErrorException- Inspect your request and try again.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
invokeEndpointAsync
default InvokeEndpointAsyncResponse invokeEndpointAsync(Consumer<InvokeEndpointAsyncRequest.Builder> invokeEndpointAsyncRequest) throws InternalFailureException, ServiceUnavailableException, ValidationErrorException, AwsServiceException, SdkClientException, SageMakerRuntimeException
After you deploy a model into production using Amazon SageMaker AI hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint in an asynchronous manner.
Inference requests sent to this API are enqueued for asynchronous processing. The processing of the inference request may or may not complete before you receive a response from this API. The response from this API will not contain the result of the inference request but contain information about where you can locate it.
Amazon SageMaker AI strips all POST headers except those supported by the API. Amazon SageMaker AI might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.
Calls to
InvokeEndpointAsyncare authenticated by using Amazon Web Services Signature Version 4. For information, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 API Reference.
This is a convenience which creates an instance of the
InvokeEndpointAsyncRequest.Builderavoiding the need to create one manually viaInvokeEndpointAsyncRequest.builder()- Parameters:
invokeEndpointAsyncRequest- AConsumerthat will call methods onInvokeEndpointAsyncRequest.Builderto create a request.- Returns:
- Result of the InvokeEndpointAsync operation returned by the service.
- Throws:
InternalFailureException- An internal failure occurred.ServiceUnavailableException- The service is unavailable. Try your call again.ValidationErrorException- Inspect your request and try again.SdkException- Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for catch all scenarios.SdkClientException- If any client side error occurs such as an IO related failure, failure to get credentials, etc.SageMakerRuntimeException- Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceException- See Also:
- AWS API Documentation
-
create
static SageMakerRuntimeClient create()
Create aSageMakerRuntimeClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.
-
builder
static SageMakerRuntimeClientBuilder builder()
Create a builder that can be used to configure and create aSageMakerRuntimeClient.
-
serviceMetadata
static ServiceMetadata serviceMetadata()
-
serviceClientConfiguration
default SageMakerRuntimeServiceClientConfiguration serviceClientConfiguration()
- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient
-
-