ListTrainingJobs - Amazon SageMaker
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

ListTrainingJobs

Lists training jobs.

Note

When StatusEquals and MaxResults are set at the same time, the MaxResults number of training jobs are first retrieved ignoring the StatusEquals parameter and then they are filtered by the StatusEquals parameter, which is returned as a response.

For example, if ListTrainingJobs is invoked with the following parameters:

{ ... MaxResults: 100, StatusEquals: InProgress ... }

First, 100 trainings jobs with any status, including those other than InProgress, are selected (sorted according to the creation time, from the most current to the oldest). Next, those with a status of InProgress are returned.

You can quickly test the API using the following Amazon CLI code.

aws sagemaker list-training-jobs --max-results 100 --status-equals InProgress

Request Syntax

{ "CreationTimeAfter": number, "CreationTimeBefore": number, "LastModifiedTimeAfter": number, "LastModifiedTimeBefore": number, "MaxResults": number, "NameContains": "string", "NextToken": "string", "SortBy": "string", "SortOrder": "string", "StatusEquals": "string", "TrainingPlanArnEquals": "string", "WarmPoolStatusEquals": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

CreationTimeAfter

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

Type: Timestamp

Required: No

CreationTimeBefore

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

Type: Timestamp

Required: No

LastModifiedTimeAfter

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

Type: Timestamp

Required: No

LastModifiedTimeBefore

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

Type: Timestamp

Required: No

MaxResults

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

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No

NameContains

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

Type: String

Length Constraints: Maximum length of 63.

Pattern: [a-zA-Z0-9\-]+

Required: No

NextToken

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.

Type: String

Length Constraints: Maximum length of 8192.

Pattern: .*

Required: No

SortBy

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

Type: String

Valid Values: Name | CreationTime | Status

Required: No

SortOrder

The sort order for results. The default is Ascending.

Type: String

Valid Values: Ascending | Descending

Required: No

StatusEquals

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

Type: String

Valid Values: InProgress | Completed | Failed | Stopping | Stopped

Required: No

TrainingPlanArnEquals

The Amazon Resource Name (ARN); of the training plan to filter training jobs by. For more information about reserving GPU capacity for your SageMaker training jobs using Amazon SageMaker Training Plan, see CreateTrainingPlan .

Type: String

Length Constraints: Minimum length of 50. Maximum length of 2048.

Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:training-plan/.*

Required: No

WarmPoolStatusEquals

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

Type: String

Valid Values: Available | Terminated | Reused | InUse

Required: No

Response Syntax

{ "NextToken": "string", "TrainingJobSummaries": [ { "CreationTime": number, "LastModifiedTime": number, "SecondaryStatus": "string", "TrainingEndTime": number, "TrainingJobArn": "string", "TrainingJobName": "string", "TrainingJobStatus": "string", "TrainingPlanArn": "string", "WarmPoolStatus": { "ResourceRetainedBillableTimeInSeconds": number, "ReusedByJob": "string", "Status": "string" } } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken

If the response is truncated, SageMaker returns this token. To retrieve the next set of training jobs, use it in the subsequent request.

Type: String

Length Constraints: Maximum length of 8192.

Pattern: .*

TrainingJobSummaries

An array of TrainingJobSummary objects, each listing a training job.

Type: Array of TrainingJobSummary objects

Errors

For information about the errors that are common to all actions, see Common Errors.

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: