tencent cloud

TencentDB for MongoDB

DescribeInstanceRoles

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-10-30 14:32:00

1. API Description

Domain name for API request: mongodb.intl.tencentcloudapi.com.

Obtains the list of roles

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeInstanceRoles.
Version Yes String Common Params. The value used for this API: 2019-07-25.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
InstanceId Yes String

Instance id

Database No String

Database name. If it is empty, query the role of all databases.

RoleType.N No Array of String

Role type: builtin_database - built-in database role, builtin_cluster - built-in cluster role, custom - custom role. Query all if left empty.

RoleName No String

Role name. Query all roles if left empty.

SearchKey No String

Common search keywords, fuzzy match inheritable roles and permissions relevant database name, role name, Action name, etc.

OrderBy No String

Sorting field, supports: RoleName, defaults to RoleName

OrderType No String

Sorting method: asc-ascending, desc-descending, defaults to asc

Offset No Integer

Pagination offset, defaults to 0

Limit No Integer

Number of items per page. Default: 20. Maximum: 100.

3. Output Parameters

Parameter Name Type Description
Total Integer

Total.

Roles Array of RoleInfo

List of characters.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 This API is used to query roles.

Input Example

POST / HTTP/1.1
Host: mongodb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeInstanceRoles
<Common request parameters>

{
    "InstanceId": "cmgo-********",
    "Database": "admin",
    "RoleType": [
        "builtin_database"
    ],
    "RoleName": "test1",
    "SearchKey": "t",
    "OrderBy": "RoleName",
    "OrderType": "desc",
    "Offset": 0,
    "Limit": 10
}

Output Example

{
    "Response": {
        "Roles": [],
        "Total": 0,
        "RequestId": "c746232b-75d3-4c34-aeef-60af9fd02ab6"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error.
InvalidParameter Parameter error
InvalidParameterValue.NotFoundInstance The instance was not found.

Ajuda e Suporte

Esta página foi útil?

comentários