Help Center/ Elastic Volume Service/ API Reference/ API/ Quota Management/ Querying Detailed Quotas of a Tenant
Updated on 2025-11-13 GMT+08:00

Querying Detailed Quotas of a Tenant

Function

This API is used to query the detailed quotas of a tenant.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/os-quota-sets/{target_project_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

The project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

target_project_id

Yes

String

Definition

The target project ID. For details, see Obtaining a Project ID.

Constraints

Set this parameter to the value of project_id.

Range

N/A

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

usage

Yes

String

Definition

Whether to query quota details.

Constraints

Only value True is supported currently.

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

The user token.

You can obtain it by calling the IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

quota_set

QuotaList object

Definition

The returned quota information.

Range

N/A

Table 5 QuotaList

Parameter

Type

Description

backup_gigabytes

QuotaDetailBackupGigabytes object

Definition

The backup capacity, in GiB. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

backups

QuotaDetailBackups object

Definition

The number of backups. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

gigabytes

QuotaDetailGigabytes object

Definition

The total capacity, in GiB. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

id

String

Definition

The project ID.

Range

N/A

snapshots

QuotaDetailSnapshots object

Definition

The number of snapshots. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

volumes

QuotaDetailVolumes object

Definition

The number of disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

gigabytes_SATA

QuotaDetailGigabytesSATA object

Definition

The capacity (GiB) for common I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

snapshots_SATA

QuotaDetailSnapshotsSATA object

Definition

The number of snapshots for common I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

volumes_SATA

QuotaDetailVolumesSATA object

Definition

The number of common I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

gigabytes_SAS

QuotaDetailGigabytesSAS object

Definition

The capacity (GiB) for high I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

snapshots_SAS

QuotaDetailSnapshotsSAS object

Definition

The number of snapshots for high I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

volumes_SAS

QuotaDetailVolumesSAS object

Definition

The number of high I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

gigabytes_SSD

QuotaDetailGigabytesSSD object

Definition

The capacity (GiB) for ultra-high I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

snapshots_SSD

QuotaDetailSnapshotsSSD object

Definition

The number of snapshots for ultra-high I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

volumes_SSD

QuotaDetailVolumesSSD object

Definition

The number of ultra-high I/O disks. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

NOTE:
  • This is a reserved field. Quotas based on disk type are not supported.

per_volume_gigabytes

QuotaDetailPerVolumeGigabytes object

Definition

The capacity quota of a disk. Sub-parameters include reserved (reserved quota), limit (maximum quota), and in_use (used quota). They are all made up of key-value pairs.

Range

N/A

Table 6 QuotaDetailBackupGigabytes

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 7 QuotaDetailBackups

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 8 QuotaDetailGigabytes

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 9 QuotaDetailSnapshots

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 10 QuotaDetailVolumes

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 11 QuotaDetailGigabytesSATA

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 12 QuotaDetailSnapshotsSATA

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 13 QuotaDetailVolumesSATA

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 14 QuotaDetailGigabytesSAS

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 15 QuotaDetailSnapshotsSAS

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 16 QuotaDetailVolumesSAS

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 17 QuotaDetailGigabytesSSD

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 18 QuotaDetailSnapshotsSSD

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 19 QuotaDetailVolumesSSD

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Table 20 QuotaDetailPerVolumeGigabytes

Parameter

Type

Description

in_use

Integer

Definition

The used quota.

Range

N/A

limit

Integer

Definition

The maximum quota.

Range

N/A

reserved

Integer

Definition

The reserved quota.

Range

N/A

Status code: 400

Table 21 Response body parameters

Parameter

Type

Description

error

Error object

Definition

The error code returned if an error occurs. For details about the error code, see Error Codes.

Range

N/A

Table 22 Error

Parameter

Type

Description

code

String

Definition

The error code returned if an error occurs.

Range

For details about the error code, see Error Codes.

message

String

Definition

The error message returned if an error occurs.

Range

N/A

Example Requests

GET https://{endpoint}/v2/{project_id}/os-quota-sets/{target_project_id}?usage=True

Example Responses

Status code: 200

OK

{
  "quota_set" : {
    "gigabytes_SAS" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 21
    },
    "volumes_SATA" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 8
    },
    "gigabytes" : {
      "reserved" : 0,
      "limit" : 42790,
      "in_use" : 2792
    },
    "backup_gigabytes" : {
      "reserved" : 0,
      "limit" : 5120,
      "in_use" : 51
    },
    "snapshots_SAS" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 0
    },
    "volumes_SSD" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 28
    },
    "snapshots" : {
      "reserved" : 0,
      "limit" : 10,
      "in_use" : 6
    },
    "id" : "cd631140887d4b6e9c786b67a6dd4c02",
    "volumes_SAS" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 2
    },
    "snapshots_SSD" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 0
    },
    "volumes" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 108
    },
    "gigabytes_SATA" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 168
    },
    "backups" : {
      "reserved" : 0,
      "limit" : 100,
      "in_use" : 10
    },
    "gigabytes_SSD" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 1085
    },
    "snapshots_SATA" : {
      "reserved" : 0,
      "limit" : -1,
      "in_use" : 0
    }
  }
}

Status code: 400

Bad Request

{
  "error" : {
    "message" : "XXXX",
    "code" : "XXX"
  }
}

SDK Sample Code

The SDK sample code is as follows.

Java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.evs.v2.region.EvsRegion;
import com.huaweicloud.sdk.evs.v2.*;
import com.huaweicloud.sdk.evs.v2.model.*;


public class CinderListQuotasSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        EvsClient client = EvsClient.newBuilder()
                .withCredential(auth)
                .withRegion(EvsRegion.valueOf("<YOUR REGION>"))
                .build();
        CinderListQuotasRequest request = new CinderListQuotasRequest();
        request.withTargetProjectId("{target_project_id}");
        try {
            CinderListQuotasResponse response = client.cinderListQuotas(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}

Python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkevs.v2.region.evs_region import EvsRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkevs.v2 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = EvsClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(EvsRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = CinderListQuotasRequest()
        request.target_project_id = "{target_project_id}"
        response = client.cinder_list_quotas(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)

Go

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    evs "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := evs.NewEvsClient(
        evs.EvsClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.CinderListQuotasRequest{}
	request.TargetProjectId = "{target_project_id}"
	response, err := client.CinderListQuotas(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

More

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

See Error Codes.