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

Querying Details of Tenant Quotas

Function

This API is used to query the details of tenant quotas.

URI

  • URI format

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

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    target_project_id

    Yes

    Specifies the ID of the target project. Set this parameter to the value of project_id.

    usage

    Yes

    Specifies whether to query the quota details. Only value true is supported currently.

Request

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

Response

  • Parameter description

    Parameter

    Type

    Description

    quota_set

    Object

    Specifies the queried quota information. For details, see Parameters in the quota_set field.

    error

    Object

    Specifies the error message returned when an error occurs. For details, see Parameters in the error field.

  • Parameters in the quota_set field

    Parameter

    Type

    Description

    volumes

    Object

    Specifies the number of disks. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    snapshots

    Object

    Specifies the number of snapshots. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    gigabytes

    Object

    Specifies the total size (GB) of disks and snapshots allowed by the quota. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    volumes_SSD

    Object

    Specifies the number of reserved ultra-high I/O disks. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    volumes_SAS

    Object

    Specifies the number of reserved high I/O disks. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    snapshots_SSD

    Object

    Specifies the number of snapshots reserved for ultra-high I/O disks. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    snapshots_SAS

    Object

    Specifies the number of snapshots reserved for high I/O disks. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    gigabytes_SSD

    Object

    Specifies the size reserved for ultra-high I/O disks, in GB. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    gigabytes_SAS

    Object

    Specifies the size reserved for high I/O disks, in GB. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    id

    String

    Specifies the tenant ID. The tenant ID is actually the project ID.

    backups

    Object

    Specifies the number of backups. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    backup_gigabytes

    Object

    Specifies the backup size, in GB. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    per_volume_gigabytes

    Object

    Specifies the capacity quota of each EVS disk. The sub-parameters include reserved, allocated, limit, in_use, and are made up of key-value pairs.

    If the limit value returned in the response is -1, no quota limit has been set.

  • Parameters in the error field

    Parameter

    Type

    Description

    message

    String

    Specifies the error message returned when an error occurs.

    code

    String

    Specifies the error code returned when an error occurs.

    For details about the error code, see Error Codes.

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

    or

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

    In the preceding example, error indicates a general error, for example, badrequest or itemNotFound. An example is provided as follows:

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

Status Codes

  • Normal

    200

Error Codes

For details, see Error Codes.