/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include namespace Aws { namespace Http { class HttpClient; class HttpClientFactory; } // namespace Http namespace Utils { template< typename R, typename E> class Outcome; namespace Threading { class Executor; } // namespace Threading } // namespace Utils namespace Auth { class AWSCredentials; class AWSCredentialsProvider; } // namespace Auth namespace Client { class RetryStrategy; } // namespace Client namespace SageMakerRuntime { namespace Model { class InvokeEndpointRequest; typedef Aws::Utils::Outcome InvokeEndpointOutcome; typedef std::future InvokeEndpointOutcomeCallable; } // namespace Model class SageMakerRuntimeClient; typedef std::function&) > InvokeEndpointResponseReceivedHandler; /** *

The Amazon SageMaker runtime API.

*/ class AWS_SAGEMAKERRUNTIME_API SageMakerRuntimeClient : public Aws::Client::AWSJsonClient { public: typedef Aws::Client::AWSJsonClient BASECLASS; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ SageMakerRuntimeClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ SageMakerRuntimeClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ SageMakerRuntimeClient(const std::shared_ptr& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); virtual ~SageMakerRuntimeClient(); /** *

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 * AWS Signature Version 4. For information, see Authenticating * Requests (AWS 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 the /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.

See Also:

AWS * API Reference

*/ virtual Model::InvokeEndpointOutcome InvokeEndpoint(const Model::InvokeEndpointRequest& request) const; /** *

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 * AWS Signature Version 4. For information, see Authenticating * Requests (AWS 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 the /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.

See Also:

AWS * API Reference

* * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::InvokeEndpointOutcomeCallable InvokeEndpointCallable(const Model::InvokeEndpointRequest& request) const; /** *

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 * AWS Signature Version 4. For information, see Authenticating * Requests (AWS 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 the /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.

See Also:

AWS * API Reference

* * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void InvokeEndpointAsync(const Model::InvokeEndpointRequest& request, const InvokeEndpointResponseReceivedHandler& handler, const std::shared_ptr& context = nullptr) const; void OverrideEndpoint(const Aws::String& endpoint); private: void init(const Aws::Client::ClientConfiguration& clientConfiguration); void InvokeEndpointAsyncHelper(const Model::InvokeEndpointRequest& request, const InvokeEndpointResponseReceivedHandler& handler, const std::shared_ptr& context) const; Aws::String m_uri; Aws::String m_configScheme; std::shared_ptr m_executor; }; } // namespace SageMakerRuntime } // namespace Aws