================================================ --- Datastore services ------------------------- ================================================ ------------------------------------------------ = Create datastore. $ curl -s -i -X POST http://127.0.0.1:8984/api/v1/db/foo HTTP/1.1 200 OK Datastore (foo) created. ------------------------------------------------ ------------------------------------------------ = Create datastore again. Expected to produce a 409 conflict. $ curl -s -i -X POST http://127.0.0.1:8984/api/v1/db/foo HTTP/1.1 409 Conflict Datastore (foo) already exists. ------------------------------------------------ ------------------------------------------------ = List datastore. $ curl -s -i -X GET http://127.0.0.1:8984/api/v1/db/foo HTTP/1.1 200 OK ------------------------------------------------ ------------------------------------------------ = Delete datastore. curl -s -i -X DELETE http://127.0.0.1:8984/api/v1/db/foo HTTP/1.1 200 OK Datastore (foo) deleted. ------------------------------------------------ ------------------------------------------------ = Delete datastore again. Expected to produce 404, datastore not found. curl -s -i -X DELETE http://127.0.0.1:8984/api/v1/db/foo HTTP/1.1 404 Not Found Datastore (foo) not found. ------------------------------------------------ ------------------------------------------------ = List datastore again. Expected to produce 404, datastore not found. curl -s -i -X GET http://127.0.0.1:8984/api/v1/db/foo HTTP/1.1 404 Not Found Datastore (foo) not found. ------------------------------------------------ ================================================ --- Datastore/Document services ---------------- ================================================ ------------------------------------------------ = Prepare environment for next test. Create datastore. curl -s -i -X POST http://127.0.0.1:8984/api/v1/db/bar HTTP/1.1 200 OK Datastore (bar) created. ------------------------------------------------ ------------------------------------------------ = Add document to datastore. curl -s -i -X POST -H Content-Type: application/xml http://127.0.0.1:8984/api/v1/db/bar/baz.xml -d HTTP/1.1 200 OK Document (baz.xml) added to datastore (bar). ------------------------------------------------ ------------------------------------------------ = List datastore. curl -s -i -X GET http://127.0.0.1:8984/api/v1/db/bar HTTP/1.1 200 OK ------------------------------------------------ ------------------------------------------------ = Retrieve document from datastore. curl -s -i -X GET http://127.0.0.1:8984/api/v1/db/bar/baz.xml HTTP/1.1 200 OK ------------------------------------------------ ------------------------------------------------ = Retrieve non-existent document from datastore. Expected to fail with 404, document not found. curl -s -i -X GET http://127.0.0.1:8984/api/v1/db/bar/bazzzz.xml HTTP/1.1 404 Not Found Document (bazzzz.xml) not found in datastore (bar). ------------------------------------------------ ------------------------------------------------ = Delete document from datastore. curl -s -i -X DELETE http://127.0.0.1:8984/api/v1/db/bar/baz.xml HTTP/1.1 200 OK Document (baz.xml) deleted from datastore (bar). ------------------------------------------------ ------------------------------------------------ = Retrieve document just deleted, ie. now non-existent, document from datastore. Expected to fail with 404, document not found. curl -s -i -X GET http://127.0.0.1:8984/api/v1/db/bar/baz.xml HTTP/1.1 404 Not Found Document (baz.xml) not found in datastore (bar). ------------------------------------------------ ------------------------------------------------ = Tear down environment setup for previous test. Delete datastore. curl -s -i -X DELETE http://127.0.0.1:8984/api/v1/db/bar HTTP/1.1 200 OK Datastore (bar) deleted. ------------------------------------------------