-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## What does this PR do ? Add Server controller fix #8
- Loading branch information
1 parent
9941d85
commit e05bbb6
Showing
42 changed files
with
588 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: adminExists | ||
description: Checks that an administrator account exists. | ||
--- | ||
|
||
# adminExists | ||
|
||
Checks that an administrator account exists. | ||
|
||
:::: tabs | ||
::: tab Java | ||
|
||
```java | ||
CompletableFuture<Boolean> adminExists() | ||
``` | ||
|
||
## Return | ||
|
||
A boolean indicating whether an admin user exists or not. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/adminExists-java.java | ||
|
||
:::: tabs | ||
::: tab Kotlin | ||
|
||
```kotlin | ||
fun adminExists(): CompletableFuture<Boolean> | ||
``` | ||
|
||
## Return | ||
|
||
A boolean indicating whether an admin user exists or not. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/adminExists-kotlin.kotlin |
1 change: 1 addition & 0 deletions
1
doc/1/controllers/server/admin-exists/snippets/admin-exists-java.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Boolean result = kuzzle.getServerController().adminExists().get(); |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/admin-exists/snippets/admin-exists-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: java-Server#AdminExistsAsync | ||
description: Checks that an administrator account exists. | ||
hooks: | ||
before: | ||
after: | ||
template: print-result | ||
expected: false |
2 changes: 2 additions & 0 deletions
2
doc/1/controllers/server/admin-exists/snippets/admin-exists-kotlin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
val result: Boolean = | ||
kuzzle.serverController.adminExists().get() |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/admin-exists/snippets/admin-exists-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: kotlin-Server#AdminExistsAsync | ||
description: Checks that an administrator account exists. | ||
hooks: | ||
before: | ||
after: | ||
template: print-result | ||
expected: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: getAllStats | ||
description: Gets all stored internal statistic snapshots. | ||
--- | ||
|
||
# getAllStats | ||
|
||
Gets all stored internal statistic snapshots. | ||
By default, snapshots are made every 10 seconds and they are stored for 1 hour. | ||
|
||
These statistics include: | ||
|
||
- the number of connected users per protocol (not available for all protocols) | ||
- the number of ongoing requests | ||
- the number of completed requests since the last frame | ||
- the number of failed requests since the last frame | ||
|
||
:::: tabs | ||
::: tab Java | ||
|
||
```java | ||
CompletableFuture<ConcurrentHashMap<String, Object>> getAllStats() | ||
``` | ||
|
||
## Return | ||
|
||
Returns a `ConcurrentHashMap<String, Object>` containing all stored internal statistic snapshots. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/get-all-stats-java.java | ||
|
||
::: tab Kotlin | ||
|
||
```kotlin | ||
fun getAllStats(): CompletableFuture<ConcurrentHashMap<String, Any?>> | ||
``` | ||
|
||
## Return | ||
|
||
Returns a `ConcurrentHashMap<String, Any?>` containing all stored internal statistic snapshots. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/get-all-stats-kotlin.kt |
4 changes: 4 additions & 0 deletions
4
doc/1/controllers/server/get-all-stats/snippets/get-all-stats-java.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ConcurrentHashMap<String, Object> result = kuzzle | ||
.getServerController() | ||
.getAllStats() | ||
.get(); |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/get-all-stats/snippets/get-all-stats-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: java-server#getAllStats | ||
description: Gets all stored internal statistic snapshots. | ||
hooks: | ||
before: | ||
after: | ||
template: print-result | ||
expected: ongoingRequests |
4 changes: 4 additions & 0 deletions
4
doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
val result: ConcurrentHashMap<String, Any?> = kuzzle | ||
.serverController | ||
.getAllStats() | ||
.get() |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/get-all-stats/snippets/get-all-stats-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: kotlin-server#getAllStats | ||
description: Gets all stored internal statistic snapshots. | ||
hooks: | ||
before: | ||
after: | ||
template: print-result | ||
expected: ongoingRequests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: getConfig | ||
description: Returns the current Kuzzle configuration. | ||
--- | ||
|
||
# getConfig | ||
|
||
Returns the current Kuzzle configuration. | ||
|
||
:::warning | ||
This route should only be accessible to administrators, as it might return sensitive information about the backend. | ||
::: | ||
|
||
:::: tabs | ||
::: tab Java | ||
|
||
```java | ||
CompletableFuture<ConcurrentHashMap<String, Object>> getConfig() | ||
``` | ||
|
||
## Return | ||
|
||
Returns a `ConcurrentHashMap<String, Object>` containing server configuration. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/get-config-java.java | ||
|
||
::: tab Kotlin | ||
|
||
```kotlin | ||
fun getConfig(): CompletableFuture<ConcurrentHashMap<String, Any?>> | ||
``` | ||
|
||
## Return | ||
|
||
Returns a `ConcurrentHashMap<String, Any?>` containing server configuration. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/get-config-kotlin.kt |
4 changes: 4 additions & 0 deletions
4
doc/1/controllers/server/get-config/snippets/get-config-java.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ConcurrentHashMap<String, Object> result = kuzzle | ||
.getServerController() | ||
.getConfig() | ||
.get(); |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/get-config/snippets/get-config-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: java-server#getConfig | ||
description: Returns the current Kuzzle configuration. | ||
hooks: | ||
before: | ||
after: | ||
template: print-result | ||
expected: ^{server={.*}$ |
4 changes: 4 additions & 0 deletions
4
doc/1/controllers/server/get-config/snippets/get-config-kotlin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
val result: ConcurrentHashMap<String, Any?> = kuzzle | ||
.serverController | ||
.getConfig() | ||
.get() |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/get-config/snippets/get-config-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: kotlin-server#getConfig | ||
description: Returns the current Kuzzle configuration. | ||
hooks: | ||
before: | ||
after: | ||
template: print-result | ||
expected: ^{server={.*}$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: getLastStats | ||
description: Returns the most recent statistics snapshot. | ||
--- | ||
|
||
# getLastStats | ||
|
||
Returns the most recent statistics snapshot. | ||
|
||
By default, snapshots are made every 10 seconds and they are stored for 1 hour. | ||
|
||
These statistics include: | ||
|
||
- the number of connected users per protocol (not available for all protocols) | ||
- the number of ongoing requests | ||
- the number of completed requests since the last frame | ||
- the number of failed requests since the last frame | ||
|
||
:::: tabs | ||
::: tab Java | ||
|
||
```java | ||
CompletableFuture<ConcurrentHashMap<String, Object>> getLastStats() | ||
``` | ||
|
||
## Return | ||
|
||
Returns an `ConcurrentHashMap<String, Object>` containing the most recent statistics snapshot. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/get-last-stats-java.java | ||
|
||
::: tab Kotlin | ||
|
||
```kotlin | ||
fun getConfig(): CompletableFuture<ConcurrentHashMap<String, Any?>> | ||
``` | ||
|
||
## Return | ||
|
||
Returns an `ConcurrentHashMap<String, Any?>` containing the most recent statistics snapshot. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/get-last-stats-kotlin.kt |
4 changes: 4 additions & 0 deletions
4
doc/1/controllers/server/get-last-stats/snippets/get-last-stats-java.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ConcurrentHashMap<String, Object> result = kuzzle | ||
.getServerController() | ||
.getLastStats() | ||
.get(); |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/get-last-stats/snippets/get-last-stats-java.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: java-server#getLastStats | ||
description: Gets all stored internal statistic snapshots. | ||
hooks: | ||
before: | ||
after: | ||
template: print-result | ||
expected: ongoingRequests |
4 changes: 4 additions & 0 deletions
4
doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
val result: ConcurrentHashMap<String, Any?> = kuzzle | ||
.serverController | ||
.getLastStats() | ||
.get() |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/get-last-stats/snippets/get-last-stats-kotlin.test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: kotlin-server#getLastStats | ||
description: Gets all stored internal statistic snapshots. | ||
hooks: | ||
before: | ||
after: | ||
template: print-result | ||
expected: ongoingRequests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
code: true | ||
type: page | ||
title: getStats | ||
description: Returns statistics snapshots within a provided timestamp range. | ||
--- | ||
|
||
# getStats | ||
|
||
Returns statistics snapshots within a provided timestamp range. | ||
By default, snapshots are made every 10 seconds and they are stored for 1 hour. | ||
|
||
These statistics include: | ||
|
||
- the number of connected users per protocol (not available for all protocols) | ||
- the number of ongoing requests | ||
- the number of completed requests since the last frame | ||
- the number of failed requests since the last frame | ||
|
||
:::: tabs | ||
::: tab Java | ||
|
||
```java | ||
CompletableFuture<ConcurrentHashMap<String, Object>> getStats( | ||
Date startTime, Date stopTime) | ||
``` | ||
|
||
<br/> | ||
|
||
| Arguments | Type | Description | | ||
| ----------- | ------------------------- | --------------------------------------------------------------- | | ||
| `startTime` | <pre>Date</pre> | Beginning of statistics frame set | | ||
| `stopTime` | <pre>Date</pre> | End of statistics frame set | | ||
|
||
## Return | ||
|
||
Returns a `ConcurrentHashMap<String, Object>` containing statistics snapshots within the provided range. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/get-stats-java.java | ||
|
||
::: tab Kotlin | ||
|
||
```kotlin | ||
fun getStats(startTime: Date, stopTime: Date): CompletableFuture<ConcurrentHashMap<String, Any?>> | ||
``` | ||
|
||
<br/> | ||
|
||
| Arguments | Type | Description | | ||
| ----------- | ------------------------- | --------------------------------------------------------------- | | ||
| `startTime` | <pre>Date</pre> | Beginning of statistics frame set | | ||
| `stopTime` | <pre>Date</pre> | End of statistics frame set | | ||
|
||
## Return | ||
|
||
Returns a `ConcurrentHashMap<String, Any?>` containing statistics snapshots within the provided range. | ||
|
||
## Usage | ||
|
||
<<< ./snippets/get-stats-kotlin.kt |
7 changes: 7 additions & 0 deletions
7
doc/1/controllers/server/get-stats/snippets/get-stats-java.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Date startTime = new Date(1234567890); | ||
Date stopTime = new Date(1541426610); | ||
|
||
ConcurrentHashMap<String, Object> result = kuzzle | ||
.getServerController() | ||
.getStats(startTime, stopTime) | ||
.get(); |
Oops, something went wrong.