Updated on 2022-11-18 GMT+08:00

API Overview

MRS provides APIs that meet RESTful API design standards, as listed in Table 1 and Table 2.

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

Table 1 V2 APIs

API

Function

API URI

Cluster management APIs

Creating a Cluster

POST /v2/{project_id}/clusters

Job object APIs

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

Obtaining SQL Results

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

SQL APIs

Submitting a 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}

Canceling a SQL Execution Task

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

Cluster HDFS file APIs (V2)

Obtaining the List of Files from a Specified Directory

GET /v2/{project_id}/clusters/{cluster_id}/files?path={directory}&offset={offset}&limit={limit}&sort_key={sort_key}&order={order}

Agency management APIs (V2)

Querying the Mapping Between a User (Group) and an IAM Agency

GET /v2/{project_id}/clusters/{cluster_id}/agency-mapping

Updating the Mapping Between a User (Group) and an IAM Agency

PUT /v2/{project_id}/clusters/{cluster_id}/agency-mapping

Table 2 V1.1 APIs

API

Function

API URI

Cluster management APIs

Creating a Cluster and Executing 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}

Terminating a Cluster

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

Querying a Host List

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

Auto scaling APIs

Configuring an Auto Scaling Rule

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

Tag management APIs

Adding Tags to a Specified Cluster

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

Deleting Tags from 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 3 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}