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}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition The project ID. For details about how to obtain the project ID, 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 about how to obtain the project ID, see Obtaining a Project ID. Constraints Set this parameter to the value of project_id. Range N/A Default Value N/A |
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
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
Parameter |
Type |
Description |
---|---|---|
quota_set |
QuotaList object |
Definition The returned quota information. Range N/A |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
gigabytes_ESSD |
QuotaDetailGigabytesESSD object |
Definition The capacity (GiB) for extreme SSD 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 |
snapshots_ESSD |
QuotaDetailSnapshotsESSD object |
Definition The number of snapshots for extreme SSD 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 |
volumes_ESSD |
QuotaDetailVolumesESSD object |
Definition The number of extreme SSD 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_GPSSD |
QuotaDetailGigabytesGPSSD object |
Definition The capacity (GiB) for general purpose SSD 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 |
snapshots_GPSSD |
QuotaDetailSnapshotsGPSSD object |
Definition The number of snapshots for general purpose SSD 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 |
volumes_GPSSD |
QuotaDetailVolumesGPSSD object |
Definition The number of general purpose SSD 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_GPSSD2 |
QuotaDetailGigabytesGPSSD2 object |
Definition The capacity (GiB) for general purpose SSD V2 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 |
snapshots_GPSSD2 |
QuotaDetailSnapshotsGPSSD2 object |
Definition The number of snapshots for general purpose SSD V2 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 |
volumes_GPSSD2 |
QuotaDetailVolumesGPSSD2 object |
Definition The number of general purpose SSD V2 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_ESSD2 |
QuotaDetailGigabytesESSD2 object |
Definition The capacity (GiB) for extreme SSD V2 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 |
snapshots_ESSD2 |
QuotaDetailSnapshotsESSD2 object |
Definition The number of snapshots for extreme SSD V2 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 |
volumes_ESSD2 |
QuotaDetailVolumesESSD2 object |
Definition The number of extreme SSD V2 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 |
per_volume_gigabytes |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
Definition The error code returned if an error occurs. For the error codes and their meanings, see Error Codes. Range N/A |
Parameter |
Type |
Description |
---|---|---|
code |
String |
Definition The error code returned if an error occurs. Range For the error codes and their meanings, 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot