started working on rest api docs

This commit is contained in:
Sandy Walsh 2014-01-14 21:34:58 +00:00
parent 26d2f6fedc
commit 3fabcecd9f
4 changed files with 107 additions and 2 deletions

103
docs/api.rst Normal file
View File

@ -0,0 +1,103 @@
The StackTach REST Interface
############################
stacky/deployments
==================
.. http:get:: /stacky/deployments/
The list of all available deployments
**Example request**:
.. sourcecode:: http
GET /stacky/deployments HTTP/1.1
Host: example.com
Accept: application/json
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: text/json
[
{
"post_id": 12345,
"author_id": 123,
"tags": ["server", "web"],
"subject": "I tried Nginx"
},
{
"post_id": 12346,
"author_id": 123,
"tags": ["html5", "standards", "web"],
"subject": "We go to HTML 5"
}
]
:query sort: one of ``hit``, ``created-at``
:query offset: offset number. default is 0
:query limit: limit number. default is 30
:reqheader Accept: the response content type depends on
:mailheader:`Accept` header
:reqheader Authorization: optional OAuth token to authenticate
:resheader Content-Type: this depends on :mailheader:`Accept`
header of request
:statuscode 200: no error
:statuscode 404: there's no user
stacky/events
=============
stacky/hosts
============
stacky/uuid
===========
stacky/timings
==============
stacky/timings/uuid
===================
stacky/summary
==============
stacky/request
==============
stacky/reports
==============
stacky/report/<report_id>
=========================
stacky/show/<event_id>
======================
stacky/watch/<deployment_id>
============================
stacky/search
=============
stacky/kpi
==========
stacky/kpi/<tenant_id>
======================
stacky/usage/launches
=====================
stacky/usage/deletes
====================
stacky/usage/exists
===================

View File

@ -28,7 +28,7 @@ import os
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['sphinxcontrib.httpdomain']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

View File

@ -13,6 +13,7 @@ Contents:
intro
setup
api
Indices and tables

View File

@ -7,4 +7,5 @@ prettytable>=0.7.2
argparse
Pympler
requests
south
south
sphinxcontrib-httpdomain