From b4907631bb78f5204af52d8b866c0d847ec38ff8 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Thu, 4 Jul 2019 11:17:58 +0300 Subject: [PATCH] Documentation for currently implemented endpoints --- Plan/json-endpoints.md | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Plan/json-endpoints.md diff --git a/Plan/json-endpoints.md b/Plan/json-endpoints.md new file mode 100644 index 000000000..e9bf1b2f4 --- /dev/null +++ b/Plan/json-endpoints.md @@ -0,0 +1,56 @@ +# JSON endpoints + +This document details what endpoints are available on a Plan webserver and what parameters they require. + +What the endpoints return is not detailed to save time, as this document is written during implementation. + +Parameters are given in the URL: `address/v1/?parameter=value&another=value` + +If invalid parameters are given the server will return 400 Bad Request. +The body of the response is the error message + +## Endpoints + +### `GET //raw` `GET //raw` + +Obtain all data in the database for a player. + +### `GET /v1/serverOverview` + +Obtain data for Server Overview tab (The first tab on `/server`-page) + +Required parameters: `serverName` or `serverUUID` + +Parameter|Expected value|Description +--|--|-- +`serverName` | Name of a Plan server | Used for identifying Plan server that the data should be about +`serverUUID` | UUID of a Plan server | Used for identifying Plan server that the data should be about + +### `GET /v1/players` + +Obtain data for `/server` player list. + +Required parameters: `serverName` or `serverUUID` + +Parameter|Expected value|Description +--|--|-- +`serverName` | Name of a Plan server | Used for identifying Plan server that the data should be about +`serverUUID` | UUID of a Plan server | Used for identifying Plan server that the data should be about + +### `GET /v1/graph` + +Obtain data for graphs. + +Required parameters: `serverName` or `serverUUID` and `type` + +Parameter|Expected value|Description +--|--|-- +`serverName` | Name of a Plan server | Used for identifying Plan server that the data should be about +`serverUUID` | UUID of a Plan server | Used for identifying Plan server that the data should be about +`type` | `performance`, `uniqueAndNew` | What kind of graph data should be given + +Type | Description +-- | -- +`performance` | TPS data points for last 6 months: Players Online, TPS, CPU, RAM, Chunks, Entities, Disk Space +`uniqueAndNew` | Player data points for each day, how many unique and how many new players were there each day. +