Commit 0a722e07 authored by Mark Caglienzi's avatar Mark Caglienzi

Merge branch 'sphinx'

parents 8eece08b b84dbb5e
# fuss-manager REST API
## General description
The main API entry point is at `/api/1.0`. All methods return `JSON` results,
and the result is always an Object whether the request is successful or not.
All successful requests return objects with the `time` key set to the server
time as a Unix timestamp.
All failed requests return objects with three keys:
* `error`: `true`
* `code`: the HTTP error code
* `message`: a string describing the error
`GET` requests can take extra arguments in a query string.
`POST` requests take their input from the `POST` body encoded as `JSON`.
## API methods
### `ping`
Takes no arguments.
Returns:
* `pong`: `true`
### `async_ping`
Takes no arguments.
Returns:
* `pong`: `true`
### `machines`
Takes no arguments.
Returns:
* `machines`: list of machine objects.
Each machine object contains the following keys:
* `mac`: MAC address, as a string
* `ip`: IP address, as a string
* `name`: machine name
* `first_seen`: time the machine was first seen, as a Unix timestamp
* `last_seen`: time the machine was last seen, as a Unix timestamp
You can use the response `time` timestamp to compute how long ago a machine was
first or last seen without introducing errors due to the clock difference
between the browser and the server.
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# 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.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
project = 'fuss-manager'
copyright = '2019-2020, Provincia Autonoma di Bolzano'
author = 'Provincia Autonoma di Bolzano'
# -- General configuration ---------------------------------------------------
# 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',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
]
# This is needed by sphinx in buster
master_doc = 'index'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Extension configuration -------------------------------------------------
# -- Options for todo extension ----------------------------------------------
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
.. fuss-manager documentation master file, created by
sphinx-quickstart on Tue Aug 18 13:35:02 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to fuss-manager's documentation!
========================================
.. toctree::
:maxdepth: 2
:caption: Contents:
configuration
web_interface
rest_api
reference
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
manager.compat module
=====================
.. automodule:: manager.compat
:members:
:undoc-members:
:show-inheritance:
manager.config module
=====================
.. automodule:: manager.config
:members:
:undoc-members:
:show-inheritance:
manager.events module
=====================
.. automodule:: manager.events
:members:
:undoc-members:
:show-inheritance:
manager.manager module
======================
.. automodule:: manager.manager
:members:
:undoc-members:
:show-inheritance:
manager.ops module
==================
.. automodule:: manager.ops
:members:
:undoc-members:
:show-inheritance:
manager.perms module
====================
.. automodule:: manager.perms
:members:
:undoc-members:
:show-inheritance:
manager.playbook module
=======================
.. automodule:: manager.playbook
:members:
:undoc-members:
:show-inheritance:
manager package
===============
.. automodule:: manager
:members:
:undoc-members:
:show-inheritance:
Subpackages
-----------
.. toctree::
manager.sources
manager.users
manager.web
Submodules
----------
.. toctree::
manager.compat
manager.config
manager.events
manager.manager
manager.ops
manager.perms
manager.playbook
manager.signing
manager.stores
manager.signing module
======================
.. automodule:: manager.signing
:members:
:undoc-members:
:show-inheritance:
manager.sources.arpwatch module
===============================
.. automodule:: manager.sources.arpwatch
:members:
:undoc-members:
:show-inheritance:
manager.sources.base module
===========================
.. automodule:: manager.sources.base
:members:
:undoc-members:
:show-inheritance:
manager.sources.chaos module
============================
.. automodule:: manager.sources.chaos
:members:
:undoc-members:
:show-inheritance:
manager.sources.command module
==============================
.. automodule:: manager.sources.command
:members:
:undoc-members:
:show-inheritance:
manager.sources.dhcp module
===========================
.. automodule:: manager.sources.dhcp
:members:
:undoc-members:
:show-inheritance:
manager.sources.inotifywait module
==================================
.. automodule:: manager.sources.inotifywait
:members:
:undoc-members:
:show-inheritance:
manager.sources package
=======================
.. automodule:: manager.sources
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
.. toctree::
manager.sources.arpwatch
manager.sources.base
manager.sources.chaos
manager.sources.command
manager.sources.dhcp
manager.sources.inotifywait
manager.stores module
=====================
.. automodule:: manager.stores
:members:
:undoc-members:
:show-inheritance:
manager.users.db module
=======================
.. automodule:: manager.users.db
:members:
:undoc-members:
:show-inheritance:
manager.users.ldap module
=========================
.. automodule:: manager.users.ldap
:members:
:undoc-members:
:show-inheritance:
manager.users.local module
==========================
.. automodule:: manager.users.local
:members:
:undoc-members:
:show-inheritance:
manager.users.master module
===========================
.. automodule:: manager.users.master
:members:
:undoc-members:
:show-inheritance:
manager.users.mock module
=========================
.. automodule:: manager.users.mock
:members:
:undoc-members:
:show-inheritance:
manager.users package
=====================
.. automodule:: manager.users
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
.. toctree::
manager.users.db
manager.users.ldap
manager.users.local
manager.users.master
manager.users.mock
manager.web package
===================
.. automodule:: manager.web
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
.. toctree::
manager.web.server
manager.web.session
manager.web.static
manager.web.views
manager.web.webapi
manager.web.server module
=========================
.. automodule:: manager.web.server
:members:
:undoc-members:
:show-inheritance:
manager.web.session module
==========================
.. automodule:: manager.web.session
:members:
:undoc-members:
:show-inheritance:
manager.web.static module
=========================
.. automodule:: manager.web.static
:members:
:undoc-members:
:show-inheritance:
manager.web.views module
========================
.. automodule:: manager.web.views
:members:
:undoc-members:
:show-inheritance:
manager.web.webapi module
=========================
.. automodule:: manager.web.webapi
:members:
:undoc-members:
:show-inheritance:
*************************
Reference documentation
*************************
.. toctree::
:maxdepth: 2
:caption: Contents:
manager/manager
***********************
fuss-manager REST API
***********************
General description
===================
The main API entry point is at ``/api/1.0``. All methods return ``JSON``
results, and the result is always an Object whether the request is
successful or not.
All successful requests return objects with the ``time`` key set to the
server time as a Unix timestamp.
All failed requests return objects with three keys:
- ``error``: ``true``
- ``code``: the HTTP error code
- ``message``: a string describing the error
``GET`` requests can take extra arguments in a query string.
``POST`` requests take their input from the ``POST`` body encoded as
``JSON``.
API methods
===========
``ping``
--------
Takes no arguments.
Returns:
- ``pong``: ``true``
``async_ping``
--------------
Takes no arguments.
Returns:
- ``pong``: ``true``
``machines``
------------
Takes no arguments.
Returns:
- ``machines``: list of machine objects.
Each machine object contains the following keys:
- ``mac``: MAC address, as a string
- ``ip``: IP address, as a string
- ``name``: machine name
- ``first_seen``: time the machine was first seen, as a Unix timestamp
- ``last_seen``: time the machine was last seen, as a Unix timestamp
You can use the response ``time`` timestamp to compute how long ago a
machine was first or last seen without introducing errors due to the
clock difference between the browser and the server.
Fuss Manager web interface
==========================
Fuss Manager web interface specs
================================
Browser compatibility
---------------------
......@@ -21,5 +21,5 @@ packaged versions, falling back on the fuss-manager static file
directory when assets are not found there.
The idea is to target Debian Bullseye and Debian Buster+backports for
offical packaging, and make the package still installable, even if not
official packaging, and make the package still installable, even if not
fully policy compliant, for earlier versions of Debian.
#!/bin/sh
# Usage: ./update-docs
# This script looks for new modules in the listed packages and creates the
# respective autodoc files.
# It will delete existing files! use due care when committing the resulting # change
PACKAGES=manager
for P in $PACKAGES
do
mkdir -p docs/$P
sphinx-apidoc -f -e -M -o docs/$P $P
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment