Queries the quotas of a specific Alibaba Cloud service.
Operation description
In this example, the operation is called to query the quotas whose instance type is ecs.g5.2xlarge
. The quotas belong to Elastic Compute Service (ECS) Quotas by Instance Type. The query result includes the name, ID, unit, dimensions, and cycle of each quota.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
quotas:ListProductQuotas | list |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
NextToken | string | No | The pagination token that is used in the next request to retrieve a new page of results.
| 1 |
MaxResults | integer | No | The maximum number of records that can be returned for the query. Valid values: 1 to 100. Default value: 30. | 30 |
ProductCode | string | Yes | The abbreviation of the Alibaba Cloud service name. Note
To query the abbreviation of an Alibaba Cloud service name, call the ListProducts operation and check the value of the ProductCode parameter.
| ecs-spec |
QuotaActionCode | string | No | The quota ID. | ecs.g5.2xlarge |
KeyWord | string | No | The keyword that you want to use to search for the quotas. Note
This parameter is available only for quotas that belong to ECS Quotas by Instance Type. The keyword is used to match the values of QuotaName and QuotaActionCode .
| ecs-spec |
SortField | string | No | The field based on which you want to sort the returned records. Note
This parameter is available only for quotas that belong to ECS Quotas by Instance Type. You can leave this parameter empty.
Valid values:
| TIME |
SortOrder | string | No | The order in which you want to sort the returned records. Note
This parameter is available only for quotas that belong to ECS Quotas by Instance Type. You can leave this parameter empty.
Valid values:
| Ascending |
Dimensions | array<object> | No | The quota dimensions. | |
object | No | The quota dimension. | ||
Key | string | No | The key of the dimension. Note
The value range of N varies based on the number of dimensions that are supported by the related Alibaba Cloud service.
| regionId |
Value | string | No | The value of the dimension. Note
The value range of N varies based on the number of dimensions that are supported by the related Alibaba Cloud service.
| cn-hangzhou |
QuotaCategory | string | No | The quota type. Default value: CommonQuota. Valid values:
| FlowControl |
GroupCode | string | No | The code of the dimension group. | entconsole_w1j3msbo2g |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"MaxResults": 1,
"NextToken": "AAAAAd98/tlL5GF2aM7UMKQGM8LZesIPr0CbfxASQvHV/pwcmVKNfdBbW8OPld3NvG9Cy8+dNcyFzyUttQA3IONfBhRGpXFyiVoTgK+dupBsP2mX",
"Quotas": [
{
"Adjustable": true,
"ApplicableRange": [
0
],
"ApplicableType": "discontinuous",
"ApplyReasonTips": "The business xxx is expected to grow by 50%.\n",
"Consumable": true,
"Dimensions": {
"regionId": "cn-hangzhou"
},
"EffectiveTime": "2022-09-28T06:07:00Z",
"ExpireTime": "2022-09-29T06:07:00Z",
"GlobalQuota": true,
"Period": {
"PeriodUnit": "day",
"PeriodValue": 1
},
"ProductCode": "ecs-spec",
"QuotaActionCode": "ecs.g5.2xlarge",
"QuotaArn": "acs:quotas:cn-hangzhou:107992689699****:quota/ecs/ecs.g5.2xlarge/postpaid/vpc/cn-hangzhou/instancetype/cn-hangzhou-i",
"QuotaCategory": "CommonQuota",
"QuotaDescription": "ecs.g5.2xlarge",
"QuotaItems": [
{
"Quota": "10",
"QuotaUnit": "AMOUNT",
"Type": "BaseQuota",
"Usage": "1"
}
],
"QuotaName": "ecs.g5.2xlarge",
"QuotaType": "privilege",
"QuotaUnit": "AMOUNT",
"SupportedRange": [
0
],
"TotalQuota": 200,
"TotalUsage": 1,
"UnadjustableDetail": "applicationProcess",
"UsageMetric": {
"MetricDimensions": {
"key": "ecs"
},
"MetricName": "Usage",
"MetricNamespace": "acs_quotas_flowcontrol"
}
}
],
"RequestId": "D0131FD5-5397-44FE-BF5A-4B7165B813CC",
"TotalCount": 4
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidSortOrder | Invalid SortOrder | The specified SortOrder parameter is invalid. |
400 | INVALID.MAX.RESULTS | The maxResults parameter is invalid. Use an integer ranging from 1 to 100. | The maxResults value is invalid. It must be an integer within the range of 1 to 100. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-11-07 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-09-22 | API Description Update. The Error code has changed | View Change Details |
2023-06-28 | The Error code has changed. The response structure of the API has changed | View Change Details |
2022-12-02 | The Error code has changed. The response structure of the API has changed | View Change Details |