Help Center/ Workspace/ API Reference/ Workspace APIs/ Quota/ Querying Resource Quotas
Updated on 2024-01-10 GMT+08:00

Querying Resource Quotas

Function

Console Framework and WKSDesktopManager call this API to query tenant quotas.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/quotas

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Content-Type

Yes

String

MIME type of the request body.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

quotas

QuotaNoLimit object

Quota information

site_quotas

Array of SiteQuotaNoLimit objects

Site quota information, excluding the central site

Table 4 QuotaNoLimit

Parameter

Type

Description

resources

Array of ResourceNoLimit objects

Quota resource list

Table 5 SiteQuotaNoLimit

Parameter

Type

Description

resources

Array of ResourceNoLimit objects

Quota resource list

site_id

String

Site ID

Table 6 ResourceNoLimit

Parameter

Type

Description

type

String

Resource type. general_instances: common desktop Memory: memory cores: CPU volumes: number of disks volume_gigabytes: disk capacity gpu_instances: GPU desktop deh: cloud office host users: user policy_groups: policy group Cores: CPU (used by the quota tool)

quota

Integer

Quotas

used

Integer

Used quota

unit

String

Quota unit

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

GET /v2/29dfe82ada564ac2b927e1ff036d9a9b/quotas

Example Responses

Status code: 200

Response to the request for querying tenant quotas

{
  "quotas" : {
    "resources" : [ {
      "type" : "general_instances",
      "quota" : 10,
      "used" : 3
    }, {
      "type" : "volumes",
      "quota" : 500,
      "used" : 33
    }, {
      "type" : "volume_gigabytes",
      "quota" : 21500,
      "unit" : "GB",
      "used" : 2090
    }, {
      "type" : "cores",
      "quota" : 80,
      "used" : 10
    }, {
      "type" : "Memory",
      "quota" : 100,
      "unit" : "GB",
      "used" : 19
    }, {
      "type" : "gpu_instances",
      "quota" : 10,
      "used" : 0
    }, {
      "type" : "users",
      "quota" : 3000,
      "used" : 29
    }, {
      "type" : "policy_groups",
      "quota" : 10,
      "used" : 0
    }, {
      "type" : "Cores",
      "quota" : 80,
      "used" : 0
    } ]
  },
  "site_quotas" : [ {
    "site_id" : 147258369,
    "resources" : [ {
      "type" : "gpu_instances",
      "quota" : 50,
      "used" : 0
    }, {
      "type" : "ies_instances",
      "quota" : 500,
      "used" : 0
    } ]
  } ]
}

Status Codes

Status Code

Description

200

Response to the request for querying tenant quotas

400

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

401

Authentication failed.

403

You do not have required permissions.

404

No resource found.

500

An internal service error occurred. For details about the error code, see the error code description.

Error Codes

See Error Codes.