Updated on 2022-12-14 GMT+08:00

API Overview

MRS provides APIs that meet RESTful API design standards, as shown in Table 1.

Some APIs are gradually discarded during MRS version evolution. For details, see Table 2.

Table 1 APIs

API

Function

API URI

Cluster management APIs (V2)

Creating Clusters

POST /v2/{project_id}/clusters

Job object APIs (V2)

Adding and Executing a Job

POST /v2/{project_id}/clusters/{cluster_id}/job-executions

Querying Information About a Job

GET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}

Querying a List of Jobs

GET /v2/{project_id}/clusters/{cluster_id}/job-executions

Terminating a Job

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

Deleting Jobs in Batches

POST /v2/{project_id}/clusters/{cluster_id}/job-executions/batch-delete

Obtain the SQL Result

GET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/sql-result

SQL APIs (V2)

Submitting an SQL Statement

POST /v2/{project_id}/clusters/{cluster_id}/sql-execution

Querying SQL Results

GET /v2/{project_id}/clusters/{cluster_id}/sql-execution/{sql_id}

Cancel an SQL Execution Task

POST /v2/{project_id}/clusters/{cluster_id}/sql-execution/{sql_id}/cancel

Data source APIs (V1.1)

Creating a Data Source

POST /v1.1/{project_id}/data-sources

Updating a Data Source

PUT /v1.1/{project_id}/data-sources/{data_source_id}

Querying the Data Source List

GET /v1.1/{project_id}/data-sources

Querying the Data Source Details

GET /v1.1/{project_id}/data-sources/{data_source_id}

Deleting a Data Source

DELETE /v1.1/{project_id}/data-sources/{data_source_id}

Cluster management APIs (V1.1)

Creating a Cluster and Running a Job

POST /v1.1/{project_id}/run-job-flow

Resizing a Cluster

PUT /v1.1/{project_id}/cluster_infos/{cluster_id}

Querying a Cluster List

GET /v1.1/{project_id}/cluster_infos

Querying Cluster Details

GET /v1.1/{project_id}/cluster_infos/{cluster_id}

Deleting a Cluster

DELETE /v1.1/{project_id}/clusters/{cluster_id}

Querying a Host List

GET /v1.1/{project_id}/clusters/{cluster_id}/hosts

Job binary object APIs (V1.1)

Creating a Job Binary Object

POST /v1.1/{project_id}/job-binaries

Updating a Job Binary Object

PUT /v1.1/{project_id}/job-binaries/{job_binary_id}

Querying the Binary Object List

GET /v1.1/{project_id}/job-binaries

Querying the Binary Object Details

GET /v1.1/{project_id}/job-binaries/{job_binary_id}

Deleting a Job Binary Object

DELETE /v1.1/{project_id}/job-binaries/{job_binary_id}

Job object APIs (V1.1)

Adding and Executing a Job (Deprecated)

POST /v1.1/{project_id}/jobs/submit-job

Creating a Job Object

POST /v1.1/{project_id}/jobs

Updating a Job Object

PATCH /v1.1/{project_id}/jobs/{job_id}

Executing a Job Object

POST /v1.1/{project_id}/jobs/{job_id}/execute

Querying the Job Object List

GET /v1.1/{project_id}/jobs

Querying Job Object Details

GET /v1.1/{project_id}/jobs/{job_id}

Querying the exe Object List of Jobs (Deprecated)

GET /v1.1/{project_id}/job-exes

Querying exe Object Details (Deprecated)

GET /v1.1/{project_id}/job-exes/{job_exe_id}

Deleting a Job Object

DELETE /v1.1/{project_id}/jobs/{job_id}

Job execution object APIs (V1.1)

Querying the Job Execution Object List

GET /v1.1/{project_id}/job-executions

Querying Job Execution Object Details

GET /v1.1/{project_id}/job-executions/{job_execution_id}

Canceling Job Execution

GET /v1.1/{project_id}/job-executions/{job_execution_id}/cancel

Deleting a Job Execution Object (Deprecated)

DELETE /v1.1/{project_id}/job-executions/{job_execution_id}

Auto scaling APIs (V1.1)

Configuring an Auto Scaling Rule

POST /v1.1/{project_id}/autoscaling-policy/{cluster_id}

Tag management APIs (V1.1)

Adding a Tag to a Specified Cluster

POST /v1.1/{project_id}/clusters/{cluster_id}/tags

Deleting a Tag of a Specified Cluster

DELETE /v1.1/{project_id}/clusters/{cluster_id}/tags/{key}

Querying Tags of a Specified Cluster

GET /v1.1/{project_id}/clusters/{cluster_id}/tags

Adding or Deleting Cluster Tags in Batches

POST /v1.1/{project_id}/clusters/{cluster_id}/tags/action

Querying All Tags

GET /v1.1/{project_id}/clusters/tags

Querying a List of Clusters with Specified Tags

POST /v1.1/{project_id}/clusters/resource_instances/action

Table 2 Historical APIs

API

Function

API URI

V1.1 Job Management API

Adding and Executing a Job

POST /v1.1/{project_id}/jobs/submit-job

Querying the exe Object List

GET /v1.1/{project_id}/job-exes

Querying exe Object Details

GET /v1.1/{project_id}/job-exes/{job_exe_id}

Deleting a Job Execution Object

DELETE /v1.1/{project_id}/job-executions/{job_execution_id}