From 0a856f7c2695d3e4cac62fd8df8d03663f00bcf4 Mon Sep 17 00:00:00 2001 From: Jesus Perez Date: Fri, 15 Jan 2016 11:30:51 +0100 Subject: [PATCH 1/2] add apiary reference --- README.rst | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index 65345c5..5042f8a 100644 --- a/README.rst +++ b/README.rst @@ -33,24 +33,14 @@ found in the `Generating support keys`_. Top_ -API Overview -============ - -To show the help of service, you can use the operation:: - - GET / (text/html) +API Reference Documentation +--------------------------- -To query the keys, you should use the next operations:: - - GET /v1/support//sshkey (text/plain) - - GET /v1/support//gpgkey (text/plain) +- `FIWARE Aiakos v1 (Apiary)`__ -To upload the keys, you should use the next operation, adding payload with the key:: +__ `FIWARE Aiakos - Apiary`_ - POST /v1/support/ (text/plain) - (Use X-Auth-Token in header) Top_ @@ -132,5 +122,6 @@ Top_ .. _FIWARE: http://www.fiware.org/ .. _FIWARE Lab: https://www.fiware.org/lab/ .. _`github issues`: https://github.com/telefonicaid/fiware-aiakos/issues +.. _FIWARE Aiakos - Apiary: https://jsapi.apiary.io/apis/fiwareaiakos/reference.html .. _`Generating support keys`: doc/README.rst .. _`Dockerfile`: Dockerfile From 4f68f21592d0143c47b06dfdf48e8fa6e553f2fd Mon Sep 17 00:00:00 2001 From: Jesus Perez Date: Fri, 15 Jan 2016 12:43:18 +0100 Subject: [PATCH 2/2] add api overview with example --- README.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.rst b/README.rst index 5042f8a..138e1c1 100644 --- a/README.rst +++ b/README.rst @@ -33,6 +33,33 @@ found in the `Generating support keys`_. Top_ +API Overview +============ + +To upload new/modified a gpg key to the server. You should send a POST like this: + +:: + + curl --request POST \ + --url http://aiakoshost/v1/support \ + --header 'accept: text/plain' \ + --header 'content-type: text/plain' \ + --header 'x-auth-token: 201dd9a13de844db905cb4f617cbc17d' \ + --data '-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: GnuPG v1\n\nmQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au\n-----END PGP PUBLIC KEY BLOCK-----' + +The result of this operation is a text/plain response with the generated key: + +:: + + -----BEGIN PGP PUBLIC KEY BLOCK----- + Version: GnuPG v1 + + mQENBFWnVCYBCADPeDMbTOkCM4MPbUMvtbAtGbUDnH3AHyZCEZZuyjeExATfT0Au + -----END PGP PUBLIC KEY BLOCK----- + + +Please have a look at the `API Reference Documentation`_ section below for more description and operations. + API Reference Documentation ---------------------------