GET /{db}
This request retrieves information about a database.
Request
Request headers
This request does not have any required headers.
Query parameters
This request does not use query parameters.
Message body
This request does not use a message body.
Response
Status codes
- 200 OK – Request completed successfully
- 404 Not Found – Requested database not found
Response headers
This response uses only standard HTTP headers.
Message body
The message body is a JSON document that contains the following objects:
| Name | Type | Description |
|---|---|---|
committed_update_seq | Integer | Number of committed updates to the database |
db_name | String | Name of the database |
db_uuid | String | Database identifier |
disk_format_version | Integer | Database schema version |
disk_size | Integer | Total amount of data stored on the disk. Units: bytes |
doc_count | Integer | Number of documents in the database |
instance_start_time | Integer | Date and time the database was opened. Units: microseconds since the epoch (1 January 1970) |
purge_seq | Integer | Returns 0. |
update_seq | Integer | Number of updates to the database |
Example
The following example retrieves information about a database named beer-db.
Request
GET /beer-db HTTP/1.1
Host: localhost:59840
Response
HTTP/1.1 200 OK
Server: CouchbaseLite 1.485
Content-Type: application/json
Accept-Ranges: bytes
Content-Length: 281
Cache-Control: must-revalidate
Date: Fri, 06 Dec 2013 22:31:17 GMT
{
"instance_start_time" : 1386620242527997,
"committed_update_seq" : 25800,
"disk_size" : 15360000,
"purge_seq" : 0,
"db_uuid" : "65FB16DF-FFD7-4514-9E8D-B734B066D28D",
"doc_count" : 5048,
"db_name" : "beer-db",
"update_seq" : 25800,
"disk_format_version" : 11
}
The following example shows the response returned when you request information about a database that does not exist on the server. The example requests information about a database named cookbook, which does not exist on the server.
Request
GET /cookbook HTTP/1.1
Host: localhost:59840
Response
HTTP/1.1 404 Not Found
Transfer-Encoding: chunked
Accept-Ranges: bytes
Content-Type: application/json
Server: CouchbaseLite 1.485
Date: Sun, 08 Dec 2013 20:16:50 GMT
{
"status" : 404,
"error" : "not_found"
}