Updated on 2024-08-28 GMT+08:00

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 is billed on a pay-per-use basis. You are charged by the 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 an API, you need to understand the API in Authentication.

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

  • URI format

    PUT /v3/{project_id}/instances/{instance_id}/second-level-monitor

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID of a tenant in a region.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    instance_id

    Yes

    Instance ID.

Request

Table 2 Parameters

Parameter

Mandatory

Type

Description

switch_option

Yes

Boolean

Whether to enable Monitoring by Seconds.

  • true: indicates that Monitoring by Seconds will be enabled.
  • false: indicates that Monitoring by Seconds will be disabled.

interval

No

Integer

Monitoring interval, which can be 1s or 5s.

Enumerated values:

  • 1
  • 5

Example Request

  • Enable Monitoring by Seconds for a DB instance, with monitoring interval set to 1s.
    PUT https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/3d39c18788b54a919bab633874c159dfin01/second-level-monitor
    
    {
      "switch_option" : true,
      "interval" : 1
    }
  • Disable Monitoring by Seconds.
    {
      "switch_option" : false
    }

Response

Status Code

Error Code

For details, see Error Codes.