StopTrainingJobCommand

Stops a training job. To stop a job, 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.

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

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { SageMakerClient, StopTrainingJobCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
// const { SageMakerClient, StopTrainingJobCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
const client = new SageMakerClient(config);
const input = { // StopTrainingJobRequest
  TrainingJobName: "STRING_VALUE", // required
};
const command = new StopTrainingJobCommand(input);
const response = await client.send(command);
// {};

StopTrainingJobCommand Input

See StopTrainingJobCommandInput for more details

Parameter
Type
Description
TrainingJobName
Required
string | undefined

The name of the training job to stop.

StopTrainingJobCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
ResourceNotFound
client

Resource being access is not found.

SageMakerServiceException
Base exception class for all service exceptions from SageMaker service.