@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AmazonSageMakerRuntimeClient extends AmazonWebServiceClient implements AmazonSageMakerRuntime
The Amazon SageMaker runtime API.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Modifier and Type | Method and Description |
---|---|
static AmazonSageMakerRuntimeClientBuilder |
builder() |
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for debugging issues
where a service isn't acting as expected.
|
InvokeEndpointResult |
invokeEndpoint(InvokeEndpointRequest request)
After you deploy a model into production using Amazon SageMaker hosting services, your client applications use
this API to get inferences from the model hosted at the specified endpoint.
|
InvokeEndpointAsyncResult |
invokeEndpointAsync(InvokeEndpointAsyncRequest request)
After you deploy a model into production using Amazon SageMaker hosting services, your client applications use
this API to get inferences from the model hosted at the specified endpoint in an asynchronous manner.
|
void |
shutdown()
Shuts down this client object, releasing any resources that might be held
open.
|
addRequestHandler, addRequestHandler, configureRegion, getClientConfiguration, getEndpointPrefix, getMonitoringListeners, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, withEndpoint, withRegion, withRegion, withTimeOffset
public static AmazonSageMakerRuntimeClientBuilder builder()
public InvokeEndpointResult invokeEndpoint(InvokeEndpointRequest request)
After you deploy a model into production using Amazon SageMaker 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, see How It Works.
Amazon SageMaker strips all POST headers except those supported by the API. Amazon SageMaker might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.
Calls to InvokeEndpoint
are 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 determines the account ID from the authentication token that is supplied by the caller.
invokeEndpoint
in interface AmazonSageMakerRuntime
invokeEndpointRequest
- 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.public InvokeEndpointAsyncResult invokeEndpointAsync(InvokeEndpointAsyncRequest request)
After you deploy a model into production using Amazon SageMaker 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 strips all POST headers except those supported by the API. Amazon SageMaker might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.
Calls to InvokeEndpointAsync
are 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.
invokeEndpointAsync
in interface AmazonSageMakerRuntime
invokeEndpointAsyncRequest
- InternalFailureException
- An internal failure occurred.ServiceUnavailableException
- The service is unavailable. Try your call again.ValidationErrorException
- Inspect your request and try again.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AmazonSageMakerRuntime
request
- The originally executed requestpublic void shutdown()
AmazonWebServiceClient
shutdown
in interface AmazonSageMakerRuntime
shutdown
in class AmazonWebServiceClient