Batch Query Data Interface

BCM

  • Function Release Records
  • Product Announcement
    • Site Monitor Billing Announcement
  • Product Description
    • Product Introduction
    • Core concepts
    • Product advantages
    • Product features
  • Product pricing
    • Product pricing
    • Site Monitor Pricing
  • Quick Start
  • Operation guide
    • Enter Cloud Monitor
    • Dashboard
      • Overview
      • Management Dashboard Charts
      • Management Dashboard
    • Alarm Service
      • Overview
      • Alarm strategy
      • Alarm history
      • Alarm Template
      • Alarm Notification Template
      • Alarm callback
    • Cloud product monitor
      • Instance monitor
      • Instance Group
      • View Metrics
    • Site Monitor
      • Timed Detection (Formerly Site Monitor)
        • Overview
        • Manage Timed Probe Tasks
        • Purchase Guide
        • View timed probe tasks
      • IP advanced fault diagnosis
        • Manage IP Advanced Fault Diagnosis Tasks
        • View IP Advanced Fault Diagnosis Tasks
      • Instant probe
        • Overview
        • Manage instant probe tasks
    • Event Monitor
    • Event Bus
      • Event Delivery History
      • Overview
      • Event summary
      • Event Set
      • Event Rules
        • Event Rules
        • Event content conversion
        • Event pattern
  • API Reference
    • Overview
    • Service domain
    • Error response
    • Query Monitoring Data for Partial Dimensions
    • Dashboard API
    • Common Request and Response Headers
    • Alarm Management API
    • Alarm Management Interface V2
    • Alarm history
    • Push Data API
    • Event Bus Push
    • Application Monitor
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Instance Group Interface
    • Site Monitor
    • Query Latest Metric Data for Partial Dimensions
    • General Description
    • Query Data API
    • Event Monitor
    • Instant Probe
    • Event Alarm History
    • Notification Template
  • Java-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Batch Query Data Interface
    • Alarm History-related APIs
  • Python-SDK
    • Overview
    • Initialization
    • Install SDK
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy List API
    • Batch Data Query Interface
  • Go-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Alarm History-related APIs
    • Batch Data Query Interface
  • BCM-Agent
    • Functions
    • Monitoring Trend Chart
    • BCM-Agent-Frequently Asked Questions
    • Appendix
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
    • Performance-related questions
  • Cloud Product Monitor List
    • Cloud Product Metric List (Legacy Version Hidden)
    • Cloud Product Monitor Object Type List
    • Cloud Product Event List
    • Cloud Product Metric List
      • Database
        • Cloud Database TableStorage
        • Cloud Database DocDB for MongoDB
        • Data transmission service (DTS)
        • Cloud native database GaiaDB
        • Vector Database (VectorDB)
        • Dedicated Database Cluster (DDC)
        • Cloud Database Redis
        • Cloud database RDS
        • Cloud Database HBase
      • Enterprise Application
        • Message Service for RabbitMQ
      • Network
        • Service Network Interface Card (SNIC)
        • Peering Connections
        • IPv6 gateway
        • NAT Gateway
        • Load Balancer Dedicated Cluster LBDC
        • Baidu Load Balance (BLB)
        • Network probe NP
        • Dedicated channel
        • Elastic IP EIP
        • Elastic Network Interface Card (ENIC)
        • Cloud Smart Network (CSN)
        • Dedicated gateway
        • Virtual Private Network (VPN) Gateway
        • Layer 2 Gateway LTGW
        • Physical dedicated line
      • Intelligent Big Data
        • MapReduce BMR
        • Message service for Kafka-dedicated
        • Message Service for RocketMQ
        • Baidu Stream Computing (BSC)
        • Baidu Elasticsearch
        • Log Service BLS
        • Data warehouse DORIS
      • Cloud native
        • Cloud Function Computing
        • Baidu container instance (BCI)
      • Compute
        • Baidu Cloud Compute (BCC)
        • Elastic Baremetal Compute BBC
      • Storage and CDN
        • Parallel Filesystem Service (PFS)
        • Cloud File System (CFS)
        • Content delivery network (CDN)
        • Baidu object storage (BOS)
        • Cloud Disk Server (CDS)
        • Baidu edge computing (BEC)
      • Website service
        • Baidu Cloud Virtual Host (BCH)
      • Large Model Platform
        • Qianfan Large Model Platform ModelBuilder
  • Typical Practices
    • Scenarios for Batch Creation of Alarm Strategies
    • Usage Scenarios for Different Notification Channels
  • Service Level Agreement (SLA)
    • Site Monitor Service Level Agreement SLA
  • BCM-Tool
    • Uninstallation Method
    • Installation method
    • BCM-Tool-Frequently Asked Questions
    • Functions
    • Multi-Region Service
    • Application method
All documents
menu
No results found, please re-enter

BCM

  • Function Release Records
  • Product Announcement
    • Site Monitor Billing Announcement
  • Product Description
    • Product Introduction
    • Core concepts
    • Product advantages
    • Product features
  • Product pricing
    • Product pricing
    • Site Monitor Pricing
  • Quick Start
  • Operation guide
    • Enter Cloud Monitor
    • Dashboard
      • Overview
      • Management Dashboard Charts
      • Management Dashboard
    • Alarm Service
      • Overview
      • Alarm strategy
      • Alarm history
      • Alarm Template
      • Alarm Notification Template
      • Alarm callback
    • Cloud product monitor
      • Instance monitor
      • Instance Group
      • View Metrics
    • Site Monitor
      • Timed Detection (Formerly Site Monitor)
        • Overview
        • Manage Timed Probe Tasks
        • Purchase Guide
        • View timed probe tasks
      • IP advanced fault diagnosis
        • Manage IP Advanced Fault Diagnosis Tasks
        • View IP Advanced Fault Diagnosis Tasks
      • Instant probe
        • Overview
        • Manage instant probe tasks
    • Event Monitor
    • Event Bus
      • Event Delivery History
      • Overview
      • Event summary
      • Event Set
      • Event Rules
        • Event Rules
        • Event content conversion
        • Event pattern
  • API Reference
    • Overview
    • Service domain
    • Error response
    • Query Monitoring Data for Partial Dimensions
    • Dashboard API
    • Common Request and Response Headers
    • Alarm Management API
    • Alarm Management Interface V2
    • Alarm history
    • Push Data API
    • Event Bus Push
    • Application Monitor
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Instance Group Interface
    • Site Monitor
    • Query Latest Metric Data for Partial Dimensions
    • General Description
    • Query Data API
    • Event Monitor
    • Instant Probe
    • Event Alarm History
    • Notification Template
  • Java-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Batch Query Data Interface
    • Alarm History-related APIs
  • Python-SDK
    • Overview
    • Initialization
    • Install SDK
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy List API
    • Batch Data Query Interface
  • Go-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Alarm History-related APIs
    • Batch Data Query Interface
  • BCM-Agent
    • Functions
    • Monitoring Trend Chart
    • BCM-Agent-Frequently Asked Questions
    • Appendix
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
    • Performance-related questions
  • Cloud Product Monitor List
    • Cloud Product Metric List (Legacy Version Hidden)
    • Cloud Product Monitor Object Type List
    • Cloud Product Event List
    • Cloud Product Metric List
      • Database
        • Cloud Database TableStorage
        • Cloud Database DocDB for MongoDB
        • Data transmission service (DTS)
        • Cloud native database GaiaDB
        • Vector Database (VectorDB)
        • Dedicated Database Cluster (DDC)
        • Cloud Database Redis
        • Cloud database RDS
        • Cloud Database HBase
      • Enterprise Application
        • Message Service for RabbitMQ
      • Network
        • Service Network Interface Card (SNIC)
        • Peering Connections
        • IPv6 gateway
        • NAT Gateway
        • Load Balancer Dedicated Cluster LBDC
        • Baidu Load Balance (BLB)
        • Network probe NP
        • Dedicated channel
        • Elastic IP EIP
        • Elastic Network Interface Card (ENIC)
        • Cloud Smart Network (CSN)
        • Dedicated gateway
        • Virtual Private Network (VPN) Gateway
        • Layer 2 Gateway LTGW
        • Physical dedicated line
      • Intelligent Big Data
        • MapReduce BMR
        • Message service for Kafka-dedicated
        • Message Service for RocketMQ
        • Baidu Stream Computing (BSC)
        • Baidu Elasticsearch
        • Log Service BLS
        • Data warehouse DORIS
      • Cloud native
        • Cloud Function Computing
        • Baidu container instance (BCI)
      • Compute
        • Baidu Cloud Compute (BCC)
        • Elastic Baremetal Compute BBC
      • Storage and CDN
        • Parallel Filesystem Service (PFS)
        • Cloud File System (CFS)
        • Content delivery network (CDN)
        • Baidu object storage (BOS)
        • Cloud Disk Server (CDS)
        • Baidu edge computing (BEC)
      • Website service
        • Baidu Cloud Virtual Host (BCH)
      • Large Model Platform
        • Qianfan Large Model Platform ModelBuilder
  • Typical Practices
    • Scenarios for Batch Creation of Alarm Strategies
    • Usage Scenarios for Different Notification Channels
  • Service Level Agreement (SLA)
    • Site Monitor Service Level Agreement SLA
  • BCM-Tool
    • Uninstallation Method
    • Installation method
    • BCM-Tool-Frequently Asked Questions
    • Functions
    • Multi-Region Service
    • Application method
  • Document center
  • arrow
  • BCM
  • arrow
  • Java-SDK
  • arrow
  • Batch Query Data Interface
Table of contents on this page
  • API description
  • API restriction
  • Request parameters
  • Response parameters
  • ErrorMetricData
  • SuccessMetricData
  • Dimension
  • DataPoint
  • Request example
  • Response result

Batch Query Data Interface

Updated at:2025-11-03

API description

API for retrieving batch instance data, supporting multi-dimensional and multi-metric queries, including data from Cloud Product Monitor, Site Monitor, or custom monitor data you've pushed.

API restriction

• The maximum number of DataPoints returned for any metric of an instance in one response is 1,440.

Request parameters

Name Types Description Required or not Parameter location
userId String Tenant ID Yes URL parameter
scope String, limited to the following character set: 0~9, A~Z, a~z, _ Scope Yes URL parameter
metricName String, limited to the following character set: "0~9, A~Z, a~z", "_"
. When searching for multiple Metrics, use a String array, with each array element being a Metric.
Monitor Metric name Yes Query
statistics Statistics, in statistics1, statistics2, statistics3 format, options: average, maximum, minimum, sum, sampleCount Statistic Method Type Yes Query
dimensions String, composed of dimensionName:dimensionValue. When a Metric has multiple Dimensions, connect them with semicolons, e.g., dimensionName:dimensionValue;dimensionName:dimensionValue. Only one dimension value can be specified for the same dimension.
When querying batch instance data, connect complete dimensions of each instance with commas, e.g., dimensionName:dimensionValue,dimensionName:dimensionValue
Dimension list Yes Query
startTime DateTime, refer to [Date and Time](BCM/API Reference/General Description.md#Date and time regulations), expressed in UTC date Query start time Yes Query
endTime DateTime, refer to [Date and Time](BCM/API Reference/General Description.md#Date and time regulations), expressed in UTC date Query end time Yes Query
periodInSecond int, multiple of 60, unit: second (s) Statistical Period Yes Query

Parameter explanation

  • For concepts like Scope, Metric, Statistic, and Dimension, refer to [Core Concepts](BCM/Product Description/Core concepts.md).

Response parameters

Name Types Description
requestId String Request identifier
code String Return code
message String Error message
errorList List<ErrorMetricData> Invalid Monitor Metrics
successList List<SuccessMetricData> Successful Monitor Metrics

ErrorMetricData

Name Types Description
metricName String Metric name
message String Error message
dimensions List<Dimension> Dimension Information

SuccessMetricData

Name Types Description
metricName String Metric name
dimensions List<Dimension> Dimension Information
dataPoints List<DataPoint> Monitor Metric

Dimension

Name Types Description
name String Dimension name
value String Dimension value

DataPoint

Name Types Description
average double Average of Metrics within the statistical period
sum double Sum of Metrics within the statistical period
minimum double Minimum value of Metrics within the statistical period
maximum double Maximum value of Metrics within the counting cycle
sampleCount int Number of DataPoints for the Metric within the statistical period
timestamp String Time corresponding to the statistical period of Monitor item, expressed in UTC date

Request example

Java
1// params definition
2String endpoint = "bcm.bj.baidubce.com";
3String userId = "453bf9********************9090dc";
4String ak = "ALTA********************YG";
5String sk = "b2c5************************3ac1";
6String scope ="BCE_BCC";
7String dimensions = "InstanceId:i-YB****4F,InstanceId:i-R6****xl";
8String[] metrics = {"CPUUsagePercent", "MemUsedPercent"};
9Statistics[] statistics = {Statistics.average, Statistics.maximum};
10long now = System.currentTimeMillis();
11String startTime = DateUtils.formatAlternateIso8601Date(new Date(now - 60 * 60 * 1000));
12String endTime = DateUtils.formatAlternateIso8601Date(new Date(now));
13int periodInSecond = 60;
14// create a bcm client
15BcmClientConfiguration config = new BcmClientConfiguration();
16config.setCredentials(new DefaultBceCredentials(ak, sk));
17config.setEndpoint(endpoint);
18BcmClient client = new BcmClient(config);
19// query metric data from bcm interface
20ListMetricDataRequest request = new ListMetricDataRequest();
21request.withUserId(userId)
22        .withScope(scope)
23        .withDimensions(dimensions)
24        .withMetricNames(metrics)
25        .withPeriodInSecond(periodInSecond)
26        .withStartTime(startTime)
27        .withEndTime(endTime)
28        .withStatistics(statistics);
29ListMetricDataResponse response = client.getMetricData(request);
30System.out.println(JsonUtils.toJsonString(response));

Response result

Plain Text
1{
2    "metadata": {
3        "bceRequestId": "024348c6-1ef4-4ee5-a411-c48ddf6b9cdd"
4    },
5    "requestId": "024348c6-1ef4-4ee5-a411-c48ddf6b9cdd",
6    "code": "OK",
7    "message": "",
8    "errorList": null,
9    "successList": [
10        {
11            "metricName": "MemUsedPercent",
12            "dimensions": [
13                {
14                    "name": "InstanceId",
15                    "value": "i-YB****4F"
16                }
17            ],
18            "dataPoints": [
19                {
20                    "average": 5.974418891389501,
21                    "sum": null,
22                    "maximum": 5.974689065937,
23                    "minimum": null,
24                    "sampleCount": null,
25                    "value": null,
26                    "timestamp": "2024-04-11T07:01:00Z"
27                }
28            ]
29        },
30        {
31            "metricName": "CPUUsagePercent",
32            "dimensions": [
33                {
34                    "name": "InstanceId",
35                    "value": "i-R6****xl"
36                }
37            ],
38            "dataPoints": [
39                {
40                    "average": 0.4166418167165,
41                    "sum": null,
42                    "maximum": 0.483133433283,
43                    "minimum": null,
44                    "sampleCount": null,
45                    "value": null,
46                    "timestamp": "2024-04-11T07:01:00Z"
47                }
48            ]
49        },
50        {
51            "metricName": "MemUsedPercent",
52            "dimensions": [
53                {
54                    "name": "InstanceId",
55                    "value": "i-R6****xl"
56                }
57            ],
58            "dataPoints": [
59                {
60                    "average": 4.961740077942499,
61                    "sum": null,
62                    "maximum": 4.97271004918,
63                    "minimum": null,
64                    "sampleCount": null,
65                    "value": null,
66                    "timestamp": "2024-04-11T07:01:00Z"
67                }
68            ]
69        },
70        {
71            "metricName": "CPUUsagePercent",
72            "dimensions": [
73                {
74                    "name": "InstanceId",
75                    "value": "i-YB****4F"
76                }
77            ],
78            "dataPoints": [
79                {
80                    "average": 0.466666770871,
81                    "sum": null,
82                    "maximum": 0.599941845894,
83                    "minimum": null,
84                    "sampleCount": null,
85                    "value": null,
86                    "timestamp": "2024-04-11T07:01:00Z"
87                }
88            ]
89        }
90    ]
91}

Previous
Alarm Strategy-related APIs
Next
Alarm History-related APIs