Show quotas

Overview

Shows quotas for a tenant.

Classification

  • Show

API Operation Object

  • os-quota-sets

Synchronous / Asynchronous

  • synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{tenant_id}/os-quota-sets/{target_tenant_id}

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress(optional)
Accept: application/json
X-Auth-Token: <token_id>

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters
name style format description required/option default value action for invalid parameter response code for invalid parameter
tenant_id URL UUID(3) ID of the tenant required - Terminate 400, 404
target_tenant_id URL UUID(3) ID of the tenant only administrative users can specified other tenant. * required - normal end -
token_id URL String(token_id) Keystone admin token required - Terminate 401
usage Query boolean or other string means False Whether show usage optional FALSE normal end -
  • * Cinder accepts any string in tenant_id even if the tenant_id is incorrect, to return the quota of default

Response

HTTP Response Header

Format

HTTP/1.1 <response code> <message>       (ex. 200 OK)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "X-Openstack-Request-Id", "Content-Length", "Date"

Response Code

Response Codes
response code condition
200 normal end
400 invalid input for tenant_id
401 unauthorized(including keystone down)
403 User who requested are not allowed to do
404 tenant_id is empty

HTTP Response Body

Format

{
    "quota_set": {
        "id": "<target_tenant_id>",
        "<resource>": <limit>,
       <<repeat>>
    }
}
{
    "quota_set": {
        "id": "<target_tenant_id>",
        "<resource>": {
            "in_use": <in_use>,
            "limit": <limit>,
            "reserved": <reserved>
        },
        <<repeat>>
    }
}

* If specified true to usage

Response Parameter

Response Parameters
item format description
resource String(1-256characters) resource name of the quota
limit int limit of quota
target_tenant_id UUID(3) ID of the tenant
in_use int number of tenants are consuming
reserved int number of tenants has reserved

Sample API Request and Response

Sample API Request

Request URI

https://example.com//v2/{tenant_id}/os-quota-sets/{target_tenant_id}

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200 OK
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "X-Openstack-Request-Id", "Content-Length", "Date"

Response Body

{
    "quota_set": {
        "id": "<target_tenant_id>",
        "<resource>": <limit>,
       <<repeat>>
    }
}
{
    "quota_set": {
        "id": "<target_tenant_id>",
        "<resource>": {
            "in_use": <in_use>,
            "limit": <limit>,
            "reserved": <reserved>
        },
        <<repeat>>
    }
}

* If specified true to usage

Execution Example

HTTP Request

GET /v2/02f0041decc14eb883332e7e8db6a5b3/os-quota-sets/02f0041decc14eb883332e7e8db6a5b3?usage=false HTTP/1.1
Host: 172.17.96.120:30776
User-Agent: python-cinderclient
Accept: application/json
X-Auth-Token: 92089276249344f0b72cc66de0b8e249

HTTP Response

HTTP/1.1 200 OK
X-Compute-Request-Id: req-df6a3ae4-c484-4e48-8f88-74aadc084e16
Content-Type: application/json
Content-Length: 317
X-Openstack-Request-Id: req-df6a3ae4-c484-4e48-8f88-74aadc084e16
Date: Fri, 06 Feb 2015 08:54:42 GMT

{"quota_set": {"volumes_vnxclidriver": -1, "gigabytes_nfsdriver": -1, "gigabytes": 10000, "backup_gigabytes": 1000, "snapshots": 10, "volumes_nfsdriver": -1, "gigabytes_vnxclidriver": -1, "snapshots_vnxclidriver": -1, "volumes": 10, "snapshots_nfsdriver": -1, "backups": 10, "id": "02f0041decc14eb883332e7e8db6a5b3"}}

Error Execution Example

HTTP Request

GET /v2/02f0041decc14eb883332e7e8db6a5b3/os-quota-sets/02f0041decc14eb883332e7e8db6a5b3 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8776
X-Auth-Token: b4039009185744c19e95271805a944b5
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 65
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-b2aabe7b-951a-4f78-8d9e-93509bff3ef0
X-Openstack-Request-Id: req-b2aabe7b-951a-4f78-8d9e-93509bff3ef0
Date: Thu, 17 Sep 2015 11:06:23 GMT

{"badRequest": {"message": "Malformed request url", "code": 400}}