Skip to content

Commit

Permalink
Automatically document the REST API with cornice.
Browse files Browse the repository at this point in the history
fixes #1323

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
  • Loading branch information
bowlofeggs committed Mar 8, 2017
1 parent f38b96d commit 72c9895
Show file tree
Hide file tree
Showing 15 changed files with 85 additions and 16 deletions.
1 change: 1 addition & 0 deletions devel/ansible/roles/dev/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- python-bunch
- python-click
- python-cornice
- python-cornice-sphinx
- python-devel
- python-dogpile-cache
- python-fedora
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../')))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), 'rtd_hacks')))

# -- General configuration -----------------------------------------------------

Expand All @@ -27,7 +28,7 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
extensions = ['cornice.ext.sphinxext', 'sphinx.ext.autodoc',
'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']

# Add any paths that contain templates here, relative to this directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Contents:
man_pages/index
python_bindings
developer_docs
services
rest_api/index
release_notes


Expand Down
6 changes: 6 additions & 0 deletions docs/rest_api/builds.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Builds
======

.. cornice-autodoc::
:modules: bodhi.server.services.builds
:services: build, builds
6 changes: 6 additions & 0 deletions docs/rest_api/comments.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Comments
========

.. cornice-autodoc::
:modules: bodhi.server.services.comments
:services: comment, comments, comments_rss
6 changes: 6 additions & 0 deletions docs/rest_api/csrf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CSRF
====

.. cornice-autodoc::
:modules: bodhi.server.services.csrf
:services: csrf
20 changes: 20 additions & 0 deletions docs/rest_api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Bodhi REST API
==============

This section of the documentation describes Bodhi's REST API. You can read about the various
sections of the API by following the links below:


.. toctree::
:maxdepth: 2

builds
comments
csrf
markdown
overrides
packages
releases
stacks
updates
users
6 changes: 6 additions & 0 deletions docs/rest_api/markdown.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Markdown
========

.. cornice-autodoc::
:modules: bodhi.server.services.markdown
:services: markdowner
7 changes: 7 additions & 0 deletions docs/rest_api/overrides.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Overrides
=========


.. cornice-autodoc::
:modules: bodhi.server.services.overrides
:services: override, overrides, overrides_rss
6 changes: 6 additions & 0 deletions docs/rest_api/packages.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Packages
========

.. cornice-autodoc::
:modules: bodhi.server.services.packages
:services: packages
6 changes: 6 additions & 0 deletions docs/rest_api/releases.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Releases
========

.. cornice-autodoc::
:modules: bodhi.server.services.releases
:services: release, releases
6 changes: 6 additions & 0 deletions docs/rest_api/stacks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Stacks
======

.. cornice-autodoc::
:modules: bodhi.server.services.stacks
:services: stack, stacks
6 changes: 6 additions & 0 deletions docs/rest_api/updates.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Updates
=======

.. cornice-autodoc::
:modules: bodhi.server.services.updates, bodhi.server.services.zz_redirects
:services: bodhi1_update_redirect, update, update_edit, update_request, updates, updates_rss
6 changes: 6 additions & 0 deletions docs/rest_api/users.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Users
=====

.. cornice-autodoc::
:modules: bodhi.server.services.user
:services: user, users, users_rss
14 changes: 0 additions & 14 deletions docs/services.rst

This file was deleted.

0 comments on commit 72c9895

Please sign in to comment.