You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::SageMakerRuntime::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



173
174
175
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/client.rb', line 173

def initialize(*args)
  super
end

Instance Method Details

#invoke_endpoint(params = {}) ⇒ Types::InvokeEndpointOutput

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.

Cals 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.

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.

Examples:

Request syntax with placeholder values


resp = client.invoke_endpoint({
  endpoint_name: "EndpointName", # required
  body: "data", # required
  content_type: "Header",
  accept: "Header",
  custom_attributes: "CustomAttributesHeader",
})

Response structure


resp.body #=> String
resp.content_type #=> String
resp.invoked_production_variant #=> String
resp.custom_attributes #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :endpoint_name (required, String)

    The name of the endpoint that you specified when you created the endpoint using the CreateEndpoint API.

  • :body (required, String, IO)

    Provides input data, in the format specified in the ContentType request header. Amazon SageMaker passes all of the data in the body to the model.

    For information about the format of the request body, see Common Data Formats—Inference.

  • :content_type (String)

    The MIME type of the input data in the request body.

  • :accept (String)

    The desired MIME type of the inference in the response.

  • :custom_attributes (String)

Returns:

See Also:



262
263
264
265
# File 'gems/aws-sdk-sagemakerruntime/lib/aws-sdk-sagemakerruntime/client.rb', line 262

def invoke_endpoint(params = {}, options = {})
  req = build_request(:invoke_endpoint, params)
  req.send_request(options)
end