Domain name for API request: tdmysql.intl.tencentcloudapi.com.
This API is used to query user permissions.
A maximum of 20 requests can be initiated per second for this API.
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: DescribeUserPrivileges. |
| Version | Yes | String | Common Params. The value used for this API: 2021-11-22. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| InstanceId | Yes | String | Instance ID, such as tdsql3-5baee8df. |
| Host | Yes | String | Accessing host allowed for the user. Username+host uniquely determines an account. |
| UserName | Yes | String | Login username. |
| DbName | Yes | String | Database name. If it is *, query global permission (*.*) and ignore the Type and Object parameter. |
| Object | No | String | The name of the specific Type, for example, when Type is table, it is exactly the table name. If both DbName and Type are function names, Object represents the specific object name and cannot be * or empty. |
| ObjectType | No | String | Type, can be set to table, view, proc, func, and *. When DbName is a specific database name and Type is *, it queries the database permission (i.e., db.*), ignoring the Object parameter. |
| ColName | No | String | When Type=table, ColName as * indicates the permission to query the table. If it is a specific field name, it indicates the permission to query the corresponding field. |
| Parameter Name | Type | Description |
|---|---|---|
| Privileges | Array of String | Permission list Note: This field may return null, indicating that no valid values can be obtained. |
| 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. |
POST / HTTP/1.1
Host: tdmysql.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeUserPrivileges
<Common request parameters>
{
"UserName": "qt4s_test",
"InstanceId": "tdsql3-0b2f04e0",
"Object": "sbtest10",
"Host": "%",
"DbName": "test",
"ObjectType": "table"
}
{
"Response": {
"Privileges": [],
"RequestId": "40b596e8-0b33-48ce-bd61-a2a5891a0920"
}
}
POST / HTTP/1.1
Host: tdmysql.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeUserPrivileges
<Common request parameters>
{
"UserName": "string",
"InstanceId": "tdsql3-267841d2",
"Object": "string",
"ColName": "String",
"Host": "%",
"DbName": "string",
"ObjectType": "string"
}
{
"Response": {
"Privileges": [],
"RequestId": "cae0499f-194e-4fec-a46a-9c42eaaeb753"
}
}
POST / HTTP/1.1
Host: tdmysql.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeUserPrivileges
<Common request parameters>
{
"UserName": "string",
"InstanceId": "tdsql3-267841d2",
"Object": "string",
"ColName": "String",
"Host": "%",
"DbName": "string",
"ObjectType": "string"
}
{
"Response": {
"Privileges": [],
"RequestId": "7ac86126-4006-43aa-9dad-267e2f5ff0d8"
}
}
POST / HTTP/1.1
Host: tdmysql.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeUserPrivileges
<Common request parameters>
{
"UserName": "qt4s_test",
"InstanceId": "tdsql3-789a2481",
"Host": "%",
"DbName": "test",
"ObjectType": "table"
}
{
"Response": {
"Privileges": null,
"RequestId": "949d8d5e-3622-4a81-9c47-7af93613eeb5"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
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.DBQueryPrivilegesError | Query user permission error. |
| InvalidParameterValue.CheckHostError | host verification failed. |
| InvalidParameterValue.CheckNameError | Name verification failed. |
| OperationDenied.InstanceStatusError | Incorrect instance status |
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan