Skip to content

Commit

Permalink
add doc for get dbs api (#85)
Browse files Browse the repository at this point in the history
* add doc for get dbs api

* update version
  • Loading branch information
Saverio Veltri authored Nov 6, 2019
1 parent 8869dd9 commit 187b042
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 29 additions & 1 deletion docs/RestApis.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Furthermore, WS APIs allow registering real-time queries on NSDb cluster. Every
HTTP APIs implement three main route categories:
- Query API, used to run historical select queries.
- Data API, used to perform insert statements.
- Command API, allowing commands execution e.g. display of namespaces and metrics, drop statements.
- Command API, allowing commands execution e.g. display of databases, namespaces and metrics, drop statements.

All the above-mentioned Web APIs allow custom security authorization mechanism implementation. To define authorization logic, user must implement `io.radicalbit.nsdb.security.http.NSDBAuthProvider` trait defining authorization behaviour for the database, namespace and metric models.
Once the custom authorization provider is set up, its canonical class name must be added to NSDb conf file under the key `nsdb.security.auth-provider-class`.
Expand Down Expand Up @@ -230,6 +230,34 @@ Provide `db`, `namespace`, `metric` and the `bit` to be inserted.

# Commands APis
Commands APis map some functionalities already implemented in NSDb Command Line Interface. They consist in a set of statements aimed to retrieve information about namespace and metric structure and on the other hand to perform drop action on the latter.

## Show databases
`Show databases` command retrieve the list of databases.

**URL** : `/commands/dbs`

**Method** : `GET`

**Auth required** : Depending on security configuration

### Example
```
http://<host>:<port>/commands/dbs
```
### Success Response
**Code:** `200 OK`

**Content example**
```json
{
"dbs":
[
"db1",
"db2"
]
}
```

## Show namespaces
`Show namespaces` command retrieve the list of namespaces belonging to the specified database.

Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

version in ThisBuild := "0.9.0-RC3"
version in ThisBuild := "0.9.0-SNAPSHOT"

0 comments on commit 187b042

Please sign in to comment.