Listing Scopes and Collections
- reference
Scopes and collections can be listed, by means of the REST API.
Description
Scopes and collections are listed by means of the GET /pools/default/buckets/<bucket_name>/scopes/
HTTP method and URI.
Syntax
The curl syntax is as follows:
curl -X GET -v http://<hostname-or-ip>:8091/pools/default/buckets/<bucket_name>/scopes -u <username>:<password>
The <bucket-name>
path-parameter specifies the name of the bucket whose defined collections are to be listed.
Responses
Success returns 200 OK
.
Failure to authenticate gives 401 Unauthorized
.
A malformed URI fails with 404 Object Not Found
.
Examples
The following example lists the collections in a bucket named testBucket
:
curl -X GET -v -u Administrator:password \ http://10.143.210.101:8091/pools/default/buckets/testBucket/scopes
If successful, the call returns 200 OK
, and an object listing scopes and collections.
For example:
{"uid":"0","scopes":[{"name":"_default","uid":"0","collections":[{"name":"_default","uid":"0"}]}]}
See Also
An overview of scopes and collections is provided in Scopes and Collections. Step-by-step procedures for management are provided in Manage Scopes and Collections. See also the CLI reference page for the collection-manage command.