All Products
Search
Document Center

CloudMonitor:BatchExport

Last Updated:Jul 26, 2024

Exports the monitoring data that is defined in the Cursor operation.

Operation description

Prerequisites

The Cursor information is returned by calling the Cursor operation.

Description

This topic provides an example on how to export the monitoring data of the cpu_idle metric for Elastic Compute Service (ECS). The namespace of ECS is acs_ecs_dashboard. The Cursor information is specified. A maximum of 1,000 data entries can be returned in each response.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
NamespacestringYes

The namespace of the cloud service.

For more information about the namespaces of cloud services, see Appendix 1: Metrics.

Note The value of this parameter must be the same as the value of the request parameter Namespace in the Cursor operation.
acs_ecs_dashboard
MetricstringYes

The metric that is used to monitor the cloud service.

For more information about the metrics of cloud services, see Appendix 1: Metrics.

Note The value of this parameter must be the same as the value of the request parameter Metric in the Cursor operation.
cpu_idle
CursorstringYes

When you call this operation to export data, you must specify the Cursor parameter. You can obtain the value of the Cursor parameter by using one of the following methods:

  • When you call this operation for the first time, you must call the Cursor operation to obtain the Cursor value. For more information, see Cursor .
  • When you call this operation again, you can obtain the Cursor value from the returned data of the last call.
eyJidWNrZXRzIjo0LCJjdXJzb3IiOiIxNjQxNDU0MzIwMDAwMWUxY2YxNWY0NTU0MTliZjllYTY4OWQ2ODI1OTU1Yzc1NmZjMDQ2OTMxMzczMzM2MzUzMTMxMzEzMzM0MzMzODM5MzEzMTMwMjQyYzY5MmQ3NTY2MzYzMjY3NmI2ZjM5MzU2YjY4MzAzMTYyNzg3MTcwNjkzMTM3MjQyYyIsImN1cnNvclZlcnNpb24iOiJxdWVyeSIsImVuZFRpbWUiOjE2NDE0NTQ3OTU4MjMsImV4cG9ydEVuZFRpbWUiOjE2NDE0NTQ3OTU4MjMsImV4cG9ydFN0YXJ0VGltZSI6MTY0MTQ1NDE5NTgyMywiZXhwcmVzc1JhbmdlIjpmYWxzZSwiaGFzTmV4dCI6dHJ1ZSwiaW5wdXRNZXRyaWMiOiJDUFVVdGlsaXphdGlvbiIsImlucHV0TmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJsaW1pdCI6MTAwMCwibG9nVGltZU1vZGUiOnRydWUsIm1hdGNoZXJzIjp7ImNoYWluIjpbeyJsYWJlbCI6InVzZXJJZCIsIm9wZXJhdG9yIjoiRVFVQUxTIiwidmFsdWUiOiIxNzM2NTExMTM0Mzg5MTEwIn1dfSwibWV0cmljIjoiQ1BVVXRpbGl6YXRpb24iLCJtZXRyaWNUeXBlIjoiTUVUUklDIiwibmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJuZXh0UGtBZGFwdGVyIjp7fSwib2Zmc2V0IjowLCJwYXJlbnRVaWQiOjEyNzA2NzY2Nzk1NDY3MDQsInN0YXJ0VGltZSI6MTY0MTQ1NDE5NTgyMywic3RlcCI6LTEsInRpbWVvdXQiOjEyMCwid2luZG93Ijo2****
LengthintegerYes

The maximum number of data entries that can be returned in each response.

Valid values: 1 to 10000.

1000
MeasurementsarrayNo

The statistical methods used to customize the returned data. By default, the measurements based on all statistical methods are returned.

For example, the cpu_idle metric of ECS (acs_ecs_dashboard) has three statistical methods: Average, Maximum, and Minimum. If you want to return only the measurements based on the Average and Maximum statistical methods, set this parameter to ["Average", "Maximum"].

The statistical methods of metrics are displayed in the Statistics column on the Metrics page of each cloud service. For more information, see Appendix 1: Metrics.

stringNo

The statistical method.

Maximum

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

Response parameters

ParameterTypeDescriptionExample
object

None.

Messagestring

The returned message.

success
Codeinteger

The HTTP status code.

Note The status code 200 indicates that the request was successful.
200
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
RequestIdstring

The request ID.

251402CD-305C-1617-808E-D8C11FC8138D
Cursorstring

The Cursor information that is used to call this operation again.

Note If null is returned, the monitoring data is exported.
v2.5eyJidWNrZXRzIjo0LCJjdXJzb3IiOiIxNjQxNDU0ODAwMDAwMWUxY2YxNWY0NTU0MTliZjllYTY4OWQ2ODI1OTU1Yzc1NmZjMDQ2OTMxMzczMzM2MzUzMTMxMzEzMzM0MzMzODM5MzEzMTMwMjQyYzY5MmQzMjdhNjU2MjY3N2E2NjZhNzczOTY2NmM3Mjc0NjM3MzY5Njg3NDcyMjQyYyIsImN1cnNvclZlcnNpb24iOiJxdWVyeSIsImVuZFRpbWUiOjE2NDE0NTUyMzYxMTIsImV4cG9ydEVuZFRpbWUiOjE2NDE0NTUyMzYxMTIsImV4cG9ydFN0YXJ0VGltZSI6MTY0MTQ1NDYzNjExMiwiZXhwcmVzc1JhbmdlIjpmYWxzZSwiaGFzTmV4dCI6dHJ1ZSwiaW5wdXRNZXRyaWMiOiJDUFVVdGlsaXphdGlvbiIsImlucHV0TmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJsaW1pdCI6MTAwMCwibG9nVGltZU1vZGUiOnRydWUsIm1hdGNoZXJzIjp7ImNoYWluIjpbeyJsYWJlbCI6InVzZXJJZCIsIm9wZXJhdG9yIjoiRVFVQUxTIiwidmFsdWUiOiIxNzM2NTExMTM0Mzg5MTEwIn1dfSwibWV0cmljIjoiQ1BVVXRpbGl6YXRpb24iLCJtZXRyaWNUeXBlIjoiTUVUUklDIiwibmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJuZXh0UGtBZGFwdGVyIjp7fSwib2Zmc2V0IjowLCJwYXJlbnRVaWQiOjEyNzA2NzY2Nzk1NDY3MDQsInN0YXJ0VGltZSI6MTY0MTQ1NDYzNjExMiwic3RlcCI6LTEsInRpbWVvdXQiOjEyMCwid2luZG93Ijo2MH0***
Lengthinteger

The number of data entries returned in this call.

1000
Anchorlong

The timestamp of the data requested by the backend. A larger timestamp indicates that the data export time is closer to the current time.

1678781819000
HasNextboolean

Indicates whether the data has been exported. Valid values:

  • true: Some data is not exported.
  • false: All the data is exported.
true
DataResultsarray

The data returned in this call.

MetricStat

The exported data. The following parameters are involved:

  • Namespace: the namespace of the cloud service. Example: acs_ecs_dashboard.
  • Metric: the name of the metric. Example: cpu_idle.
  • Timestamp: the timestamp of the monitoring data. Unit: milliseconds. Example: 1641454680000.
  • Period: the statistical period of the monitoring data. Unit: seconds. Example: 60.
  • Dimensions: the dimensions used to identify the monitored instance, for example, [{"Label":"userId", "Value":""20654616023382****"}, {"Label":"InstanceId", "Value":""i-2ze2d6j5uhg20x4****"}].
  • Associated: the additional information about the monitored instance, such as the tags in key-value pairs. Example: {"group":"test****", "name":"Alice"}.
  • Measurements: the statistical methods of the metric. Multiple values are displayed by default. Example: {"Average":60,"Maximum":85}.
  • LogTime: the time when the monitoring data is recorded. Unit: milliseconds. For non-raw data (aggregated data), the value of LogTime is null.

Examples

Sample success responses

JSONformat

{
  "Message": "success",
  "Code": 200,
  "Success": true,
  "RequestId": "251402CD-305C-1617-808E-D8C11FC8138D",
  "Cursor": "v2.5eyJidWNrZXRzIjo0LCJjdXJzb3IiOiIxNjQxNDU0ODAwMDAwMWUxY2YxNWY0NTU0MTliZjllYTY4OWQ2ODI1OTU1Yzc1NmZjMDQ2OTMxMzczMzM2MzUzMTMxMzEzMzM0MzMzODM5MzEzMTMwMjQyYzY5MmQzMjdhNjU2MjY3N2E2NjZhNzczOTY2NmM3Mjc0NjM3MzY5Njg3NDcyMjQyYyIsImN1cnNvclZlcnNpb24iOiJxdWVyeSIsImVuZFRpbWUiOjE2NDE0NTUyMzYxMTIsImV4cG9ydEVuZFRpbWUiOjE2NDE0NTUyMzYxMTIsImV4cG9ydFN0YXJ0VGltZSI6MTY0MTQ1NDYzNjExMiwiZXhwcmVzc1JhbmdlIjpmYWxzZSwiaGFzTmV4dCI6dHJ1ZSwiaW5wdXRNZXRyaWMiOiJDUFVVdGlsaXphdGlvbiIsImlucHV0TmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJsaW1pdCI6MTAwMCwibG9nVGltZU1vZGUiOnRydWUsIm1hdGNoZXJzIjp7ImNoYWluIjpbeyJsYWJlbCI6InVzZXJJZCIsIm9wZXJhdG9yIjoiRVFVQUxTIiwidmFsdWUiOiIxNzM2NTExMTM0Mzg5MTEwIn1dfSwibWV0cmljIjoiQ1BVVXRpbGl6YXRpb24iLCJtZXRyaWNUeXBlIjoiTUVUUklDIiwibmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJuZXh0UGtBZGFwdGVyIjp7fSwib2Zmc2V0IjowLCJwYXJlbnRVaWQiOjEyNzA2NzY2Nzk1NDY3MDQsInN0YXJ0VGltZSI6MTY0MTQ1NDYzNjExMiwic3RlcCI6LTEsInRpbWVvdXQiOjEyMCwid2luZG93Ijo2MH0***",
  "Length": 1000,
  "Anchor": 1678781819000,
  "HasNext": true,
  "DataResults": [
    {
      "Namespace": "acs_ecs_dashboard",
      "Metric": "cpu_idle",
      "Period": 60,
      "Timestamp": 1641454680000,
      "Dimensions": [
        {
          "Label": "instanceId",
          "Value": "i-dferwret*****"
        }
      ],
      "Associated": {
        "key": "{\"group\":\"test****\", \"name\":\"Alice\"}"
      },
      "Measurements": {
        "key": "{\"Average\":60,\"Maximum\":85}"
      },
      "LogTime": 1683686550073
    }
  ]
}

Error codes

HTTP status codeError codeError message
400%s%s
500InternalErrorThe request processing has failed due to some unknown error.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history