zun/api-ref/source/quotas.inc
Kien Nguyen 85f3f3877b Add api-ref for quotas and quota_classes
Change-Id: I51ce4eaaa6495f17b0792cd6517d455fc7a39f9d
Partial-Implements: blueprint quota-support
2018-09-19 10:20:51 +07:00

164 lines
2.5 KiB
ReStructuredText

.. -*- rst -*-
==============
Manage Quotas
==============
Gets, updates, gets default and deletes quotas for a project.
Update quotas for a project
===========================
.. rest_method:: PUT /v1/quotas
Update the quotas for a project
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
.. rest_parameters:: parameters.yaml
- containers: container-request
- memory: memory-request
- cpu: cpu-request
- disk: disk-request
Request Example
---------------
.. literalinclude:: samples/quotas-update-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- containers: container-response
- memory: memory-response
- cpu: cpu-response
- disk: disk-response
Response Example
----------------
.. literalinclude:: samples/quotas-update-resp.json
:language: javascript
Get quotas for a project
========================
.. rest_method:: GET /v1/quotas
Get quotas for a project
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
Response
--------
.. rest_parameters:: parameters.yaml
- usages: usages
- containers: container-response
- memory: memory-response
- cpu: cpu-response
- disk: disk-response
Response Example
----------------
.. literalinclude:: samples/quotas-get-resp.json
:language: javascript
Get Default quotas for a project
================================
.. rest_method:: GET /v1/quotas/defaults
Get the default quotas for a project
Response Codes
--------------
.. rest_status_code:: success status.yaml
- 200
.. rest_status_code:: error status.yaml
- 400
- 401
- 403
Request
-------
Response
--------
.. rest_parameters:: parameters.yaml
- usages: usages
- containers: container-response
- memory: memory-response
- cpu: cpu-response
- disk: disk-response
Response Example
----------------
.. literalinclude:: samples/quotas-get-defaults-resp.json
:language: javascript
Revert Quotas to defaults
=========================
.. rest_method:: DELETE /v1/quotas
Reverts the quotas to default values for a project
.. rest_status_code:: success status.yaml
- 202
.. rest_status_code:: error status.yaml
- 401
- 403
Request
-------
Response
--------
There is no body content for the response of a successful DELETE operation.