Updated on 2024-03-21 GMT+08:00

Querying the List of Training Job Configurations

Sample Code

In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.

1
2
3
4
5
from modelarts.session import Session
from modelarts.estimator import Estimator
session = Session()
job_paras_list = Estimator.get_job_configs_list(modelarts_session=session, per_page=10, page=1, sort_by="create_time", order="asc", search_content="configname")
print(job_paras_list)

Parameters

Table 1 get_job_configs_list request parameters

Parameter

Mandatory

Type

Description

modelarts_session

Yes

Object

Session object. For details about the initialization method, see Session Authentication.

per_page

No

Integer

Number of job parameters displayed on each page. The value range is [1, 1000]. Default value: 10

page

No

Integer

Index of the page to be queried. Default value: 1

sortBy/sort_by

No

String

When AK/SK-based authentication is used, the parameter name is sortBy. When account-based authentication is used, the parameter name is sort_by. The parameter specifies the sorting mode of the query. The value can be job_name, job_desc, status, duration, engine_type, or create_time. Default value: job_name

order

No

String

Sorting order. The options are as follows:

  • asc: ascending order. It is the default value.
  • desc: descending order

search_content

No

String

Search content, for example, a parameter name. By default, this parameter is left blank.

Table 2 get_job_configs_list response parameters

Parameter

Type

Description

error_msg

String

Error message when the API call fails.

This parameter is not included when the API call succeeds.

error_code

String

Error code when the API fails to be called. For details, see Error Codes.

This parameter is not included when the API call succeeds.

config_total_count

Integer

Total number of the queried training job configurations

configs

JSON Array

configs parameters

is_success

Boolean

Whether the API call succeeds

Table 3 configs parameters

Parameter

Type

Description

config_name

String

Name of a training job parameter configuration

config_desc

String

Description of a training job parameter configuration

create_time

Long

Time when a training job is created

engine_type

Short

Engine type of a training job

engine_name

String

Name of the engine selected for a training job

engine_id

Long

ID of the engine selected for a training job

engine_version

String

Version of the engine selected for a training job