
# 查询训练作业参数列表
#### 功能介绍
根据指定条件查询用户创建的训练作业参数。
#### URI
GET /v1/{project_id}/training-job-configs
参数说明如[表1]所示。
 表1参数说明 
| 参数         | 是否必选 | 参数类型   | 说明                                                                                               |
|:---|:---|:---|:---|
| project_id | 是    | String | 用户项目ID。获取方法请参见[获取项目ID和名称](https://support.huaweicloud.com/api-modelarts/modelarts_03_0147.html)。 |
   
#### 请求消息
请求参数如[表2]所示。
 表2请求参数 
| 参数             | 是否必选 | 参数类型    | 说明                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|:---|
| per_page       | 否    | Integer | 指定每一页展示作业参数的总量，默认为10，"per_page"可选的范围为\[1，1000\]。                                                                                                                                                                                                                                                                                                                        |
| page           | 否    | Integer | 指定要查询页的索引，默认为1。                                                                                                                                                                                                                                                                                                                                                         |
| sortBy         | 否    | String  | 指定查询的排序方式，默认是作业参数名称"config_name"，目前支持的排序还有作业参数描述"config_desc"及参数创建时间 "create_time"。sample的配置类型不支持"create_time"的排序方式。                                                                                                                                                                                                                                                    |
| order          | 否    | String  | 可选值有以下两种。 - "asc"为递增排序。  - "desc"为递减排序，默认为"desc"。                       |
| search_content | 否    | String  | 指定要查询的文字信息，例如参数名称。默认为空。                                                                                                                                                                                                                                                                                                                                                 |
| config_type    | 否    | String  | 指定要查询的配置类型，可选值有以下两种 - "custom"为查询用户自定义配置。  - "sample"为查询示例配置，默认为"custom"。   |
   
#### 响应消息
响应参数如[表3]所示。
 表3响应参数 
| 参数                 | 参数类型                                                                                 | 说明                                                                                                    |
|:---|:---|:---|
| is_success         | Boolean                                                                              | 请求是否成功。                                                                                               |
| error_message      | String                                                                               | 调用失败时的错误信息。调用成功时无此字段。                                                                                 |
| error_code         | String                                                                               | 调用失败时的错误码，具体请参见[错误码](https://support.huaweicloud.com/api-modelarts/modelarts_03_0095.html)。调用成功时无此字段。 |
| config_total_count | Integer                                                                              | 查询到的训练作业参数的总数。                                                                                        |
| configs            | Array of [ConfigResponse] objects | configs参数属性列表。                                                                                        |
   
 表4configs属性列表说明 
| 参数             | 参数类型    | 说明                                                                                                                              |
|:---|:---|:---|
| config_name    | String  | 训练作业参数的名称。                                                                                                                      |
| config_desc    | String  | 训练作业参数的描述信息。                                                                                                                    |
| create_time    | Long    | 训练作业的创建时间。                                                                                                                      |
| engine_type    | integer | 训练作业的引擎类型。                                                                                                                      |
| engine_name    | String  | 训练作业的引擎名称。                                                                                                                      |
| engine_id      | Long    | 训练作业的引擎ID。                                                                                                                      |
| engine_version | String  | 训练作业使用的引擎版本。                                                                                                                    |
| user_image_url | String  | 自定义镜像训练作业的自定义镜像的SWR-URL。如："100.125.5.235:20202/jobmng/custom-cpu-base:1.0"                                                      |
| user_command   | String  | 自定义镜像训练作业的自定义镜像的容器的启动命令。形式为："bash /home/work/run_train.sh python /home/work/user-job-dir/app/train.py {python_file_parameter}"。 |
   
#### 请求示例
```
GET    https://endpoint/v1/{project_id}/training-job-configs?per_page=10&page=1&sortBy=create_time&order=asc&search_content=configname
```
#### 响应示例
- 成功响应示例
  ```
  {
      "is_success": true,
      "config_total_count": 3,
      "configs": [
          {
              "config_name": "testConfig",
              "config_desc": "This is config",
              "create_time": 1524189990635,
              "engine_type": 1,
              "engine_name": "TensorFlow",
              "engine_id": 1,
              "engine_version": "TF-1.4.0-python2.7",
              "user_image_url": "100.125.5.235:20202/jobmng/custom-cpu-base:1.0",
              "user_command": "bash -x /home/work/run_train.sh python /home/work/user-job-dir/app/mnist/mnist_softmax.py --data_url /home/work/user-job-dir/app/mnist_data"
          }
      ]
  }
  ```
  
- 失败响应示例
  ```
  {
      "is_success": false,
      "error_message": "Error string",
      "error_code": "ModelArts.0105"
  }
  ```
  
 
#### 状态码
状态码请参见[状态码](https://support.huaweicloud.com/api-modelarts/modelarts_03_0094.html)。
