Skip to content

Commit

Permalink
[#807] Be explicit about what the resource_id should be. Also add a n…
Browse files Browse the repository at this point in the history
…ote that tells you how to remove a datastore resource after testing the set-up
  • Loading branch information
domoritz committed Apr 24, 2013
1 parent e2fb6b2 commit 3db7c03
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/datastore-setup.rst
Expand Up @@ -118,16 +118,22 @@ The DataStore is now set-up. To test the set-up, (re)start CKAN and run the foll

This should return a JSON page without errors.

To test the whether the set-up allows writing you can create a new resource in the DataStore. To do so, run the following command::
To test the whether the set-up allows writing, you can create a new resource in the DataStore. To do so, run the following command::

curl -X POST http://127.0.0.1:5000/api/3/action/datastore_create -H "Authorization: {YOUR-API-KEY}" -d '{"resource_id": "{RESOURCE-ID}", "fields": [ {"id": "a"}, {"id": "b"} ], "records": [ { "a": 1, "b": "xyz"}, {"a": 2, "b": "zzz"} ]}'

Note that you will need to replace ``{YOUR-API-KEY}`` with a valid API key and ``{RESOURCE-ID}`` with a resource id of an existing CKAN resource.

A table named after the resource id should have been created on your DataStore
database. Visiting the following URL should return a response from the DataStore with
the records inserted above::

http://127.0.0.1:5000/api/3/action/datastore_search?resource_id={RESOURCE_ID}

You can now delete the DataStore table with::

curl -X POST http://127.0.0.1:5000/api/3/action/datastore_delete -H "Authorization: {YOUR-API-KEY}" -d '{"resource_id": "{RESOURCE-ID}"}'

To find out more about the DataStore API, go to :doc:`datastore-api`.


Expand Down

0 comments on commit 3db7c03

Please sign in to comment.