Browse Source

Merge "Resource Quota - API documentation"

Jenkins 2 years ago
parent
commit
ae41b4511c

+ 1
- 0
api-ref/source/index.rst View File

@@ -15,3 +15,4 @@
15 15
 .. include:: certificates.inc
16 16
 .. include:: mservices.inc
17 17
 .. include:: stats.inc
18
+.. include:: quotas.inc

+ 124
- 0
api-ref/source/quotas.inc View File

@@ -0,0 +1,124 @@
1
+.. -*- rst -*-
2
+
3
+=================
4
+ Magnum Quota API
5
+=================
6
+
7
+Lists, creates, shows details, and updates Quotas.
8
+
9
+Set new quota
10
+==================
11
+
12
+.. rest_method:: POST /v1/quotas
13
+
14
+Create new quota for a project.
15
+
16
+Response Codes
17
+--------------
18
+
19
+.. rest_status_code:: success status.yaml
20
+
21
+   - 201
22
+
23
+.. rest_status_code:: error status.yaml
24
+
25
+   - 400
26
+   - 401
27
+   - 403
28
+   - 404
29
+
30
+Request Example
31
+----------------
32
+
33
+.. literalinclude:: samples/quota-create-req.json
34
+   :language: javascript
35
+
36
+Response Example
37
+----------------
38
+
39
+.. literalinclude:: samples/quota-create-resp.json
40
+   :language: javascript
41
+
42
+List all quotas
43
+================
44
+
45
+.. rest_method:: GET /v1/quotas
46
+
47
+List all quotas in Magnum.
48
+
49
+Response Codes
50
+--------------
51
+
52
+.. rest_status_code:: success status.yaml
53
+
54
+   - 200
55
+
56
+.. rest_status_code:: error status.yaml
57
+
58
+   - 401
59
+   - 403
60
+
61
+Response Example
62
+----------------
63
+
64
+.. literalinclude:: samples/quota-get-all-resp.json
65
+   :language: javascript
66
+
67
+Show details of a quota
68
+=========================
69
+
70
+.. rest_method:: GET /v1/quotas/{project_id}/{resource}
71
+
72
+Get quota information for the given project_id and resource.
73
+
74
+Response Codes
75
+--------------
76
+
77
+.. rest_status_code:: success status.yaml
78
+
79
+   - 200
80
+
81
+.. rest_status_code:: error status.yaml
82
+
83
+   - 401
84
+   - 403
85
+   - 404
86
+
87
+Response Example
88
+----------------
89
+
90
+.. literalinclude:: samples/quota-get-one-resp.json
91
+   :language: javascript
92
+
93
+Update a resource quota
94
+=============================
95
+
96
+.. rest_method:: PATCH /v1/quotas/{project_id}/{resource}
97
+
98
+Update resource quota for the given projec id.
99
+
100
+Response Codes
101
+--------------
102
+
103
+.. rest_status_code:: success status.yaml
104
+
105
+   - 202
106
+
107
+.. rest_status_code:: error status.yaml
108
+
109
+   - 400
110
+   - 401
111
+   - 403
112
+   - 404
113
+
114
+Request Example
115
+----------------
116
+
117
+.. literalinclude:: samples/quota-update-req.json
118
+   :language: javascript
119
+
120
+Response Example
121
+----------------
122
+
123
+.. literalinclude:: samples/quota-update-resp.json
124
+   :language: javascript

+ 5
- 0
api-ref/source/samples/quota-create-req.json View File

@@ -0,0 +1,5 @@
1
+{
2
+   "project_id": "aa5436ab58144c768ca4e9d2e9f5c3b2",
3
+   "resource": "Cluster",
4
+   "hard_limit": 10
5
+}

+ 8
- 0
api-ref/source/samples/quota-create-resp.json View File

@@ -0,0 +1,8 @@
1
+{
2
+   "resource": "Cluster",
3
+   "created_at": "2017-01-17T17:35:48+00:00",
4
+   "updated_at": null,
5
+   "hard_limit": 1,
6
+   "project_id": "aa5436ab58144c768ca4e9d2e9f5c3b2",
7
+   "id": 26
8
+}

+ 12
- 0
api-ref/source/samples/quota-get-all-resp.json View File

@@ -0,0 +1,12 @@
1
+{
2
+   "quotas": [
3
+      {
4
+         "resource": "Cluster",
5
+         "created_at": "2017-01-17T17:35:49+00:00",
6
+         "updated_at": "2017-01-17T17:38:21+00:00",
7
+         "hard_limit": 10,
8
+         "project_id": "aa5436ab58144c768ca4e9d2e9f5c3b2",
9
+         "id": 26
10
+      }
11
+   ]
12
+}

+ 8
- 0
api-ref/source/samples/quota-get-one-resp.json View File

@@ -0,0 +1,8 @@
1
+{
2
+   "resource": "Cluster",
3
+   "created_at": "2017-01-17T17:35:49+00:00",
4
+   "updated_at": "2017-01-17T17:38:20+00:00",
5
+   "hard_limit": 10,
6
+   "project_id": "aa5436ab58144c768ca4e9d2e9f5c3b2",
7
+   "id": 26
8
+}

+ 8
- 0
api-ref/source/samples/quota-udpate-resp.json View File

@@ -0,0 +1,8 @@
1
+{
2
+   "resource": "Cluster",
3
+   "created_at": "2017-01-17T17:35:49+00:00",
4
+   "updated_at": "2017-01-17T17:38:20+00:00",
5
+   "hard_limit": 10,
6
+   "project_id": "aa5436ab58144c768ca4e9d2e9f5c3b2",
7
+   "id": 26
8
+}

+ 3
- 0
api-ref/source/samples/quota-update-req.json View File

@@ -0,0 +1,3 @@
1
+{
2
+   "hard_limit": 10
3
+}

Loading…
Cancel
Save