GetEcsQuotaUsage
Queries the planned and actual resource usage of Elastic Compute Service (ECS) quotas for the tenant and region of the current call. You can aggregate CPU and memory metrics by average or maximum value. The maximum query time range is 7 days.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
odps:GetEcsQuotaUsage |
get |
*Quota
|
None | None |
Request syntax
GET /api/v1/quotas/ecs/{nickname}/usage HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| nickname |
string |
Yes |
The name of the ECS quota. This name is used to locate the request path and permission resources. The usage is calculated based on the tenant and region of the current call. |
example_ecs_quota |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| tenantId |
string |
No |
The tenant ID. The server uses the tenant associated with the current call. |
123456 |
| region |
string |
No |
The region ID. The server uses the region in the context of the current call. |
cn-hangzhou |
| from |
integer |
Yes |
The start time of the query. The time is a UNIX timestamp in seconds. |
1793520000 |
| to |
integer |
Yes |
The end time of the query. The time is a UNIX timestamp in seconds. The end time must be later than the start time, and the time range cannot exceed 7 days. |
1793523600 |
| aggMethod |
string |
No |
The metric aggregation method. Valid values: avg (average value, default) and max (maximum value). |
avg |
| subQuotaNickname |
string |
No |
The name of the sub-quota. The current implementation aggregates data by tenant and region. This parameter is not used for filtering. |
example_subquota |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The API response, which includes the request ID and ECS quota usage. |
||
| requestId |
string |
The request ID. You can use this ID to locate server call logs. |
EFAB5AA9-394A-5B28-81FB-A32F03C4DD13 |
| httpCode |
integer |
The HTTP status code. |
400 |
| errorCode |
string |
The error code returned when the call fails. |
InvalidParameter |
| errorMsg |
string |
The error message returned when the call fails. |
The specified parameter is invalid. |
| data |
object |
The metric data and chart configurations for ECS quota usage. |
|
| metrics |
object |
The time series of ECS quota usage, including the sampling time and the corresponding planned and actual resource usage. |
{"timestamps":[1726790400000],"planCount":[16],"runningCount":[12],"planCountMem":[64],"runningCountMem":[48]} |
| plot |
array<object> |
The chart configurations used to display CPU and memory usage. |
|
|
object |
The configuration of a single resource chart. |
||
| title |
string |
The title of the chart. |
CPU resources |
| type |
string |
The resource type of the chart. Valid values: cpu (CPU) and memory (memory). |
cpu |
| yAxis |
array |
The name of the metric displayed in the chart. |
|
|
string |
The name of a metric displayed in the chart. |
planCount |
Examples
Success response
JSON format
{
"requestId": "EFAB5AA9-394A-5B28-81FB-A32F03C4DD13",
"httpCode": 400,
"errorCode": "InvalidParameter",
"errorMsg": "The specified parameter is invalid.",
"data": {
"metrics": {
"timestamps": [
1726790400000
],
"planCount": [
16
],
"runningCount": [
12
],
"planCountMem": [
64
],
"runningCountMem": [
48
]
},
"plot": [
{
"title": "CPU resources",
"type": "cpu",
"yAxis": [
"planCount"
]
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.