summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorPhil <phil.buschmann@tum.de>2018-06-11 20:23:00 +0200
committerPhil <phil.buschmann@tum.de>2018-06-11 20:23:00 +0200
commitee0ee0d7bb3270944112af9e8509569319948d11 (patch)
treec227db66ca5620f1dcd78b04f547f88821378930 /source
downloadgnunet-rest-api-ee0ee0d7bb3270944112af9e8509569319948d11.tar.gz
gnunet-rest-api-ee0ee0d7bb3270944112af9e8509569319948d11.zip
Initial commit
Diffstat (limited to 'source')
-rw-r--r--source/conf.py155
-rw-r--r--source/gns.rst47
-rw-r--r--source/identity.rst130
-rw-r--r--source/index.rst43
-rw-r--r--source/intro.rst110
5 files changed, 485 insertions, 0 deletions
diff --git a/source/conf.py b/source/conf.py
new file mode 100644
index 0000000..e5ed1eb
--- /dev/null
+++ b/source/conf.py
@@ -0,0 +1,155 @@
1# -*- coding: utf-8 -*-
2#
3# Configuration file for the Sphinx documentation builder.
4#
5# This file does only contain a selection of the most common options. For a
6# full list see the documentation:
7# http://www.sphinx-doc.org/en/master/config
8
9# -- Path setup --------------------------------------------------------------
10
11# If extensions (or modules to document with autodoc) are in another directory,
12# add these directories to sys.path here. If the directory is relative to the
13# documentation root, use os.path.abspath to make it absolute, like shown here.
14#
15# import os
16# import sys
17# sys.path.insert(0, os.path.abspath('.'))
18
19
20# -- Project information -----------------------------------------------------
21
22project = 'GNUnet REST API'
23copyright = '2018, Philippe Buschmann'
24author = 'Philippe Buschmann'
25
26# The short X.Y version
27version = ''
28# The full version, including alpha/beta/rc tags
29release = ''
30
31
32# -- General configuration ---------------------------------------------------
33
34# If your documentation needs a minimal Sphinx version, state it here.
35#
36# needs_sphinx = '1.0'
37
38# Add any Sphinx extension module names here, as strings. They can be
39# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
40# ones.
41extensions = [
42]
43
44# Add any paths that contain templates here, relative to this directory.
45templates_path = ['_templates']
46
47# The suffix(es) of source filenames.
48# You can specify multiple suffix as a list of string:
49#
50# source_suffix = ['.rst', '.md']
51source_suffix = '.rst'
52
53# The master toctree document.
54master_doc = 'index'
55
56# The language for content autogenerated by Sphinx. Refer to documentation
57# for a list of supported languages.
58#
59# This is also used if you do content translation via gettext catalogs.
60# Usually you set "language" from the command line for these cases.
61language = None
62
63# List of patterns, relative to source directory, that match files and
64# directories to ignore when looking for source files.
65# This pattern also affects html_static_path and html_extra_path .
66exclude_patterns = []
67
68# The name of the Pygments (syntax highlighting) style to use.
69pygments_style = 'sphinx'
70
71
72# -- Options for HTML output -------------------------------------------------
73
74# The theme to use for HTML and HTML Help pages. See the documentation for
75# a list of builtin themes.
76#
77html_theme = 'alabaster'
78
79# Theme options are theme-specific and customize the look and feel of a theme
80# further. For a list of options available for each theme, see the
81# documentation.
82#
83# html_theme_options = {}
84
85# Add any paths that contain custom static files (such as style sheets) here,
86# relative to this directory. They are copied after the builtin static files,
87# so a file named "default.css" will overwrite the builtin "default.css".
88html_static_path = ['_static']
89
90# Custom sidebar templates, must be a dictionary that maps document names
91# to template names.
92#
93# The default sidebars (for documents that don't match any pattern) are
94# defined by theme itself. Builtin themes are using these templates by
95# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
96# 'searchbox.html']``.
97#
98# html_sidebars = {}
99
100
101# -- Options for HTMLHelp output ---------------------------------------------
102
103# Output file base name for HTML help builder.
104htmlhelp_basename = 'GNUnetRESTAPIdoc'
105
106
107# -- Options for LaTeX output ------------------------------------------------
108
109latex_elements = {
110 # The paper size ('letterpaper' or 'a4paper').
111 #
112 # 'papersize': 'letterpaper',
113
114 # The font size ('10pt', '11pt' or '12pt').
115 #
116 # 'pointsize': '10pt',
117
118 # Additional stuff for the LaTeX preamble.
119 #
120 # 'preamble': '',
121
122 # Latex figure (float) alignment
123 #
124 # 'figure_align': 'htbp',
125}
126
127# Grouping the document tree into LaTeX files. List of tuples
128# (source start file, target name, title,
129# author, documentclass [howto, manual, or own class]).
130latex_documents = [
131 (master_doc, 'GNUnetRESTAPI.tex', 'GNUnet REST API Documentation',
132 'Philippe Buschmann', 'manual'),
133]
134
135
136# -- Options for manual page output ------------------------------------------
137
138# One entry per manual page. List of tuples
139# (source start file, name, description, authors, manual section).
140man_pages = [
141 (master_doc, 'gnunetrestapi', 'GNUnet REST API Documentation',
142 [author], 1)
143]
144
145
146# -- Options for Texinfo output ----------------------------------------------
147
148# Grouping the document tree into Texinfo files. List of tuples
149# (source start file, target name, title, author,
150# dir menu entry, description, category)
151texinfo_documents = [
152 (master_doc, 'GNUnetRESTAPI', 'GNUnet REST API Documentation',
153 author, 'GNUnetRESTAPI', 'One line description of project.',
154 'Miscellaneous'),
155] \ No newline at end of file
diff --git a/source/gns.rst b/source/gns.rst
new file mode 100644
index 0000000..1a77379
--- /dev/null
+++ b/source/gns.rst
@@ -0,0 +1,47 @@
1GNUnet GNS API Service
2======================
3
4
5============
6GET Requests
7============
8
9+--------------------+------------------------------------------------------------------------------------------+
10|**Title** |Return all records for given name |
11+--------------------+------------------------------------------------------------------------------------------+
12|**URL** |:literal:`/gns` |
13+--------------------+------------------------------------------------------------------------------------------+
14|**Method** |**GET** |
15+--------------------+------------------------------------------------------------------------------------------+
16|**URL Params** | | ``?name=``:name |
17| | | optional: ``&record_type=``:type |
18| | | optional: ``&options=``:(0|1|2) |
19| | | optional: ``&pkey=``:zonekey *or* ``&ego=``:identity_name |
20+--------------------+------------------------------------------------------------------------------------------+
21|**Data Params** |none |
22+--------------------+------------------------------------------------------------------------------------------+
23|**Success Response**|[{"id":"*id*", "type":"*ego*", "name":"*name*"},...] |
24+--------------------+------------------------------------------------------------------------------------------+
25|**Error Response** |{"error":"*error_desc*"} |
26+--------------------+------------------------------------------------------------------------------------------+
27
28
29===============
30OPTIONS Request
31===============
32
33+--------------------+---------------------------------------------------------+
34|**Title** |Get request options |
35+--------------------+---------------------------------------------------------+
36|**URL** |:literal:`/gns` |
37+--------------------+---------------------------------------------------------+
38|**Method** |**OPTIONS** |
39+--------------------+---------------------------------------------------------+
40|**URL Params** |none |
41+--------------------+---------------------------------------------------------+
42|**Data Params** |none |
43+--------------------+---------------------------------------------------------+
44|**Success Response**|Access-Control-Allow-Methods: GET |
45+--------------------+---------------------------------------------------------+
46|**Error Response** |none |
47+--------------------+---------------------------------------------------------+
diff --git a/source/identity.rst b/source/identity.rst
new file mode 100644
index 0000000..48e5e5a
--- /dev/null
+++ b/source/identity.rst
@@ -0,0 +1,130 @@
1GNUnet Identity API Service
2===========================
3
4
5============
6GET Requests
7============
8
9+--------------------+----------------------------------------------------+
10|**Title** |Return all identities |
11+--------------------+----------------------------------------------------+
12|**URL** |:literal:`/identity` |
13+--------------------+----------------------------------------------------+
14|**Method** |**GET** |
15+--------------------+----------------------------------------------------+
16|**URL Params** |none |
17+--------------------+----------------------------------------------------+
18|**Data Params** |none |
19+--------------------+----------------------------------------------------+
20|**Success Response**|[{"id":"*id*", "type":"*ego*", "name":"*name*"},...]|
21+--------------------+----------------------------------------------------+
22|**Error Response** |{"error":"*error_desc*"} |
23+--------------------+----------------------------------------------------+
24
25|
26+--------------------+----------------------------------------------------+
27|**Title** |Return specific identity |
28+--------------------+----------------------------------------------------+
29|**URL** |:literal:`/identity:id` |
30+--------------------+----------------------------------------------------+
31|**Method** |**GET** |
32+--------------------+----------------------------------------------------+
33|**URL Params** |none |
34+--------------------+----------------------------------------------------+
35|**Data Params** |none |
36+--------------------+----------------------------------------------------+
37|**Success Response**|[{"id":"*id*", "type":"*ego*", "name":"*name*"}] |
38+--------------------+----------------------------------------------------+
39|**Error Response** |{"error":"*error_desc*"} |
40+--------------------+----------------------------------------------------+
41
42============
43POST Request
44============
45
46+--------------------+----------------------------------------------------+
47|**Title** |Create identity |
48+--------------------+----------------------------------------------------+
49|**URL** |:literal:`/identity` |
50+--------------------+----------------------------------------------------+
51|**Method** |**POST** |
52+--------------------+----------------------------------------------------+
53|**URL Params** |none |
54+--------------------+----------------------------------------------------+
55|**Data Params** |{"name":"*name*"} |
56+--------------------+----------------------------------------------------+
57|**Success Response**|Response Code: :literal:`201` (Created) |
58+--------------------+----------------------------------------------------+
59|**Error Response** | | {"error":"*error_desc*"} |
60| | | *or* |
61| | | Response Code: :literal:`409` (Conflict) |
62+--------------------+----------------------------------------------------+
63
64===========
65PUT Request
66===========
67
68+--------------------+----------------------------------------------------+
69|**Title** |Change name or subsystem of identity |
70+--------------------+----------------------------------------------------+
71|**URL** |:literal:`/identity/:id` |
72+--------------------+----------------------------------------------------+
73|**Method** |**PUT** |
74+--------------------+----------------------------------------------------+
75|**URL Params** |none |
76+--------------------+----------------------------------------------------+
77|**Data Params** | | {"newname":"*name*"} : Rename |
78| | | *or* |
79| | | {"subsystem":"*name*"} : Set subsystem |
80+--------------------+----------------------------------------------------+
81|**Success Response**|Response Code: :literal:`204` (No Content) |
82+--------------------+----------------------------------------------------+
83|**Error Response** | | {"error":"*error_desc*"} |
84| | | *or* |
85| | | Response Code: :literal:`404` (Not Found) |
86| | | *or* |
87| | | Response Code: :literal:`409` (Conflict) |
88+--------------------+----------------------------------------------------+
89
90==============
91DELETE Request
92==============
93
94+--------------------+----------------------------------------------------+
95|**Title** |Delete specific identity |
96+--------------------+----------------------------------------------------+
97|**URL** |:literal:`/identity:id` |
98+--------------------+----------------------------------------------------+
99|**Method** |**DELETE** |
100+--------------------+----------------------------------------------------+
101|**URL Params** |none |
102+--------------------+----------------------------------------------------+
103|**Data Params** |none |
104+--------------------+----------------------------------------------------+
105|**Success Response**|Response Code: :literal:`204` (No Content) |
106+--------------------+----------------------------------------------------+
107|**Error Response** | | {"error":"*error_desc*"} |
108| | | *or* |
109| | | Response Code: :literal:`404` (Not Found) |
110+--------------------+----------------------------------------------------+
111
112===============
113OPTIONS Request
114===============
115
116+--------------------+---------------------------------------------------------+
117|**Title** |Get request options |
118+--------------------+---------------------------------------------------------+
119|**URL** |:literal:`/identity` |
120+--------------------+---------------------------------------------------------+
121|**Method** |**OPTIONS** |
122+--------------------+---------------------------------------------------------+
123|**URL Params** |none |
124+--------------------+---------------------------------------------------------+
125|**Data Params** |none |
126+--------------------+---------------------------------------------------------+
127|**Success Response**|Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS|
128+--------------------+---------------------------------------------------------+
129|**Error Response** |none |
130+--------------------+---------------------------------------------------------+
diff --git a/source/index.rst b/source/index.rst
new file mode 100644
index 0000000..b31dec1
--- /dev/null
+++ b/source/index.rst
@@ -0,0 +1,43 @@
1.. GNUnet REST API documentation master file, created by
2 sphinx-quickstart on Mon May 28 19:41:25 2018.
3 You can adapt this file completely to your liking, but it should at least
4 contain the root `toctree` directive.
5
6Welcome to GNUnet REST API's documentation!
7===========================================
8
9========
10Requests
11========
12
13The GNUnet Web API is based in REST principles. Data resources are accessed via HTTP requests to an API endpoint. Where possible, the Web API uses the following HTTP methods for each action:
14
15+----------+-----------------------------+
16|**Method**|**Action** |
17+----------+-----------------------------+
18|GET |Retrieve object(s) |
19+----------+-----------------------------+
20|POST |Create new object(s) |
21+----------+-----------------------------+
22|PUT |Edit existing object(s) |
23+----------+-----------------------------+
24|DELETE |Delete existing object(s) |
25+----------+-----------------------------+
26
27
28.. toctree::
29 :maxdepth: 2
30 :caption: Contents:
31
32 identity
33 gns
34
35
36
37==================
38Indices and tables
39==================
40
41* :ref:`genindex`
42* :ref:`modindex`
43* :ref:`search`
diff --git a/source/intro.rst b/source/intro.rst
new file mode 100644
index 0000000..ffa2a6a
--- /dev/null
+++ b/source/intro.rst
@@ -0,0 +1,110 @@
1GNUnet Identity API Service
2===========================
3
4
5============
6GET Requests
7============
8
9+--------------------+----------------------------------------------------+
10|**Title** |Return all identities |
11+--------------------+----------------------------------------------------+
12|**URL** |:literal:`/identity` |
13+--------------------+----------------------------------------------------+
14|**Method** |**GET** |
15+--------------------+----------------------------------------------------+
16|**URL Params** |none |
17+--------------------+----------------------------------------------------+
18|**Data Params** |none |
19+--------------------+----------------------------------------------------+
20|**Success Response**|[{"id":"*id*", "type":"*ego*", "name":"*name*"},...]|
21+--------------------+----------------------------------------------------+
22|**Error Response** |{"error":"*error_desc*"} |
23+--------------------+----------------------------------------------------+
24
25|
26+--------------------+----------------------------------------------------+
27|**Title** |Return specific identity |
28+--------------------+----------------------------------------------------+
29|**URL** |:literal:`/identity:id` |
30+--------------------+----------------------------------------------------+
31|**Method** |**GET** |
32+--------------------+----------------------------------------------------+
33|**URL Params** |none |
34+--------------------+----------------------------------------------------+
35|**Data Params** |none |
36+--------------------+----------------------------------------------------+
37|**Success Response**|[{"id":"*id*", "type":"*ego*", "name":"*name*"}] |
38+--------------------+----------------------------------------------------+
39|**Error Response** |{"error":"*error_desc*"} |
40+--------------------+----------------------------------------------------+
41
42============
43POST Request
44============
45
46+--------------------+----------------------------------------------------+
47|**Title** |Create identity |
48+--------------------+----------------------------------------------------+
49|**URL** |:literal:`/identity` |
50+--------------------+----------------------------------------------------+
51|**Method** |**POST** |
52+--------------------+----------------------------------------------------+
53|**URL Params** |none |
54+--------------------+----------------------------------------------------+
55|**Data Params** |{"name":"*name*"} |
56+--------------------+----------------------------------------------------+
57|**Success Response**|Response Code: :literal:`201` (Created) |
58+--------------------+----------------------------------------------------+
59|**Error Response** | | {"error":"*error_desc*"} |
60| | | *or* |
61| | | Response Code: :literal:`409` (Conflict) |
62+--------------------+----------------------------------------------------+
63
64===========
65PUT Request
66===========
67
68+--------------------+----------------------------------------------------+
69|**Title** |Change name or subsystem of identity |
70+--------------------+----------------------------------------------------+
71|**URL** |:literal:`/identity/:id` |
72+--------------------+----------------------------------------------------+
73|**Method** |**PUT** |
74+--------------------+----------------------------------------------------+
75|**URL Params** |none |
76+--------------------+----------------------------------------------------+
77|**Data Params** | | {"newname":"*name*"} : Rename |
78| | | *or* |
79| | | {"subsystem":"*name*"} : Set subsystem |
80+--------------------+----------------------------------------------------+
81|**Success Response**|Response Code: :literal:`204` (No Content) |
82+--------------------+----------------------------------------------------+
83|**Error Response** | | {"error":"*error_desc*"} |
84| | | *or* |
85| | | Response Code: :literal:`404` (Not Found) |
86| | | *or* |
87| | | Response Code: :literal:`409` (Conflict) |
88+--------------------+----------------------------------------------------+
89
90==============
91DELETE Request
92==============
93
94+--------------------+----------------------------------------------------+
95|**Title** |Delete specific identity |
96+--------------------+----------------------------------------------------+
97|**URL** |:literal:`/identity:id` |
98+--------------------+----------------------------------------------------+
99|**Method** |**DELETE** |
100+--------------------+----------------------------------------------------+
101|**URL Params** |none |
102+--------------------+----------------------------------------------------+
103|**Data Params** |none |
104+--------------------+----------------------------------------------------+
105|**Success Response**|Response Code: :literal:`204` (No Content) |
106+--------------------+----------------------------------------------------+
107|**Error Response** | | {"error":"*error_desc*"} |
108| | | *or* |
109| | | Response Code: :literal:`404` (Not Found) |
110+--------------------+----------------------------------------------------+