Domain name for API request: cdb.intl.tencentcloudapi.com.
This API is used to enable or disable the feature of sending CDB slow and error logs to CLS.
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: ModifyDBInstanceLogToCLS. |
| Version | Yes | String | Common Params. The value used for this API: 2017-03-20. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| InstanceId | Yes | String | Instance ID, which can be obtained through the DescribeDBInstances API. |
| LogType | Yes | String | Log type. Error: error log, slowlog: slow log. |
| Status | Yes | String | Delivery status. ON: enabled, OFF: disabled. |
| CreateLogset | No | Boolean | Whether required to create logset. Default to false. |
| Logset | No | String | Logset name when creating a logset; logset ID when selecting an existing logset. Empty by default. |
| CreateLogTopic | No | Boolean | Whether required to create log topic. Default to false. |
| LogTopic | No | String | Enter a log topic name when creating a log topic, or enter a log topic ID when selecting an existing log topic. Empty by default. |
| Period | No | Integer | Valid period of the log topic. Default value: 30 days if left empty. Maximum value: 3600 days. |
| CreateIndex | No | Boolean | Whether to create an index when creating a log topic. Defaults to false. |
| ClsRegion | No | String | CLS region. If left empty, it defaults to the Region parameter value. |
| ResourceTags.N | No | Array of TagInfoItem | Selectable when creating a log topic. Cannot exceed 10 tags |
| Parameter Name | Type | Description |
|---|---|---|
| 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. |
Ship slow logs and error logs of a CDB instance to CLS.
POST / HTTP/1.1
Host: cdb.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ModifyDBInstanceLogToCLS
<Common request parameters>
{
"InstanceId": "cdb-ewa3b",
"LogType": "error",
"Status": "ON",
"CreateLogset": true,
"Logset": "sub_fyrtjbqw",
"CreateLogTopic": true,
"LogTopic": "my_test",
"Period": 1,
"CreateIndex": true
}
{
"Response": {
"RequestId": "6EF60BEC-0242-43AF-BB20-270359FB54A7"
}
}
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 |
|---|---|
| InternalError.UnknownError | Unknown error |
| InvalidParameter.ControllerNotFoundError | This API was not found. |
| InvalidParameter.InvalidParameterError | Invalid parameter value |
| InvalidParameter.JsonUnmarshalError | Failed to deserialize JSON. |
| MissingParameter.MissingParamError | Required parameters are missing. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback