You can use this API to query the overview information about all job versions created by a user based on specified conditions, including the statuses and GPU quantity of all job versions.
GET /v1/{project_id}/training-jobs/versions
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Table 2 describes the request parameters.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
No |
Integer |
Offset. |
limit |
No |
Integer |
Number of displayed records. The default value is 20. The value 0 indicates that all records are displayed. |
status |
No |
String |
Job status. By default, all job statuses are returned. For example, to query failed jobs, set the value of status to 3, 5, 6, or 13. For details about the job statuses, see Job Statuses. |
sort_by |
No |
String |
Sorting mode of the query. By default, the records are sorted by create_time. The records can be sorted by job_desc, status, duration, or job_name. |
order |
No |
String |
Sorting order. Options:
|
pool_id |
No |
String |
ID of the resource pool to be queried. |
workspace_id |
No |
String |
Workspace where a job resides. Default value: 0 |
Parameter |
Type |
Description |
---|---|---|
is_success |
Boolean |
Whether the request is successful |
error_message |
String |
Error message of a failed API call. This parameter is not included when the API call succeeds. |
error_code |
String |
Error code of a failed API call. For details, see Error Codes. This parameter is not included when the API call succeeds. |
total_count |
Integer |
Total number of created job versions. |
versions |
JSON Array |
Attributes of a training job. For details, see Table 4. |
Parameter |
Type |
Description |
---|---|---|
version_id |
Long |
ID of a training job |
version_name |
String |
Name of a training job |
status |
Byte |
Status of a training job. For details about the job statuses, see Job Statuses. |
create_time |
Long |
Timestamp when a training job is created |
start_time |
Long |
Timestamp when a training job starts. |
end_time |
Long |
Timestamp when a training job ends. |
duration |
Long |
Running duration of a training job. |
version_desc |
String |
Description of a training job |
pool_id |
String |
ID of the resource pool to which a training job belongs. |
flavor_code |
String |
Resource specifications selected for a training job |
npu_num |
integer |
Number of NPUs used by a training job. |
gpu_num |
integer |
Number of GPUs used by a training job. |
Query training jobs in batches.
GET https://endpoint/v1/{project_id}/training-jobs/versions
{ versions:[ { "version_id": 1485, "version_name": "trainjob-3f47", "status": 12, "create_time": 1557473030000, "start_time": 1557473040000, "end_time": 1557473093000, "duration": 53000, "version_desc": null, "pool_id": "pool9928813f", "flavor_code": "modelarts.p1.2xlarge", "npu_num": 0, "gpu_num": 1 } ], "offset": 20, "limit": 20, "total_count": 1, "is_success": true }
{ "is_success": false, "error_message": "Error string", "error_code": "ModelArts.0105" }
For details about the status code, see Status Code.