BatchExport

更新时间:
复制 MD 格式

Calls the BatchExport operation to export monitoring data defined in the Cursor operation.

Operation description

Prerequisites

Make sure that you have called the Cursor operation to obtain the initial Cursor.

Usage notes

This topic provides an example to show how to export the monitoring data of an initial Cursor of the metric cpu_idle of the cloud service acs_ecs_dashboard. A maximum of 1,000 data entries are returned per call.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:BatchExport

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Namespace

string

Yes

The data namespace of the cloud service.

For information about how to obtain the data namespace of a cloud service, see Appendix 1: Metrics.

Note

This parameter must be the same as the request parameter Namespace in the Cursor operation.

acs_ecs_dashboard

Metric

string

Yes

The name of the metric of the cloud service.

For information about how to obtain the name of a metric of a cloud service, see Appendix 1: Metrics.

Note

This parameter must be the same as the request parameter Metric in the Cursor operation.

cpu_idle

Cursor

string

Yes

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

  • When you call this operation for the first time, you must first call the Cursor operation to obtain the value of Cursor. For more information, see Cursor.

  • When you call this operation again, you can obtain the value of Cursor from the response of the last call.

eyJidWNrZXRzIjo0LCJjdXJzb3IiOiIxNjQxNDU0MzIwMDAwMWUxY2YxNWY0NTU0MTliZjllYTY4OWQ2ODI1OTU1Yzc1NmZjMDQ2OTMxMzczMzM2MzUzMTMxMzEzMzM0MzMzODM5MzEzMTMwMjQyYzY5MmQ3NTY2MzYzMjY3NmI2ZjM5MzU2YjY4MzAzMTYyNzg3MTcwNjkzMTM3MjQyYyIsImN1cnNvclZlcnNpb24iOiJxdWVyeSIsImVuZFRpbWUiOjE2NDE0NTQ3OTU4MjMsImV4cG9ydEVuZFRpbWUiOjE2NDE0NTQ3OTU4MjMsImV4cG9ydFN0YXJ0VGltZSI6MTY0MTQ1NDE5NTgyMywiZXhwcmVzc1JhbmdlIjpmYWxzZSwiaGFzTmV4dCI6dHJ1ZSwiaW5wdXRNZXRyaWMiOiJDUFVVdGlsaXphdGlvbiIsImlucHV0TmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJsaW1pdCI6MTAwMCwibG9nVGltZU1vZGUiOnRydWUsIm1hdGNoZXJzIjp7ImNoYWluIjpbeyJsYWJlbCI6InVzZXJJZCIsIm9wZXJhdG9yIjoiRVFVQUxTIiwidmFsdWUiOiIxNzM2NTExMTM0Mzg5MTEwIn1dfSwibWV0cmljIjoiQ1BVVXRpbGl6YXRpb24iLCJtZXRyaWNUeXBlIjoiTUVUUklDIiwibmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJuZXh0UGtBZGFwdGVyIjp7fSwib2Zmc2V0IjowLCJwYXJlbnRVaWQiOjEyNzA2NzY2Nzk1NDY3MDQsInN0YXJ0VGltZSI6MTY0MTQ1NDE5NTgyMywic3RlcCI6LTEsInRpbWVvdXQiOjEyMCwid2luZG93Ijo2****

Length

integer

Yes

The maximum number of data entries to return each time.

Valid values: 1 to 10000.

1000

Measurements

array

No

The measurements that are used to customize the returned data. By default, all measurements are returned.

For example, the metric cpu_idle of the cloud service acs_ecs_dashboard has three measurement columns: Average, Maximum, and Minimum. If you only need to return the Average and Maximum columns, set this parameter to the array ["Average", "Maximum"].

For information about how to obtain the measurements of a metric of a cloud service, see the statistics column of Appendix 1: Metrics.

string

No

The column name of the measurement.

Maximum

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

Response elements

Element

Type

Description

Example

object

None.

Message

string

The returned message.

success

Code

integer

The status code.

Note

The value 200 indicates success.

200

Success

boolean

Indicates whether the operation was successful. Valid values:

  • true: successful

  • false: failed

true

RequestId

string

The request ID.

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

Cursor

string

The cursor that is used to call this operation again.

Note

If the returned result is null, the monitoring data has been exported.

v2.5eyJidWNrZXRzIjo0LCJjdXJzb3IiOiIxNjQxNDU0ODAwMDAwMWUxY2YxNWY0NTU0MTliZjllYTY4OWQ2ODI1OTU1Yzc1NmZjMDQ2OTMxMzczMzM2MzUzMTMxMzEzMzM0MzMzODM5MzEzMTMwMjQyYzY5MmQzMjdhNjU2MjY3N2E2NjZhNzczOTY2NmM3Mjc0NjM3MzY5Njg3NDcyMjQyYyIsImN1cnNvclZlcnNpb24iOiJxdWVyeSIsImVuZFRpbWUiOjE2NDE0NTUyMzYxMTIsImV4cG9ydEVuZFRpbWUiOjE2NDE0NTUyMzYxMTIsImV4cG9ydFN0YXJ0VGltZSI6MTY0MTQ1NDYzNjExMiwiZXhwcmVzc1JhbmdlIjpmYWxzZSwiaGFzTmV4dCI6dHJ1ZSwiaW5wdXRNZXRyaWMiOiJDUFVVdGlsaXphdGlvbiIsImlucHV0TmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJsaW1pdCI6MTAwMCwibG9nVGltZU1vZGUiOnRydWUsIm1hdGNoZXJzIjp7ImNoYWluIjpbeyJsYWJlbCI6InVzZXJJZCIsIm9wZXJhdG9yIjoiRVFVQUxTIiwidmFsdWUiOiIxNzM2NTExMTM0Mzg5MTEwIn1dfSwibWV0cmljIjoiQ1BVVXRpbGl6YXRpb24iLCJtZXRyaWNUeXBlIjoiTUVUUklDIiwibmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJuZXh0UGtBZGFwdGVyIjp7fSwib2Zmc2V0IjowLCJwYXJlbnRVaWQiOjEyNzA2NzY2Nzk1NDY3MDQsInN0YXJ0VGltZSI6MTY0MTQ1NDYzNjExMiwic3RlcCI6LTEsInRpbWVvdXQiOjEyMCwid2luZG93Ijo2MH0***

Length

integer

The number of data entries returned for this call.

1000

Anchor

integer

The timestamp when the backend requested the data. A larger timestamp indicates that the exported data is closer to the current time.

1678781819000

HasNext

boolean

Indicates whether the data has been exported. Valid values:

  • true: Some data has not been exported.

  • false: All data has been exported.

true

DataResults

array

The data returned by this call.

MetricStat

The exported data. The details are as follows:

  • Namespace: the data namespace of the cloud service. Example: acs_ecs_dashboard.

  • Metric: the name of the metric of the cloud service. 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 Dimension information that is used to identify the monitored object (instance). Example: [{"Label":"userId", "Value":""20654616023382****"}, {"Label":"InstanceId", "Value":""i-2ze2d6j5uhg20x4****"}].

  • Associated: the additional information about the monitored object (instance), such as tag information. The value is a collection of key:value pairs. Example: {"group":"test****", "name":"Alice"}.

  • Measurements: the measurements of the metric (multi-value mode by default). Example: {"Average":60,"Maximum":85}.

  • LogTime: the record time of the monitoring data. Unit: milliseconds. For non-raw data (aggregated data), LogTime is empty (NULL).

Examples

Success response

JSON format

{
  "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 code

Error code

Error message

Description

400 %s %s
500 InternalError The request processing has failed due to some unknown error.
500 %s %s
403 %s %s
404 %s %s
503 %s %s

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.