Updated on 2023-12-19 GMT+08:00

Introduction

Create IAM users and assign permissions to the users so you can perform fine-grained permissions management for your MRS resources. If your Huawei Cloud account meets service requirements, you do not need to create IAM users. In this case, skip this section.

By default, new IAM users do not have permissions assigned. You need to add them to one or more groups, and attach permissions policies or roles to these groups. Users inherit permissions from the groups to which they are added and can perform specified operations on cloud services based on the permissions.

You can grant users permissions by using roles and policies. Roles are a type of coarse-grained authorization mechanism that defines permissions related to user responsibilities. Policies define API-based permissions for operations on specific resources under certain conditions, allowing for more fine-grained, secure access control of cloud resources.

Policy-based authorization is useful if you want to allow or deny the access to an API.

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. The permissions required for calling an API are determined by the actions supported by the API. Only users who have been granted permissions allowing the actions can call the API successfully. For example, if an IAM user queries MRS clusters using an API, the user must have been granted permissions that allow the mrs:cluster:list action.

Supported Actions

MRS provides system-defined policies that can be directly used in IAM. MRS cluster administrators can also create custom policies and use them to supplement system-defined policies, implementing more refined access control. Operations supported by policies are specific to APIs. The following are common concepts related to policies:

  • Permission: A statement in a policy that allows or denies certain operations.
  • API: REST APIs that can be called by a user who has been granted specific permissions.
  • Action: Specific operations that are allowed or denied.
  • Dependencies: actions on which a specific action depends. When allowing an action for a user, you also need to allow any existing action dependencies for that user.
  • IAM or enterprise projects: Type of projects for which an action will take effect. Policies that contain actions for both IAM and enterprise projects can be used and take effect for both IAM and Enterprise Management. Policies that only contain actions for IAM projects can be used and only take effect for IAM.

    The check mark (√) indicates that an action takes effect. The cross mark (x) indicates that an action does not take effect.

Table 1 Actions

Permissions

API

Action

IAM Project

Enterprise Project

Creating a Cluster and Executing a Job (V1)

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

mrs:cluster:create

Creating a Cluster (V2)

POST/v2/{project_id}/clusters

Querying a Cluster List (V1)

GET /v1.1/{project_id}/cluster_infos

mrs:cluster:list

Obtaining a Cluster List (V2) (Obtaining Cluster Details)

GET/v2/{project_id}/clusters

Deleting a Cluster

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

mrs:cluster:delete

Querying a Host List (V1)

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

mrs:host:list

Querying a File List (V2)

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

mrs:file:list

Adding and Executing a Job (V1)

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

mrs:job:submit

Adding and Executing a Job (V2)

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

Querying the exe Object List of Jobs (V1)

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

mrs:job:list

Querying Information About a Job (V2)

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

Querying a List of Jobs (V2)

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

Obtaining the SQL Result (V2)

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

Querying exe Object Details (V1)

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

mrs:job:get

Querying User Agent Information

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

Querying Job Log Details

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

Querying Tags of a Specified Cluster

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

mrs:tag:list

Querying All Tags

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

Creating a Tag for a Cluster

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

mrs:tag:create

Adding or Deleting Cluster Tags in Batches

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

mrs:tag:batchOperate

Querying a List of Clusters with Specified Tags

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

mrs:tag:listResource

×

Terminating a Job (V2)

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

mrs:job:stop

Deleting Jobs in Batches (V2)

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

mrs:job:batchDelete

Canceling SQL Execution

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

mrs:sql:cancel

Submitting a SQL Statement

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

mrs:sql:execute

Obtaining All AS Policies

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

mrs:cluster:policy

Configuring an Auto Scaling Rule

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

Updating User Agent Information

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

mrs:cluster:syncUser

Obtaining Job Execution Results

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

mrs:sql:get