Updated on 2022-02-21 GMT+08:00

Querying the Quota of a Tenant

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 /v1.0/{project_id}/quota

Table 1 describes the parameter.
Table 1 Parameter description

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID

Request

Request parameters

None

Example request

None

Response

Response parameters

Table 2 describes the response parameters.
Table 2 Parameter description

Parameter

Type

Mandatory

Description

quotas

JSON

Yes

Quota information. For details, see Table 3.

Table 3 quotas parameter description

Parameter

Type

Mandatory

Description

resources

Array

Yes

List of quotas. For details, see Table 4.

resource_user

JSON

Yes

Information about a resource tenant For details, see Table 5.

Table 4 resources parameter description

Parameter

Type

Description

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

Values:

  • instances: indicates the instance quota.
  • ram: indicates the memory quota.

unit

String

Resource unit.

  • When type is set to instance, no value is returned.
  • When type is set to ram, GB is returned.

max

Integer

  • Indicates the maximum limit of instance quota when type is set to instance.
  • Indicates the maximum limit of memory quota when type is set to ram.

min

Integer

  • Indicates the minimum limit of instance quota when type is set to instance.
  • Indicates the minimum limit of memory quota when type is set to ram.
Table 5 resource_user parameter description

Parameter

Type

Description

tenant_id

String

Resource tenant ID

tenant_name

Integer

Resource tenant name

Example response
{
    "quotas": {
        "resources": [
            {
                "quota": 10,
                "used": 3,
                "type": "instance",
                "min": 1,
                "max": 10,
                "unit": null
            },
            {
                "quota": 800,
                "used": 22,
                "type": "ram",
                "min": 1,
                "max": 800,
                "unit": "GB"
            }
        ],
        "resource_user": {
            "tenant_id": "836152f9838a44089f40f3cf6fd432bf",
            "tenant_name": "op_svc_dcs_003"
        }
    }
}

Status Code

Table 6 describes the status code of successful operations. For details about other status codes, see Table 1.

Table 6 Status code

Status Code

Description

200

Tenant quota queried successfully.