From d0530b7d59a5ea5a5110d3001a94d3d56b022672 Mon Sep 17 00:00:00 2001 From: aviau Date: Wed, 29 Apr 2015 09:56:12 -0400 Subject: [PATCH] Documented Actions API Change-Id: Ia7ae9ae8b26556102008a0c1b80542a2277e9c1e --- doc/source/conf.py | 9 +++--- doc/source/index.rst | 1 - doc/source/webapi/v2/actions.rst | 26 ++++++++++++++++ doc/source/webapi/v2/config.rst | 19 +++++++----- doc/source/webapi/v2/index.rst | 1 + doc/source/webapi/v2/logs.rst | 36 ----------------------- doc/source/webapi/v2/status.rst | 4 +-- surveil/api/datamodel/actions/downtime.py | 2 +- test-requirements.txt | 1 + 9 files changed, 48 insertions(+), 51 deletions(-) create mode 100644 doc/source/webapi/v2/actions.rst delete mode 100644 doc/source/webapi/v2/logs.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index c658b40..eed13ab 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -25,7 +25,7 @@ extensions = [ 'sphinx.ext.intersphinx', 'sphinxcontrib.autohttp.flask', 'sphinxcontrib.pecanwsme.rest', - 'oslosphinx', + # 'oslosphinx', 'wsmeext.sphinxext', ] @@ -43,7 +43,7 @@ master_doc = 'index' # General information about the project. project = u'surveil' -copyright = u'2014, Surveil Contributors' +copyright = u'2014-2015, Surveil Contributors' # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True @@ -60,8 +60,9 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] -# html_theme = '_theme' -html_static_path = ['_static'] +import sphinx_rtd_theme +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project diff --git a/doc/source/index.rst b/doc/source/index.rst index 38dc1d4..3b36b61 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -8,7 +8,6 @@ Table of Contents: :maxdepth: 2 readme - getting_started webapi/index Indices and tables diff --git a/doc/source/webapi/v2/actions.rst b/doc/source/webapi/v2/actions.rst new file mode 100644 index 0000000..5bfdc1f --- /dev/null +++ b/doc/source/webapi/v2/actions.rst @@ -0,0 +1,26 @@ +.. docbookrestapi + +======= +Actions +======= + +acknowledge +=========== + +.. rest-controller:: surveil.api.controllers.v2.actions.acknowledge:AcknowledgeController + :webprefix: /v2/actions/acknowledge + +downtime +======== + +.. rest-controller:: surveil.api.controllers.v2.actions.downtime:DowntimeController + :webprefix: /v2/actions/downtime + +types documentation +=================== + +.. autotype:: surveil.api.datamodel.actions.acknowledgement.Acknowledgement + :members: + +.. autotype:: surveil.api.datamodel.actions.downtime.Downtime + :members: diff --git a/doc/source/webapi/v2/config.rst b/doc/source/webapi/v2/config.rst index a8be265..4fe7c45 100644 --- a/doc/source/webapi/v2/config.rst +++ b/doc/source/webapi/v2/config.rst @@ -28,11 +28,6 @@ Hosts .. rest-controller:: surveil.api.controllers.v2.config.hosts:ServiceCheckResultsSubController :webprefix: /v2/config/hosts/(host_name)/services/(service_description)/results -.. autotype:: surveil.api.controllers.v2.datamodel.checkresult.CheckResult - :members: - -.. autotype:: surveil.api.controllers.v2.datamodel.host.Host - :members: Services ======== @@ -40,7 +35,7 @@ Services .. rest-controller:: surveil.api.controllers.v2.config.services:ServicesController :webprefix: /v2/config/services -.. autotype:: surveil.api.controllers.v2.datamodel.service.Service +.. autotype:: surveil.api.datamodel.config.service.Service :members: @@ -53,6 +48,16 @@ Commands .. rest-controller:: surveil.api.controllers.v2.config.commands:CommandController :webprefix: /v2/config/commands -.. autotype:: surveil.api.controllers.v2.datamodel.command.Command + +types documentation +=================== + +.. autotype:: surveil.api.datamodel.config.command.Command + :members: + +.. autotype:: surveil.api.datamodel.config.host.Host + :members: + +.. autotype:: surveil.api.datamodel.checkresult.CheckResult :members: diff --git a/doc/source/webapi/v2/index.rst b/doc/source/webapi/v2/index.rst index e1501b0..d1fc9e9 100644 --- a/doc/source/webapi/v2/index.rst +++ b/doc/source/webapi/v2/index.rst @@ -7,3 +7,4 @@ V2 Web API config status + actions diff --git a/doc/source/webapi/v2/logs.rst b/doc/source/webapi/v2/logs.rst deleted file mode 100644 index 798c673..0000000 --- a/doc/source/webapi/v2/logs.rst +++ /dev/null @@ -1,36 +0,0 @@ -.. docbookrestapi - -==== -Logs -==== - -.. rest-controller:: surveil.api.controllers.v2.logs:LogsController - :webprefix: /v2/logs - - -Acknowledgements -================ - -.. rest-controller:: surveil.api.controllers.v2.logs.acknowledgements:AcknowledgementsController - :webprefix: /v2/logs/acknowledgements - - -Comments -======== - -.. rest-controller:: surveil.api.controllers.v2.logs.comments:CommentsController - :webprefix: /v2/logs/comments - - -Downtimes -========= - -.. rest-controller:: surveil.api.controllers.v2.logs.downtimes:DowntimesController - :webprefix: /v2/logs/downtimes - - -Notifications -============= - -.. rest-controller:: surveil.api.controllers.v2.logs.notifications:NotificationsController - :webprefix: /v2/logs/notifications \ No newline at end of file diff --git a/doc/source/webapi/v2/status.rst b/doc/source/webapi/v2/status.rst index 85db748..99730da 100644 --- a/doc/source/webapi/v2/status.rst +++ b/doc/source/webapi/v2/status.rst @@ -54,8 +54,8 @@ Metrics .. rest-controller:: surveil.api.controllers.v2.status.metrics:MetricController :webprefix: /v2/status/metrics/ -Types -===== +types documentation +=================== .. autotype:: surveil.api.datamodel.status.live_service.LiveService :members: diff --git a/surveil/api/datamodel/actions/downtime.py b/surveil/api/datamodel/actions/downtime.py index 87a6765..6e4dd51 100644 --- a/surveil/api/datamodel/actions/downtime.py +++ b/surveil/api/datamodel/actions/downtime.py @@ -25,7 +25,7 @@ class Downtime(types.Base): service_description = wsme.wsattr(wtypes.text, mandatory=False) """Ther service description""" - time_stamp = wsme.wsattr(wtypes.text, mandatory=False) + time_stamp = wsme.wsattr(int, mandatory=False) """Time stamp for the downtime""" start_time = wsme.wsattr(int, mandatory=False) diff --git a/test-requirements.txt b/test-requirements.txt index fe33a51..1f3ffeb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,3 +7,4 @@ oslosphinx>=2.5.0 testrepository>=0.0.18 mongomock httpretty +sphinx_rtd_theme