DescribeAccounts

最后更新时间:2021-10-12 17:21:24

1. API Description

Domain name for API request: cdb.tencentcloudapi.com.

This API (DescribeAccounts) is used to query information of all TencentDB accounts.

A maximum of 50 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 parameter. The value used for this API: DescribeAccounts.
Version Yes String Common parameter. The value used for this API: 2017-03-20.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
InstanceId Yes String Instance ID in the format of cdb-c1nl9rpv. It is the same as the instance ID displayed on the TencentDB Console page.
Offset No Integer Record offset. Default value: 0.
Limit No Integer Number of results to be returned for a single request. Value range: 1-100. Default value: 20.
AccountRegexp No String Regular expression for matching account names, which complies with the rules at MySQL official website.

3. Output Parameters

Parameter Name Type Description
TotalCount Integer Number of eligible accounts.
Items Array of AccountInfo Details of eligible accounts.
MaxUserConnections Integer The maximum number of instance connections (set by the MySQL parameter max_connections)
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Querying the information of all TencentDB accounts

Input Example

https://cdb.tencentcloudapi.com/?Action=DescribeAccounts
&InstanceId=cdb-f35wr6wj
&<Common request parameters>

Output Example

{
  "Response": {
    "RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7",
    "TotalCount": 2,
    "MaxUserConnections": 10240,
    "Items": [
      {
        "Notes": "test",
        "Host": "localhost",
        "User": "test_user",
        "ModifyTime": "2020-11-10 01:00:00",
        "ModifyPasswordTime": "2020-11-10 01:00:00",
        "CreateTime": "2020-11-10 01:00:00",
        "MaxUserConnections": 20
      },
      {
        "Notes": "test2",
        "Host": "localhost",
        "User": "root",
        "ModifyTime": "2020-11-10 01:00:00",
        "ModifyPasswordTime": "2020-11-10 01:00:00",
        "CreateTime": "2020-11-10 01:00:00",
        "MaxUserConnections": 20
      }
    ]
  }
}

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
FailedOperation.CreateAccountError Creation failed. Please check whether the user already exists.
FailedOperation.DBOperationActionError Database operation failed.
FailedOperation.GetPrivilegeError An error occurred while obtaining permissions.
FailedOperation.InstanceQueryError Query failed.
FailedOperation.PrivilegeDataIllegal The executed operation to modify permissions is invalid. You can refer to product documentation for more information about permissions that can be modified for this instance. If you have any questions, please contact customer service.
FailedOperation.ResponseValueError Exception with the backend request for the service. Please contact customer service.
FailedOperation.StartFlowError Failed to initiate the operation. Please try again later. If the operation remains unsuccessful, please contact customer service.
FailedOperation.SubmitAsyncTaskError Failed to submit the task. Please try again later. If the submission remains unsuccessful, please contact customer service.
InternalError.HttpError Exceptional HTTP request
InternalError.InternalAssertError Internal service error. Please contact customer service.
InternalError.InternalHttpServerError An exception occurred while executing the request.
InternalError.InternalRequestError The backend failed to request the service. Please contact customer service.
InternalError.RegexpCompileError Regular expression compilation error.
InternalError.UnknownError Unknown error
InvalidParameter Parameter error.
InvalidParameter.InstanceNotFound The instance does not exist.
InvalidParameterValue.AccountDescriptionCharacterError The account description contains special characters.
InvalidParameterValue.AccountDescriptionLengthError The account description should not exceed 255 characters.
InvalidParameterValue.AccountHostRuleError Incorrect format of the host parameter in the account.
InvalidParameterValue.AccountPasswordCharacterError The account password contains invalid characters.
InvalidParameterValue.AccountPasswordLengthError The account password is too long or too short.
InvalidParameterValue.AccountPasswordRuleError The password format is incorrect. It should contain 8 to 64 characters and must contain at least two character sets of the following: letters, digits, and special symbols (_+-&=!@#$%^*()).
InvalidParameterValue.InvalidParameterValueError Invalid parameter value
InvalidParameterValue.UserNameRuleError Incorrect format of the account username.
InvalidParameterValue.UserNotExistError The account does not exist.
InvalidParameterValue.VerifyAccountNoRootError No root account found.
InvalidParameterValue.VerifyAccountPasswordError Invalid account password.
InvalidParameterValue.VerifyAccountPrivError The account does not have the GRANT permission.
MissingParameter.AccountMissingParameterError Account-related parameters are missing.
OperationDenied.DeleteRootAccountError The root account cannot be deleted.
OperationDenied.NotSupportModifyLocalRootHostError The host information of the local root account cannot be modified.
ResourceNotFound.CdbInstanceNotFoundError The instance cannot be found. Please check whether your instance status is normal.
UnsupportedOperation.PrivilegesUnsupportedError Unsupported permission.