Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
psanders committed Apr 20, 2020
1 parent 5d775ed commit bbb1c7f
Show file tree
Hide file tree
Showing 23 changed files with 146 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/api/agents/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If successful this method creates an Agent resource.
**Sample Call**

```json
POST /api/v1beta1/agents
POST /api/{apiversion}/agents
{
"apiVersion": "v1beta1",
"kind": "Agent",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/agents/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If successful this method returns an Agent resource.
**Sample Call**

```json
GET /api/v1beta1/agents/ag3f77f6
GET /api/{apiversion}/agents/ag3f77f6
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/agents/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If successful this method returns a list of Agent resources.
**Sample Call**

```json
GET /api/v1beta1/agents
GET /api/{apiversion}/agents
{

}
Expand Down
40 changes: 40 additions & 0 deletions docs/api/config/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
This method returns the servers' configuration.

**URL**

`/system/config`

**Method**

`GET`

**Parameters**

| Parameter Name | Type | Value | Description
| --- | :--------- | :--------- | :--------- |
| full | query | boolean | If set to `true` it will return a merged configuration between defaults and explicit values|

**Request body**

Do not supply a request body with this method.

**Response**

If successful this method returns the current configuration from the server.

**Sample Call**

```json
GET /api/{apiversion}/system/config
{

}

HTTP/1.1 200 OK
{
"status": 200,
"message": "Successful request",
"data": {
...
}
}
41 changes: 41 additions & 0 deletions docs/api/config/update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
This method updates the servers' configuration.

**URL**

`/system/config`

**Method**

`PUT`

**Parameters**

This method does not receive any parameters.

**Request body**

A file containing the [servers' configuration](/configuration/general) in `json` format.

**Response**

The changes will take effect on the next time the instance restart.

**Sample Call**

```json
PUT /api/{apiversion}/config
{
"apiVersion": "v1beta1",
"spec": {
"dataSource": {
"provider": "redis_data_provider"
}
}
}

HTTP/1.1 200 OK
{
"status": "200",
"message": "Successful request"
}
```
2 changes: 1 addition & 1 deletion docs/api/domains/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If successful this method creates a Domain resource.
**Sample Call**

```json
POST /api/v1beta1/domains
POST /api/{apiversion}/domains
{
"apiVersion": "v1beta1",
"kind": "Domain",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/domains/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If successful this method returns a Domain resource.
**Sample Call**

```json
GET /api/v1beta1/domains/dm6c87r2
GET /api/{apiversion}/domains/dm6c87r2
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/domains/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If successful this method returns a list of Domain resources.
**Sample Call**

```json
GET /api/v1beta1/domains
GET /api/{apiversion}/domains
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/gateways/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If successful this method creates a Gateway resource.
**Sample Call**

```json
POST /api/v1beta1/gateways
POST /api/{apiversion}/gateways
{
"apiVersion": "v1beta1",
"kind": "Gateway",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/gateways/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If successful this method returns a Gateway resource.
**Sample Call**

```json
GET /api/v1beta1/gateways/gw5c77t2
GET /api/{apiversion}/gateways/gw5c77t2
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/gateways/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If successful this method returns a list of Gateways resources.
**Sample Call**

```json
GET /api/v1beta1/gateways
GET /api/{apiversion}/gateways
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/numbers/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If successful this method creates a Number.
**Sample Call**

```json
POST /api/v1beta1/numbers
POST /api/{apiversion}/numbers
{
"apiVersion": "v1beta1",
"kind": "Number",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/numbers/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If successful this method returns a Number.
**Sample Call**

```json
GET /api/v1beta1/numbers/dd50baa4
GET /api/{apiversion}/numbers/dd50baa4
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/numbers/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If successful this method returns a list of Numbers.
**Sample Call**

```json
GET /api/v1beta1/numbers
GET /api/{apiversion}/numbers
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/peers/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If successful this method creates a Peer resource.
**Sample Call**

```json
POST /api/v1beta1/peers
POST /api/{apiversion}/peers
{
"apiVersion": "v1beta1",
"kind": "Peer",
Expand Down
2 changes: 1 addition & 1 deletion docs/api/peers/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If successful this method returns a Peer resource.
**Sample Call**

```json
GET /api/v1beta1/peers/pr2c77f4
GET /api/{apiversion}/peers/pr2c77f4
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/peers/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If successful this method returns a list of Peer resources.
**Sample Call**

```json
GET /api/v1beta1/peers
GET /api/{apiversion}/peers
{

}
Expand Down
39 changes: 39 additions & 0 deletions docs/api/status/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Pings an instance of Routr engine.

**URL**

`/system/status`

**Method**

`GET`

**Parameters**

This method does not receive any parameters.

**Request body**

Do not supply a request body with this method.

**Response**

If successful this method will return a `status = 200`. A client implementing
this method can assumed that no answer or a bad answer means that the server
us down or "unhealthy."

**Sample Call**

```json
GET /api/{apiversion}/system/status
{

}

HTTP/1.1 200 OK
{
"status": "200",
"message": "Successful request",
"data": "up"
}
```
4 changes: 2 additions & 2 deletions docs/api/sys/status.md → docs/api/status/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This method returns information about the server.
| Parameter Name | Type | Value | Description
| --- | :--------- | :--------- | :--------- |
| status | path | string | This accepts either `down` or `restarting` parameters |
| filter | now | boolean | If set to `true` it will not wait for current calls to finish |
| now | query | boolean | If set to `true` it will not wait for current calls to finish |

**Request body**

Expand All @@ -26,7 +26,7 @@ If successful this method causes the server to change its status.
**Sample Call**

```json
POST /api/v1beta1/system/status/reload
POST /api/{apiversion}/system/status/reload
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/sys/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If successful this method returns relevant information about the server.
**Sample Call**

```json
GET /api/v1beta1/system/info
GET /api/{apiversion}/system/info
{

}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/sys/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If successful this method returns logging information from the server.
**Sample Call**

```json
GET /api/v1beta1/system/logs
GET /api/{apiversion}/system/logs
{

}
Expand Down
7 changes: 6 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ nav:
- get: api/numbers/get.md
- list: api/numbers/list.md
- update: api/numbers/update.md
- Configuration:
- Get: api/config/get.md
- Update: api/config/update.md
- System:
- Status: api/sys/status.md
- Status:
- Get: api/status/get.md
- Update: api/status/update.md
- Info: api/sys/info.md
- Logs: api/sys/logs.md
- Guides:
Expand Down
2 changes: 1 addition & 1 deletion mod/rest/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Rest {
res.status(401)
res.body('{"status": "401", "message":"Unauthorized"}')
} else {
LOG.error(e.getMessage())
//LOG.error(e.getMessage())
res.status(500)
res.body('{"status": "500", "message":"Internal server error"}')
}
Expand Down

0 comments on commit bbb1c7f

Please sign in to comment.