Querying the Tenant Quotas¶
Function¶
This API is used to query the default instance quota and total memory quota of a tenant and the maximum and minimum quotas a tenant can apply for. Different tenants have different quotas in different regions.
URI¶
GET /v2/{project_id}/quota
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Project ID. For details, see Obtaining a Project ID. |
Request Parameters¶
None
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
unit | String | Resource unit.
|
min | Integer | Minimum limit of instance quota when type is set to instance.
|
max | Integer | Maximum limit of instance quota when type is set to instance.
|
quota | Integer | Maximum number of instances that can be created and maximum allowed total memory. |
used | Integer | Number of created instances and used memory. |
type | String | The value can be instance or ram.
|
Status code: 400
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Status code: 500
Parameter | Type | Description |
---|---|---|
error_msg | String | Error message. Maximum: 1024 |
error_code | String | Error code. Maximum: 9 |
error_ext_msg | String | Extended error information. This parameter is not used currently and is set to null. Maximum: 1024 |
Example Requests¶
GET https://{dcs_endpoint}/v2/{project_id}/quota
Example Responses¶
Status code: 200
Tenant quota queried successfully.
{
"quotas" : {
"resources" : [ {
"unit" : { },
"min" : 1,
"max" : 10,
"quota" : 10,
"used" : 3,
"type" : "instance"
}, {
"unit" : "GB",
"min" : 1,
"max" : 800,
"quota" : 800,
"used" : 22,
"type" : "ram"
} ]
}
}
Status Codes¶
Status Code | Description |
---|---|
200 | Tenant quota queried successfully. |
400 | Invalid request. |
500 | Internal service error. |
Error Codes¶
See Error Codes.