Updated on 2025-08-20 GMT+08:00

Revoking a Role from a User

Function

This API is used to revoke a role from a user.

Constraints

This operation cannot be performed when the DB instance is in the abnormal or frozen state.

URI

  • URI format

    DELETE /v3/{project_id}/instances/{instance_id}/db-user-role

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Definition

    Project ID of a tenant in a region.

    To obtain the value, see Obtaining a Project ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

    instance_id

    Yes

    Definition

    Instance ID.

    Constraints

    N/A

    Range

    N/A

    Default Value

    N/A

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

user

Yes

String

Definition

Username.

Constraints

N/A

Range

The username must be different from the names of built-in users.

Default Value

N/A

roles

Yes

Array of strings

Definition

Role name.

Constraints

N/A

Range

The role name must be different from the names of built-in user roles.

Default Value

N/A

Example Request

Revoke roles user3 and user4 from the user user1.

DELETE https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in03/db-user-role 

{ 
   "user" : "user1", 
   "roles" : [ "user3", "user4" ] 
 }

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    resp

    String

    Definition

    Calling result.

    Range

    Returns successful if the calling is successful.

Status Code

Error Code

For details, see Error Codes.