Configuring a Monitoring by Seconds Policy
Function
This API is used to configure a Monitoring by Seconds policy for a DB instance. The policy takes effect about 5 minutes after you configure it.
Monitoring by Seconds at an interval of 1s or 5s is billed on a pay-per-use basis. You are charged once per hour.
Monitoring by Seconds policies of the primary instance and read replicas are independent from each other. Monitoring by Seconds is automatically disabled for instances with fewer than 4 vCPUs.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about the request header parameters.
Authorization Information
- If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| rds:instance:enableSecondLevelMonitoring | permission_management | instance | g:EnterpriseProjectId g:ResourceTag/<tag-key> | rds:log:switch | - |
Constraints
- This API is in OBT. To use this API, contact customer service.
- This API is available to only RDS for MySQL instances with 4 vCPUs or more.
URI
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Definition
Project ID of a tenant in a region.
To obtain the value, see Obtaining a Project ID.
Constraints
N/A
Range
N/A
Default Value
N/A
instance_id
Yes
Definition
Instance ID.
You can obtain the value of this parameter from id in Table 4 by calling the API for querying DB instances.
Constraints
N/A
Range
N/A
Default Value
N/A
Request
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| switch_option | Yes | Boolean | Definition Whether to enable Monitoring by Seconds. Constraints N/A Range
Default Value N/A |
| interval | No | Integer | Definition Monitoring interval, in seconds. Constraints This parameter is mandatory when switch_option is set to true. Range Enumerated values:
Default Value N/A |
Example Request
- Enable Monitoring by Seconds for a DB instance, with an interval set to 5s.
PUT https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/3d39c18788b54a919bab633874c159dfin01/second-level-monitor { "switch_option" : true, "interval" : 5 } - Disable Monitoring by Seconds.
{ "switch_option" : false }
Response
- Example normal response
- Abnormal response
For details, see Abnormal Response Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot