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

Class: Aws::SageMaker::Client

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

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#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



152
153
154
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 152

def initialize(*args)
  super
end

Instance Method Details

#add_tags(params = {}) ⇒ Types::AddTagsOutput

Adds or overwrites one or more tags for the specified Amazon SageMaker resource. You can add tags to notebook instances, training jobs, models, endpoint configurations, and endpoints.

Each tag consists of a key and an optional value. Tag keys must be unique per resource. For more information about tags, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

Examples:

Request syntax with placeholder values


resp = client.add_tags({
  resource_arn: "ResourceArn", # required
  tags: [ # required
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource that you want to tag.

  • :tags (required, Array<Types::Tag>)

    An array of Tag objects. Each tag is a key-value pair. Only the key parameter is required. If you don't specify a value, Amazon SageMaker sets the value to an empty string.

Returns:

See Also:



205
206
207
208
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 205

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

#create_endpoint(params = {}) ⇒ Types::CreateEndpointOutput

Creates an endpoint using the endpoint configuration specified in the request. Amazon SageMaker uses the endpoint to provision resources and deploy models. You create the endpoint configuration with the CreateEndpointConfig API.

Use this API only for hosting models using Amazon SageMaker hosting services.

The endpoint name must be unique within an AWS Region in your AWS account.

When it receives the request, Amazon SageMaker creates the endpoint, launches the resources (ML compute instances), and deploys the model(s) on them.

When Amazon SageMaker receives the request, it sets the endpoint status to Creating. After it creates the endpoint, it sets the status to InService. Amazon SageMaker can then process incoming requests for inferences. To check the status of an endpoint, use the DescribeEndpoint API.

For an example, see Exercise 1: Using the K-Means Algorithm Provided by Amazon SageMaker.

Examples:

Request syntax with placeholder values


resp = client.create_endpoint({
  endpoint_name: "EndpointName", # required
  endpoint_config_name: "EndpointConfigName", # required
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Response structure


resp.endpoint_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :endpoint_name (required, String)

    The name of the endpoint. The name must be unique within an AWS Region in your AWS account.

  • :endpoint_config_name (required, String)

    The name of an endpoint configuration. For more information, see CreateEndpointConfig.

  • :tags (Array<Types::Tag>)

    An array of key-value pairs. For more information, see Using Cost Allocation Tagsin the AWS Billing and Cost Management User Guide.

Returns:

See Also:



288
289
290
291
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 288

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

#create_endpoint_config(params = {}) ⇒ Types::CreateEndpointConfigOutput

Creates an endpoint configuration that Amazon SageMaker hosting services uses to deploy models. In the configuration, you identify one or more models, created using the CreateModel API, to deploy and the resources that you want Amazon SageMaker to provision. Then you call the CreateEndpoint API.

Use this API only if you want to use Amazon SageMaker hosting services to deploy models into production.

In the request, you define one or more ProductionVariants, each of which identifies a model. Each ProductionVariant parameter also describes the resources that you want Amazon SageMaker to provision. This includes the number and type of ML compute instances to deploy.

If you are hosting multiple models, you also assign a VariantWeight to specify how much traffic you want to allocate to each model. For example, suppose that you want to host two models, A and B, and you assign traffic weight 2 for model A and 1 for model B. Amazon SageMaker distributes two-thirds of the traffic to Model A, and one-third to model B.

Examples:

Request syntax with placeholder values


resp = client.create_endpoint_config({
  endpoint_config_name: "EndpointConfigName", # required
  production_variants: [ # required
    {
      variant_name: "VariantName", # required
      model_name: "ModelName", # required
      initial_instance_count: 1, # required
      instance_type: "ml.c4.2xlarge", # required, accepts ml.c4.2xlarge, ml.c4.8xlarge, ml.c4.xlarge, ml.c5.2xlarge, ml.c5.9xlarge, ml.c5.xlarge, ml.m4.xlarge, ml.p2.xlarge, ml.p3.2xlarge, ml.t2.medium
      initial_variant_weight: 1.0,
    },
  ],
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  kms_key_id: "KmsKeyId",
})

Response structure


resp.endpoint_config_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :endpoint_config_name (required, String)

    The name of the endpoint configuration. You specify this name in a CreateEndpoint request.

  • :production_variants (required, Array<Types::ProductionVariant>)

    An array of ProductionVariant objects, one for each model that you want to host at this endpoint.

  • :tags (Array<Types::Tag>)

    An array of key-value pairs. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

  • :kms_key_id (String)

    The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon SageMaker uses to encrypt data on the storage volume attached to the ML compute instance that hosts the endpoint.

Returns:

See Also:



380
381
382
383
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 380

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

#create_model(params = {}) ⇒ Types::CreateModelOutput

Creates a model in Amazon SageMaker. In the request, you name the model and describe one or more containers. For each container, you specify the docker image containing inference code, artifacts (from prior training), and custom environment map that the inference code uses when you deploy the model into production.

Use this API to create a model only if you want to use Amazon SageMaker hosting services. To host your model, you create an endpoint configuration with the CreateEndpointConfig API, and then create an endpoint with the CreateEndpoint API.

Amazon SageMaker then deploys all of the containers that you defined for the model in the hosting environment.

In the CreateModel request, you must define a container with the PrimaryContainer parameter.

In the request, you also provide an IAM role that Amazon SageMaker can assume to access model artifacts and docker image for deployment on ML compute hosting instances. In addition, you also use the IAM role to manage permissions the inference code needs. For example, if the inference code access any other AWS resources, you grant necessary permissions via this role.

Examples:

Request syntax with placeholder values


resp = client.create_model({
  model_name: "ModelName", # required
  primary_container: { # required
    container_hostname: "ContainerHostname",
    image: "Image", # required
    model_data_url: "Url",
    environment: {
      "EnvironmentKey" => "EnvironmentValue",
    },
  },
  execution_role_arn: "RoleArn", # required
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Response structure


resp.model_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :model_name (required, String)

    The name of the new model.

  • :primary_container (required, Types::ContainerDefinition)

    The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed into production.

  • :execution_role_arn (required, String)

    The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances. Deploying on ML compute instances is part of model hosting. For more information, see Amazon SageMaker Roles.

  • :tags (Array<Types::Tag>)

    An array of key-value pairs. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

Returns:

See Also:



469
470
471
472
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 469

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

#create_notebook_instance(params = {}) ⇒ Types::CreateNotebookInstanceOutput

Creates an Amazon SageMaker notebook instance. A notebook instance is an ML compute instance running on a Jupyter notebook.

In a CreateNotebookInstance request, you specify the type of ML compute instance that you want to run. Amazon SageMaker launches the instance, installs common libraries that you can use to explore datasets for model training, and attaches an ML storage volume to the notebook instance.

Amazon SageMaker also provides a set of example notebooks. Each notebook demonstrates how to use Amazon SageMaker with a specific an algorithm or with a machine learning framework.

After receiving the request, Amazon SageMaker does the following:

  1. Creates a network interface in the Amazon SageMaker VPC.

  2. (Option) If you specified SubnetId, creates a network interface in your own VPC, which is inferred from the subnet ID that you provide in the input. When creating this network interface, Amazon SageMaker attaches the security group that you specified in the request to the network interface that it creates in your VPC.

  3. Launches an EC2 instance of the type specified in the request in the Amazon SageMaker VPC. If you specified SubnetId of your VPC, Amazon SageMaker specifies both network interfaces when launching this instance. This enables inbound traffic from your own VPC to the notebook instance, assuming that the security groups allow it.

After creating the notebook instance, Amazon SageMaker returns its Amazon Resource Name (ARN).

After Amazon SageMaker creates the notebook instance, you can connect to the Jupyter server and work in Jupyter notebooks. For example, you can write code to explore a dataset that you can use for model training, train a model, host models by creating Amazon SageMaker endpoints, and validate hosted models.

For more information, see How It Works.

Examples:

Request syntax with placeholder values


resp = client.create_notebook_instance({
  notebook_instance_name: "NotebookInstanceName", # required
  instance_type: "ml.t2.medium", # required, accepts ml.t2.medium, ml.m4.xlarge, ml.p2.xlarge
  subnet_id: "SubnetId",
  security_group_ids: ["SecurityGroupId"],
  role_arn: "RoleArn", # required
  kms_key_id: "KmsKeyId",
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Response structure


resp.notebook_instance_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_name (required, String)

    The name of the new notebook instance.

  • :instance_type (required, String)

    The type of ML compute instance to launch for the notebook instance.

  • :subnet_id (String)

    The ID of the subnet in a VPC to which you would like to have a connectivity from your ML compute instance.

  • :security_group_ids (Array<String>)

    The VPC security group IDs, in the form sg-xxxxxxxx. The security groups must be for the same VPC as specified in the subnet.

  • :role_arn (required, String)

    When you send any requests to AWS resources from the notebook instance, Amazon SageMaker assumes this role to perform tasks on your behalf. You must grant this role necessary permissions so Amazon SageMaker can perform these tasks. The policy must allow the Amazon SageMaker service principal (sagemaker.amazonaws.com) permissions to assume this role. For more information, see Amazon SageMaker Roles.

  • :kms_key_id (String)

    If you provide a AWS KMS key ID, Amazon SageMaker uses it to encrypt data at rest on the ML storage volume that is attached to your notebook instance.

  • :tags (Array<Types::Tag>)

    A list of tags to associate with the notebook instance. You can add tags later by using the CreateTags API.

Returns:

See Also:



583
584
585
586
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 583

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

#create_presigned_notebook_instance_url(params = {}) ⇒ Types::CreatePresignedNotebookInstanceUrlOutput

Returns a URL that you can use to connect to the Juypter server from a notebook instance. In the Amazon SageMaker console, when you choose Open next to a notebook instance, Amazon SageMaker opens a new tab showing the Jupyter server home page from the notebook instance. The console uses this API to get the URL and show the page.

Examples:

Request syntax with placeholder values


resp = client.create_presigned_notebook_instance_url({
  notebook_instance_name: "NotebookInstanceName", # required
  session_expiration_duration_in_seconds: 1,
})

Response structure


resp.authorized_url #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_name (required, String)

    The name of the notebook instance.

  • :session_expiration_duration_in_seconds (Integer)

    The duration of the session, in seconds. The default is 12 hours.

Returns:

See Also:



619
620
621
622
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 619

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

#create_training_job(params = {}) ⇒ Types::CreateTrainingJobResponse

Starts a model training job. After training completes, Amazon SageMaker saves the resulting model artifacts to an Amazon S3 location that you specify.

If you choose to host your model using Amazon SageMaker hosting services, you can use the resulting model artifacts as part of the model. You can also use the artifacts in a deep learning service other than Amazon SageMaker, provided that you know how to use them for inferences.

In the request body, you provide the following:

  • AlgorithmSpecification - Identifies the training algorithm to use.

  • HyperParameters - Specify these algorithm-specific parameters to influence the quality of the final model. For a list of hyperparameters for each training algorithm provided by Amazon SageMaker, see Algorithms.

  • InputDataConfig - Describes the training dataset and the Amazon S3 location where it is stored.

  • OutputDataConfig - Identifies the Amazon S3 location where you want Amazon SageMaker to save the results of model training.

  • ResourceConfig - Identifies the resources, ML compute instances, and ML storage volumes to deploy for model training. In distributed training, you specify more than one instance.

  • RoleARN - The Amazon Resource Number (ARN) that Amazon SageMaker assumes to perform tasks on your behalf during model training. You must grant this role the necessary permissions so that Amazon SageMaker can successfully complete model training.

  • StoppingCondition - Sets a duration for training. Use this parameter to cap model training costs.

For more information about Amazon SageMaker, see How It Works.

Examples:

Request syntax with placeholder values


resp = client.create_training_job({
  training_job_name: "TrainingJobName", # required
  hyper_parameters: {
    "ParameterKey" => "ParameterValue",
  },
  algorithm_specification: { # required
    training_image: "AlgorithmImage", # required
    training_input_mode: "Pipe", # required, accepts Pipe, File
  },
  role_arn: "RoleArn", # required
  input_data_config: [ # required
    {
      channel_name: "ChannelName", # required
      data_source: { # required
        s3_data_source: { # required
          s3_data_type: "ManifestFile", # required, accepts ManifestFile, S3Prefix
          s3_uri: "S3Uri", # required
          s3_data_distribution_type: "FullyReplicated", # accepts FullyReplicated, ShardedByS3Key
        },
      },
      content_type: "ContentType",
      compression_type: "None", # accepts None, Gzip
      record_wrapper_type: "None", # accepts None, RecordIO
    },
  ],
  output_data_config: { # required
    kms_key_id: "KmsKeyId",
    s3_output_path: "S3Uri", # required
  },
  resource_config: { # required
    instance_type: "ml.m4.xlarge", # required, accepts ml.m4.xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.c4.xlarge, ml.c4.2xlarge, ml.c4.8xlarge, ml.p2.xlarge, ml.p2.8xlarge, ml.p2.16xlarge, ml.p3.2xlarge, ml.p3.8xlarge, ml.p3.16xlarge, ml.c5.xlarge, ml.c5.2xlarge, ml.c5.4xlarge, ml.c5.9xlarge, ml.c5.18xlarge
    instance_count: 1, # required
    volume_size_in_gb: 1, # required
    volume_kms_key_id: "KmsKeyId",
  },
  stopping_condition: { # required
    max_runtime_in_seconds: 1,
  },
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Response structure


resp.training_job_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :training_job_name (required, String)

    The name of the training job. The name must be unique within an AWS Region in an AWS account. It appears in the Amazon SageMaker console.

  • :hyper_parameters (Hash<String,String>)

    Algorithm-specific parameters. You set hyperparameters before you start the learning process. Hyperparameters influence the quality of the model. For a list of hyperparameters for each training algorithm provided by Amazon SageMaker, see Algorithms.

    You can specify a maximum of 100 hyperparameters. Each hyperparameter is a key-value pair. Each key and value is limited to 256 characters, as specified by the Length Constraint.

  • :algorithm_specification (required, Types::AlgorithmSpecification)

    The registry path of the Docker image that contains the training algorithm and algorithm-specific metadata, including the input mode. For more information about algorithms provided by Amazon SageMaker, see Algorithms. For information about providing your own algorithms, see Bring Your Own Algorithms .

  • :role_arn (required, String)

    The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.

    During model training, Amazon SageMaker needs your permission to read input data from an S3 bucket, download a Docker image that contains training code, write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, and publish metrics to Amazon CloudWatch. You grant permissions for all of these tasks to an IAM role. For more information, see Amazon SageMaker Roles.

  • :input_data_config (required, Array<Types::Channel>)

    An array of Channel objects. Each channel is a named input source. InputDataConfig describes the input data and its location.

    Algorithms can accept input data from one or more channels. For example, an algorithm might have two channels of input data, training_data and validation_data. The configuration for each channel provides the S3 location where the input data is stored. It also provides information about the stored data: the MIME type, compression method, and whether the data is wrapped in RecordIO format.

    Depending on the input mode that the algorithm supports, Amazon SageMaker either copies input data files from an S3 bucket to a local directory in the Docker container, or makes it available as input streams.

  • :output_data_config (required, Types::OutputDataConfig)

    Specifies the path to the S3 bucket where you want to store model artifacts. Amazon SageMaker creates subfolders for the artifacts.

  • :resource_config (required, Types::ResourceConfig)

    The resources, including the ML compute instances and ML storage volumes, to use for model training.

    ML storage volumes store model artifacts and incremental states. Training algorithms might also use ML storage volumes for scratch space. If you want Amazon SageMaker to use the ML storage volume to store the training data, choose File as the TrainingInputMode in the algorithm specification. For distributed training algorithms, specify an instance count greater than 1.

  • :stopping_condition (required, Types::StoppingCondition)

    Sets a duration for training. Use this parameter to cap model training costs. To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms might use this 120-second window to save the model artifacts.

    When Amazon SageMaker terminates a job because the stopping condition has been met, training algorithms provided by Amazon SageMaker save the intermediate results of the job. This intermediate data is a valid model artifact. You can use it to create a model using the CreateModel API.

  • :tags (Array<Types::Tag>)

    An array of key-value pairs. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

Returns:

See Also:



829
830
831
832
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 829

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

#delete_endpoint(params = {}) ⇒ Struct

Deletes an endpoint. Amazon SageMaker frees up all of the resources that were deployed when the endpoint was created.

Examples:

Request syntax with placeholder values


resp = client.delete_endpoint({
  endpoint_name: "EndpointName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :endpoint_name (required, String)

    The name of the endpoint that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



852
853
854
855
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 852

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

#delete_endpoint_config(params = {}) ⇒ Struct

Deletes an endpoint configuration. The DeleteEndpoingConfig API deletes only the specified configuration. It does not delete endpoints created using the configuration.

Examples:

Request syntax with placeholder values


resp = client.delete_endpoint_config({
  endpoint_config_name: "EndpointConfigName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :endpoint_config_name (required, String)

    The name of the endpoint configuration that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



876
877
878
879
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 876

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

#delete_model(params = {}) ⇒ Struct

Deletes a model. The DeleteModel API deletes only the model entry that was created in Amazon SageMaker when you called the CreateModel API. It does not delete model artifacts, inference code, or the IAM role that you specified when creating the model.

Examples:

Request syntax with placeholder values


resp = client.delete_model({
  model_name: "ModelName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :model_name (required, String)

    The name of the model to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



905
906
907
908
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 905

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

#delete_notebook_instance(params = {}) ⇒ Struct

Deletes an Amazon SageMaker notebook instance. Before you can delete a notebook instance, you must call the StopNotebookInstance API.

When you delete a notebook instance, you lose all of your data. Amazon SageMaker removes the ML compute instance, and deletes the ML storage volume and the network interface associated with the notebook instance.

Examples:

Request syntax with placeholder values


resp = client.delete_notebook_instance({
  notebook_instance_name: "NotebookInstanceName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_name (required, String)

    The name of the Amazon SageMaker notebook instance to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



933
934
935
936
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 933

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

#delete_tags(params = {}) ⇒ Struct

Deletes the specified tags from an Amazon SageMaker resource.

To list a resource's tags, use the ListTags API.

Examples:

Request syntax with placeholder values


resp = client.delete_tags({
  resource_arn: "ResourceArn", # required
  tag_keys: ["TagKey"], # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource whose tags you want to delete.

  • :tag_keys (required, Array<String>)

    An array or one or more tag keys to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



962
963
964
965
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 962

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

#describe_endpoint(params = {}) ⇒ Types::DescribeEndpointOutput

Returns the description of an endpoint.

Examples:

Request syntax with placeholder values


resp = client.describe_endpoint({
  endpoint_name: "EndpointName", # required
})

Response structure


resp.endpoint_name #=> String
resp.endpoint_arn #=> String
resp.endpoint_config_name #=> String
resp.production_variants #=> Array
resp.production_variants[0].variant_name #=> String
resp.production_variants[0].current_weight #=> Float
resp.production_variants[0].desired_weight #=> Float
resp.production_variants[0].current_instance_count #=> Integer
resp.production_variants[0].desired_instance_count #=> Integer
resp.endpoint_status #=> String, one of "OutOfService", "Creating", "Updating", "RollingBack", "InService", "Deleting", "Failed"
resp.failure_reason #=> String
resp.creation_time #=> Time
resp.last_modified_time #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :endpoint_name (required, String)

    The name of the endpoint.

Returns:

See Also:



1009
1010
1011
1012
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1009

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

#describe_endpoint_config(params = {}) ⇒ Types::DescribeEndpointConfigOutput

Returns the description of an endpoint configuration created using the CreateEndpointConfig API.

Examples:

Request syntax with placeholder values


resp = client.describe_endpoint_config({
  endpoint_config_name: "EndpointConfigName", # required
})

Response structure


resp.endpoint_config_name #=> String
resp.endpoint_config_arn #=> String
resp.production_variants #=> Array
resp.production_variants[0].variant_name #=> String
resp.production_variants[0].model_name #=> String
resp.production_variants[0].initial_instance_count #=> Integer
resp.production_variants[0].instance_type #=> String, one of "ml.c4.2xlarge", "ml.c4.8xlarge", "ml.c4.xlarge", "ml.c5.2xlarge", "ml.c5.9xlarge", "ml.c5.xlarge", "ml.m4.xlarge", "ml.p2.xlarge", "ml.p3.2xlarge", "ml.t2.medium"
resp.production_variants[0].initial_variant_weight #=> Float
resp.kms_key_id #=> String
resp.creation_time #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :endpoint_config_name (required, String)

    The name of the endpoint configuration.

Returns:

See Also:



1051
1052
1053
1054
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1051

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

#describe_model(params = {}) ⇒ Types::DescribeModelOutput

Describes a model that you created using the CreateModel API.

Examples:

Request syntax with placeholder values


resp = client.describe_model({
  model_name: "ModelName", # required
})

Response structure


resp.model_name #=> String
resp.primary_container.container_hostname #=> String
resp.primary_container.image #=> String
resp.primary_container.model_data_url #=> String
resp.primary_container.environment #=> Hash
resp.primary_container.environment["EnvironmentKey"] #=> String
resp.execution_role_arn #=> String
resp.creation_time #=> Time
resp.model_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :model_name (required, String)

    The name of the model.

Returns:

See Also:



1091
1092
1093
1094
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1091

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

#describe_notebook_instance(params = {}) ⇒ Types::DescribeNotebookInstanceOutput

Returns information about a notebook instance.

Examples:

Request syntax with placeholder values


resp = client.describe_notebook_instance({
  notebook_instance_name: "NotebookInstanceName", # required
})

Response structure


resp.notebook_instance_arn #=> String
resp.notebook_instance_name #=> String
resp.notebook_instance_status #=> String, one of "Pending", "InService", "Stopping", "Stopped", "Failed", "Deleting"
resp.failure_reason #=> String
resp.url #=> String
resp.instance_type #=> String, one of "ml.t2.medium", "ml.m4.xlarge", "ml.p2.xlarge"
resp.subnet_id #=> String
resp.security_groups #=> Array
resp.security_groups[0] #=> String
resp.role_arn #=> String
resp.kms_key_id #=> String
resp.network_interface_id #=> String
resp.last_modified_time #=> Time
resp.creation_time #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_name (required, String)

    The name of the notebook instance that you want information about.

Returns:

See Also:



1144
1145
1146
1147
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1144

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

#describe_training_job(params = {}) ⇒ Types::DescribeTrainingJobResponse

Returns information about a training job.

Examples:

Request syntax with placeholder values


resp = client.describe_training_job({
  training_job_name: "TrainingJobName", # required
})

Response structure


resp.training_job_name #=> String
resp.training_job_arn #=> String
resp.model_artifacts.s3_model_artifacts #=> String
resp.training_job_status #=> String, one of "InProgress", "Completed", "Failed", "Stopping", "Stopped"
resp.secondary_status #=> String, one of "Starting", "Downloading", "Training", "Uploading", "Stopping", "Stopped", "MaxRuntimeExceeded", "Completed", "Failed"
resp.failure_reason #=> String
resp.hyper_parameters #=> Hash
resp.hyper_parameters["ParameterKey"] #=> String
resp.algorithm_specification.training_image #=> String
resp.algorithm_specification.training_input_mode #=> String, one of "Pipe", "File"
resp.role_arn #=> String
resp.input_data_config #=> Array
resp.input_data_config[0].channel_name #=> String
resp.input_data_config[0].data_source.s3_data_source.s3_data_type #=> String, one of "ManifestFile", "S3Prefix"
resp.input_data_config[0].data_source.s3_data_source.s3_uri #=> String
resp.input_data_config[0].data_source.s3_data_source.s3_data_distribution_type #=> String, one of "FullyReplicated", "ShardedByS3Key"
resp.input_data_config[0].content_type #=> String
resp.input_data_config[0].compression_type #=> String, one of "None", "Gzip"
resp.input_data_config[0].record_wrapper_type #=> String, one of "None", "RecordIO"
resp.output_data_config.kms_key_id #=> String
resp.output_data_config.s3_output_path #=> String
resp.resource_config.instance_type #=> String, one of "ml.m4.xlarge", "ml.m4.4xlarge", "ml.m4.10xlarge", "ml.c4.xlarge", "ml.c4.2xlarge", "ml.c4.8xlarge", "ml.p2.xlarge", "ml.p2.8xlarge", "ml.p2.16xlarge", "ml.p3.2xlarge", "ml.p3.8xlarge", "ml.p3.16xlarge", "ml.c5.xlarge", "ml.c5.2xlarge", "ml.c5.4xlarge", "ml.c5.9xlarge", "ml.c5.18xlarge"
resp.resource_config.instance_count #=> Integer
resp.resource_config.volume_size_in_gb #=> Integer
resp.resource_config.volume_kms_key_id #=> String
resp.stopping_condition.max_runtime_in_seconds #=> Integer
resp.creation_time #=> Time
resp.training_start_time #=> Time
resp.training_end_time #=> Time
resp.last_modified_time #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :training_job_name (required, String)

    The name of the training job.

Returns:

See Also:



1217
1218
1219
1220
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1217

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

#list_endpoint_configs(params = {}) ⇒ Types::ListEndpointConfigsOutput

Lists endpoint configurations.

Examples:

Request syntax with placeholder values


resp = client.list_endpoint_configs({
  sort_by: "Name", # accepts Name, CreationTime
  sort_order: "Ascending", # accepts Ascending, Descending
  next_token: "PaginationToken",
  max_results: 1,
  name_contains: "EndpointConfigNameContains",
  creation_time_before: Time.now,
  creation_time_after: Time.now,
})

Response structure


resp.endpoint_configs #=> Array
resp.endpoint_configs[0].endpoint_config_name #=> String
resp.endpoint_configs[0].endpoint_config_arn #=> String
resp.endpoint_configs[0].creation_time #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :sort_by (String)

    The field to sort results by. The default is CreationTime.

  • :sort_order (String)

    The sort order for results. The default is Ascending.

  • :next_token (String)

    If the result of the previous ListEndpointConfig request was truncated, the response includes a NextToken. To retrieve the next set of endpoint configurations, use the token in the next request.

  • :max_results (Integer)

    The maximum number of training jobs to return in the response.

  • :name_contains (String)

    A string in the endpoint configuration name. This filter returns only endpoint configurations whose name contains the specified string.

  • :creation_time_before (Time, DateTime, Date, Integer, String)

    A filter that returns only endpoint configurations created before the specified time (timestamp).

  • :creation_time_after (Time, DateTime, Date, Integer, String)

    A filter that returns only endpoint configurations created after the specified time (timestamp).

Returns:

See Also:



1279
1280
1281
1282
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1279

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

#list_endpoints(params = {}) ⇒ Types::ListEndpointsOutput

Lists endpoints.

Examples:

Request syntax with placeholder values


resp = client.list_endpoints({
  sort_by: "Name", # accepts Name, CreationTime, Status
  sort_order: "Ascending", # accepts Ascending, Descending
  next_token: "PaginationToken",
  max_results: 1,
  name_contains: "EndpointNameContains",
  creation_time_before: Time.now,
  creation_time_after: Time.now,
  last_modified_time_before: Time.now,
  last_modified_time_after: Time.now,
  status_equals: "OutOfService", # accepts OutOfService, Creating, Updating, RollingBack, InService, Deleting, Failed
})

Response structure


resp.endpoints #=> Array
resp.endpoints[0].endpoint_name #=> String
resp.endpoints[0].endpoint_arn #=> String
resp.endpoints[0].creation_time #=> Time
resp.endpoints[0].last_modified_time #=> Time
resp.endpoints[0].endpoint_status #=> String, one of "OutOfService", "Creating", "Updating", "RollingBack", "InService", "Deleting", "Failed"
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :sort_by (String)

    Sorts the list of results. The default is CreationTime.

  • :sort_order (String)

    The sort order for results. The default is Ascending.

  • :next_token (String)

    If the result of a ListEndpoints request was truncated, the response includes a NextToken. To retrieve the next set of endpoints, use the token in the next request.

  • :max_results (Integer)

    The maximum number of endpoints to return in the response.

  • :name_contains (String)

    A string in endpoint names. This filter returns only endpoints whose name contains the specified string.

  • :creation_time_before (Time, DateTime, Date, Integer, String)

    A filter that returns only endpoints that were created before the specified time (timestamp).

  • :creation_time_after (Time, DateTime, Date, Integer, String)

    A filter that returns only endpoints that were created after the specified time (timestamp).

  • :last_modified_time_before (Time, DateTime, Date, Integer, String)

    A filter that returns only endpoints that were modified before the specified timestamp.

  • :last_modified_time_after (Time, DateTime, Date, Integer, String)

    A filter that returns only endpoints that were modified after the specified timestamp.

  • :status_equals (String)

    A filter that returns only endpoints with the specified status.

Returns:

See Also:



1357
1358
1359
1360
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1357

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

#list_models(params = {}) ⇒ Types::ListModelsOutput

Lists models created with the CreateModel API.

Examples:

Request syntax with placeholder values


resp = client.list_models({
  sort_by: "Name", # accepts Name, CreationTime
  sort_order: "Ascending", # accepts Ascending, Descending
  next_token: "PaginationToken",
  max_results: 1,
  name_contains: "ModelNameContains",
  creation_time_before: Time.now,
  creation_time_after: Time.now,
})

Response structure


resp.models #=> Array
resp.models[0].model_name #=> String
resp.models[0].model_arn #=> String
resp.models[0].creation_time #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :sort_by (String)

    Sorts the list of results. The default is CreationTime.

  • :sort_order (String)

    The sort order for results. The default is Ascending.

  • :next_token (String)

    If the response to a previous ListModels request was truncated, the response includes a NextToken. To retrieve the next set of models, use the token in the next request.

  • :max_results (Integer)

    The maximum number of models to return in the response.

  • :name_contains (String)

    A string in the training job name. This filter returns only models in the training job whose name contains the specified string.

  • :creation_time_before (Time, DateTime, Date, Integer, String)

    A filter that returns only models created before the specified time (timestamp).

  • :creation_time_after (Time, DateTime, Date, Integer, String)

    A filter that returns only models created after the specified time (timestamp).

Returns:

See Also:



1423
1424
1425
1426
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1423

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

#list_notebook_instances(params = {}) ⇒ Types::ListNotebookInstancesOutput

Returns a list of the Amazon SageMaker notebook instances in the requester's account in an AWS Region.

Examples:

Request syntax with placeholder values


resp = client.list_notebook_instances({
  next_token: "NextToken",
  max_results: 1,
  sort_by: "Name", # accepts Name, CreationTime, Status
  sort_order: "Ascending", # accepts Ascending, Descending
  name_contains: "NotebookInstanceNameContains",
  creation_time_before: Time.now,
  creation_time_after: Time.now,
  last_modified_time_before: Time.now,
  last_modified_time_after: Time.now,
  status_equals: "Pending", # accepts Pending, InService, Stopping, Stopped, Failed, Deleting
})

Response structure


resp.next_token #=> String
resp.notebook_instances #=> Array
resp.notebook_instances[0].notebook_instance_name #=> String
resp.notebook_instances[0].notebook_instance_arn #=> String
resp.notebook_instances[0].notebook_instance_status #=> String, one of "Pending", "InService", "Stopping", "Stopped", "Failed", "Deleting"
resp.notebook_instances[0].url #=> String
resp.notebook_instances[0].instance_type #=> String, one of "ml.t2.medium", "ml.m4.xlarge", "ml.p2.xlarge"
resp.notebook_instances[0].creation_time #=> Time
resp.notebook_instances[0].last_modified_time #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :next_token (String)

    If the previous call to the ListNotebookInstances is truncated, the response includes a NextToken. You can use this token in your subsequent ListNotebookInstances request to fetch the next set of notebook instances.

    You might specify a filter or a sort order in your request. When response is truncated, you must use the same values for the filer and sort order in the next request.

  • :max_results (Integer)

    The maximum number of notebook instances to return.

  • :sort_by (String)

    The field to sort results by. The default is Name.

  • :sort_order (String)

    The sort order for results.

  • :name_contains (String)

    A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.

  • :creation_time_before (Time, DateTime, Date, Integer, String)

    A filter that returns only notebook instances that were created before the specified time (timestamp).

  • :creation_time_after (Time, DateTime, Date, Integer, String)

    A filter that returns only notebook instances that were created after the specified time (timestamp).

  • :last_modified_time_before (Time, DateTime, Date, Integer, String)

    A filter that returns only notebook instances that were modified before the specified time (timestamp).

  • :last_modified_time_after (Time, DateTime, Date, Integer, String)

    A filter that returns only notebook instances that were modified after the specified time (timestamp).

  • :status_equals (String)

    A filter that returns only notebook instances with the specified status.

Returns:

See Also:



1512
1513
1514
1515
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1512

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

#list_tags(params = {}) ⇒ Types::ListTagsOutput

Returns the tags for the specified Amazon SageMaker resource.

Examples:

Request syntax with placeholder values


resp = client.list_tags({
  resource_arn: "ResourceArn", # required
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve.

  • :next_token (String)

    If the response to the previous ListTags request is truncated, Amazon SageMaker returns this token. To retrieve the next set of tags, use it in the subsequent request.

  • :max_results (Integer)

    Maximum number of tags to return.

Returns:

See Also:



1555
1556
1557
1558
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1555

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

#list_training_jobs(params = {}) ⇒ Types::ListTrainingJobsResponse

Lists training jobs.

Examples:

Request syntax with placeholder values


resp = client.list_training_jobs({
  next_token: "NextToken",
  max_results: 1,
  creation_time_after: Time.now,
  creation_time_before: Time.now,
  last_modified_time_after: Time.now,
  last_modified_time_before: Time.now,
  name_contains: "NameContains",
  status_equals: "InProgress", # accepts InProgress, Completed, Failed, Stopping, Stopped
  sort_by: "Name", # accepts Name, CreationTime, Status
  sort_order: "Ascending", # accepts Ascending, Descending
})

Response structure


resp.training_job_summaries #=> Array
resp.training_job_summaries[0].training_job_name #=> String
resp.training_job_summaries[0].training_job_arn #=> String
resp.training_job_summaries[0].creation_time #=> Time
resp.training_job_summaries[0].training_end_time #=> Time
resp.training_job_summaries[0].last_modified_time #=> Time
resp.training_job_summaries[0].training_job_status #=> String, one of "InProgress", "Completed", "Failed", "Stopping", "Stopped"
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :next_token (String)

    If the result of the previous ListTrainingJobs request was truncated, the response includes a NextToken. To retrieve the next set of training jobs, use the token in the next request.

  • :max_results (Integer)

    The maximum number of training jobs to return in the response.

  • :creation_time_after (Time, DateTime, Date, Integer, String)

    A filter that only training jobs created after the specified time (timestamp).

  • :creation_time_before (Time, DateTime, Date, Integer, String)

    A filter that returns only training jobs created before the specified time (timestamp).

  • :last_modified_time_after (Time, DateTime, Date, Integer, String)

    A filter that returns only training jobs modified after the specified time (timestamp).

  • :last_modified_time_before (Time, DateTime, Date, Integer, String)

    A filter that returns only training jobs modified before the specified time (timestamp).

  • :name_contains (String)

    A string in the training job name. This filter returns only models whose name contains the specified string.

  • :status_equals (String)

    A filter that retrieves only training jobs with a specific status.

  • :sort_by (String)

    The field to sort results by. The default is CreationTime.

  • :sort_order (String)

    The sort order for results. The default is Ascending.

Returns:

See Also:



1634
1635
1636
1637
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1634

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

#start_notebook_instance(params = {}) ⇒ Struct

Launches an ML compute instance with the latest version of the libraries and attaches your ML storage volume. After configuring the notebook instance, Amazon SageMaker sets the notebook instance status to InService. A notebook instance's status must be InService before you can connect to your Jupyter notebook.

Examples:

Request syntax with placeholder values


resp = client.start_notebook_instance({
  notebook_instance_name: "NotebookInstanceName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_name (required, String)

    The name of the notebook instance to start.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1660
1661
1662
1663
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1660

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

#stop_notebook_instance(params = {}) ⇒ Struct

Terminates the ML compute instance. Before terminating the instance, Amazon SageMaker disconnects the ML storage volume from it. Amazon SageMaker preserves the ML storage volume.

To access data on the ML storage volume for a notebook instance that has been terminated, call the StartNotebookInstance API. StartNotebookInstance launches another ML compute instance, configures it, and attaches the preserved ML storage volume so you can continue your work.

Examples:

Request syntax with placeholder values


resp = client.stop_notebook_instance({
  notebook_instance_name: "NotebookInstanceName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_name (required, String)

    The name of the notebook instance to terminate.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1690
1691
1692
1693
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1690

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

#stop_training_job(params = {}) ⇒ Struct

Stops a training job. To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which delays job termination for 120 seconds. Algorithms might use this 120-second window to save the model artifacts, so the results of the training is not lost.

Training algorithms provided by Amazon SageMaker save the intermediate results of a model training job. This intermediate data is a valid model artifact. You can use the model artifacts that are saved when Amazon SageMaker stops a training job to create a model.

When it receives a StopTrainingJob request, Amazon SageMaker changes the status of the job to Stopping. After Amazon SageMaker stops the job, it sets the status to Stopped.

Examples:

Request syntax with placeholder values


resp = client.stop_training_job({
  training_job_name: "TrainingJobName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :training_job_name (required, String)

    The name of the training job to stop.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1724
1725
1726
1727
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1724

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

#update_endpoint(params = {}) ⇒ Types::UpdateEndpointOutput

Deploys the new EndpointConfig specified in the request, switches to using newly created endpoint, and then deletes resources provisioned for the endpoint using the previous EndpointConfig (there is no availability loss).

When Amazon SageMaker receives the request, it sets the endpoint status to Updating. After updating the endpoint, it sets the status to InService. To check the status of an endpoint, use the DescribeEndpoint API.

Examples:

Request syntax with placeholder values


resp = client.update_endpoint({
  endpoint_name: "EndpointName", # required
  endpoint_config_name: "EndpointConfigName", # required
})

Response structure


resp.endpoint_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :endpoint_name (required, String)

    The name of the endpoint whose configuration you want to update.

  • :endpoint_config_name (required, String)

    The name of the new endpoint configuration.

Returns:

See Also:



1768
1769
1770
1771
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1768

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

#update_endpoint_weights_and_capacities(params = {}) ⇒ Types::UpdateEndpointWeightsAndCapacitiesOutput

Updates variant weight of one or more variants associated with an existing endpoint, or capacity of one variant associated with an existing endpoint. When it receives the request, Amazon SageMaker sets the endpoint status to Updating. After updating the endpoint, it sets the status to InService. To check the status of an endpoint, use the DescribeEndpoint API.

Examples:

Request syntax with placeholder values


resp = client.update_endpoint_weights_and_capacities({
  endpoint_name: "EndpointName", # required
  desired_weights_and_capacities: [ # required
    {
      variant_name: "VariantName", # required
      desired_weight: 1.0,
      desired_instance_count: 1,
    },
  ],
})

Response structure


resp.endpoint_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :endpoint_name (required, String)

    The name of an existing Amazon SageMaker endpoint.

  • :desired_weights_and_capacities (required, Array<Types::DesiredWeightAndCapacity>)

    An object that provides new capacity and weight values for a variant.

Returns:

See Also:



1815
1816
1817
1818
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1815

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

#update_notebook_instance(params = {}) ⇒ Struct

Updates a notebook instance. NotebookInstance updates include upgrading or downgrading the ML compute instance used for your notebook instance to accommodate changes in your workload requirements. You can also update the VPC security groups.

Examples:

Request syntax with placeholder values


resp = client.update_notebook_instance({
  notebook_instance_name: "NotebookInstanceName", # required
  instance_type: "ml.t2.medium", # accepts ml.t2.medium, ml.m4.xlarge, ml.p2.xlarge
  role_arn: "RoleArn",
})

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_name (required, String)

    The name of the notebook instance to update.

  • :instance_type (String)

    The Amazon ML compute instance type.

  • :role_arn (String)

    Amazon Resource Name (ARN) of the IAM role to associate with the instance.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1849
1850
1851
1852
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1849

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

#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean

Polls an API operation until a resource enters a desired state.

Basic Usage

A waiter will call an API operation until:

  • It is successful
  • It enters a terminal state
  • It makes the maximum number of attempts

In between attempts, the waiter will sleep.

# polls in a loop, sleeping between attempts
client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.

# poll for ~25 seconds
client.wait_until(waiter_name, params, {
  max_attempts: 5,
  delay: 5,
})

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(waiter_name, params, {

  # disable max attempts
  max_attempts: nil,

  # poll for 1 hour, instead of a number of attempts
  before_wait: -> (attempts, response) do
    throw :failure if Time.now - started_at > 3600
  end
})

Handling Errors

When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Valid Waiters

The following table lists the valid waiter names, the operations they call, and the default :delay and :max_attempts values.

waiter_name params :delay :max_attempts
endpoint_deleted #describe_endpoint 30 60
endpoint_in_service #describe_endpoint 30 120
notebook_instance_deleted #describe_notebook_instance 30 60
notebook_instance_in_service #describe_notebook_instance 30 60
notebook_instance_stopped #describe_notebook_instance 30 60
training_job_completed_or_stopped #describe_training_job 120 180

Parameters:

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

    ({})

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

    ({})

Options Hash (options):

  • :max_attempts (Integer)
  • :delay (Integer)
  • :before_attempt (Proc)
  • :before_wait (Proc)

Yields:

  • (w.waiter)

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.



1964
1965
1966
1967
1968
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1964

def wait_until(waiter_name, params = {}, options = {})
  w = waiter(waiter_name, options)
  yield(w.waiter) if block_given? # deprecated
  w.wait(params)
end