summaryrefslogtreecommitdiff
path: root/api-ref/source/quotas.inc
blob: f70756f995da471c9636823659376b6d20c4813f (plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
.. -*- rst -*-

======
Quotas
======




Show resources limit for current project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. rest_method::  GET /v1.0/{project_id}/limits

Get resources quota and rate limit for the current project.

Normal response codes: 200


Request
-------

.. rest_parameters:: parameters.yaml

   - project_id: project_id

Response Example
----------------

.. literalinclude:: samples/limit-show-response.json
   :language: javascript




Show resources quota for a specific project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. rest_method::  GET /v1.0/{project_id}/mgmt/quotas/{user_project}

Admin can query resource quota of any project. The project user can only show
the project's own quota.

Normal response codes: 200


Request
-------

.. rest_parameters:: parameters.yaml

   - project_id: project_id
   - user_project: user_project

Response Parameters
-------------------

.. rest_parameters:: parameters.yaml

    - quotas: quota_list
    - resource: quota_resource
    - in_use: quota_in_use
    - limit: quota_limit
    - reserved: quota_reserved

Response Example
----------------

.. literalinclude:: samples/quota-show-response.json
   :language: javascript




Update resources quota for a specific project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. rest_method::  PUT /v1.0/{project_id}/mgmt/quotas/{user_project}

Admin only action by default. Supported resources:

* instances
* backups

If not set, use the default resource quota in Trove configuration.

Normal response codes: 200

Request
-------

.. rest_parameters:: parameters.yaml

   - project_id: project_id
   - user_project: user_project
   - quotas: quotas

Request Example
---------------

.. literalinclude:: samples/quota-update.json
   :language: javascript

Response Parameters
-------------------

.. rest_parameters:: parameters.yaml

   - quotas: quotas

Response Example
----------------

.. literalinclude:: samples/quota-update.json
   :language: javascript