Updated on 2024-06-07 GMT+08:00

Querying Roles

Function

This API is used to query roles of users.

  • Before calling an API, you need to understand the API in Authentication.

URI

  • URI format

    GET /v3/{project_id}/instances/{instance_id}/roles

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    To obtain it, refer to Obtaining a Project ID.

    instance_id

    Yes

    Instance ID.

    Table 2 Query parameters

    Parameter

    Mandatory

    Type

    Description

    user_name

    No

    String

    Username. If this parameter is specified, the set of roles that can be granted to the user is returned.

Request

None

Example Request

Query roles of users.

GET https://rds.ap-southeast-1.myhuaweicloud.com/v3/8b3d99b2fb1148c69be8fe37bb896f27/instances/51986c9a48df43839a3ba300d6c5e91fin03/roles?user_name=user1

Response

  • Normal response
    Table 3 Parameters

    Parameter

    Type

    Description

    roles

    Array of strings

    Role information.

Status Code

Error Code

For details, see Error Codes.