Help Center> Distributed Cache Service> API Reference> Other APIs> Querying the Quota of a Tenant (V2)

Querying the Quota of a Tenant (V2)

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.

Constraints

None

URI

GET /v2/{project_id}/quota

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request

None

Response

If the status code is 200, the following parameters are returned:

Table 2 Response parameters

Parameter

Type

Description

quotas

quotas object

Quota information.

Table 3 quotas

Parameter

Type

Description

resources

Array of Resources objects

List of quotas.

Table 4 Resources

Parameter

Type

Description

unit

String

Resource unit.

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

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.

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.

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

Options:

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

Example Request

GET https://{dcs_endpoint}/v2/{project_id}/quota

Example Response

If the status code is 200, the tenant quota is successfully queried.

{
	"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 Code

Status Code

Description

200

Tenant quota queried successfully.

400

The request could not be understood by the server due to malformed syntax.

500

Failed to complete the request because of an internal service error.

Error Codes

For details, see Error Codes.