Updated on 2024-08-29 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

Changing a Cluster Name

PUT /v2/{project_id}/clusters/{cluster_id}/cluster-name

Creating a Cluster and Submitting a Job

POST /v2/{project_id}/run-job-flow

Scaling Out a Cluster

POST /v2/{project_id}/clusters/{cluster_id}/expand

Scaling In a Cluster

POST /v2/{project_id}/clusters/{cluster_id}/shrink

Adding Components to a Cluster

POST /v2/{project_id}/clusters/{cluster_id}/components

Querying the Cluster Node List

GET /v2/{project_id}/clusters/{cluster_id}/nodes

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

Obtaining SQL Results

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

Deleting Jobs in Batches

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

Auto scaling APIs

Viewing Auto Scaling Policies

GET /v2/{project_id}/autoscaling-policy/{cluster_id}

Updating an Auto Scaling Policy

PUT /v2/{project_id}/autoscaling-policy/{cluster_id}

Deleting an AS policy

DELETE /v2/{project_id}/autoscaling-policy/{cluster_id}

Creating an AS policy

POST /v2/{project_id}/autoscaling-policy/{cluster_id}

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}

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

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

Data connection management APIs

Creating a Data Connection

POST /v2/{project_id}/data-connectors

Querying the Data Connection List

GET /v2/{project_id}/data-connectors

Updating a Data Connection

PUT /v2/{project_id}/data-connectors/{connector_id}

Deleting a Data Connection

DELETE /v2/{project_id}/data-connectors/{connector_id}

Version metadata query APIs

Obtaining MRS Version List

GET /v2/{project_id}/metadata/versions

Querying Available Specifications of an MRS Cluster Version

GET /v2/{project_id}/metadata/version/{version_name}/available-flavor

IAM synchronization APIs

Obtaining Synchronized IAM Users and User Groups

GET /v2/{project_id}/clusters/{cluster_id}/iam-sync-user

Synchronizing an IAM User and User Group

POST /v2/{project_id}/clusters/{cluster_id}/iam-sync-user

Cancelling Synchronization of Specified Users and User Groups

DELETE /v2/{project_id}/clusters/{cluster_id}/iam-sync-user

Tag Management APIs

Enabling or Disabling the Default Tag of a Cluster

POST /v2/{project_id}/clusters/{cluster_id}/tags/switch

Querying the Status of Default Cluster Tags

GET /v2/{project_id}/clusters/{cluster_id}/tags/status

Querying Tag Quotas

GET /v2/{project_id}/clusters/{cluster_id}/tags/quota

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}

Querying a Host List

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

Terminating a Cluster

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

Job object APIs

Adding and Executing a Job (Deprecated)

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

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}

Job execution object APIs

Deleting a Job Execution Object (Deprecated)

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 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 Tags to a Cluster 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

AZ APIs

Querying AZ Information

GET /v1.1/{region_id}/available-zones

Version metadata

Querying the Metadata of a Cluster Version

GET /v1.1/{project_id}/metadata/versions/{version_name}

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}