[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-rest-api] 01/05: proposal for extending the API
From: |
gnunet |
Subject: |
[gnunet-rest-api] 01/05: proposal for extending the API |
Date: |
Sat, 09 May 2020 20:17:23 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet-rest-api.
commit cf063ec655b5aefa023f81d5c8cbdeb18458887d
Author: rexxnor <address@hidden>
AuthorDate: Mon May 4 15:34:16 2020 +0200
proposal for extending the API
---
source/identity.rst | 6 +++---
source/namestore.rst | 43 ++++++++++++++++++++++++++++++++++++++++---
2 files changed, 43 insertions(+), 6 deletions(-)
diff --git a/source/identity.rst b/source/identity.rst
index 8474e71..6dc55cf 100644
--- a/source/identity.rst
+++ b/source/identity.rst
@@ -8,7 +8,7 @@ Variables in single quotes ``'...'`` can or must be changed
according to your sp
``public_key`` is the public key of an identity.
-``name`` is the name of an identity.
+``name`` is the name of an identity.
``newname`` is the new name of an identity for the rename request.
@@ -32,7 +32,7 @@ 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) No identity found - Identity was not found with given name,
public key or no identity was found at all
@@ -58,7 +58,7 @@ A response of a message has a HTTP response code. Usually,
this code is 200 OK f
c) 204 No Content - Success PUT or DELETE request
d) 404 Not Found - Identity is not found with identifier
e) 409 Conflict - PUT or POST request not possible due to existing
duplicate
-
+
``d) 404 Not Found`` is always used when the error message is either ``2)``,
``3)`` or ``4)``.
Requests
diff --git a/source/namestore.rst b/source/namestore.rst
index 8ead7c6..eaea0bd 100644
--- a/source/namestore.rst
+++ b/source/namestore.rst
@@ -53,11 +53,11 @@ 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) No identity found - Identity was not found with given name,
this is combined with the HTTP Error Code 404 Not Found
- 3) No default zone specified - Identity name was not given and no
identiy was added to the subsystem namestore
+ 3) No default zone specified - Identity name was not given and no
identiy was added to the subsystem namestore
4) Namestore action failed - The task of the namestore API (not REST
API) failed
5) No data - Missing data
6) Data invalid - Wrong data given
@@ -91,11 +91,27 @@ GET Request
|**Error Response** | {"error":"*error_desc*"} :sup:`2; 4`
|
+--------------------+---------------------------------------------------------+
++--------------------+------------------------------------------------------------------------+
+|**Title** |Returns namestore entry for zone and name optionally
filtering by type. |
++--------------------+------------------------------------------------------------------------+
+|**URL** |:literal:`/namestore/'zone'/'name'?record_type='type'`
|
++--------------------+------------------------------------------------------------------------+
+|**Method** |**GET**
|
++--------------------+------------------------------------------------------------------------+
+|**URL Params** |none
|
++--------------------+------------------------------------------------------------------------+
+|**Data Params** |none
|
++--------------------+------------------------------------------------------------------------+
+|**Success Response**|``Record``
|
++--------------------+------------------------------------------------------------------------+
+|**Error Response** | {"error":"*error_desc*"} :sup:`2; 4`
|
++--------------------+------------------------------------------------------------------------+
+
POST Request
------------
+--------------------+---------------------------------------------------------+
-|**Title** |Creates a namestore entry in a zone
|
+|**Title** |Creates a namestore entry in a zone.
|
+--------------------+---------------------------------------------------------+
|**URL** |:literal:`/namestore/'zone'`
|
+--------------------+---------------------------------------------------------+
@@ -112,6 +128,27 @@ POST Request
|
+PUT Request
+------------
+
++--------------------+---------------------------------------------------------+
+|**Title** |Replaces a namestore entriy in a zone
|
++--------------------+---------------------------------------------------------+
+|**URL** |:literal:`/namestore/'zone'`
|
++--------------------+---------------------------------------------------------+
+|**Method** |**PUT**
|
++--------------------+---------------------------------------------------------+
+|**URL Params** |none
|
++--------------------+---------------------------------------------------------+
+|**Data Params** |``Record``
|
++--------------------+---------------------------------------------------------+
+|**Success Response**|Response Code: :literal:`204` (No Content)
|
++--------------------+---------------------------------------------------------+
+|**Error Response** | {"error":"*error_desc*"} :sup:`3; 4; 5; 6; 7`
|
++--------------------+---------------------------------------------------------+
+
+|
+
DELETE Request
--------------
--
To stop receiving notification emails like this one, please contact
address@hidden.