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

API Overview

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

Table 1 V2 APIs

API

Function

API URI

Cluster management APIs

Creating Clusters

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

Obtain the SQL Result

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

SQL APIs

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

Cluster HDFS file APIs (V2)

Obtaining 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 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 object APIs

Adding a Job and Executing the Job

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

Querying the exe Object List of Jobs

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

Querying exe Object Details

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

Job execution object APIs

Deleting a Job Execution Object

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

Auto scaling APIs

Configuring an Auto Scaling Rule

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

Tag management APIs

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