Skip to content

Commit f16dd02

Browse files
mboersmaGabriel Monroy
authored andcommitted
Fixed #175 -- update REST API documentation for application-refactor.
1 parent 3ad53ce commit f16dd02

2 files changed

Lines changed: 120 additions & 50 deletions

File tree

api/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
"""
22
The **api** Django app presents a RESTful web API for interacting with the **deis** system.
3-
4-
:py:mod:`api.fields`
53
"""

api/urls.py

Lines changed: 120 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
1313
Destroy a :class:`~api.models.Key` by its `id`.
1414
15-
See also :meth:`KeyViewSet.destroy() <api.views.KeyViewSet.destroy>`
16-
1715
.. http:get:: /api/keys/
1816
1917
List all :class:`~api.models.Key`\s.
@@ -22,8 +20,6 @@
2220
2321
Create a new :class:`~api.models.Key`.
2422
25-
See also :meth:`KeyViewSet.post_save() <api.views.KeyViewSet.post_save>`
26-
2723
2824
Providers
2925
=========
@@ -72,8 +68,6 @@
7268
7369
Create a new :class:`~api.models.Flavor`.
7470
75-
See also :meth:`FlavorViewSet.create() <api.views.FlavorViewSet.create>`
76-
7771
7872
Formations
7973
==========
@@ -82,6 +76,10 @@
8276
8377
Retrieve a :class:`~api.models.Formation` by its `id`.
8478
79+
.. http:patch:: /api/formations/(string:id)/
80+
81+
Update parts of a :class:`~api.models.Formation`.
82+
8583
.. http:delete:: /api/formations/(string:id)/
8684
8785
Destroy a :class:`~api.models.Formation` by its `id`.
@@ -95,12 +93,11 @@
9593
Create a new :class:`~api.models.Formation`.
9694
9795
See also
98-
:meth:`FormationViewSet.create() <api.views.FormationViewSet.create>` and
9996
:meth:`FormationViewSet.post_save() <api.views.FormationViewSet.post_save>`
10097
10198
102-
Infrastructure
103-
--------------
99+
Formation Infrastructure
100+
------------------------
104101
105102
.. http:get:: /api/formations/(string:id)/layers/(string:id)/
106103
@@ -114,6 +111,9 @@
114111
115112
Destroy a :class:`~api.models.Layer` by its `id`.
116113
114+
See also
115+
:meth:`FormationLayerViewSet.destroy() <api.views.FormationLayerViewSet.destroy>`
116+
117117
.. http:get:: /api/formations/(string:id)/layers/
118118
119119
List all :class:`~api.models.Layer`\s.
@@ -122,6 +122,9 @@
122122
123123
Create a new :class:`~api.models.Layer`.
124124
125+
See also
126+
:meth:`FormationLayerViewSet.create() <api.views.FormationLayerViewSet.create>`
127+
125128
.. http:get:: /api/formations/(string:id)/nodes/(string:id)/
126129
127130
Retrieve a :class:`~api.models.Node` by its `id`.
@@ -134,83 +137,153 @@
134137
135138
List all :class:`~api.models.Node`\s.
136139
137-
.. http:get:: /api/formations/(string:id)/containers/
138140
139-
List all :class:`~api.models.Container`\s.
141+
Formation Actions
142+
-----------------
143+
144+
.. http:post:: /api/formations/(string:id)/scale/
145+
146+
See also
147+
:meth:`FormationViewSet.scale() <api.views.FormationViewSet.scale>`
148+
149+
.. http:post:: /api/formations/(string:id)/balance/
150+
151+
See also
152+
:meth:`FormationViewSet.balance() <api.views.FormationViewSet.balance>`
153+
154+
.. http:post:: /api/formations/(string:id)/calculate/
155+
156+
See also
157+
:meth:`FormationViewSet.calculate() <api.views.FormationViewSet.calculate>`
158+
159+
.. http:post:: /api/formations/(string:id)/converge/
160+
161+
See also
162+
:meth:`FormationViewSet.converge() <api.views.FormationViewSet.converge>`
140163
141164
142-
Release Components
143-
------------------
165+
Applications
166+
============
144167
145-
.. http:get:: /api/formations/(string:id)/config/
168+
.. http:get:: /api/apps/(string:id)/
169+
170+
Retrieve a :class:`~api.models.Application` by its `id`.
171+
172+
.. http:delete:: /api/apps/(string:id)/
173+
174+
Destroy a :class:`~api.models.Formation` by its `id`.
175+
176+
.. http:get:: /api/apps/
177+
178+
List all :class:`~api.models.Formation`\s.
179+
180+
.. http:post:: /api/apps/
181+
182+
Create a new :class:`~api.models.Formation`.
183+
184+
185+
Application Release Components
186+
------------------------------
187+
188+
.. http:get:: /api/apps/(string:id)/config/
146189
147190
List all :class:`~api.models.Config`\s.
148191
149-
.. http:post:: /api/formations/(string:id)/config/
192+
.. http:post:: /api/apps/(string:id)/config/
150193
151194
Create a new :class:`~api.models.Config`.
152195
153-
.. http:get:: /api/formations/(string:id)/builds/(string:uuid)/
196+
.. http:get:: /api/apps/(string:id)/builds/(string:uuid)/
154197
155198
Retrieve a :class:`~api.models.Build` by its `uuid`.
156199
157-
.. http:post:: /api/formations/(string:id)/builds/
200+
.. http:get:: /api/apps/(string:id)/builds/
201+
202+
List all :class:`~api.models.Build`\s.
203+
204+
.. http:post:: /api/apps/(string:id)/builds/
158205
159206
Create a new :class:`~api.models.Build`.
160207
161-
.. http:get:: /api/formations/(string:id)/releases/(int:version)/
208+
.. http:get:: /api/apps/(string:id)/releases/(int:version)/
162209
163210
Retrieve a :class:`~api.models.Release` by its `version`.
164211
165-
.. http:get:: /api/formations/(string:id)/releases/
212+
.. http:get:: /api/apps/(string:id)/releases/
166213
167214
List all :class:`~api.models.Release`\s.
168215
169-
Actions
170-
-------
171216
172-
.. http:post:: /api/formations/(string:id)/scale/layers/
217+
Application Infrastructure
218+
--------------------------
173219
174-
See also
175-
:meth:`FormationViewSet.scale_layers() <api.views.FormationViewSet.scale_layers>`
220+
.. http:get:: /api/apps/(string:id)/containers/(string:type)/(int:num)/
176221
177-
.. http:post:: /api/formations/(string:id)/scale/containers/
222+
List all :class:`~api.models.Container`\s.
178223
179-
See also
180-
:meth:`FormationViewSet.scale_containers() <api.views.FormationViewSet.scale_containers>`
224+
.. http:get:: /api/apps/(string:id)/containers/(string:type)/
181225
182-
.. http:post:: /api/formations/(string:id)/balance/
226+
List all :class:`~api.models.Container`\s.
183227
184-
See also
185-
:meth:`FormationViewSet.balance() <api.views.FormationViewSet.balance>`
228+
.. http:get:: /api/apps/(string:id)/containers/
186229
187-
.. http:post:: /api/formations/(string:id)/calculate/
230+
List all :class:`~api.models.Container`\s.
231+
232+
233+
Application Actions
234+
-------------------
235+
236+
.. http:post:: /api/apps/(string:id)/scale/
188237
189238
See also
190-
:meth:`FormatinViewSet.calculate() <api.views.FormationViewSet.calculate>`
239+
:meth:`AppViewSet.scale() <api.views.AppViewSet.scale>`
191240
192-
.. http:post:: /api/formations/(string:id)/converge/
241+
.. http:post:: /api/apps/(string:id)/logs/
193242
194243
See also
195-
:meth:`FormationViewSet.converge() <api.views.FormationViewSet.converge>`
244+
:meth:`AppViewSet.logs() <api.views.AppViewSet.logs>`
196245
197-
.. http:post:: /api/formations/(string:id)/logs/
246+
.. http:post:: /api/apps/(string:id)/run/
198247
199248
See also
200-
:meth:`FormationViewSet.logs() <api.views.FormationViewSet.logs>`
249+
:meth:`AppViewSet.run() <api.views.AppViewSet.run>`
201250
202-
.. http:post:: /api/formations/(string:id)/run/
251+
.. http:post:: /api/apps/(string:id)/calculate/
203252
204253
See also
205-
:meth:`FormationViewSet.run() <api.views.FormationViewSet.run>`
254+
:meth:`AppViewSet.calculate() <api.views.AppViewSet.calculate>`
255+
256+
257+
Nodes
258+
=====
259+
260+
.. http:get:: /api/nodes/(string:id)/
261+
262+
Retrieve a :class:`~api.models.Node` by its `id`.
263+
264+
.. http:patch:: /api/nodes/(string:id)/
265+
266+
Update parts of a :class:`~api.models.Node`.
267+
268+
.. http:delete:: /api/nodes/(string:id)/
269+
270+
Destroy a :class:`~api.models.Node` by its `id`.
271+
272+
.. http:get:: /api/nodes/
273+
274+
List all :class:`~api.models.Node`\s.
275+
276+
.. http:post:: /api/nodes/
277+
278+
Create a new :class:`~api.models.Node`.
206279
207280
208281
Auth
209282
====
210283
211284
.. http:post:: /api/auth/register/
212285
213-
Create a new :class:`~api.models.UserRegistration`.
286+
Create a new :class:`~django.contrib.auth.models.User`.
214287
215288
.. http:post:: /api/auth/login
216289
@@ -225,7 +298,6 @@
225298
Generate an API key.
226299
227300
"""
228-
# pylint: disable=C0103
229301

230302
from __future__ import unicode_literals
231303

@@ -249,25 +321,25 @@
249321
views.KeyViewSet.as_view({
250322
'get': 'retrieve', 'delete': 'destroy'})),
251323
url(r'^keys/?',
252-
views.KeyViewSet.as_view({'post': 'create', 'get': 'list'})),
324+
views.KeyViewSet.as_view({'get': 'list', 'post': 'create'})),
253325
# provider
254326
url(r'^providers/(?P<id>[a-z0-9-]+)/?',
255327
views.ProviderViewSet.as_view({
256328
'get': 'retrieve', 'patch': 'partial_update', 'delete': 'destroy'})),
257329
url(r'^providers/?',
258-
views.ProviderViewSet.as_view({'post': 'create', 'get': 'list'})),
330+
views.ProviderViewSet.as_view({'get': 'list', 'post': 'create'})),
259331
# flavor
260332
url(r'^flavors/(?P<id>[a-z0-9-]+)/?',
261333
views.FlavorViewSet.as_view({
262334
'get': 'retrieve', 'patch': 'partial_update', 'delete': 'destroy'})),
263335
url(r'^flavors/?',
264-
views.FlavorViewSet.as_view({'post': 'create', 'get': 'list'})),
336+
views.FlavorViewSet.as_view({'get': 'list', 'post': 'create'})),
265337
# formation infrastructure
266338
url(r'^formations/(?P<id>[a-z0-9-]+)/layers/(?P<layer>[a-z0-9-]+)/?',
267339
views.FormationLayerViewSet.as_view({
268340
'get': 'retrieve', 'patch': 'partial_update', 'delete': 'destroy'})),
269341
url(r'^formations/(?P<id>[a-z0-9-]+)/layers/?',
270-
views.FormationLayerViewSet.as_view({'post': 'create', 'get': 'list'})),
342+
views.FormationLayerViewSet.as_view({'get': 'list', 'post': 'create'})),
271343
url(r'^formations/(?P<id>[a-z0-9-]+)/nodes/(?P<node>[a-z0-9-]+)/?',
272344
views.FormationNodeViewSet.as_view({
273345
'get': 'retrieve', 'delete': 'destroy'})),
@@ -287,14 +359,14 @@
287359
views.FormationViewSet.as_view({
288360
'get': 'retrieve', 'patch': 'partial_update', 'delete': 'destroy'})),
289361
url(r'^formations/?',
290-
views.FormationViewSet.as_view({'post': 'create', 'get': 'list'})),
362+
views.FormationViewSet.as_view({'get': 'list', 'post': 'create'})),
291363
# application release components
292364
url(r'^apps/(?P<id>[a-z0-9-]+)/config/?',
293-
views.AppConfigViewSet.as_view({'post': 'create', 'get': 'retrieve'})),
365+
views.AppConfigViewSet.as_view({'get': 'retrieve', 'post': 'create'})),
294366
url(r'^apps/(?P<id>[a-z0-9-]+)/builds/(?P<uuid>[a-z0-9-]+)/?',
295367
views.AppBuildViewSet.as_view({'get': 'retrieve'})),
296368
url(r'^apps/(?P<id>[a-z0-9-]+)/builds/?',
297-
views.AppBuildViewSet.as_view({'post': 'create', 'get': 'list'})),
369+
views.AppBuildViewSet.as_view({'get': 'list', 'post': 'create'})),
298370
url(r'^apps/(?P<id>[a-z0-9-]+)/releases/(?P<version>[0-9]+)/?',
299371
views.AppReleaseViewSet.as_view({'get': 'retrieve'})),
300372
url(r'^apps/(?P<id>[a-z0-9-]+)/releases/?',
@@ -319,7 +391,7 @@
319391
url(r'^apps/(?P<id>[a-z0-9-]+)/?',
320392
views.AppViewSet.as_view({'get': 'retrieve', 'delete': 'destroy'})),
321393
url(r'^apps/?',
322-
views.AppViewSet.as_view({'post': 'create', 'get': 'list'})),
394+
views.AppViewSet.as_view({'get': 'list', 'post': 'create'})),
323395
# nodes
324396
url(r'^nodes/(?P<node>[a-z0-9-]+)/converge/?',
325397
views.NodeViewSet.as_view({'post': 'converge'})),

0 commit comments

Comments
 (0)