Updated on 2026-06-27 GMT+08:00

API Overview

Table 1 and Table 2 describe the RESTful APIs provided by MRS.

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

Table 1 V2 APIs

Type

API

Description

Cluster management APIs

Creating a Cluster - CreateCluster

This API is used to create an MRS cluster.

Changing a Cluster Name - UpdateClusterName

This API is used to change a cluster name.

Creating a Cluster and Submitting a Job - CreateClusterAndSubmitJob

This API is used to create an MRS cluster, submit a job, and delete the cluster upon job completion.

Obtaining the Cluster Communication Security Authorization Status - ListSecurityRuleStatus

This API is used to obtain the communication security authorization status of the current cluster.

Scaling Out a Cluster - ExpandCluster

This API is used to scale out an MRS cluster.

Scaling In a Cluster - ShrinkCluster

This API is used to scale in an MRS cluster.

Adding Components to a Cluster - AddComponent

This API is used to add components to a cluster. This feature is supported only for custom clusters in MRS 3.1.2 or later regular versions, and MRS 3.1.2-LTS.2 or later LTS versions.

Querying the Cluster Node List - ListNodes

This API is used to query the list of cluster nodes.

Job object APIs

Adding and Executing a Job - CreateExecuteJob

This API is used to add and submit a job in an MRS cluster.

Querying a List of Jobs - ShowJobList

This API is used to query the list of jobs submitted on the job management page of a specified MRS cluster.

Querying Information About a Job - ShowSingleJob

This API is used to query the details of a specified job in an MRS cluster.

Terminating a Job - StopJob

This API is used to terminate a specified job in an MRS cluster.

Obtaining SQL Results - ShowSqlResultWithJob

This API is used to query the results returned after the execution of SQL statements for SparkSQL and SparkScript job types in an MRS cluster.

Deleting Jobs in Batches - BatchDeleteJobs

This API is used to delete jobs in batches in an MRS cluster.

Auto scaling APIs

Viewing Auto Scaling Policies - ShowAutoScalingPolicy

This API is used to view all auto scaling policy information for a specified cluster.

Updating an Auto Scaling Policy - UpdateAutoScalingPolicy

This API is used to update an auto scaling policy.

Deleting an Auto Scaling Policy - DeleteAutoScalingPolicy

This API is used to delete an auto scaling policy.

Creating an Auto Scaling policy - CreateAutoScalingPolicy

This API is used to create an auto scaling policy.

Cluster HDFS file APIs (V2)

Obtaining the List of Files from a Specified Directory - ShowHdfsFileList

This API is used to obtain the file list of a specified directory in an MRS cluster.

SQL APIs

Submitting a SQL Statement - ExecuteSql

This API is used to submit and execute a SQL statement in an MRS cluster.

Querying SQL Results - ShowSqlResult

This API is used to query the execution result of a SQL statement in an MRS cluster.

Canceling a SQL Execution Task - CancelSql

This API is used to cancel the execution task of a SQL statement in an MRS cluster.

Agency management APIs (V2)

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

This API is used to obtain the details of the mapping between users (or user groups) and IAM agencies.

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

This API is used to update the mapping between users (or user groups) and IAM agencies.

Data connection management APIs

Creating a Data Connection - CreateDataConnector

This API is used to create a data connection.

Querying the Data Connection List - ListDataConnector

This API is used to query the list of data connections.

Updating a Data Connection - UpdateDataConnector

This API is used to update a data connection.

Deleting a Data Connection - DeleteDataConnector

This API is used to delete a data connection.

Version metadata query APIs

Obtaining the MRS Version List - ShowMrsVersionList

This API is used to display the list of MRS versions.

Querying Available Specifications of an MRS Cluster Version - ShowMrsFlavors

This API is used to query the available specifications for an MRS cluster version.

IAM synchronization management APIs

Checking Ongoing IAM User Synchronization in a Cluster - ListClusterSyncTaskStatus

This API is used to query whether the current cluster is undergoing IAM synchronization.

Querying IAM User Synchronization Status of a Specified Cluster - ListClusterSyncStatus

This API is used to query the IAM synchronization status of a specified cluster.

Obtaining Synchronized IAM Users and User Groups - ShowSyncIamUser

This API is used to obtain the synchronized IAM users and user groups.

IAM Synchronization - UpdateSyncIamUser

This API is used to synchronize IAM users and user groups to Manager. If a specific user is specified, the IAM user groups associated with that user will also be synchronized to Manager.

Cancelling Synchronization of Specified Users and User Groups - CancelSyncIamUser

This API is used to cancel synchronization for specified users and user groups.

Tag Management APIs

Enabling or Disabling the Default Tag of a Cluster - SwitchClusterTags

This API is used to enable or disable the cluster default tag for an existing cluster. When enabled, nodes within the cluster will be tagged with the cluster default tag.

Querying the Default Cluster Tag Status - ShowDefaultTagStatus

This API is used to query the status of the cluster default tag.

Querying Tag Quotas - ShowTagQuota

This API is used to query tag quota information.

Table 2 V1.1 APIs

Type

API

Description

Cluster management APIs

Creating a Cluster and Executing a Job - CreateClusterAndSubmitJob

This API is used to create an MRS cluster and submit a job within the cluster. This API is not compatible with Sahara.

Resizing a Cluster - ModifyClusterNode

This API is used to scale out or scale in the Core or Task nodes of a cluster after creation. The number of Master nodes cannot be adjusted after an MRS cluster is successfully created, meaning scaling of Master nodes is not supported. This API is not compatible with Sahara.

Querying a Cluster List - ListClusters

This API is used to view the list of clusters created by a user. This API is not compatible with Sahara.

Querying Cluster Details - ShowClusterDetails

This API is used to view the details of a specified cluster. This API is not compatible with Sahara.

Querying a Host List - ListHosts

This API is used to query the host list details of a specified cluster.

Terminating a Cluster - DeleteCluster

This API is used to delete a cluster after data processing and analysis is complete, or when the cluster is running abnormally and cannot provide services. This API is compatible with Sahara.

Clusters in any of the following states cannot be deleted:
  • scaling-out: Scaling out
  • scaling-in: Scaling in
  • starting: Starting
  • terminating: Deleting
  • terminated: Deleted
  • failed: Failed

Querying the Status of an Agency Switch Task in a Specified Cluster - ListAgencyTaskStatus

This API is used to query the status of the agency switching task for a specified cluster.

Auto scaling APIs

Configuring an Auto Scaling Rule - CreateAutoScalingPolicy

This API is used to configure auto scaling rules.

Auto scaling rules can also be created in the API for creating a cluster and executing a job.

AZ APIs

Querying AZ Information - ListAvailableZones

This API is used to query the ID of an availability zone (AZ). When creating a cluster, the AZ ID for the instance must be configured, and this ID can be queried using this API.

Version metadata

Querying the Metadata of a Cluster Version - ShowMrsVersionMetadata

This API is used to query the metadata of a corresponding version. If a cluster ID is specified in the parameters, the latest metadata after the cluster has been updated with patches can be queried.

Tag management APIs

Adding Tags to a Specified Cluster - CreateClusterTag

This API is used to add a tag to a cluster.

Querying Tags of a Specified Cluster - ListClusterTags

This API is used to query the tag information of a cluster.

Deleting Tags from a Specified Cluster - DeleteClusterTag

This API is used to delete a tag from a cluster.

Adding Tags to a Cluster in Batches - BatchCreateClusterTags

This API is used to add tags to a cluster in batches.

Deleting Tags from a Cluster in Batches - BatchDeleteClusterTags

This API is used to delete tags from a cluster in batches.

Querying All Tags - ListAllTags

This API is used to query all tag collections of a tenant in a specified region.

Querying a List of Clusters with Specified Tags - ListClustersByTags

This API is used to filter clusters using tags.

Table 3 Historical APIs

Type

API

Description

V1.1 Job Management API

Adding and Executing a Job

This API is used to add a job to an MRS cluster and execute the job. This API is not compatible with Sahara.

Querying the exe Object List

This API is used to query the list of all job exe objects. This API is not compatible with Sahara.

Querying exe Object Details

This API is used to query the detailed information of a specified job exe object. This API is not compatible with Sahara.

Deleting a Job Execution Object

This API is used to delete a specified job execution object. This API is compatible with Sahara.