Skip to content

Commit

Permalink
[doc] Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
olegator77 committed Jan 9, 2019
1 parent bc6a811 commit 9b32266
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 25 deletions.
3 changes: 1 addition & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Version 2.0.0 (07.01.2019)

## Core
- [fea] Master-slave replication added (beta)
- [fea] Master-slave replication added (beta). [Documentation](replication.md)
- [fea] Transactions support
- [fea] min/max/stddev values added to perfstat
- [fea] storage lazy load option added


## Reindexer tool

- [fea] \subscribe command added
Expand Down
123 changes: 110 additions & 13 deletions cpp_src/server/contrib/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Reindexer is fast.
- [Items](#items)
- [JoinCacheMemStats](#joincachememstats)
- [JoinedDef](#joineddef)
- [LogQueriesConfig](#logqueriesconfig)
- [NamespacesConfig](#namespacesconfig)
- [Namespace](#namespace)
- [NamespaceMemStats](#namespacememstats)
- [NamespacePerfStats](#namespaceperfstats)
Expand All @@ -62,6 +62,7 @@ Reindexer is fast.
- [QueryCacheMemStats](#querycachememstats)
- [QueryItems](#queryitems)
- [QueryPerfStats](#queryperfstats)
- [ReplicationConfig](#replicationconfig)
- [SelectPerfStats](#selectperfstats)
- [SortDef](#sortdef)
- [StatusResponse](#statusresponse)
Expand Down Expand Up @@ -104,8 +105,10 @@ Reindexer is fast.




## Paths


### List available databases
```
GET /db
Expand Down Expand Up @@ -136,6 +139,7 @@ This operation will output list of all available databases
* databases



### Create new database
```
POST /db
Expand Down Expand Up @@ -166,6 +170,7 @@ This operation will create new database. If database is already exists, then err
* databases



### Drop database
```
DELETE /db/{database}
Expand Down Expand Up @@ -198,6 +203,7 @@ Can not be undone. USE WITH CAUTION.
* databases



### List available namespaces
```
GET /db/{database}/namespaces
Expand Down Expand Up @@ -229,6 +235,8 @@ If database is not exists, then error will be returned.

* namespaces



### Create namespace
```
POST /db/{database}/namespaces
Expand Down Expand Up @@ -261,6 +269,7 @@ If namespace is already exists, then operation do not nothing.
* namespaces



### Get namespace description
```
GET /db/{database}/namespaces/{name}
Expand Down Expand Up @@ -291,6 +300,8 @@ This operation will return specified namespace description, including options of

* namespaces



### Drop namespace
```
DELETE /db/{database}/namespaces/{name}
Expand Down Expand Up @@ -324,6 +335,7 @@ Can not be undone. USE WITH CAUTION.
* namespaces



### Get documents from namespace
```
GET /db/{database}/namespaces/{name}/items
Expand Down Expand Up @@ -361,6 +373,7 @@ This operation will select documents from namespace with specified filters, and
* items



### Update documents in namespace
```
PUT /db/{database}/namespaces/{name}/items
Expand Down Expand Up @@ -399,6 +412,7 @@ Each document should be in request body as separate JSON object, e.g.
* items



### Insert documents to namespace
```
POST /db/{database}/namespaces/{name}/items
Expand Down Expand Up @@ -437,6 +451,7 @@ Each document should be in request body as separate JSON object, e.g.
* items



### Delete documents from namespace
```
DELETE /db/{database}/namespaces/{name}/items
Expand Down Expand Up @@ -475,6 +490,7 @@ Each document should be in request body as separate JSON object, e.g.
* items



### List available indexes
```
GET /db/{database}/namespaces/{name}/indexes
Expand Down Expand Up @@ -506,6 +522,7 @@ This operation will return list of available indexes, from specified database an
* indexes



### Update index in namespace
```
PUT /db/{database}/namespaces/{name}/indexes
Expand Down Expand Up @@ -539,6 +556,7 @@ Operation is synchronious, so it can take long time, if namespace contains bunc
* indexes



### Add new index to namespace
```
POST /db/{database}/namespaces/{name}/indexes
Expand Down Expand Up @@ -572,6 +590,7 @@ Operation is synchronious, so it can take long time, if namespace contains bunch
* indexes



### Drop index from namespace
```
DELETE /db/{database}/namespaces/{name}/indexes/{indexname}
Expand Down Expand Up @@ -605,6 +624,7 @@ Operation is synchronious, so it can take long time, if namespace contains bunc
* indexes



### Query documents from namespace
```
GET /db/{database}/query
Expand Down Expand Up @@ -639,6 +659,8 @@ then `limit` and `offset` from http request.

* queries



### Query documents from namespace
```
POST /db/{database}/query
Expand Down Expand Up @@ -670,6 +692,7 @@ This opertaion queries documents from namespace by DSL query.
* queries



### Delete documents from namespace
```
DELETE /db/{database}/query
Expand Down Expand Up @@ -701,6 +724,40 @@ This opertaion removes documents from namespace by DSL query.
* queries



### Suggest for autocompletion of SQL query
```
GET /db/{database}/suggest
```


#### Description
This operation pareses SQL query, and suggests autocompletion variants


#### Parameters

|Type|Name|Description|Schema|
|---|---|---|---|
|**Path**|**database** <br>*required*|Database name|string|
|**Query**|**pos** <br>*required*|Cursor position for suggest|integer|
|**Query**|**q** <br>*required*|SQL query|string|


#### Responses

|HTTP Code|Description|Schema|
|---|---|---|
|**200**|successful operation|[SuggestItems](#suggestitems)|
|**400**|Invalid status value|[StatusResponse](#statusresponse)|


#### Tags

* queries



### Query documents from namespace
```
POST /db/{database}/sqlquery
Expand Down Expand Up @@ -934,6 +991,9 @@ This operation will update system configuration:
|---|---|---|
|**last_sec_avg_lock_time_us** <br>*optional*|Average waiting time for acquiring lock to this object at last second|integer|
|**last_sec_qps** <br>*optional*|Count of queries to this object, requested at last second|integer|
|**latency_stddev** <br>*optional*|Standard deviation of latency values|number|
|**max_latency_us** <br>*optional*|Maximum latency value|integer|
|**min_latency_us** <br>*optional*|Minimal latency value|integer|
|**total_avg_latency_us** <br>*optional*|Average latency (execution time) for queries to this object|integer|
|**total_avg_lock_latency_us** <br>*optional*|Average waiting time for acquiring lock to this object|integer|
|**total_queries_count** <br>*optional*|Total count of queries to this object|integer|
Expand Down Expand Up @@ -1139,15 +1199,6 @@ Number of elements in join cache. Stores results of selects to right table by ON



### LogQueriesConfig

|Name|Description|Schema|
|---|---|---|
|**log_level** <br>*optional*|Log level of queries core logger|enum (none, error, warning, info, trace)|
|**namespace** <br>*optional*|Name of namespace, or `*` for setting to all namespaces|string|



### Namespace

|Name|Description|Schema|
Expand Down Expand Up @@ -1228,6 +1279,15 @@ Number of elements in join cache. Stores results of selects to right table by ON



### NamespacesConfig

|Name|Description|Schema|
|---|---|---|
|**log_level** <br>*optional*|Log level of queries core logger|enum (none, error, warning, info, trace)|
|**namespace** <br>*optional*|Name of namespace, or `*` for setting to all namespaces|string|



### OnDef

|Name|Description|Schema|
Expand Down Expand Up @@ -1317,6 +1377,9 @@ Performance statistics per each query
|---|---|---|
|**last_sec_avg_lock_time_us** <br>*optional*|Average waiting time for acquiring lock to this object at last second|integer|
|**last_sec_qps** <br>*optional*|Count of queries to this object, requested at last second|integer|
|**latency_stddev** <br>*optional*|Standard deviation of latency values|number|
|**max_latency_us** <br>*optional*|Maximum latency value|integer|
|**min_latency_us** <br>*optional*|Minimal latency value|integer|
|**query** <br>*optional*|SQL representation of query|string|
|**total_avg_latency_us** <br>*optional*|Average latency (execution time) for queries to this object|integer|
|**total_avg_lock_latency_us** <br>*optional*|Average waiting time for acquiring lock to this object|integer|
Expand All @@ -1325,6 +1388,19 @@ Performance statistics per each query



### ReplicationConfig

|Name|Description|Schema|
|---|---|---|
|**cluster_id** <br>*optional*|Cluser ID - must be same for client and for master|integer|
|**force_sync_on_logic_error** <br>*optional*|force resync on logic error conditions|boolean|
|**force_sync_on_wrong_data_hash** <br>*optional*|force resync on wrong data hash conditions|boolean|
|**master_dsn** <br>*optional*|DSN to master. Only cproto schema is supported|string|
|**namespaces** <br>*optional*|List of namespaces for replication. If emply, all namespaces. All replicated namespaces will become read only for slave|< string > array|
|**role** <br>*optional*|Replication role|enum (none, slave, master)|



### SelectPerfStats
Performance statistics for select operations

Expand All @@ -1335,12 +1411,16 @@ Performance statistics for select operations
|---|---|---|
|**last_sec_avg_lock_time_us** <br>*optional*|Average waiting time for acquiring lock to this object at last second|integer|
|**last_sec_qps** <br>*optional*|Count of queries to this object, requested at last second|integer|
|**latency_stddev** <br>*optional*|Standard deviation of latency values|number|
|**max_latency_us** <br>*optional*|Maximum latency value|integer|
|**min_latency_us** <br>*optional*|Minimal latency value|integer|
|**total_avg_latency_us** <br>*optional*|Average latency (execution time) for queries to this object|integer|
|**total_avg_lock_latency_us** <br>*optional*|Average waiting time for acquiring lock to this object|integer|
|**total_queries_count** <br>*optional*|Total count of queries to this object|integer|
|**total_sec_avg_latency_us** <br>*optional*|Average latency (execution time) for queries to this object at last second|integer|



### SortDef
Specifies results sorting order

Expand All @@ -1352,15 +1432,25 @@ Specifies results sorting order
|**values** <br>*optional*|Optional: Documents with this values of field will be returned first|< object > array|



### StatusResponse

|Name|Description|Schema|
|---|---|---|
|**description** <br>*optional*|Text description of error details|string|
|**response_code** <br>*optional*|Error code:<br> * 0 - errOK<br> * 1 - errParseSQL<br> * 2 - errQueryExec<br> * 3 - errParams<br> * 4 - errLogic<br> * 5 - errParseJson<br> * 6 - errParseDSL<br> * 7 - errConflict<br> * 8 - errParseBin<br> * 9 - errForbidden<br> * 10 - errWasRelock<br> * 11 - errNotValid<br> * 12 - errNetwork<br> * 13 - errNotFound<br> * 14 - errStateInvalidated|integer|
|**response_code** <br>*optional*|Error code:<br> * 0 - errOK<br> * 1 - errParseSQL<br> * 2 - errQueryExec<br> * 3 - errParams<br> * 4 - errLogic<br> * 5 - errParseJson<br> * 6 - errParseDSL<br> * 7 - errConflict<br> * 8 - errParseBin<br> * 9 - errForbidden<br> * 10 - errWasRelock<br> * 11 - errNotValid<br> * 12 - errNetwork<br> * 13 - errNotFound<br> * 14 - errStateInvalidated<br> * 15 - errBadTransaction<br> * 16 - errOutdatedWAL<br> * 17 - errNoWAL<br> * 18 - errDataHashMismatch|integer|
|**success** <br>*optional*|Status of operation|boolean|



### SuggestItems

|Name|Description|Schema|
|---|---|---|
|**suggests** <br>*optional*|Suggested query autocompletion variants|< string > array|



### SysInfo

|Name|Description|Schema|
Expand All @@ -1374,13 +1464,16 @@ Specifies results sorting order
|**version** <br>*optional*|Server version|string|



### SystemConfigItem

|Name|Description|Schema|
|---|---|---|
|**log_queries** <br>*optional*||< [LogQueriesConfig](#logqueriesconfig) > array|
|**namespaces** <br>*optional*||< [NamespacesConfig](#namespacesconfig) > array|
|**profiling** <br>*optional*||[ProfilingConfig](#profilingconfig)|
|**type** <br>*required*|**Default** : `"profiling"`|enum (profiling, log_queries)|
|**replication** <br>*optional*||[ReplicationConfig](#replicationconfig)|
|**type** <br>*required*|**Default** : `"profiling"`|enum (profiling, namespaces, replication)|



### UpdatePerfStats
Expand All @@ -1393,12 +1486,16 @@ Performance statistics for update operations
|---|---|---|
|**last_sec_avg_lock_time_us** <br>*optional*|Average waiting time for acquiring lock to this object at last second|integer|
|**last_sec_qps** <br>*optional*|Count of queries to this object, requested at last second|integer|
|**latency_stddev** <br>*optional*|Standard deviation of latency values|number|
|**max_latency_us** <br>*optional*|Maximum latency value|integer|
|**min_latency_us** <br>*optional*|Minimal latency value|integer|
|**total_avg_latency_us** <br>*optional*|Average latency (execution time) for queries to this object|integer|
|**total_avg_lock_latency_us** <br>*optional*|Average waiting time for acquiring lock to this object|integer|
|**total_queries_count** <br>*optional*|Total count of queries to this object|integer|
|**total_sec_avg_latency_us** <br>*optional*|Average latency (execution time) for queries to this object at last second|integer|



### UpdateResponse

|Name|Description|Schema|
Expand Down
Loading

0 comments on commit 9b32266

Please sign in to comment.