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



163
164
165
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 163

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:



216
217
218
219
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 216

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.

If any of the models hosted at this endpoint get model data from an Amazon S3 location, Amazon SageMaker uses AWS Security Token Service to download model artifacts from the S3 path you provided. AWS STS is activated in your IAM user account by default. If you previously deactivated AWS STS for a region, you need to reactivate AWS STS for that region. For more information, see Activating and Deactivating AWS STS i an AWS Region in the AWS Identity and Access Management User Guide.

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:



309
310
311
312
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 309

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.t2.medium", # required, accepts ml.t2.medium, ml.t2.large, ml.t2.xlarge, ml.t2.2xlarge, ml.m4.xlarge, ml.m4.2xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.m4.16xlarge, ml.m5.large, ml.m5.xlarge, ml.m5.2xlarge, ml.m5.4xlarge, ml.m5.12xlarge, ml.m5.24xlarge, ml.c4.large, ml.c4.xlarge, ml.c4.2xlarge, ml.c4.4xlarge, ml.c4.8xlarge, ml.p2.xlarge, ml.p2.8xlarge, ml.p2.16xlarge, ml.p3.2xlarge, ml.p3.8xlarge, ml.p3.16xlarge, ml.c5.large, ml.c5.xlarge, ml.c5.2xlarge, ml.c5.4xlarge, ml.c5.9xlarge, ml.c5.18xlarge
      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:



401
402
403
404
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 401

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

#create_hyper_parameter_tuning_job(params = {}) ⇒ Types::CreateHyperParameterTuningJobResponse

Starts a hyperparameter tuning job.

Examples:

Request syntax with placeholder values


resp = client.create_hyper_parameter_tuning_job({
  hyper_parameter_tuning_job_name: "HyperParameterTuningJobName", # required
  hyper_parameter_tuning_job_config: { # required
    strategy: "Bayesian", # required, accepts Bayesian
    hyper_parameter_tuning_job_objective: { # required
      type: "Maximize", # required, accepts Maximize, Minimize
      metric_name: "MetricName", # required
    },
    resource_limits: { # required
      max_number_of_training_jobs: 1, # required
      max_parallel_training_jobs: 1, # required
    },
    parameter_ranges: { # required
      integer_parameter_ranges: [
        {
          name: "ParameterKey", # required
          min_value: "ParameterValue", # required
          max_value: "ParameterValue", # required
        },
      ],
      continuous_parameter_ranges: [
        {
          name: "ParameterKey", # required
          min_value: "ParameterValue", # required
          max_value: "ParameterValue", # required
        },
      ],
      categorical_parameter_ranges: [
        {
          name: "ParameterKey", # required
          values: ["ParameterValue"], # required
        },
      ],
    },
  },
  training_job_definition: { # required
    static_hyper_parameters: {
      "ParameterKey" => "ParameterValue",
    },
    algorithm_specification: { # required
      training_image: "AlgorithmImage", # required
      training_input_mode: "Pipe", # required, accepts Pipe, File
      metric_definitions: [
        {
          name: "MetricName", # required
          regex: "MetricRegex", # required
        },
      ],
    },
    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
      },
    ],
    vpc_config: {
      security_group_ids: ["SecurityGroupId"], # required
      subnets: ["SubnetId"], # required
    },
    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.2xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.m4.16xlarge, ml.m5.large, ml.m5.xlarge, ml.m5.2xlarge, ml.m5.4xlarge, ml.m5.12xlarge, ml.m5.24xlarge, ml.c4.xlarge, ml.c4.2xlarge, ml.c4.4xlarge, 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.hyper_parameter_tuning_job_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :hyper_parameter_tuning_job_name (required, String)

    The name of the tuning job. This name is the prefix for the names of all training jobs that this tuning job launches. The name must be unique within the same AWS account and AWS Region. Names are not case sensitive, and must be between 1-32 characters.

  • :hyper_parameter_tuning_job_config (required, Types::HyperParameterTuningJobConfig)

    The HyperParameterTuningJobConfig object that describes the tuning job, including the search strategy, metric used to evaluate training jobs, ranges of parameters to search, and resource limits for the tuning job.

  • :training_job_definition (required, Types::HyperParameterTrainingJobDefinition)

    The HyperParameterTrainingJobDefinition object that describes the training jobs that this tuning job launches, including static hyperparameters, input data configuration, output data configuration, resource configuration, and stopping condition.

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

    An array of key-value pairs. You can use tags to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. For more information, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.

Returns:

See Also:



541
542
543
544
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 541

def create_hyper_parameter_tuning_job(params = {}, options = {})
  req = build_request(:create_hyper_parameter_tuning_job, 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
    },
  ],
  vpc_config: {
    security_group_ids: ["SecurityGroupId"], # required
    subnets: ["SubnetId"], # 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.

    To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

  • :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.

  • :vpc_config (Types::VpcConfig)

    A VpcConfig object that specifies the VPC that you want your model to connect to. Control access to and from your model container by configuring the VPC. For more information, see host-vpc.

Returns:

See Also:



644
645
646
647
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 644

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 a machine learning (ML) compute instance running on a Jupyter notebook.

In a CreateNotebookInstance request, 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 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, Amazon SageMaker 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.t2.large, ml.t2.xlarge, ml.t2.2xlarge, ml.m4.xlarge, ml.m4.2xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.m4.16xlarge, ml.p2.xlarge, ml.p2.8xlarge, ml.p2.16xlarge, ml.p3.2xlarge, ml.p3.8xlarge, ml.p3.16xlarge
  subnet_id: "SubnetId",
  security_group_ids: ["SecurityGroupId"],
  role_arn: "RoleArn", # required
  kms_key_id: "KmsKeyId",
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
  lifecycle_config_name: "NotebookInstanceLifecycleConfigName",
  direct_internet_access: "Enabled", # accepts Enabled, Disabled
})

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.

    To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

  • :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.

  • :lifecycle_config_name (String)

    The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see notebook-lifecycle-config.

  • :direct_internet_access (String)

    Sets whether Amazon SageMaker provides internet access to the notebook instance. If you set this to Disabled this notebook instance will be able to access resources only in your VPC, and will not be able to connect to Amazon SageMaker training and endpoint services unless your configure a NAT Gateway in your VPC.

    For more information, see appendix-notebook-and-internet-access. You can set the value of this parameter to Disabled only if you set a value for the SubnetId parameter.

Returns:

See Also:



783
784
785
786
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 783

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

#create_notebook_instance_lifecycle_config(params = {}) ⇒ Types::CreateNotebookInstanceLifecycleConfigOutput

Creates a lifecycle configuration that you can associate with a notebook instance. A lifecycle configuration is a collection of shell scripts that run when you create or start a notebook instance.

Each lifecycle configuration script has a limit of 16384 characters.

The value of the $PATH environment variable that is available to both scripts is /sbin:bin:/usr/sbin:/usr/bin.

View CloudWatch Logs for notebook instance lifecycle configurations in log group /aws/sagemaker/NotebookInstances in log stream [notebook-instance-name]/[LifecycleConfigHook].

Lifecycle configuration scripts cannot run for longer than 5 minutes. If a script runs for longer than 5 minutes, it fails and the notebook instance is not created or started.

For information about notebook instance lifestyle configurations, see notebook-lifecycle-config.

Examples:

Request syntax with placeholder values


resp = client.create_notebook_instance_lifecycle_config({
  notebook_instance_lifecycle_config_name: "NotebookInstanceLifecycleConfigName", # required
  on_create: [
    {
      content: "NotebookInstanceLifecycleConfigContent",
    },
  ],
  on_start: [
    {
      content: "NotebookInstanceLifecycleConfigContent",
    },
  ],
})

Response structure


resp.notebook_instance_lifecycle_config_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_lifecycle_config_name (required, String)

    The name of the lifecycle configuration.

  • :on_create (Array<Types::NotebookInstanceLifecycleHook>)

    A shell script that runs only once, when you create a notebook instance.

  • :on_start (Array<Types::NotebookInstanceLifecycleHook>)

    A shell script that runs every time you start a notebook instance, including when you create the notebook instance.

Returns:

See Also:



847
848
849
850
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 847

def create_notebook_instance_lifecycle_config(params = {}, options = {})
  req = build_request(:create_notebook_instance_lifecycle_config, 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 Jupyter 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:



883
884
885
886
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 883

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.2xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.m4.16xlarge, ml.m5.large, ml.m5.xlarge, ml.m5.2xlarge, ml.m5.4xlarge, ml.m5.12xlarge, ml.m5.24xlarge, ml.c4.xlarge, ml.c4.2xlarge, ml.c4.4xlarge, 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",
  },
  vpc_config: {
    security_group_ids: ["SecurityGroupId"], # required
    subnets: ["SubnetId"], # required
  },
  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.

  • :hyper_parameters (Hash<String,String>)

    Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process. 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 your-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.

    To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

  • :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.

  • :vpc_config (Types::VpcConfig)

    A VpcConfig object that specifies the VPC that you want your training job to connect to. Control access to and from your training container by configuring the VPC. For more information, see train-vpc

  • :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:



1106
1107
1108
1109
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1106

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

#create_transform_job(params = {}) ⇒ Types::CreateTransformJobResponse

Starts a transform job. After the results are obtained, Amazon SageMaker saves them to an Amazon S3 location that you specify.

To perform batch transformations, you create a transform job and use the data that you have readily available.

In the request body, you provide the following:

  • TransformJobName - Identifies the transform job. The name must be unique within an AWS Region in an AWS account.

  • ModelName - Identifies the model to use.

  • TransformInput - Describes the dataset to be transformed and the Amazon S3 location where it is stored.

  • TransformOutput - Identifies the Amazon S3 location where you want Amazon SageMaker to save the results from the transform job.

  • TransformResources - Identifies the ML compute instances for the transform job.

For more information about how batch transformation works Amazon SageMaker, see How It Works.

Examples:

Request syntax with placeholder values


resp = client.create_transform_job({
  transform_job_name: "TransformJobName", # required
  model_name: "ModelName", # required
  max_concurrent_transforms: 1,
  max_payload_in_mb: 1,
  batch_strategy: "MultiRecord", # accepts MultiRecord, SingleRecord
  environment: {
    "TransformEnvironmentKey" => "TransformEnvironmentValue",
  },
  transform_input: { # required
    data_source: { # required
      s3_data_source: { # required
        s3_data_type: "ManifestFile", # required, accepts ManifestFile, S3Prefix
        s3_uri: "S3Uri", # required
      },
    },
    content_type: "ContentType",
    compression_type: "None", # accepts None, Gzip
    split_type: "None", # accepts None, Line, RecordIO
  },
  transform_output: { # required
    s3_output_path: "S3Uri", # required
    accept: "Accept",
    assemble_with: "None", # accepts None, Line
    kms_key_id: "KmsKeyId",
  },
  transform_resources: { # required
    instance_type: "ml.m4.xlarge", # required, accepts ml.m4.xlarge, ml.m4.2xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.m4.16xlarge, ml.c4.xlarge, ml.c4.2xlarge, ml.c4.4xlarge, 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, ml.m5.large, ml.m5.xlarge, ml.m5.2xlarge, ml.m5.4xlarge, ml.m5.12xlarge, ml.m5.24xlarge
    instance_count: 1, # required
  },
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Response structure


resp.transform_job_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :transform_job_name (required, String)

    The name of the transform job. The name must be unique within an AWS Region in an AWS account.

  • :model_name (required, String)

    The name of the model that you want to use for the transform job.

  • :max_concurrent_transforms (Integer)

    The maximum number of parallel requests on each instance node that can be launched in a transform job. The default value is 1. To allow Amazon SageMaker to determine the appropriate number for MaxConcurrentTransforms, set the value to 0.

  • :max_payload_in_mb (Integer)

    The maximum payload size allowed, in MB. A payload is the data portion of a record (without metadata). The value in MaxPayloadInMB must be greater than the size of a single record.You can approximate the size of a record by dividing the size of your dataset by the number of records. The value you enter should be proportional to the number of records you want per batch. It is recommended to enter a slightly higher value to ensure the records will fit within the maximum payload size. The default value is 6 MB. For an unlimited payload size, set the value to 0.

  • :batch_strategy (String)

    Determins the number of records included in a single batch. SingleRecord means only one record is used per batch. MultiRecord means a batch is set to contain as many records that could possibly fit within the MaxPayloadInMB limit.

  • :environment (Hash<String,String>)

    The environment variables to set in the Docker container. We support up to 16 key and values entries in the map.

  • :transform_input (required, Types::TransformInput)

    Describes the input source and the way the transform job consumes it.

  • :transform_output (required, Types::TransformOutput)

    Describes the results of the transform job.

  • :transform_resources (required, Types::TransformResources)

    Describes the resources, including ML instance types and ML instance count, to use for the transform job.

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

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

Returns:

See Also:



1245
1246
1247
1248
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1245

def create_transform_job(params = {}, options = {})
  req = build_request(:create_transform_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:



1268
1269
1270
1271
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1268

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 DeleteEndpointConfig 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:



1292
1293
1294
1295
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1292

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:



1321
1322
1323
1324
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1321

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:



1349
1350
1351
1352
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1349

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

#delete_notebook_instance_lifecycle_config(params = {}) ⇒ Struct

Deletes a notebook instance lifecycle configuration.

Examples:

Request syntax with placeholder values


resp = client.delete_notebook_instance_lifecycle_config({
  notebook_instance_lifecycle_config_name: "NotebookInstanceLifecycleConfigName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_lifecycle_config_name (required, String)

    The name of the lifecycle configuration to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



1371
1372
1373
1374
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1371

def delete_notebook_instance_lifecycle_config(params = {}, options = {})
  req = build_request(:delete_notebook_instance_lifecycle_config, 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:



1400
1401
1402
1403
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1400

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].deployed_images #=> Array
resp.production_variants[0].deployed_images[0].specified_image #=> String
resp.production_variants[0].deployed_images[0].resolved_image #=> String
resp.production_variants[0].deployed_images[0].resolution_time #=> Time
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:



1451
1452
1453
1454
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1451

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.t2.medium", "ml.t2.large", "ml.t2.xlarge", "ml.t2.2xlarge", "ml.m4.xlarge", "ml.m4.2xlarge", "ml.m4.4xlarge", "ml.m4.10xlarge", "ml.m4.16xlarge", "ml.m5.large", "ml.m5.xlarge", "ml.m5.2xlarge", "ml.m5.4xlarge", "ml.m5.12xlarge", "ml.m5.24xlarge", "ml.c4.large", "ml.c4.xlarge", "ml.c4.2xlarge", "ml.c4.4xlarge", "ml.c4.8xlarge", "ml.p2.xlarge", "ml.p2.8xlarge", "ml.p2.16xlarge", "ml.p3.2xlarge", "ml.p3.8xlarge", "ml.p3.16xlarge", "ml.c5.large", "ml.c5.xlarge", "ml.c5.2xlarge", "ml.c5.4xlarge", "ml.c5.9xlarge", "ml.c5.18xlarge"
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:



1493
1494
1495
1496
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1493

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

#describe_hyper_parameter_tuning_job(params = {}) ⇒ Types::DescribeHyperParameterTuningJobResponse

Gets a description of a hyperparameter tuning job.

Examples:

Request syntax with placeholder values


resp = client.describe_hyper_parameter_tuning_job({
  hyper_parameter_tuning_job_name: "HyperParameterTuningJobName", # required
})

Response structure


resp.hyper_parameter_tuning_job_name #=> String
resp.hyper_parameter_tuning_job_arn #=> String
resp.hyper_parameter_tuning_job_config.strategy #=> String, one of "Bayesian"
resp.hyper_parameter_tuning_job_config.hyper_parameter_tuning_job_objective.type #=> String, one of "Maximize", "Minimize"
resp.hyper_parameter_tuning_job_config.hyper_parameter_tuning_job_objective.metric_name #=> String
resp.hyper_parameter_tuning_job_config.resource_limits.max_number_of_training_jobs #=> Integer
resp.hyper_parameter_tuning_job_config.resource_limits.max_parallel_training_jobs #=> Integer
resp.hyper_parameter_tuning_job_config.parameter_ranges.integer_parameter_ranges #=> Array
resp.hyper_parameter_tuning_job_config.parameter_ranges.integer_parameter_ranges[0].name #=> String
resp.hyper_parameter_tuning_job_config.parameter_ranges.integer_parameter_ranges[0].min_value #=> String
resp.hyper_parameter_tuning_job_config.parameter_ranges.integer_parameter_ranges[0].max_value #=> String
resp.hyper_parameter_tuning_job_config.parameter_ranges.continuous_parameter_ranges #=> Array
resp.hyper_parameter_tuning_job_config.parameter_ranges.continuous_parameter_ranges[0].name #=> String
resp.hyper_parameter_tuning_job_config.parameter_ranges.continuous_parameter_ranges[0].min_value #=> String
resp.hyper_parameter_tuning_job_config.parameter_ranges.continuous_parameter_ranges[0].max_value #=> String
resp.hyper_parameter_tuning_job_config.parameter_ranges.categorical_parameter_ranges #=> Array
resp.hyper_parameter_tuning_job_config.parameter_ranges.categorical_parameter_ranges[0].name #=> String
resp.hyper_parameter_tuning_job_config.parameter_ranges.categorical_parameter_ranges[0].values #=> Array
resp.hyper_parameter_tuning_job_config.parameter_ranges.categorical_parameter_ranges[0].values[0] #=> String
resp.training_job_definition.static_hyper_parameters #=> Hash
resp.training_job_definition.static_hyper_parameters["ParameterKey"] #=> String
resp.training_job_definition.algorithm_specification.training_image #=> String
resp.training_job_definition.algorithm_specification.training_input_mode #=> String, one of "Pipe", "File"
resp.training_job_definition.algorithm_specification.metric_definitions #=> Array
resp.training_job_definition.algorithm_specification.metric_definitions[0].name #=> String
resp.training_job_definition.algorithm_specification.metric_definitions[0].regex #=> String
resp.training_job_definition.role_arn #=> String
resp.training_job_definition.input_data_config #=> Array
resp.training_job_definition.input_data_config[0].channel_name #=> String
resp.training_job_definition.input_data_config[0].data_source.s3_data_source.s3_data_type #=> String, one of "ManifestFile", "S3Prefix"
resp.training_job_definition.input_data_config[0].data_source.s3_data_source.s3_uri #=> String
resp.training_job_definition.input_data_config[0].data_source.s3_data_source.s3_data_distribution_type #=> String, one of "FullyReplicated", "ShardedByS3Key"
resp.training_job_definition.input_data_config[0].content_type #=> String
resp.training_job_definition.input_data_config[0].compression_type #=> String, one of "None", "Gzip"
resp.training_job_definition.input_data_config[0].record_wrapper_type #=> String, one of "None", "RecordIO"
resp.training_job_definition.vpc_config.security_group_ids #=> Array
resp.training_job_definition.vpc_config.security_group_ids[0] #=> String
resp.training_job_definition.vpc_config.subnets #=> Array
resp.training_job_definition.vpc_config.subnets[0] #=> String
resp.training_job_definition.output_data_config.kms_key_id #=> String
resp.training_job_definition.output_data_config.s3_output_path #=> String
resp.training_job_definition.resource_config.instance_type #=> String, one of "ml.m4.xlarge", "ml.m4.2xlarge", "ml.m4.4xlarge", "ml.m4.10xlarge", "ml.m4.16xlarge", "ml.m5.large", "ml.m5.xlarge", "ml.m5.2xlarge", "ml.m5.4xlarge", "ml.m5.12xlarge", "ml.m5.24xlarge", "ml.c4.xlarge", "ml.c4.2xlarge", "ml.c4.4xlarge", "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.training_job_definition.resource_config.instance_count #=> Integer
resp.training_job_definition.resource_config.volume_size_in_gb #=> Integer
resp.training_job_definition.resource_config.volume_kms_key_id #=> String
resp.training_job_definition.stopping_condition.max_runtime_in_seconds #=> Integer
resp.hyper_parameter_tuning_job_status #=> String, one of "Completed", "InProgress", "Failed", "Stopped", "Stopping"
resp.creation_time #=> Time
resp.hyper_parameter_tuning_end_time #=> Time
resp.last_modified_time #=> Time
resp.training_job_status_counters.completed #=> Integer
resp.training_job_status_counters.in_progress #=> Integer
resp.training_job_status_counters.retryable_error #=> Integer
resp.training_job_status_counters.non_retryable_error #=> Integer
resp.training_job_status_counters.stopped #=> Integer
resp.objective_status_counters.succeeded #=> Integer
resp.objective_status_counters.pending #=> Integer
resp.objective_status_counters.failed #=> Integer
resp.best_training_job.training_job_name #=> String
resp.best_training_job.training_job_arn #=> String
resp.best_training_job.creation_time #=> Time
resp.best_training_job.training_start_time #=> Time
resp.best_training_job.training_end_time #=> Time
resp.best_training_job.training_job_status #=> String, one of "InProgress", "Completed", "Failed", "Stopping", "Stopped"
resp.best_training_job.tuned_hyper_parameters #=> Hash
resp.best_training_job.tuned_hyper_parameters["ParameterKey"] #=> String
resp.best_training_job.failure_reason #=> String
resp.best_training_job.final_hyper_parameter_tuning_job_objective_metric.type #=> String, one of "Maximize", "Minimize"
resp.best_training_job.final_hyper_parameter_tuning_job_objective_metric.metric_name #=> String
resp.best_training_job.final_hyper_parameter_tuning_job_objective_metric.value #=> Float
resp.best_training_job.objective_status #=> String, one of "Succeeded", "Pending", "Failed"
resp.failure_reason #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :hyper_parameter_tuning_job_name (required, String)

    The name of the tuning job to describe.

Returns:

See Also:



1603
1604
1605
1606
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1603

def describe_hyper_parameter_tuning_job(params = {}, options = {})
  req = build_request(:describe_hyper_parameter_tuning_job, 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.vpc_config.security_group_ids #=> Array
resp.vpc_config.security_group_ids[0] #=> String
resp.vpc_config.subnets #=> Array
resp.vpc_config.subnets[0] #=> 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:



1648
1649
1650
1651
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1648

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", "Updating"
resp.failure_reason #=> String
resp.url #=> String
resp.instance_type #=> String, one of "ml.t2.medium", "ml.t2.large", "ml.t2.xlarge", "ml.t2.2xlarge", "ml.m4.xlarge", "ml.m4.2xlarge", "ml.m4.4xlarge", "ml.m4.10xlarge", "ml.m4.16xlarge", "ml.p2.xlarge", "ml.p2.8xlarge", "ml.p2.16xlarge", "ml.p3.2xlarge", "ml.p3.8xlarge", "ml.p3.16xlarge"
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
resp.notebook_instance_lifecycle_config_name #=> String
resp.direct_internet_access #=> String, one of "Enabled", "Disabled"

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:



1705
1706
1707
1708
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1705

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

#describe_notebook_instance_lifecycle_config(params = {}) ⇒ Types::DescribeNotebookInstanceLifecycleConfigOutput

Returns a description of a notebook instance lifecycle configuration.

For information about notebook instance lifestyle configurations, see notebook-lifecycle-config.

Examples:

Request syntax with placeholder values


resp = client.describe_notebook_instance_lifecycle_config({
  notebook_instance_lifecycle_config_name: "NotebookInstanceLifecycleConfigName", # required
})

Response structure


resp.notebook_instance_lifecycle_config_arn #=> String
resp.notebook_instance_lifecycle_config_name #=> String
resp.on_create #=> Array
resp.on_create[0].content #=> String
resp.on_start #=> Array
resp.on_start[0].content #=> String
resp.last_modified_time #=> Time
resp.creation_time #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_lifecycle_config_name (required, String)

    The name of the lifecycle configuration to describe.

Returns:

See Also:



1748
1749
1750
1751
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1748

def describe_notebook_instance_lifecycle_config(params = {}, options = {})
  req = build_request(:describe_notebook_instance_lifecycle_config, 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.tuning_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.2xlarge", "ml.m4.4xlarge", "ml.m4.10xlarge", "ml.m4.16xlarge", "ml.m5.large", "ml.m5.xlarge", "ml.m5.2xlarge", "ml.m5.4xlarge", "ml.m5.12xlarge", "ml.m5.24xlarge", "ml.c4.xlarge", "ml.c4.2xlarge", "ml.c4.4xlarge", "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.vpc_config.security_group_ids #=> Array
resp.vpc_config.security_group_ids[0] #=> String
resp.vpc_config.subnets #=> Array
resp.vpc_config.subnets[0] #=> 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:



1828
1829
1830
1831
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1828

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

#describe_transform_job(params = {}) ⇒ Types::DescribeTransformJobResponse

Returns information about a transform job.

Examples:

Request syntax with placeholder values


resp = client.describe_transform_job({
  transform_job_name: "TransformJobName", # required
})

Response structure


resp.transform_job_name #=> String
resp.transform_job_arn #=> String
resp.transform_job_status #=> String, one of "InProgress", "Completed", "Failed", "Stopping", "Stopped"
resp.failure_reason #=> String
resp.model_name #=> String
resp.max_concurrent_transforms #=> Integer
resp.max_payload_in_mb #=> Integer
resp.batch_strategy #=> String, one of "MultiRecord", "SingleRecord"
resp.environment #=> Hash
resp.environment["TransformEnvironmentKey"] #=> String
resp.transform_input.data_source.s3_data_source.s3_data_type #=> String, one of "ManifestFile", "S3Prefix"
resp.transform_input.data_source.s3_data_source.s3_uri #=> String
resp.transform_input.content_type #=> String
resp.transform_input.compression_type #=> String, one of "None", "Gzip"
resp.transform_input.split_type #=> String, one of "None", "Line", "RecordIO"
resp.transform_output.s3_output_path #=> String
resp.transform_output.accept #=> String
resp.transform_output.assemble_with #=> String, one of "None", "Line"
resp.transform_output.kms_key_id #=> String
resp.transform_resources.instance_type #=> String, one of "ml.m4.xlarge", "ml.m4.2xlarge", "ml.m4.4xlarge", "ml.m4.10xlarge", "ml.m4.16xlarge", "ml.c4.xlarge", "ml.c4.2xlarge", "ml.c4.4xlarge", "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", "ml.m5.large", "ml.m5.xlarge", "ml.m5.2xlarge", "ml.m5.4xlarge", "ml.m5.12xlarge", "ml.m5.24xlarge"
resp.transform_resources.instance_count #=> Integer
resp.creation_time #=> Time
resp.transform_start_time #=> Time
resp.transform_end_time #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :transform_job_name (required, String)

    The name of the transform job that you want to view details of.

Returns:

See Also:



1893
1894
1895
1896
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1893

def describe_transform_job(params = {}, options = {})
  req = build_request(:describe_transform_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:



1955
1956
1957
1958
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 1955

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:



2033
2034
2035
2036
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2033

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

#list_hyper_parameter_tuning_jobs(params = {}) ⇒ Types::ListHyperParameterTuningJobsResponse

Gets a list of HyperParameterTuningJobSummary objects that describe the hyperparameter tuning jobs launched in your account.

Examples:

Request syntax with placeholder values


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

Response structure


resp.hyper_parameter_tuning_job_summaries #=> Array
resp.hyper_parameter_tuning_job_summaries[0].hyper_parameter_tuning_job_name #=> String
resp.hyper_parameter_tuning_job_summaries[0].hyper_parameter_tuning_job_arn #=> String
resp.hyper_parameter_tuning_job_summaries[0].hyper_parameter_tuning_job_status #=> String, one of "Completed", "InProgress", "Failed", "Stopped", "Stopping"
resp.hyper_parameter_tuning_job_summaries[0].strategy #=> String, one of "Bayesian"
resp.hyper_parameter_tuning_job_summaries[0].creation_time #=> Time
resp.hyper_parameter_tuning_job_summaries[0].hyper_parameter_tuning_end_time #=> Time
resp.hyper_parameter_tuning_job_summaries[0].last_modified_time #=> Time
resp.hyper_parameter_tuning_job_summaries[0].training_job_status_counters.completed #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].training_job_status_counters.in_progress #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].training_job_status_counters.retryable_error #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].training_job_status_counters.non_retryable_error #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].training_job_status_counters.stopped #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].objective_status_counters.succeeded #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].objective_status_counters.pending #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].objective_status_counters.failed #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].resource_limits.max_number_of_training_jobs #=> Integer
resp.hyper_parameter_tuning_job_summaries[0].resource_limits.max_parallel_training_jobs #=> Integer
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :next_token (String)

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

  • :max_results (Integer)

    The maximum number of tuning jobs to return. The default value is 10.

  • :sort_by (String)

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

  • :sort_order (String)

    The sort order for results. The default is Ascending.

  • :name_contains (String)

    A string in the tuning job name. This filter returns only tuning jobs whose name contains the specified string.

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

    A filter that returns only tuning jobs that were created after the specified time.

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

    A filter that returns only tuning jobs that were created before the specified time.

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

    A filter that returns only tuning jobs that were modified after the specified time.

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

    A filter that returns only tuning jobs that were modified before the specified time.

  • :status_equals (String)

    A filter that returns only tuning jobs with the specified status.

Returns:

See Also:



2124
2125
2126
2127
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2124

def list_hyper_parameter_tuning_jobs(params = {}, options = {})
  req = build_request(:list_hyper_parameter_tuning_jobs, 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:



2190
2191
2192
2193
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2190

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

#list_notebook_instance_lifecycle_configs(params = {}) ⇒ Types::ListNotebookInstanceLifecycleConfigsOutput

Lists notebook instance lifestyle configurations created with the CreateNotebookInstanceLifecycleConfig API.

Examples:

Request syntax with placeholder values


resp = client.list_notebook_instance_lifecycle_configs({
  next_token: "NextToken",
  max_results: 1,
  sort_by: "Name", # accepts Name, CreationTime, LastModifiedTime
  sort_order: "Ascending", # accepts Ascending, Descending
  name_contains: "NotebookInstanceLifecycleConfigNameContains",
  creation_time_before: Time.now,
  creation_time_after: Time.now,
  last_modified_time_before: Time.now,
  last_modified_time_after: Time.now,
})

Response structure


resp.next_token #=> String
resp.notebook_instance_lifecycle_configs #=> Array
resp.notebook_instance_lifecycle_configs[0].notebook_instance_lifecycle_config_name #=> String
resp.notebook_instance_lifecycle_configs[0].notebook_instance_lifecycle_config_arn #=> String
resp.notebook_instance_lifecycle_configs[0].creation_time #=> Time
resp.notebook_instance_lifecycle_configs[0].last_modified_time #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :next_token (String)

    If the result of a ListNotebookInstanceLifecycleConfigs request was truncated, the response includes a NextToken. To get the next set of lifecycle configurations, use the token in the next request.

  • :max_results (Integer)

    The maximum number of lifecycle configurations to return in the response.

  • :sort_by (String)

    Sorts the list of results. The default is CreationTime.

  • :sort_order (String)

    The sort order for results.

  • :name_contains (String)

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

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

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

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

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

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

    A filter that returns only lifecycle configurations that were modified before the specified time (timestamp).

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

    A filter that returns only lifecycle configurations that were modified after the specified time (timestamp).

Returns:

See Also:



2265
2266
2267
2268
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2265

def list_notebook_instance_lifecycle_configs(params = {}, options = {})
  req = build_request(:list_notebook_instance_lifecycle_configs, 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, Updating
  notebook_instance_lifecycle_config_name_contains: "NotebookInstanceLifecycleConfigName",
})

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", "Updating"
resp.notebook_instances[0].url #=> String
resp.notebook_instances[0].instance_type #=> String, one of "ml.t2.medium", "ml.t2.large", "ml.t2.xlarge", "ml.t2.2xlarge", "ml.m4.xlarge", "ml.m4.2xlarge", "ml.m4.4xlarge", "ml.m4.10xlarge", "ml.m4.16xlarge", "ml.p2.xlarge", "ml.p2.8xlarge", "ml.p2.16xlarge", "ml.p3.2xlarge", "ml.p3.8xlarge", "ml.p3.16xlarge"
resp.notebook_instances[0].creation_time #=> Time
resp.notebook_instances[0].last_modified_time #=> Time
resp.notebook_instances[0].notebook_instance_lifecycle_config_name #=> String

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.

  • :notebook_instance_lifecycle_config_name_contains (String)

    A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.

Returns:

See Also:



2362
2363
2364
2365
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2362

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:



2405
2406
2407
2408
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2405

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 returns 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 training jobs 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:



2484
2485
2486
2487
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2484

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

#list_training_jobs_for_hyper_parameter_tuning_job(params = {}) ⇒ Types::ListTrainingJobsForHyperParameterTuningJobResponse

Gets a list of TrainingJobSummary objects that describe the training jobs that a hyperparameter tuning job launched.

Examples:

Request syntax with placeholder values


resp = client.list_training_jobs_for_hyper_parameter_tuning_job({
  hyper_parameter_tuning_job_name: "HyperParameterTuningJobName", # required
  next_token: "NextToken",
  max_results: 1,
  status_equals: "InProgress", # accepts InProgress, Completed, Failed, Stopping, Stopped
  sort_by: "Name", # accepts Name, CreationTime, Status, FinalObjectiveMetricValue
  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_start_time #=> Time
resp.training_job_summaries[0].training_end_time #=> Time
resp.training_job_summaries[0].training_job_status #=> String, one of "InProgress", "Completed", "Failed", "Stopping", "Stopped"
resp.training_job_summaries[0].tuned_hyper_parameters #=> Hash
resp.training_job_summaries[0].tuned_hyper_parameters["ParameterKey"] #=> String
resp.training_job_summaries[0].failure_reason #=> String
resp.training_job_summaries[0].final_hyper_parameter_tuning_job_objective_metric.type #=> String, one of "Maximize", "Minimize"
resp.training_job_summaries[0].final_hyper_parameter_tuning_job_objective_metric.metric_name #=> String
resp.training_job_summaries[0].final_hyper_parameter_tuning_job_objective_metric.value #=> Float
resp.training_job_summaries[0].objective_status #=> String, one of "Succeeded", "Pending", "Failed"
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :hyper_parameter_tuning_job_name (required, String)

    The name of the tuning job whose training jobs you want to list.

  • :next_token (String)

    If the result of the previous ListTrainingJobsForHyperParameterTuningJob 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. The default value is 10.

  • :status_equals (String)

    A filter that returns only training jobs with the specified status.

  • :sort_by (String)

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

    If the value of this field is FinalObjectiveMetricValue, any training jobs that did not return an objective metric are not listed.

  • :sort_order (String)

    The sort order for results. The default is Ascending.

Returns:

See Also:



2555
2556
2557
2558
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2555

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

#list_transform_jobs(params = {}) ⇒ Types::ListTransformJobsResponse

Lists transform jobs.

Examples:

Request syntax with placeholder values


resp = client.list_transform_jobs({
  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
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.transform_job_summaries #=> Array
resp.transform_job_summaries[0].transform_job_name #=> String
resp.transform_job_summaries[0].transform_job_arn #=> String
resp.transform_job_summaries[0].creation_time #=> Time
resp.transform_job_summaries[0].transform_end_time #=> Time
resp.transform_job_summaries[0].last_modified_time #=> Time
resp.transform_job_summaries[0].transform_job_status #=> String, one of "InProgress", "Completed", "Failed", "Stopping", "Stopped"
resp.transform_job_summaries[0].failure_reason #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

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

    A filter that returns only transform jobs created after the specified time.

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

    A filter that returns only transform jobs created before the specified time.

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

    A filter that returns only transform jobs modified after the specified time.

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

    A filter that returns only transform jobs modified before the specified time.

  • :name_contains (String)

    A string in the transform job name. This filter returns only transform jobs whose name contains the specified string.

  • :status_equals (String)

    A filter that retrieves only transform 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 Descending.

  • :next_token (String)

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

  • :max_results (Integer)

    The maximum number of transform jobs to return in the response. The default value is 10.

Returns:

See Also:



2636
2637
2638
2639
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2636

def list_transform_jobs(params = {}, options = {})
  req = build_request(:list_transform_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:



2662
2663
2664
2665
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2662

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

#stop_hyper_parameter_tuning_job(params = {}) ⇒ Struct

Stops a running hyperparameter tuning job and all running training jobs that the tuning job launched.

All model artifacts output from the training jobs are stored in Amazon Simple Storage Service (Amazon S3). All data that the training jobs write to Amazon CloudWatch Logs are still available in CloudWatch. After the tuning job moves to the Stopped state, it releases all reserved resources for the tuning job.

Examples:

Request syntax with placeholder values


resp = client.stop_hyper_parameter_tuning_job({
  hyper_parameter_tuning_job_name: "HyperParameterTuningJobName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :hyper_parameter_tuning_job_name (required, String)

    The name of the tuning job to stop.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2691
2692
2693
2694
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2691

def stop_hyper_parameter_tuning_job(params = {}, options = {})
  req = build_request(:stop_hyper_parameter_tuning_job, 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:



2721
2722
2723
2724
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2721

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:



2755
2756
2757
2758
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2755

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

#stop_transform_job(params = {}) ⇒ Struct

Stops a transform job.

When Amazon SageMaker receives a StopTransformJob request, the status of the job changes to Stopping. After Amazon SageMaker stops the job, the status is set to Stopped. When you stop a transform job before it is completed, Amazon SageMaker doesn't store the job's output in Amazon S3.

Examples:

Request syntax with placeholder values


resp = client.stop_transform_job({
  transform_job_name: "TransformJobName", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :transform_job_name (required, String)

    The name of the transform job to stop.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2783
2784
2785
2786
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2783

def stop_transform_job(params = {}, options = {})
  req = build_request(:stop_transform_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.

You cannot update an endpoint with the current EndpointConfig. To update an endpoint, you must create a new EndpointConfig.

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:



2832
2833
2834
2835
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2832

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:



2879
2880
2881
2882
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2879

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.t2.large, ml.t2.xlarge, ml.t2.2xlarge, ml.m4.xlarge, ml.m4.2xlarge, ml.m4.4xlarge, ml.m4.10xlarge, ml.m4.16xlarge, ml.p2.xlarge, ml.p2.8xlarge, ml.p2.16xlarge, ml.p3.2xlarge, ml.p3.8xlarge, ml.p3.16xlarge
  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)

    The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can assume to access the notebook instance. For more information, see Amazon SageMaker Roles.

    To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2923
2924
2925
2926
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2923

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

#update_notebook_instance_lifecycle_config(params = {}) ⇒ Struct

Updates a notebook instance lifecycle configuration created with the CreateNotebookInstanceLifecycleConfig API.

Examples:

Request syntax with placeholder values


resp = client.update_notebook_instance_lifecycle_config({
  notebook_instance_lifecycle_config_name: "NotebookInstanceLifecycleConfigName", # required
  on_create: [
    {
      content: "NotebookInstanceLifecycleConfigContent",
    },
  ],
  on_start: [
    {
      content: "NotebookInstanceLifecycleConfigContent",
    },
  ],
})

Parameters:

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

    ({})

Options Hash (params):

  • :notebook_instance_lifecycle_config_name (required, String)

    The name of the lifecycle configuration.

  • :on_create (Array<Types::NotebookInstanceLifecycleHook>)

    The shell script that runs only once, when you create a notebook instance

  • :on_start (Array<Types::NotebookInstanceLifecycleHook>)

    The shell script that runs every time you start a notebook instance, including when you create the notebook instance.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2964
2965
2966
2967
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 2964

def update_notebook_instance_lifecycle_config(params = {}, options = {})
  req = build_request(:update_notebook_instance_lifecycle_config, 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.



3079
3080
3081
3082
3083
# File 'gems/aws-sdk-sagemaker/lib/aws-sdk-sagemaker/client.rb', line 3079

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