Commit c70d8920 authored by Cédric Bonhomme's avatar Cédric Bonhomme

Merge branch 'master' of git.list.lu:charism/shelter-database

parents 18b7a4f2 43b6d361
Shelter Database project news
<<<<<<< HEAD
0.3 (2016-08-02)
* merge the rodekruis repository (https://github.com/rodekruis/shelter-database)
in the LIST repository;
......@@ -10,7 +10,3 @@ Shelter Database project news
0.1 (2016-04-10)
* first stable prototype with base functionalities.
=======
0.1 (2015-03-30)
- initial release.
>>>>>>> 56b170c62373521aae3518c6fece0335e0e06ec5
......@@ -28,6 +28,10 @@ Web Services
============
Example of requests to the Web Service
<<<<<<< HEAD
>>>>>>> b6b3759e10b96db233dac9cadc04365ff404dd97
=======
>>>>>>> 19a939463af74c6008ef819369c07cfda36d9d34
--------------------------------------
.. code-block:: shell
......@@ -46,6 +50,34 @@ Example of requests to the Web Service
# Get the translations of a string
$ GET http://127.0.0.1:5000/api/translation?q={"filters":[{"name":"original","op":"eq","val":"Name of shelter"}]}
<<<<<<< HEAD
<<<<<<< HEAD
=======
Web Services
============
Example of requests to the Web Service
--------------------------------------
.. code-block:: shell
# Get the list of root categories
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_null"}]}
# Get the list of child categories
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"}]}
# Get information about the child category "Walls & Frame"
$ GET http://127.0.0.1:5000/api/category?q={"filters":[{"name":"parent_id","op":"is_not_null"},{"name":"name","op":"eq","val":"Walls %26 frame"}]}
# Get information about an attribute
$ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Landform"}]}
$ GET http://127.0.0.1:5000/api/attribute?q={"filters":[{"name":"name","op":"eq","val":"Main hazards in country"}]}
# Get the translations of a string
$ GET http://127.0.0.1:5000/api/translation?q={"filters":[{"name":"original","op":"eq","val":"Name of shelter"}]}
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
=======
>>>>>>> b6b3759e10b96db233dac9cadc04365ff404dd97
=======
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
=======
>>>>>>> 56b170c62373521aae3518c6fece0335e0e06ec5
>>>>>>> 19a939463af74c6008ef819369c07cfda36d9d34
......@@ -62,6 +62,10 @@ request parameters:
Examples:
<<<<<<< HEAD
>>>>>>> b6b3759e10b96db233dac9cadc04365ff404dd97
=======
>>>>>>> 19a939463af74c6008ef819369c07cfda36d9d34
.. code-block:: shell
......@@ -89,6 +93,56 @@ Examples:
http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type/open fire
#get all shelters which have a specific attribute value
<<<<<<< HEAD
<<<<<<< HEAD
=======
Web Services
============
Usage of the development API v0.1
---------------------------------
request parameters:
**attribute**: pass one or more attribute names, such as `<attribute=Name,Vegetation>`
NOTE: Currently the attribute names may contain capital letters and spaces.
Spaces should be substituted as `<%20>` int the URL, for example
`<Climate%20Zone>`. An alternative "coding-friendly" attribute naming will be implemented shortly,
as unique strings for each attribute whithout spaces and upper case letters.
**format**: use `<format=prettytext>` to get the nicely formatted attribute names in the JSON,
instead of the "coding-friendly" attribute names.
Examples:
.. code-block:: shell
http://0.0.0.0:5000/api/v0.1
# Welcome message and version info
http://0.0.0.0:5000/api/v0.1/shelters
# Get all shelters and their attributes
http://0.0.0.0:5000/api/v0.1/shelters/3
# Get a specific shelter via shelter ID
http://0.0.0.0:5000/api/v0.1/shelters?attribute=Vegetation
# Get all shelters which have an atttribute value for "Vegetation"
http://0.0.0.0:5000/api/v0.1/shelters?attribute=vegetation&format=prettytext
# Get all shelters which have an atttribute value for "Vegetation", with nicely formatted attribute names
http://0.0.0.0:5000/api/v0.1/attributes/Climate zone
# Get all available values of an attribute
http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type
#get all shelters which have a specific attribute
http://0.0.0.0:5000/api/v0.1/shelters/Kitchen type/open fire
#get all shelters which have a specific attribute value
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
=======
>>>>>>> b6b3759e10b96db233dac9cadc04365ff404dd97
=======
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
=======
>>>>>>> 56b170c62373521aae3518c6fece0335e0e06ec5
>>>>>>> 19a939463af74c6008ef819369c07cfda36d9d34
This diff is collapsed.
<<<<<<< HEAD
<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>> b6b3759e10b96db233dac9cadc04365ff404dd97
=======
>>>>>>> 56b170c62373521aae3518c6fece0335e0e06ec5
>>>>>>> 19a939463af74c6008ef819369c07cfda36d9d34
.. Shelter Database documentation master file, created by
sphinx-quickstart on Sun Jun 19 21:53:46 2016.
You can adapt this file completely to your liking, but it should at least
......@@ -89,4 +93,8 @@ Web Services
api
>>>>>>> 011351c71fefe44d232b84497307f51ee6d5b501
=======
<<<<<<< HEAD
>>>>>>> b6b3759e10b96db233dac9cadc04365ff404dd97
=======
>>>>>>> 56b170c62373521aae3518c6fece0335e0e06ec5
>>>>>>> 19a939463af74c6008ef819369c07cfda36d9d34
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment