Quotas

Quotas - objects resource limits and their usage. Quotas limits can be editable by users.

/api/quotas/

Supported actions and methods:

/api/quotas/

Methods: GET

To get an actual value for object quotas limit and usage issue a GET request against /api/<objects>/.

To get all quotas visible to the user issue a GET request against /api/quotas/

/api/quotas/<uuid>/

Methods: GET, PUT, PATCH

Supported fields for update:

  • limit – float
  • threshold – float

To set quota limit issue a PUT request against /api/quotas/<quota uuid>* with limit values.

Please note that if a quota is a cache of a backend quota (e.g. ‘storage’ size of an OpenStack tenant), it will be impossible to modify it through /api/quotas/<quota uuid>* endpoint.

Example of changing quota limit:

POST /api/quotas/6ad5f49d6d6c49648573b2b71f44a42b/ HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4
Host: example.com

{
    "limit": 2000.0
}

Example of changing quota threshold:

PUT /api/quotas/6ad5f49d6d6c49648573b2b71f44a42b/ HTTP/1.1
Content-Type: application/json
Accept: application/json
Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4
Host: example.com

{
    "threshold": 100.0
}

/api/quotas/<uuid>/history/

Methods: GET

Historical data endpoints could be available for any objects (currently implemented for quotas and events count). The data is available at <object_endpoint>/history/, for example: /api/quotas/<uuid>/history/.

There are two ways to define datetime points for historical data.

  1. Send ?point=<timestamp> parameter that can list. Response will contain historical data for each given point
    in the same order.
  2. Send ?start=<timestamp>, ?end=<timestamp>, ?points_count=<integer> parameters. Result will contain <points_count> points from <start> to <end>.

Response format:

[
    {
        "point": <timestamp>,
        "object": {<object_representation>}
    },
    {
        "point": <timestamp>
        "object": {<object_representation>}
    },
...
]

NB! There will not be any “object” for corresponding point in response if there is no data about object for a given timestamp.