
# 查询execution
get_execution(execution_id)
#### 功能描述
查询特定execution执行结果。
#### 输入参数
| 参数           | 是否必选 | 参数类型   | 参数描述                                                                                                                  |
|:---|:---|:---|:---|
| execution_id | 是    | String | 执行ID，可以为[create_execution](https://support.huaweicloud.com/sdkreference-gcs/gcs_sdkreference_002_004_001.html)接口的返回值。 |
   
#### 返回值
响应中含有一个execution结构，建议通过response.json()方式获取返回值，结构如[表1]所示。
 表1返回值 
| 参数                 | 参数类型       | 参数描述                                                                                      |
|:---|:---|:---|
| execution          | JSONObject | execution基本属性，详见[表3]。                 |
| object             | JSONObject | k8s execution部分，详见[表3 K8s execution结构]。 |
| status             | JSONObject | 节点状态，详见[表11]， 如果为空，则不返回。               |
| enterprise_project | JSONObjec  | 企业项目，详见表[表2]                           |
   
 表2enterprise_project 
| 参数   | 参数类型   | 描述      |
|:---|:---|:---|
| id   | String | 企业项目id  |
| name | String | 企业项目的名称 |
   
 表3Execution基本属性 
| 参数              | 参数类型       | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|:---|:---|:---|
| guid            | String     | execution guid。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| name            | String     | execution名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| namespace       | String     | execution所属命名空间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| cluster_name    | String     | execution所属集群名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| cluster_id      | String     | execution所属集群ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| project_id      | String     | execution所属项目ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| domain_id       | String     | execution所属租户ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| description     | String     | execution描述。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| status          | String     | execution状态： - Pending：等待处理中  - Running：处理中  - Cancelling：取消中  - ForceCancelling：强制取消中  - Retrying：重试中  - Succeeded：执行成功  - Failed：执行失败  - Cancelled：取消   |
| workflow_id     | String     | 创建execution的流程ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| workflow_name   | String     | 创建execution的流程名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| workflow_scope  | String     | 创建execution的流程使用范围。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| inputs_json     | String     | execution输入。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| outputs_json    | String     | execution输出。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| image           | String     | 流程拓扑图。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| time_duration   | int        | 处理持续时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| sfs_volume_name | String     | 中间件存储卷名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| job_type        | String     | execution的任务类型，可选值为： - CCE.Job：job任务运行于CCE服务。  - CCI.Job：job任务运行于CCI服务。  - DLI.Job：job任务运行于DLI服务。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| target          | String     | execution的运行环境，可选值为： - cce：execution运行于CCE服务  - cci：execution运行于CCI服务                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| create_at       | String     | execution创建时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| update_at       | String     | execution更新时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| label           | Dictionary | 标签集合                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| resources       | Dictionary | execution消耗的资源和时间比，该时间比表示execution的实际执行时间所占总时间（包括执行时间、调度时间、失败处理时间等时间总和）的百分比，其中百分号已省略                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| priority        | int        | execution的优先级，取值范围\[0,999\]，默认为0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   
 表4K8s execution结构 
| 参数         | 参数类型                                                                             | 描述                                 |
|:---|:---|:---|
| kind       | String                                                                           | 值为"execution"，表示是execution类型。      |
| apiVersion | String                                                                           | 值为"gene.kubedag/v1alpha1"，表示api版本。 |
| metadata   | [表4 Execution Metadata结构]    | execution的元属性。                     |
| spec       | [表5 Execution Spec参数]         | execution的创建细节属性。                  |
| status     | [表7 Execution Spec Metadata参数] | execution的运行状态。                    |
   
 表5Execution Metadata结构 
| 参数                   | 参数类型       | 描述                                                                                 |
|:---|:---|:---|
| name                 | String     | execution名字，与[表2]中name字段一致。    |
| namespace            | String     | execution所属命名空间。                                                                   |
| selfLink             | String     | 访问该资源的连接。                                                                          |
| uid                  | String     | execution资源的ID，与[表2]的guid字段一致。 |
| annotations          | JSONObject | execution的特殊属性。                                                                    |
| resourceVersion等其余字段 | -          | k8s自带属性。                                                                           |
   
 表6Execution Spec参数 
| 参数                | 参数类型                                                                 | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|:---|:---|:---|
| metadata          | JSONObject，参见[表7] | execution的元信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| actionName        | String                                                               | excution操作的名称。 - create：创建  - start：启动  - stop：停止  - delete：删除  - scale：伸缩  - reconfig：重配置  - retry：重试   |
| timeoutInMinutes  | int                                                                  | execution的超时时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| onFailureStrategy | String                                                               | execution的超时重试逻辑： - DoNothing：不作处理  - Rollback：回滚  - Resume：恢复  - Delete：删除                                                                                                                                                                                                                                                                                                                           |
| objectData        | String                                                               | execution所使用的workflow数据，base64编码。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| location          | String                                                               | 指定的execution执行者的容器ip。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
   
 表7Execution Spec Metadata参数 
| 参数        | 参数类型                                        | 描述                                                     |
|:---|:---|:---|
| labels    | JSONObject，内部每个key-value表示有个名为key值为value的标签 | execution的标签，标签与创建时的stack.spec.selector.matchlabels一致。 |
| namespace | String                                      | 命名空间。                                                  |
   
 表8Execution Status结构 
| 参数                | 参数类型         | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|:---|:---|:---|
| actionName        | String       | 操作的名称。 - create：创建  - start：启动  - stop：停止  - delete：删除  - scale：伸缩  - reconfig：重配置  - retry：重试   |
| progress          | int          | 执行进度。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| objectStatus      | ActionStatus | 操作的总体执行进度，[表8 ExecutionStatus ActionStatus结构]。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| subObjectStatuses | JSONObject   | 分步操作的执行进度， 每个key-value结构表示key对应的节点的执行进度，value为[表9 ExecutionStatus SubActionStatus结构] 。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| elementStatuses   | JSONObject   | 各步骤的实际状态。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
   
 表9ExecutionStatus ActionStatus结构 
| 参数       | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
|:---|:---|:---|
| phase    | String | 该操作步骤的执行状态： - Pending：等待处理中  - Running：处理中  - Cancelling：取消中  - ForceCancelling：强制取消中  - Retrying：重试中  - Succeeded：执行成功  - Failed：执行失败  - Cancelled：取消   |
| message  | String | 详细的出错信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| reason   | String | 简短的CamelCase格式的错误描述信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| updateAt | String | 以RFC3339格式表示的信息更新的UTC时间戳。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
   
 表10ExecutionStatus SubActionStatus结构 
| 参数            | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|
| phase         | String | 该操作步骤的执行状态： - Pending：等待处理中  - Running：处理中  - Cancelling：取消中  - ForceCancelling：强制取消中  - Retrying：重试中  - Succeeded：执行成功  - Failed：执行失败  - Cancelled：取消   |
| message       | String | 详细的出错信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| reason        | String | 简短的CamelCase格式的错误描述信息。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| updateAt      | String | 以RFC3339格式表示的信息更新的UTC时间戳。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| subActionName | String | 操作的名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| createAt      | String | 以RFC3339格式表示的信息创建的UTC时间戳。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   
 表11步骤状态概览 
| 参数                   | 参数类型                                                                 | 描述             |
|:---|:---|:---|
| node_number          | int                                                                  | excution中步骤数量。 |
| finished_node_number | int                                                                  | 已完成步骤个数。       |
| actual_node_status   | JSONObject，详见[表12] | 各步骤的状态。        |
   
 表12步骤状态 
| 参数                   | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| name                 | String | 节点名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| status               | String | 该操作步骤的执行状态： - Pending：等待处理中  - Running：处理中  - Cancelling：取消中  - ForceCancelling：强制取消中  - Retrying：重试中  - Succeeded：执行成功  - Failed：执行失败  - Cancelled：取消   |
| sub_job_num          | int    | 子job的数量。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| finished_sub_job_num | int    | 已完成子job的数量。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| sub_job_status       | map    | 子job的状态： - Pending：等待处理中  - Running：处理中  - Cancelling：取消中  - ForceCancelling：强制取消中  - Retrying：重试中  - Succeeded：执行成功  - Failed：执行失败  - Cancelled：取消             |
| time_duration        | int    | 持续时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| resources            | map    | job在持续时间内的资源消耗情况： - CPU：单位为"ch"（核数\*秒数）  - GPU：单位为"ch"（核数\*秒数）  - Memory：单位为"gs"(内存数\*秒数，内存单位为g)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   
