Imports the monitoring data of a specified metric to a specified namespace of Hybrid Cloud Monitoring.

Prerequisites

Hybrid Cloud Monitoring is activated. For more information, see Activate Hybrid Cloud Monitoring.

Limit

The size of the monitoring data that you import at a time must be less than or equal to 1 MB.

Usage notes

This topic provides an example on how to import the monitoring data of the CPU_Usage metric to the default-aliyun namespace of Hybrid Cloud Monitoring.

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 PutHybridMonitorMetricData

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

Namespace String Yes default-aliyun

The name of the namespace.

For information about how to obtain the name of a namespace, see DescribeHybridMonitorNamespaceList.

MetricList.N.Name String Yes CPU_Usage

The name of the metric.

The name can contain letters, digits, and underscores (_). The name must start with a letter.

MetricList.N.Labels.N.Key String No IP

The tag key of the metric.

The key can contain letters, digits, and underscores (_). The key must start with a letter or an underscore (_).

Note You must specify a key and a value for a tag at the same time.
MetricList.N.Labels.N.Value String No 192.168.XX.XX

The tag value of the metric.

Note You must specify a key and a value for a tag at the same time.
MetricList.N.Value String Yes 90

The value of the metric.

The value is an integer or a floating-point number.

MetricList.N.TS Long No 1640776119473

The timestamp when the monitoring data is imported.

Unit: milliseconds. By default, the current timestamp is used.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
RequestId String 5DB1CBCA-D14A-55FA-814F-B4DBD9735F68

The ID of the request.

ErrorDetail Array of detail

The details of the invalid parameters.

If the request parameters that you set are invalid, the details of the invalid parameters are displayed.

Index Long 0

The position of the error message in the array.

ErrorMessage String label name :123 not match [a-zA-Z_][a-zA-Z0-9_]*

The error message of the invalid parameter.

Examples

Sample requests

http(s)://[Endpoint]/?Action=PutHybridMonitorMetricData
&MetricList.1.1ame=CPU_Usage
&MetricList.1.Value=90
&Namespace=default-aliyun
&<Common request parameters>

Sample success responses

XML format

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

<PutHybridMonitorMetricDataResponse>
	<RequestId>5DB1CBCA-D14A-55FA-814F-B4DBD9735F68</RequestId>
	<Code>200</Code>
</PutHybridMonitorMetricDataResponse>

JSON format

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

{
  "RequestId" : "5DB1CBCA-D14A-55FA-814F-B4DBD9735F68",
  "Code" : "200"
}

Error codes

For a list of error codes, visit the API Error Center.