
# 查询训练作业参数详情
#### 功能介绍
查看指定的训练作业参数详情。
#### URI
GET /v1/{project_id}/training-job-configs/{config_name}
参数说明如[表1]所示。
 表1路径参数 
| 参数          | 是否必选 | 参数类型   | 说明                                                                                               |
|:---|:---|:---|:---|
| project_id  | 是    | String | 用户项目ID。获取方法请参见[获取项目ID和名称](https://support.huaweicloud.com/api-modelarts/modelarts_03_0147.html)。 |
| config_name | 是    | String | 训练作业参数的名称。                                                                                       |
   
表2Query参数 
| 参数          | 是否必选 | 参数类型   | 说明                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| 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_name          | String     | 训练作业参数的名称。                                                                                                        |
| config_desc          | String     | 训练作业参数的描述信息。                                                                                                      |
| worker_server_num    | Integer    | 训练作业worker的个数。                                                                                                    |
| app_url              | String     | 训练作业的代码目录。                                                                                                        |
| boot_file_url        | String     | 训练作业的代码启动文件。                                                                                                      |
| model_id             | Long       | 训练作业的模型ID。                                                                                                        |
| parameter            | JSON Array | 训练作业的运行参数，为"label-value"格式；当为自定义镜像训练作业的时候，此参数为容器环境变量。详情请查看[表8] |
| spec_id              | Long       | 训练作业资源规格ID。                                                                                                       |
| data_url             | String     | 训练作业的数据集。                                                                                                         |
| dataset_id           | String     | 训练作业的数据集ID。                                                                                                       |
| dataset_version_id   | String     | 训练作业的数据集版本ID。                                                                                                     |
| data_source          | JSON Array | 训练作业使用的多数据集。详情请查看[表4]。                                          |
| engine_type          | Integer    | 训练作业的引擎类型。                                                                                                        |
| engine_name          | String     | 训练作业的引擎名称。                                                                                                        |
| engine_id            | Long       | 训练作业的引擎ID。                                                                                                        |
| engine_version       | String     | 训练作业使用的引擎版本。                                                                                                      |
| train_url            | String     | 训练作业的输出文件OBS路径URL，默认为空，如"/usr/train/"。                                                                            |
| log_url              | String     | 训练作业的日志OBS输出路径URL，默认为空。如："/usr/train/"。                                                                           |
| user_image_url       | String     | 自定义镜像训练作业的自定义镜像的SWR-URL。                                                                                          |
| user_command         | String     | 自定义镜像训练作业的自定义镜像的容器的启动命令。                                                                                          |
| spec_code            | String     | 训练作业资源规格。                                                                                                         |
| gpu_type             | String     | 资源规格gpu的类型。                                                                                                       |
| create_time          | Long       | 训练作业参数创建时间 。                                                                                                      |
| cpu                  | String     | 资源规格CPU内存。                                                                                                        |
| gpu_num              | Integer    | 资源规格gpu的个数。                                                                                                       |
| core                 | String     | 资源规格的核数。                                                                                                          |
| dataset_name         | String     | 训练作业的数据集名称。                                                                                                       |
| dataset_version_name | String     | 训练作业的数据集名称。                                                                                                       |
| pool_id              | String     | 资源池ID。                                                                                                            |
| pool_name            | String     | 资源池名称。                                                                                                            |
| volumes              | JSON Array | 训练作业可使用的存储卷。具体请参见[表5]。                                         |
| nas_mount_path       | String     | SFS Turbo (NAS) 训练本地挂载路径。如："/home/work/nas"。                                                                      |
| nas_share_addr       | String     | SFS Turbo (NAS) 共享路径。如："192.168.8.150:/"。                                                                         |
| nas_type             | String     | 当前仅支持 nfs。如："nfs"。                                                                                                |
   
 表4data_source属性列表 
| 参数              | 参数类型   | 说明                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|
| dataset_id      | String | 训练作业的数据集ID。                                                                                                                                                                                                                                                                                                                                                                                                |
| dataset_version | String | 训练作业的数据集版本ID。                                                                                                                                                                                                                                                                                                                                                                                              |
| type            | String | 数据集类型。 - "obs"：表示使用OBS的数据。    - "dataset"：表示使用数据集的数据。   |
| data_url        | String | OBS的桶路径。                                                                                                                                                                                                                                                                                                                                                                                                   |
   
 表5volumes属性列表 
| 参数        | 参数类型   | 说明                                                                                                     |
|:---|:---|:---|
| nfs       | Object | 共享文件系统类型的存储卷。仅支持运行于已联通共享文件系统网络的资源池的训练作业。具体请参见[表6]。 |
| host_path | Object | 主机文件系统类型的存储卷。仅支持运行于专属资源池中的训练作业。具体请参见[表7]。           |
   
 表6nfs属性列表 
| 参数        | 参数类型    | 说明                                                                                                                                                                                                                                                                                                                                                          |
|:---|:---|:---|
| id        | String  | SFS Turbo 文件系统 ID。                                                                                                                                                                                                                                                                                                                                          |
| src_path  | String  | SFS Turbo 文件系统地址。                                                                                                                                                                                                                                                                                                                                           |
| dest_path | String  | 训练作业的本地路径。                                                                                                                                                                                                                                                                                                                                                  |
| read_only | Boolean | dest_path 是否为只读权限，默认为读写权限。 - true：只读权限  - false：默认值，读写权限   |
   
 表7host_path属性列表 
| 参数        | 参数类型    | 说明                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| src_path  | String  | 宿主机的本地路径。                                                                                                                                                                                                                                                                                                                                               |
| dest_path | String  | 训练作业的本地路径。                                                                                                                                                                                                                                                                                                                                              |
| read_only | Boolean | dest_path 是否为只读权限，默认为读写权限。 - true：只读权限  - false：默认值，读写权限   |
   
 表8parameter属性列表 
| 参数    | 参数类型   | 说明    |
|:---|:---|:---|
| label | String | 参数名称。 |
| value | String | 参数值。  |
   
#### 请求示例
如下以查询名为"config123"的作业参数详情为例。
```
GET    https://endpoint/v1/{project_id}/training-job-configs/config123
```
#### 响应示例
- 成功响应示例
  ```
  {
      "spec_code": "modelarts.vm.gpu.v100",
      "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",
      "gpu_type": "nvidia-v100",
      "dataset_version_id": "2ff0d6ba-c480-45ae-be41-09a8369bfc90",
      "engine_name": "TensorFlow",
      "is_success": true,
      "nas_mount_path": "/home/work/nas",
      "worker_server_num": 1,
      "nas_share_addr": "192.168.8.150:/",
      "train_url": "/test/minst/train_out/out1/",
      "nas_type": "nfs",
      "spec_id": 4,
      "parameter": [
          {
              "label": "learning_rate",
              "value": 0.01
          }
      ],
      "log_url": "/usr/log/",
      "config_name": "config123",
      "app_url": "/usr/app/",
      "create_time": 1559045426000,
      "dataset_id": "38277e62-9e59-48f4-8d89-c8cf41622c24",
      "volumes": [
          {
              "nfs": {
                  "id": "43b37236-9afa-4855-8174-32254b9562e7",
                  "src_path": "192.168.8.150:/",
                  "dest_path": "/home/work/nas",
                  "read_only": false
              }
          },
          {
              "host_path": {
                  "src_path": "/root/work",
                  "dest_path": "/home/mind",
                  "read_only": false
              }
          }
      ],
      "cpu": "64",
      "model_id": 4,
      "boot_file_url": "/usr/app/boot.py",
      "dataset_name": "dataset-test",
      "pool_id": "pool9928813f",
      "config_desc": "This is a config desc test",
      "gpu_num": 1,
      "data_source": [
          {
              "type": "obs",
              "data_url": "/test/minst/data/"
          }
      ],
      "pool_name": "pnt1",
      "dataset_version_name": "dataset-version-test",
      "core": "8",
      "engine_type": 1,
      "engine_id": 3,
      "engine_version": "TF-1.8.0-python2.7",
      "data_url": "/test/minst/data/"
  }
  ```
  
- 失败响应示例
  ```
  {
      "is_success": false,
      "error_message": "Error string",
      "error_code": "ModelArts.0105"
  }
  ```
  
 
#### 状态码
状态码请参见[表1](https://support.huaweicloud.com/api-modelarts/modelarts_03_0094.html#ZH-CN_TOPIC_0000002334623361__table1450010510213)。
