Calculates the total number of usage records.
Operation description
Calculates the total number of usage records over a specified time range.
Try it now
Test
RAM authorization
Request syntax
POST /api/v1/computeMetrics/sumByRecord HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. For example: {"startDate":1775714495313,"endDate":1776232895313,"projectNames":["vw2","mcqa2_tpcds_test","bird"]} |
|
| projectNames |
array |
No |
The list of project names. |
|
|
string |
No |
The project name. |
projectName |
|
| startDate |
integer |
No |
The start of the time range to query, specified as a required Unix timestamp in milliseconds. |
1715393576201 |
| endDate |
integer |
No |
The end of the time range to query, specified as a required Unix timestamp in milliseconds. |
1718590596556 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. For example: { "data":[ { "dailyComputeRecords":[ { "dateTime":"20260409", "record":"494", "percentage":100.0 }, { "dateTime":"20260410", "record":"89", "percentage":100.0 }, { "dateTime":"20260411" }, { "dateTime":"20260412" }, { "dateTime":"20260413" }, { "dateTime":"20260414", "record":"9", "percentage":100.0 }, { "dateTime":"20260415" } ], "type":"$sum" }, { "dailyComputeRecords":[ { "dateTime":"20260409", "record":"494", "percentage":100.0 }, { "dateTime":"20260410", "record":"89", "percentage":100.0 }, { "dateTime":"20260411" }, { "dateTime":"20260412" }, { "dateTime":"20260413" }, { "dateTime":"20260414", "record":"9", "percentage":100.0 }, { "dateTime":"20260415" } ], "type":"ComputationSql" } ], "requestId":"0adbdcee17762496758954804d0001" } |
||
| requestId |
string |
The request ID. |
0a06dfe517540143853845404e83af |
| httpCode |
integer |
The HTTP status code.
|
200 |
| data |
array<object> |
The response data. |
|
|
array<object> |
An object containing usage data for a specific usage type. |
||
| type |
string |
The usage type. For example: ComputationSql |
ComputationSql |
| dailyComputeRecords |
array<object> |
A list of daily usage records. |
|
|
object |
A daily usage record. |
||
| dateTime |
string |
The statistics date. The format is yyyyMMdd. |
20260411 |
| record |
string |
The record count. |
1200 |
| percentage |
number |
This day's usage as a percentage of the total usage for the specified period. The value does not include a percent sign (%). |
50 |
Examples
Success response
JSON format
{
"requestId": "0a06dfe517540143853845404e83af",
"httpCode": 200,
"data": [
{
"type": "ComputationSql",
"dailyComputeRecords": [
{
"dateTime": "20260411",
"record": "1200",
"percentage": 50
}
]
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.