
# 停止/启动/重试execution
operate_execution(execution_id, action, priority=0，timeout=720, inputs_json={})
#### 功能描述
停止正在执行的execution、启动已停止的execution或重试已失败的execution。
建议在使用本接口前，先调用[查询execution](https://support.huaweicloud.com/sdkreference-gcs/gcs_sdkreference_002_004_004.html)接口，查询已有execution的状态。
- 如果要停止正在执行的execution，则需要确保该[查询execution](https://support.huaweicloud.com/sdkreference-gcs/gcs_sdkreference_002_004_004.html)接口返回值object.status.actionName为create，且object.status.objectStatus.phase为Running或是Pending。
- 如果要重新启动execution，则该execution的状态可以如下二选一：
  - object.status.actionName为create，且object.status.objectStatus.phase为Failed或Cancelled。
  
  - object.status.actionName为delete，且object.status.objectStatus.phase为Failed。
   
 
#### 输入参数
| 参数           | 是否必选 | 参数类型   | 参数描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| execution_id | 是    | String | 执行结果ID，可以为[创建execution](https://support.huaweicloud.com/sdkreference-gcs/gcs_sdkreference_002_004_001.html)接口的返回值。                                                                                                                                                                                                                                                                                                                                                                                                    |
| action       | 是    | String | 操作类型，可以取如下两个值： - cancel：停止正在执行的execution。  - retry：启动已停止的execution或重试已失败的execution。                                                                                                                                     |
| priority     | 否    | Int64  | 该操作的优先级，取值范围\[0,999\]，0表示优先级最低，999表示优先级最高，默认值为0。                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| timeout      | 否    | Int64  | 超时时间，单位为分钟，如果不填，则默认是1440分钟。 - 如果action为retry，则表示execution从当前状态到开始启动（即Running状态）的超时时间，若超过该时间，仍然没有成功启动/重试任务，则GCS不再尝试启动/重试任务。  - 如果action为cancel，则表示execution从当前状态到已停止（即Cancelled状态）的超时时间，若超过该时间，仍然没有停止成功，则GCS不再尝试停止任务。   |
| inputs_json  | 否    | Map    | 编辑流程输入参数，启动时替换流程文件中的inputs值，例如{"key1":"value1", "key2":"value2"}。 说明： 仅当action为retry时，填写该参数有效。                                                                                                                                                                                                                                                                                                                       |
   
#### 返回值
表1Execution事件结构 
| 参数 | 参数类型   | 描述    |
|:---|:---|:---|
| id | String | 执行ID。 |
   
