
# 终止作业
#### 场景描述
当作业提交后未执行完成时，手动终止作业。API的调用方法请参见[如何调用API](https://support.huaweicloud.com/api-mrs/mrs_02_0008.html)。
#### 约束限制
- 集群已创建成功并处于"运行中"。
- 已获取待创建集群区域的项目ID，请参考[获取项目ID](https://support.huaweicloud.com/api-mrs/mrs_02_0011.html)获取。
- 已获取集群ID，即创建集群成功后返回结果中的"cluster_id" 或参考[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html#mrs_02_9001__zh-cn_topic_0264280065_section177891315153619)获取。
- 已获取作业ID，即作业提交成功后返回结果中的"job_id"或参考[获取作业ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html#mrs_02_9001__zh-cn_topic_0264280065_section247234143612)获取。
- IAM用户已同步完成，可通过在集群详情页的"概览"页签，单击"IAM用户同步"右侧的"单击同步"进行IAM用户同步。
- 作业相关程序和输入文件已存放在OBS中。
- 该示例以新增MapReduce作业为例。
 
#### 操作步骤
- 接口相关信息 URI格式：POST /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/kill
  详情请参见[终止作业](https://support.huaweicloud.com/api-mrs/StopJob.html)。
  
- 请求示例 POST: https://*{endpoint}* /v2/*{project_id}* /clusters/*{cluster_id}* /job-executions/*{job_execution_id}*/kill
  - {endpoint}信息具体请参考[终端节点](https://support.huaweicloud.com/api-mrs/mrs_02_0001.html#mrs_02_0001__zh-cn_topic_0264280009_section17316828876)。
  
  - {project_id}信息请通过[获取项目ID](https://support.huaweicloud.com/api-mrs/mrs_02_0011.html)获取。
  
  - {cluster_id}信息即创建集群成功后返回结果中的"cluster_id" 或参考[获取集群ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html#mrs_02_9001__zh-cn_topic_0264280065_section177891315153619)获取。
  
  - {job_execution_id}信息即作业提交成功后返回结果中的"job_id"或参考[获取作业ID](https://support.huaweicloud.com/api-mrs/mrs_02_9001.html#mrs_02_9001__zh-cn_topic_0264280065_section247234143612)获取。
  
  
  Body：无
  
- 响应示例 无
  
 
