You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ii...@apache.org on 2018/11/26 12:54:25 UTC
[couchdb-documentation] 01/01: Add new return codes for database
creation/deletion
This is an automated email from the ASF dual-hosted git repository.
iilyak pushed a commit to branch fix-return-codes-db-create-delete
in repository https://gitbox.apache.org/repos/asf/couchdb-documentation.git
commit 4f29052f6cf7b9d2840daf4c183552adfc935ced
Author: ILYA Khlopotov <ii...@apache.org>
AuthorDate: Mon Nov 26 12:48:36 2018 +0000
Add new return codes for database creation/deletion
There is a change in status codes returned by create/delete database operations
* PUT <db>
- Database creation returns 201 - Creation if the quorum is met
- Database creation returns 202 - Accepted if at least one node responds ok
- Database creation returns 500 - Error if there is no correct response from any node
* DELETE <db>
- Database deletion returns 404 - Not found if all nodes respond not found
- Database deletion returns 200 - OK if the quorum is met and at least one is ok
- Database deletion returns 202 - Accepted if the number of responses are bellow quorum and at least one is ok
- Database deletion returns 500 - Error in other cases
---
src/api/database/common.rst | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/api/database/common.rst b/src/api/database/common.rst
index 8a8db3f..216eb2e 100644
--- a/src/api/database/common.rst
+++ b/src/api/database/common.rst
@@ -166,7 +166,8 @@
:>json string error: Error type. Available if response code is ``4xx``
:>json string reason: Error description. Available if response code is
``4xx``
- :code 201: Database created successfully
+ :code 201: Database created successfully (quorum is met)
+ :code 202: Accepted (at least by one node)
:code 400: Invalid database name
:code 401: CouchDB Server Administrator privileges required
:code 412: Database already exists
@@ -267,7 +268,8 @@
:>header Content-Type: - :mimetype:`application/json`
- :mimetype:`text/plain; charset=utf-8`
:>json boolean ok: Operation status
- :code 200: Database removed successfully
+ :code 200: Database removed successfully (quorum is met and database is deleted by at least one node)
+ :code 202: Accepted (deleted by at least one of the nodes, quorum is not met yet)
:code 400: Invalid database name or forgotten document id by accident
:code 401: CouchDB Server Administrator privileges required
:code 404: Database doesn't exist or invalid database name