Help Center> Distributed Message Service for Kafka> API Reference> Permissions and Supported Actions
Updated on 2024-01-31 GMT+08:00

Permissions and Supported Actions

This chapter describes fine-grained permissions management for your Kafka instances. If your HUAWEI ID does not need individual IAM users, then you may skip over this chapter.

By default, new IAM users do not have permissions assigned. You need to add a user 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.

For details about DMS for Kafka system policies, see Permissions Management.

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

An account has all of 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 wants to query Kafka instances using an API, the user must have been granted permissions that allow the dms:instance:create action.

Supported Actions

DMS for Kafka provides system-defined policies that can be directly used in IAM. You 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.
  • APIs: REST APIs that can be called by a user who has been granted specific permissions.
  • Action: Specific operations that are allowed or denied.
  • IAM projects or enterprise projects: A custom policy can be applied to IAM projects or enterprise projects or both. 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. Administrators can check whether an action supports IAM projects or enterprise projects in the action list. For details about the differences between IAM and enterprise projects, see What Are the Differences Between IAM and Enterprise Management?

DMS for Kafka supports the following actions in custom policies:

  • Lifecycle management actions, including actions supported by Kafka instance lifecycle management APIs, such as the APIs for creating an instance, querying the instance list, modifying instance information, and batch restarting or deleting instances.
  • Instance management actions, including actions supported by Kafka instance management APIs, such as the APIs for resetting passwords and enabling or disabling automatic topic creation.
  • Dumping management actions, including actions supported by dumping management APIs, such as the APIs for creating a dump connector, creating a dumping task, and querying the dumping task list.
  • Specification modification management action, supported by the specification modification management API for modifying instance specifications.
  • Topic management actions, including actions supported by topic management APIs, such as the APIs for creating, querying, and modifying topics.
  • User management actions, including actions supported by user management APIs, such as the APIs for creating users, querying users, and configuring user permissions.
  • Message query actions, including actions supported by message query APIs, such as the API for querying messages.
  • Background task management actions, including actions supported by background task management APIs, such as the APIs for querying the background task list of an instance and querying a specified background task.
  • Tag management actions, including actions supported by tag management APIs, such as the APIs for querying instance tags and project tags.
  • Others: including actions supported by APIs for enabling and disabling public network access

Lifecycle Management

Table 1 Lifecycle management

Permission

API

Action

IAM

(Project)

Enterprise

(Enterprise Project)

Creating an instance

POST /v2/{engine}/{project_id}/instances

dms:instance:create

Querying all instances

GET /v2/{project_id}/instances

dms:instance:list

Querying an instance

GET /v2/{project_id}/instances/{instance_id}

dms:instance:get

Deleting an instance

DELETE /v2/{project_id}/instances/{instance_id}

dms:instance:delete

Modifying instance information

PUT /v2/{project_id}/instances/{instance_id}

dms:instance:modify

Batch restarting or deleting instances

POST /v2/{project_id}/instances/action

Restart: dms:instance:modifyStatus

Delete: dms:instance:delete

Instance Management

Table 2 Instance management

Permission

API

Action

IAM

(Project)

Enterprise

(Enterprise Project)

Resetting a password

POST /v2/{project_id}/instances/{instance_id}/password

dms:instance:resetAuthInfo

Resetting the Kafka Manager password

PUT /v2/{project_id}/instances/{instance_id}/kafka-manager-password

dms:instance:resetAuthInfo

Restarting Kafka Manager

PUT /v2/{project_id}/instances/{instance_id}/restart-kafka-manager

dms:instance:modifyStatus

Configuring automatic topic creation

POST /v2/{project_id}/instances/{instance_id}/autotopic

dms:instance:modify

Modifying the private IP address for cross-VPC access

POST /v2/{project_id}/instances/{instance_id}/crossvpc/modify

dms:instance:modify

Resetting consumer group offset to the specified position

POST /v2/{project_id}/instances/{instance_id}/management/groups/{group}/reset-message-offset

dms:instance:modify

Dumping Management

Table 3 Dumping management

Permission

API

Action

IAM Projects

Enterprise Projects

Creating a dumping connector for an instance

POST /v2/{project_id}/instances/{instance_id}/connector

dms:instance:connector

Creating a dumping task

POST /v2/{project_id}/connectors/{connector_id}/sink-tasks

dms:instance:createConnectorSinkTask

Listing dumping tasks

GET /v2/{project_id}/connectors/{connector_id}/sink-tasks

dms:instance:listConnectorSinkTask

Modifying dumping task quotas

PUT /v2/{project_id}/connectors/{connector_id}/sink-tasks

dms:instance:createConnectorSinkTask

Querying a dumping task

GET /v2/{project_id}/connectors/{connector_id}/sink-tasks/{task_id}

dms:instance:getConnectorSinkTask

Deleting a dumping task

POST /v2/{project_id}/connectors/{connector_id}/sink-tasks/{task_id}

dms:instance:deleteConnectorSinkTask

Specification Modification Management

Table 4 Specification modification management

Permission

API

Action

IAM Projects

Enterprise Projects

Modifying instance specifications

POST /v2/{engine}/{project_id}/instances/{instance_id}/extend

dms:instance:scale

Topic Management

Table 5 Topic management

Permission

API

Action

IAM Projects

Enterprise Projects

Creating a topic in a Kafka instance

POST /v2/{project_id}/instances/{instance_id}/topics

dms:instance:modify

Querying a topic in a Kafka instance

GET /v2/{project_id}/instances/{instance_id}/topics

dms:instance:get

Modifying topics of a Kafka instance

PUT /v2/{project_id}/instances/{instance_id}/topics

dms:instance:modify

Deleting topics in a Kafka instance in batches

POST /v2/{project_id}/instances/{instance_id}/topics/delete

dms:instance:modify

User Management

Table 6 User management

Permission

API

Action

IAM Projects

Enterprise Projects

Querying the user list

GET /v2/{project_id}/instances/{instance_id}/users

dms:instance:get

Creating a user

POST /v2/{project_id}/instances/{instance_id}/users

dms:instance:modify

Deleting users in batches

PUT /v2/{project_id}/instances/{instance_id}/users

dms:instance:modify

Resetting a user password

PUT /v2/{project_id}/instances/{instance_id}/users/{user_name}

dms:instance:get

Querying user permissions

GET /v1/{project_id}/instances/{instance_id}/topics/{topic_name}/accesspolicy

dms:instance:get

Granting user permissions

POST /v1/{project_id}/instances/{instance_id}/topics/accesspolicy

dms:instance:modify

Message Query

Table 7 Message query

Permission

API

Action

IAM Projects

Enterprise Projects

Querying messages

GET /v2/{project_id}/instances/{instance_id}/messages

dms:instance:get

Background Task Management

Table 8 Background task management

Permission

API

Action

IAM Projects

Enterprise Projects

Listing background tasks

GET /v2/{project_id}/instances/{instance_id}/tasks

dms:instance:getBackgroundTask

Querying a background task

GET /v2/{project_id}/instances/{instance_id}/tasks/{task_id}

dms:instance:getBackgroundTask

Deleting a background task

DELETE /v2/{project_id}/instances/{instance_id}/tasks/{task_id}

dms:instance:deleteBackgroundTask

Tag Management

Table 9 Tag management

Permission

API

Action

IAM Projects

Enterprise Projects

Batch adding or deleting tags

POST /v2/{project_id}/kafka/{instance_id}/tags/action

dms:instance:modify

Listing tags of an instance

GET /v2/{project_id}/kafka/{instance_id}/tags

dms:instance:get

Listing tags of a project

GET /v2/{project_id}/kafka/tags

dms:instance:get

Other

Table 10 Message query

Permission

API

Action

IAM Projects

Enterprise Projects

Enabling or disabling public access

This operation is supported only by using the console and not by calling APIs.

dms:instance:modify