Skip to content

/AWS1/CL_SGM=>LISTTRAININGJOBS()

About ListTrainingJobs

Lists training jobs.

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 Web Services CLI code.

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

Method Signature

IMPORTING

Optional arguments:

iv_nexttoken TYPE /AWS1/SGMNEXTTOKEN /AWS1/SGMNEXTTOKEN

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.

iv_maxresults TYPE /AWS1/SGMMAXRESULTS /AWS1/SGMMAXRESULTS

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

iv_creationtimeafter TYPE /AWS1/SGMTIMESTAMP /AWS1/SGMTIMESTAMP

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

iv_creationtimebefore TYPE /AWS1/SGMTIMESTAMP /AWS1/SGMTIMESTAMP

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

iv_lastmodifiedtimeafter TYPE /AWS1/SGMTIMESTAMP /AWS1/SGMTIMESTAMP

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

iv_lastmodifiedtimebefore TYPE /AWS1/SGMTIMESTAMP /AWS1/SGMTIMESTAMP

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

iv_namecontains TYPE /AWS1/SGMNAMECONTAINS /AWS1/SGMNAMECONTAINS

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

iv_statusequals TYPE /AWS1/SGMTRAININGJOBSTATUS /AWS1/SGMTRAININGJOBSTATUS

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

iv_sortby TYPE /AWS1/SGMSORTBY /AWS1/SGMSORTBY

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

iv_sortorder TYPE /AWS1/SGMSORTORDER /AWS1/SGMSORTORDER

The sort order for results. The default is Ascending.

iv_warmpoolstatusequals TYPE /AWS1/SGMWARMPOOLRESRCSTATUS /AWS1/SGMWARMPOOLRESRCSTATUS

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

iv_trainingplanarnequals TYPE /AWS1/SGMTRAININGPLANARN /AWS1/SGMTRAININGPLANARN

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 .

RETURNING

oo_output TYPE REF TO /aws1/cl_sgmlisttrnjobsrsp /AWS1/CL_SGMLISTTRNJOBSRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->/aws1/if_sgm~listtrainingjobs(
  iv_creationtimeafter = '20150101000000.0000000'
  iv_creationtimebefore = '20150101000000.0000000'
  iv_lastmodifiedtimeafter = '20150101000000.0000000'
  iv_lastmodifiedtimebefore = '20150101000000.0000000'
  iv_maxresults = 123
  iv_namecontains = |string|
  iv_nexttoken = |string|
  iv_sortby = |string|
  iv_sortorder = |string|
  iv_statusequals = |string|
  iv_trainingplanarnequals = |string|
  iv_warmpoolstatusequals = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_trainingjobsummaries( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_trainingjobname = lo_row_1->get_trainingjobname( ).
      lv_trainingjobarn = lo_row_1->get_trainingjobarn( ).
      lv_timestamp = lo_row_1->get_creationtime( ).
      lv_timestamp = lo_row_1->get_trainingendtime( ).
      lv_timestamp = lo_row_1->get_lastmodifiedtime( ).
      lv_trainingjobstatus = lo_row_1->get_trainingjobstatus( ).
      lv_secondarystatus = lo_row_1->get_secondarystatus( ).
      lo_warmpoolstatus = lo_row_1->get_warmpoolstatus( ).
      IF lo_warmpoolstatus IS NOT INITIAL.
        lv_warmpoolresourcestatus = lo_warmpoolstatus->get_status( ).
        lv_resourceretainedbillabl = lo_warmpoolstatus->get_resrcrtnedbillabletime00( ).
        lv_trainingjobname = lo_warmpoolstatus->get_reusedbyjob( ).
      ENDIF.
      lv_trainingplanarn = lo_row_1->get_trainingplanarn( ).
    ENDIF.
  ENDLOOP.
  lv_nexttoken = lo_result->get_nexttoken( ).
ENDIF.