diff --git a/doc/datastore-setup.rst b/doc/datastore-setup.rst index 16b63d71ca9..940fa8682d0 100644 --- a/doc/datastore-setup.rst +++ b/doc/datastore-setup.rst @@ -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`.