From 6abcc884462288fbf776a963bc248de5c5ea7681 Mon Sep 17 00:00:00 2001 From: Pedro Sanders Date: Mon, 13 Apr 2020 13:16:19 -0400 Subject: [PATCH] Updated docs --- docs/api/agents/create.md | 6 ++- docs/api/agents/delete.md | 5 ++- docs/api/agents/update.md | 5 ++- docs/api/domains/create.md | 6 ++- docs/api/domains/delete.md | 5 ++- docs/api/domains/update.md | 5 ++- docs/api/gateways/create.md | 6 ++- docs/api/gateways/delete.md | 5 ++- docs/api/gateways/update.md | 5 ++- docs/api/location/create.md | 4 +- docs/api/location/delete.md | 4 +- docs/api/numbers/create.md | 6 ++- docs/api/numbers/delete.md | 5 ++- docs/api/numbers/update.md | 5 ++- docs/api/peers/create.md | 6 ++- docs/api/peers/delete.md | 5 ++- docs/api/peers/update.md | 5 ++- docs/api/sys/info.md | 90 +++++++++++++++++++------------------ docs/api/sys/status.md | 11 ++--- mod/rest/rest.js | 2 +- 20 files changed, 123 insertions(+), 68 deletions(-) diff --git a/docs/api/agents/create.md b/docs/api/agents/create.md index 83ec5a42e..34a1f2ec1 100644 --- a/docs/api/agents/create.md +++ b/docs/api/agents/create.md @@ -43,5 +43,9 @@ POST /api/v1beta1/agents } HTTP/1.1 201 Created -{ "status": "201", "message": "Created", "data": "ag3f77f6" } +{ + "status": "201", + "message": "Created", + "data": "ag3f77f6" +} ``` diff --git a/docs/api/agents/delete.md b/docs/api/agents/delete.md index 4a4a4eedf..ee1c35b2c 100644 --- a/docs/api/agents/delete.md +++ b/docs/api/agents/delete.md @@ -31,5 +31,8 @@ DELETE /api/v1beta1/agents/ag3f77f6 } HTTP/1.1 200 OK -{"status": "200", "Successful request"} +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/agents/update.md b/docs/api/agents/update.md index 845b52340..196ee9510 100644 --- a/docs/api/agents/update.md +++ b/docs/api/agents/update.md @@ -43,5 +43,8 @@ PUT /api/v1beta1/agents/ag3f77f6 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/domains/create.md b/docs/api/domains/create.md index 0817f446c..f41fc0dc5 100644 --- a/docs/api/domains/create.md +++ b/docs/api/domains/create.md @@ -38,5 +38,9 @@ POST /api/v1beta1/domains } HTTP/1.1 201 Created -{ "status": "201", "message": "Created", "data": "dm6c87r2" } +{ + "status": "201", + "message": "Created", + "data": "dm6c87r2" +} ``` diff --git a/docs/api/domains/delete.md b/docs/api/domains/delete.md index 8e142b4bb..26a2dbffd 100644 --- a/docs/api/domains/delete.md +++ b/docs/api/domains/delete.md @@ -33,5 +33,8 @@ DELETE /api/v1beta1/domains/dm6c87r2 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/domains/update.md b/docs/api/domains/update.md index 7562f0bca..63b7aeea4 100644 --- a/docs/api/domains/update.md +++ b/docs/api/domains/update.md @@ -39,5 +39,8 @@ PUT /api/v1beta1/domains/dm6c87r2 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/gateways/create.md b/docs/api/gateways/create.md index 013b7f06c..c94307ed1 100644 --- a/docs/api/gateways/create.md +++ b/docs/api/gateways/create.md @@ -42,5 +42,9 @@ POST /api/v1beta1/gateways HTTP/1.1 201 Created -{ "status": "201", "message": "Created", "data": "gw5c77t2" } +{ + "status": "201", + "message": "Created", + "data": "gw5c77t2" +} ``` diff --git a/docs/api/gateways/delete.md b/docs/api/gateways/delete.md index 4d8f1ab61..a3ed1666a 100644 --- a/docs/api/gateways/delete.md +++ b/docs/api/gateways/delete.md @@ -33,5 +33,8 @@ DELETE /api/v1beta1/gateways/gw5c77t2 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/gateways/update.md b/docs/api/gateways/update.md index a906df6aa..7c2122070 100644 --- a/docs/api/gateways/update.md +++ b/docs/api/gateways/update.md @@ -42,5 +42,8 @@ PUT /api/v1beta1/gateways/gw5c77t2 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/location/create.md b/docs/api/location/create.md index f6a18873b..efcea7572 100644 --- a/docs/api/location/create.md +++ b/docs/api/location/create.md @@ -34,8 +34,8 @@ POST /api/{apiversion}/location/sip:guest@guest } HTTP/1.1 200 OK -{ +{ "status": 200, - "message": "Added location entry." + "message": "Added location entry" } ``` diff --git a/docs/api/location/delete.md b/docs/api/location/delete.md index 8bdf317f7..72aa5e19f 100644 --- a/docs/api/location/delete.md +++ b/docs/api/location/delete.md @@ -31,8 +31,8 @@ DELETE /api/{apiversion}/location/sip:guest@guest } HTTP/1.1 200 OK -{ +{ "status": 200, - "message": "Location entry evicted." + "message": "Location entry evicted" } ``` diff --git a/docs/api/numbers/create.md b/docs/api/numbers/create.md index cc0347355..864b2a0dc 100644 --- a/docs/api/numbers/create.md +++ b/docs/api/numbers/create.md @@ -45,5 +45,9 @@ POST /api/v1beta1/numbers } HTTP/1.1 201 Created -{ "status": "201", "message": "Created", "data": "dd50baa4" } +{ + "status": "201", + "message": "Created", + "data": "dd50baa4" +} ``` diff --git a/docs/api/numbers/delete.md b/docs/api/numbers/delete.md index 99f4c9a74..6eb848b79 100644 --- a/docs/api/numbers/delete.md +++ b/docs/api/numbers/delete.md @@ -31,5 +31,8 @@ DELETE /api/v1beta1/numbers/dd50baa4 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/numbers/update.md b/docs/api/numbers/update.md index cd4fe82b9..6ba1b20b6 100644 --- a/docs/api/numbers/update.md +++ b/docs/api/numbers/update.md @@ -45,5 +45,8 @@ PUT /api/v1beta1/numbers/dd50baa4 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/peers/create.md b/docs/api/peers/create.md index a8e1eabfa..b35b346da 100644 --- a/docs/api/peers/create.md +++ b/docs/api/peers/create.md @@ -39,5 +39,9 @@ POST /api/v1beta1/peers } HTTP/1.1 201 Created -{ "status": "201", "message": "Created", "data": "pr2c77f4" } +{ + "status": "201", + "message": "Created", + "data": "pr2c77f4" +} ``` diff --git a/docs/api/peers/delete.md b/docs/api/peers/delete.md index 9c48c2bc3..0f9e8f94d 100644 --- a/docs/api/peers/delete.md +++ b/docs/api/peers/delete.md @@ -31,5 +31,8 @@ DELETE /api/v1beta1/peers/pr2c77f4 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/peers/update.md b/docs/api/peers/update.md index 10e6b4eac..880cea152 100644 --- a/docs/api/peers/update.md +++ b/docs/api/peers/update.md @@ -40,5 +40,8 @@ PUT /api/v1beta1/peers/pr2c77f4 } HTTP/1.1 200 OK -{ "status": "200", "Successful request" } +{ + "status": "200", + "message": "Successful request" +} ``` diff --git a/docs/api/sys/info.md b/docs/api/sys/info.md index 7ac374160..5f5c6ef42 100644 --- a/docs/api/sys/info.md +++ b/docs/api/sys/info.md @@ -29,47 +29,51 @@ GET /api/v1beta1/system/info } HTTP/1.1 200 OK -{ - "version":"v1.0", - "apiVersion":"v1beta1", - "apiPath":"/api/v1beta1", - "env":[ - { - "var":"ROUTR_JAVA_OPTS", - "value":null - }, - { - "var":"ROUTR_DS_PROVIDER", - "value":null - }, - { - "var":"ROUTR_DS_PARAMETERS", - "value":null - }, - { - "var":"ROUTR_CONFIG_FILE", - "value":null - }, - { - "var":"ROUTR_SALT", - "value":null - }, - { - "var":"ROUTR_EXTERN_ADDR", - "value":null - }, - { - "var":"ROUTR_LOCALNETS", - "value":null - }, - { - "var":"ROUTR_REGISTRAR_INTF", - "value":null - }, - { - "var":"ROUTR_JS_ENGINE", - "value":null - } - ] + +{ + "status":200, + "message":"Successful request", + "data":{ + "version":"v1.0", + "apiVersion":"v1beta1", + "apiPath":"/api/v1beta1", + "env":[ + { + "var":"ROUTR_JAVA_OPTS", + "value":null + }, + { + "var":"ROUTR_DS_PROVIDER", + "value":null + }, + { + "var":"ROUTR_DS_PARAMETERS", + "value":null + }, + { + "var":"ROUTR_CONFIG_FILE", + "value":null + }, + { + "var":"ROUTR_SALT", + "value":null + }, + { + "var":"ROUTR_EXTERN_ADDR", + "value":null + }, + { + "var":"ROUTR_LOCALNETS", + "value":null + }, + { + "var":"ROUTR_REGISTRAR_INTF", + "value":null + }, + { + "var":"ROUTR_JS_ENGINE", + "value":null + } + ] + } } -``` diff --git a/docs/api/sys/status.md b/docs/api/sys/status.md index a844df364..183676807 100644 --- a/docs/api/sys/status.md +++ b/docs/api/sys/status.md @@ -12,10 +12,8 @@ This method returns information about the server. | Parameter Name | Type | Value | Description | --- | :--------- | :--------- | :--------- | -| status | path | string | This accepts either `down` or `reload` parameters | - -Note: A `down` value causes the server to shutdown. A `reload` value causes -the server to reload its configuration from file. +| 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 | **Request body** @@ -34,5 +32,8 @@ POST /api/v1beta1/system/status/reload } HTTP/1.1 200 OK -{ "status": "200", "message": "Reloaded configuration from file." } +{ + "status": "200", + "message": "Request sent to server" +} ``` diff --git a/mod/rest/rest.js b/mod/rest/rest.js index 7a757e37b..dbee40bf7 100644 --- a/mod/rest/rest.js +++ b/mod/rest/rest.js @@ -102,7 +102,7 @@ class Rest { const cmd = req.queryParams('now') === 'true' ? `${c}-now` : c grpc.run(cmd) res.status(200) - return '{"status": "200", "message":"Request sent to server."}' + return '{"status": "200", "message":"Request sent to server"}' } start () {