summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil <phil.buschmann@tum.de>2018-07-30 00:40:48 +0200
committerPhil <phil.buschmann@tum.de>2018-07-30 00:40:48 +0200
commit802b073508b373d6d1dd03c134d301b44cc49b64 (patch)
tree5753f5238fc872bf0e63d2c14402e5c010db0e04
parent974ec01a83adc04d296ff9508c5ae1db4f4d379b (diff)
downloadgnunet-rest-api-802b073508b373d6d1dd03c134d301b44cc49b64.tar.gz
gnunet-rest-api-802b073508b373d6d1dd03c134d301b44cc49b64.zip
add namestore
-rw-r--r--source/index.rst1
-rw-r--r--source/namestore.rst79
2 files changed, 78 insertions, 2 deletions
diff --git a/source/index.rst b/source/index.rst
index b31dec1..3f41bb9 100644
--- a/source/index.rst
+++ b/source/index.rst
@@ -31,6 +31,7 @@ The GNUnet Web API is based in REST principles. Data resources are accessed via
31 31
32 identity 32 identity
33 gns 33 gns
34 namestore
34 35
35 36
36 37
diff --git a/source/namestore.rst b/source/namestore.rst
index 39d21d3..6adb4a2 100644
--- a/source/namestore.rst
+++ b/source/namestore.rst
@@ -1,6 +1,81 @@
1GNUnet Namestore API Service 1GNUnet Namestore API Service
2=========================== 2============================
3 3
4Variables in single quotes ``'...'`` can or must be changed according to your specific case. 4Variables in single quotes ``'...'`` can or must be changed according to your specific case.
5 5
6namestore add: identity_name, record_name, record_type, expiration_time, value, flag(?) 6Namestore communicates with GNS records.
7
8``type`` is the type of the record, e.g. "PKEY" for private key.
9
10``value`` is the value of the specific type of the record, e.g. the private key of an identity.
11
12``time`` is the expiration time of the record either "never" or fancy time (see GNUNET_STRINGS_fancy_time_to_absolute)
13
14``flag`` is the option of the record. Either 0 for none, 2 for private, 8 for relative expiration or 16 if all other records have expired. ``flag`` must be a number
15
16``label`` is the name of the record. No duplicates are allowed.
17
18``error_desc`` is the description of the returned error.
19
20
21GET Request
22------------
23
24+--------------------+---------------------------------------------------------------------------------------------------------------------------+
25|**Title** |Returns all namestore entries |
26+--------------------+---------------------------------------------------------------------------------------------------------------------------+
27|**URL** |:literal:`/namestore` |
28+--------------------+---------------------------------------------------------------------------------------------------------------------------+
29|**Method** |**GET** |
30+--------------------+---------------------------------------------------------------------------------------------------------------------------+
31|**URL Params** |none |
32+--------------------+---------------------------------------------------------------------------------------------------------------------------+
33|**Data Params** |none |
34+--------------------+---------------------------------------------------------------------------------------------------------------------------+
35|**Success Response**|[{"value": "*value*", "type": "*type*", "expiration_time": "*time*", "flag": *flag*, "label": "*name*"},...] |
36+--------------------+---------------------------------------------------------------------------------------------------------------------------+
37|**Error Response** |{"error":"*error_desc*"} |
38+--------------------+---------------------------------------------------------------------------------------------------------------------------+
39
40
41POST Request
42------------
43
44+--------------------+------------------------------------------------------------------------------------------------------+
45|**Title** |Creates a namestore entry |
46+--------------------+------------------------------------------------------------------------------------------------------+
47|**URL** |:literal:`/namestore` |
48+--------------------+------------------------------------------------------------------------------------------------------+
49|**Method** |**POST** |
50+--------------------+------------------------------------------------------------------------------------------------------+
51|**URL Params** |none |
52+--------------------+------------------------------------------------------------------------------------------------------+
53|**Data Params** |{"value": "*value*", "type": "*type*", "expiration_time": "*time*", "flag": *flag*, "label": "*name*"}|
54+--------------------+------------------------------------------------------------------------------------------------------+
55|**Success Response**|Response Code: :literal:`204` (No Content) |
56+--------------------+------------------------------------------------------------------------------------------------------+
57|**Error Response** | | {"error":"*error_desc*"} |
58| | | *or* |
59| | | Response Code: :literal:`409` (Conflict) |
60+--------------------+------------------------------------------------------------------------------------------------------+
61
62
63DELETE Request
64--------------
65
66+--------------------+----------------------------------------------------+
67| **Title** | Deletes specific namestore entry |
68+--------------------+----------------------------------------------------+
69|**URL** |:literal:`/namestore?label='label'` |
70+--------------------+----------------------------------------------------+
71|**Method** | **DELETE** |
72+--------------------+----------------------------------------------------+
73|**URL Params** | none |
74+--------------------+----------------------------------------------------+
75|**Data Params** | none |
76+--------------------+----------------------------------------------------+
77|**Success Response**| Response Code: :literal:`204` (No Content) |
78+--------------------+----------------------------------------------------+
79|**Error Response** | {"error":"*error_desc*"} |
80+--------------------+----------------------------------------------------+
81