Updated on 2024-08-29 GMT+08:00

Terminating a Job

Scenario

This API is used to manually terminate the job if a job is not completed after being submitted. For details on how to call APIs, see Making an API Request.

Constraints

  • A cluster has been created and is in the Running state.
  • You have obtained the project ID of the region where the cluster is to be created. For details, see Obtaining a Project ID.
  • You have obtained the cluster ID, that is, the value of cluster_id in the command output returned after the cluster is successfully created. For details about how to obtain the cluster ID, see Obtaining a Cluster ID.
  • You have obtained the job ID, that is, the value of job_id in the returned result after the job is successfully submitted. For details about how to obtain the job ID, see Obtaining a Job ID.
  • IAM users have been synchronized. On the Overview tab page of the cluster details page, click Click to synchronize on the right of IAM User Sync to synchronize IAM users.
  • The job-related programs and input files have been stored in OBS.
  • In this example, a MapReduce job is added.

Procedure

  • API

    URI format: POST /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/kill

    For details, see Terminating a Job.

  • Example request

    POST: https://{endpoint}/v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/kill

    • For details about {endpoint}, see Endpoints.
    • For details about {project_id}, see Obtaining a Project ID.
    • {cluster_id} indicates the value of cluster_id in the command output returned after the cluster is successfully created. You can also obtain the value of cluster_id by referring to Obtaining a Cluster ID.
    • {job_execution_id} indicates the job ID returned after the job is successfully submitted. You can also obtain the job ID by referring to Obtaining a Job ID.

    Request body: None

  • Example response

    None