gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet-rest-api] 01/03: added config API doc


From: gnunet
Subject: [GNUnet-SVN] [gnunet-rest-api] 01/03: added config API doc
Date: Tue, 20 Aug 2019 13:16:13 +0200

This is an automated email from the git hooks/post-receive script.

pagkopoulou pushed a commit to branch master
in repository gnunet-rest-api.

commit 2b56d58578770ff643fd32716c0dd336e50ccfcf
Author: Alexia Pagkopoulou <address@hidden>
AuthorDate: Tue Aug 20 11:23:21 2019 +0200

    added config API doc
---
 source/config.rst | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 source/index.rst  |   1 +
 2 files changed, 125 insertions(+)

diff --git a/source/config.rst b/source/config.rst
new file mode 100644
index 0000000..e5e6dc9
--- /dev/null
+++ b/source/config.rst
@@ -0,0 +1,124 @@
+Config API Service
+==================
+
+Definition
+~~~~~~~~~~
+
+Variables in single quotes ``'...'`` can or must be changed according to your 
specific case.
+
+``config`` refers to the configuration file.
+
+``'section'`` is a section of settings in the configuration file.
+
+``'option'`` is an setting in the configuration file with a modifiable 
``'value'``.
+
+Configuration
+-------------
+
+The configuration file is divided in ``sections``, each consisting of various 
``options`` with their corresponding ``values``.
+
+Error Response
+--------------
+
+An error response is sent in the JSON format: 
``{"error":"*error_description*"}``
+
+Following numbers are added for references inside the documentation only.
+
+Error descriptions are::
+    
+    Nr. Error Description                           - Explanation
+    1)  Unknown Error                               - Error is not specified
+    2)  Unable to parse JSON Object from "*URI*"    - Corrupt JSON data given
+
+Error ``1)`` is always possible and is not listed in following requests.
+
+ATTENTION: Any error message from the Configuration API (not REST API) can 
occur and can be returned in the error response. These responses are not listed 
here.
+
+Response Code
+-------------
+
+A response of a message has a HTTP response code. Usually, this code is 200 OK 
for a successful response. The code changes in some cases::
+
+    a) 200 OK           - Normal response (but may contain an error message)
+    b) 201 Created      - Success after POST request
+    c) 400 Bad Request  - Invalid request
+
+Requests
+~~~~~~~~
+
+GET Requests
+------------
+
++--------------------+---------------------------------------------------------------+
+|**Title**           | Returns the config or the specified section of the 
config     |
++--------------------+---------------------------------------------------------------+
+|**URL**             | :literal:`/config`                                      
      |
++--------------------+---------------------------------------------------------------+
+|**Method**          | **GET**                                                 
      |
++--------------------+---------------------------------------------------------------+
+|**URL Params**      | none                                                    
      |
++--------------------+---------------------------------------------------------------+
+|**Data Params**     | none                                                    
      |
++--------------------+---------------------------------------------------------------+
+|**Success Response**| {"section":{"option":"*value*",...},...}                
      |
++--------------------+---------------------------------------------------------------+
+|**Error Response**  | {"error":"*error_desc*"}                                
      |
++--------------------+---------------------------------------------------------------+
+
+|
+
++--------------------+---------------------------------------------------------------+
+|**Title**           | Returns only a specific section                         
      |
++--------------------+---------------------------------------------------------------+
+|**URL**             | ``/config/'section'``                                   
      |
++--------------------+---------------------------------------------------------------+
+|**Method**          | **GET**                                                 
      |
++--------------------+---------------------------------------------------------------+
+|**URL Params**      | none                                                    
      |
++--------------------+---------------------------------------------------------------+
+|**Data Params**     | none                                                    
      |
++--------------------+---------------------------------------------------------------+
+|**Success Response**| {"option":"*value*",...}                                
      |
++--------------------+---------------------------------------------------------------+
+|**Error Response**  | {"error":"*error_desc*"}                                
      |
++--------------------+---------------------------------------------------------------+
+
+
+POST Request
+------------
+
++--------------------+---------------------------------------------------------------+
+|**Title**           | Creates/modifies options in the config                  
      |
++--------------------+---------------------------------------------------------------+
+|**URL**             | :literal:`/config`                                      
      |
++--------------------+---------------------------------------------------------------+
+|**Method**          | **POST**                                                
      |
++--------------------+---------------------------------------------------------------+
+|**URL Params**      | none                                                    
      |
++--------------------+---------------------------------------------------------------+
+|**Data Params**     | {"'section'": {"'option'": "'value'",...},...}          
      |
++--------------------+---------------------------------------------------------------+
+|**Success Response**| Response Code: ``b) 200 OK``                            
      |
++--------------------+---------------------------------------------------------------+
+|**Error Response**  | | {"error":"*error_desc*"}                              
      |
++--------------------+---------------------------------------------------------------+
+
+
+OPTIONS Request
+---------------
+
++--------------------+---------------------------------------------------------------+
+|**Title**           | Gets request options                                    
      |
++--------------------+---------------------------------------------------------------+
+|**URL**             | :literal:`/config`                                      
      |
++--------------------+---------------------------------------------------------------+
+|**Method**          | **OPTIONS**                                             
      |
++--------------------+---------------------------------------------------------------+
+|**URL Params**      | none                                                    
      |
++--------------------+---------------------------------------------------------------+
+|**Data Params**     | none                                                    
      |
++--------------------+---------------------------------------------------------------+
+|**Success Response**|                                                         
      |
++--------------------+---------------------------------------------------------------+
+|**Error Response**  | none                                                    
      |
++--------------------+---------------------------------------------------------------+
diff --git a/source/index.rst b/source/index.rst
index 4fc373e..f68257c 100644
--- a/source/index.rst
+++ b/source/index.rst
@@ -37,6 +37,7 @@ Services
    namestore
    gns
    peerinfo
+   config
 
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]