diff --git a/ceilometer/api/controllers/v2.py b/ceilometer/api/controllers/v2.py index bbdd5618..d5fcda4d 100644 --- a/ceilometer/api/controllers/v2.py +++ b/ceilometer/api/controllers/v2.py @@ -486,6 +486,11 @@ class Source(Base): name = text data = {text: text} + @staticmethod + def sample(): + return Source(name='openstack', + data={'key': 'value'}) + class SourceController(RestController): """Works on resources.""" diff --git a/doc/source/api.rst b/doc/source/api.rst deleted file mode 100644 index 77abbe4f..00000000 --- a/doc/source/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -========= - Web API -========= - -.. autoflask:: ceilometer.api.app:app - :undoc-static: diff --git a/doc/source/conf.py b/doc/source/conf.py index 70131677..4898cd1a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -31,8 +31,11 @@ import sys extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinxcontrib.autohttp.flask', + 'wsme.sphinxext', ] +wsme_protocols = ['restjson', 'restxml'] + todo_include_todos = True # Add any paths that contain templates here, relative to this directory. diff --git a/doc/source/index.rst b/doc/source/index.rst index 5944dd7c..93d19e7a 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -50,9 +50,10 @@ Table of contents measurements install configuration - api + webapi/index contributing/index releasenotes/index + api/index glossary .. - installation diff --git a/doc/source/webapi/index.rst b/doc/source/webapi/index.rst new file mode 100644 index 00000000..408fba69 --- /dev/null +++ b/doc/source/webapi/index.rst @@ -0,0 +1,9 @@ +========= + Web API +========= + +.. toctree:: + :maxdepth: 2 + + v1 + v2 diff --git a/doc/source/webapi/v1.rst b/doc/source/webapi/v1.rst new file mode 100644 index 00000000..a4faa483 --- /dev/null +++ b/doc/source/webapi/v1.rst @@ -0,0 +1,6 @@ +============ + V1 Web API +============ + +.. autoflask:: ceilometer.api.v1.app:app + :undoc-static: diff --git a/doc/source/webapi/v2.rst b/doc/source/webapi/v2.rst new file mode 100644 index 00000000..9f9b8fc7 --- /dev/null +++ b/doc/source/webapi/v2.rst @@ -0,0 +1,12 @@ +============ + V2 Web API +============ + +.. default-domain:: wsme + +.. root:: ceilometer.api.controllers.root.RootController + :webpath: + +.. autotype:: ceilometer.api.controllers.v2.Source + +.. service:: /v2/sources