Creates or updates a recording rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AddRecordingRule

The operation that you want to perform. Set the value to AddRecordingRule.

ClusterId String Yes cc7a37ee31aea4ed1a059eff8034b****

The ID of the cluster.

RuleYaml String Yes groups: - name: "recording_demo" rules: - expr: "sum(jvm_memory_max_bytes)" record: "rate_coredns_demo"

The recording rule.

RegionId String Yes cn-hangzhou

The ID of the region.

Response parameters

Parameter Type Example Description
RequestId String 9FEA6D00-317F-45E3-9004-7FB8B0B7****

The ID of the request.

Data String success

The status of the response.

Examples

Sample requests

http(s)://[Endpoint]/?Action=AddRecordingRule
&ClusterId=cc7a37ee31aea4ed1a059eff8034b****
&RuleYaml=groups: - name: "recording_demo"   rules:   - expr: "sum(jvm_memory_max_bytes)"     record: "rate_coredns_demo"
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<AddRecordingRuleResponse>
    <RequestId>9FEA6D00-317F-45E3-9004-7FB8B0B7****</RequestId>
    <Data>success</Data>
</AddRecordingRuleResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "9FEA6D00-317F-45E3-9004-7FB8B0B7****",
  "Data" : "success"
}