|
@@ -19,26 +19,28 @@ Creates a new dashboard or updates an existing dashboard.
|
|
|
|
|
|
|
|
**Example Request for new dashboard**:
|
|
**Example Request for new dashboard**:
|
|
|
|
|
|
|
|
- POST /api/dashboards/db HTTP/1.1
|
|
|
|
|
- Accept: application/json
|
|
|
|
|
- Content-Type: application/json
|
|
|
|
|
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- "dashboard": {
|
|
|
|
|
- "id": null,
|
|
|
|
|
- "title": "Production Overview",
|
|
|
|
|
- "tags": [ "templated" ],
|
|
|
|
|
- "timezone": "browser",
|
|
|
|
|
- "rows": [
|
|
|
|
|
- {
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- "schemaVersion": 6,
|
|
|
|
|
- "version": 0
|
|
|
|
|
- },
|
|
|
|
|
- "overwrite": false
|
|
|
|
|
- }
|
|
|
|
|
|
|
+```http
|
|
|
|
|
+POST /api/dashboards/db HTTP/1.1
|
|
|
|
|
+Accept: application/json
|
|
|
|
|
+Content-Type: application/json
|
|
|
|
|
+Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
|
+
|
|
|
|
|
+{
|
|
|
|
|
+ "dashboard": {
|
|
|
|
|
+ "id": null,
|
|
|
|
|
+ "title": "Production Overview",
|
|
|
|
|
+ "tags": [ "templated" ],
|
|
|
|
|
+ "timezone": "browser",
|
|
|
|
|
+ "rows": [
|
|
|
|
|
+ {
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ "schemaVersion": 6,
|
|
|
|
|
+ "version": 0
|
|
|
|
|
+ },
|
|
|
|
|
+ "overwrite": false
|
|
|
|
|
+}
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
JSON Body schema:
|
|
JSON Body schema:
|
|
|
|
|
|
|
@@ -47,15 +49,17 @@ JSON Body schema:
|
|
|
|
|
|
|
|
**Example Response**:
|
|
**Example Response**:
|
|
|
|
|
|
|
|
- HTTP/1.1 200 OK
|
|
|
|
|
- Content-Type: application/json; charset=UTF-8
|
|
|
|
|
- Content-Length: 78
|
|
|
|
|
|
|
+```http
|
|
|
|
|
+HTTP/1.1 200 OK
|
|
|
|
|
+Content-Type: application/json; charset=UTF-8
|
|
|
|
|
+Content-Length: 78
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- "slug": "production-overview",
|
|
|
|
|
- "status": "success",
|
|
|
|
|
- "version": 1
|
|
|
|
|
- }
|
|
|
|
|
|
|
+{
|
|
|
|
|
+ "slug": "production-overview",
|
|
|
|
|
+ "status": "success",
|
|
|
|
|
+ "version": 1
|
|
|
|
|
+}
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
Status Codes:
|
|
Status Codes:
|
|
|
|
|
|
|
@@ -67,14 +71,16 @@ Status Codes:
|
|
|
The **412** status code is used when a newer dashboard already exists (newer, its version is greater than the version that was sent). The
|
|
The **412** status code is used when a newer dashboard already exists (newer, its version is greater than the version that was sent). The
|
|
|
same status code is also used if another dashboard exists with the same title. The response body will look like this:
|
|
same status code is also used if another dashboard exists with the same title. The response body will look like this:
|
|
|
|
|
|
|
|
- HTTP/1.1 412 Precondition Failed
|
|
|
|
|
- Content-Type: application/json; charset=UTF-8
|
|
|
|
|
- Content-Length: 97
|
|
|
|
|
|
|
+```http
|
|
|
|
|
+HTTP/1.1 412 Precondition Failed
|
|
|
|
|
+Content-Type: application/json; charset=UTF-8
|
|
|
|
|
+Content-Length: 97
|
|
|
|
|
|
|
|
- {
|
|
|
|
|
- "message": "The dashboard has been changed by someone else",
|
|
|
|
|
- "status": "version-mismatch"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+{
|
|
|
|
|
+ "message": "The dashboard has been changed by someone else",
|
|
|
|
|
+ "status": "version-mismatch"
|
|
|
|
|
+}
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
In in case of title already exists the `status` property will be `name-exists`.
|
|
In in case of title already exists the `status` property will be `name-exists`.
|
|
|
|
|
|
|
@@ -86,34 +92,38 @@ Will return the dashboard given the dashboard slug. Slug is the url friendly ver
|
|
|
|
|
|
|
|
**Example Request**:
|
|
**Example Request**:
|
|
|
|
|
|
|
|
- GET /api/dashboards/db/production-overview HTTP/1.1
|
|
|
|
|
- Accept: application/json
|
|
|
|
|
- Content-Type: application/json
|
|
|
|
|
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
|
|
|
+```http
|
|
|
|
|
+GET /api/dashboards/db/production-overview HTTP/1.1
|
|
|
|
|
+Accept: application/json
|
|
|
|
|
+Content-Type: application/json
|
|
|
|
|
+Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
**Example Response**:
|
|
**Example Response**:
|
|
|
|
|
|
|
|
- HTTP/1.1 200
|
|
|
|
|
- Content-Type: application/json
|
|
|
|
|
-
|
|
|
|
|
- {
|
|
|
|
|
- "meta": {
|
|
|
|
|
- "isStarred": false,
|
|
|
|
|
- "slug": "production-overview"
|
|
|
|
|
- },
|
|
|
|
|
- "dashboard": {
|
|
|
|
|
- "id": null,
|
|
|
|
|
- "title": "Production Overview",
|
|
|
|
|
- "tags": [ "templated" ],
|
|
|
|
|
- "timezone": "browser",
|
|
|
|
|
- "rows": [
|
|
|
|
|
- {
|
|
|
|
|
- }
|
|
|
|
|
- ],
|
|
|
|
|
- "schemaVersion": 6,
|
|
|
|
|
- "version": 0
|
|
|
|
|
|
|
+```http
|
|
|
|
|
+HTTP/1.1 200
|
|
|
|
|
+Content-Type: application/json
|
|
|
|
|
+
|
|
|
|
|
+{
|
|
|
|
|
+ "meta": {
|
|
|
|
|
+ "isStarred": false,
|
|
|
|
|
+ "slug": "production-overview"
|
|
|
|
|
+ },
|
|
|
|
|
+ "dashboard": {
|
|
|
|
|
+ "id": null,
|
|
|
|
|
+ "title": "Production Overview",
|
|
|
|
|
+ "tags": [ "templated" ],
|
|
|
|
|
+ "timezone": "browser",
|
|
|
|
|
+ "rows": [
|
|
|
|
|
+ {
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ "schemaVersion": 6,
|
|
|
|
|
+ "version": 0
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
## Delete dashboard
|
|
## Delete dashboard
|
|
|
|
|
|
|
@@ -123,17 +133,21 @@ The above will delete the dashboard with the specified slug. The slug is the url
|
|
|
|
|
|
|
|
**Example Request**:
|
|
**Example Request**:
|
|
|
|
|
|
|
|
- DELETE /api/dashboards/db/test HTTP/1.1
|
|
|
|
|
- Accept: application/json
|
|
|
|
|
- Content-Type: application/json
|
|
|
|
|
- Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
|
|
|
+```http
|
|
|
|
|
+DELETE /api/dashboards/db/test HTTP/1.1
|
|
|
|
|
+Accept: application/json
|
|
|
|
|
+Content-Type: application/json
|
|
|
|
|
+Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
**Example Response**:
|
|
**Example Response**:
|
|
|
|
|
|
|
|
- HTTP/1.1 200
|
|
|
|
|
- Content-Type: application/json
|
|
|
|
|
|
|
+```http
|
|
|
|
|
+HTTP/1.1 200
|
|
|
|
|
+Content-Type: application/json
|
|
|
|
|
|
|
|
- {"title": "Test"}
|
|
|
|
|
|
|
+{"title": "Test"}
|
|
|
|
|
+```
|
|
|
|
|
|
|
|
## Gets the home dashboard
|
|
## Gets the home dashboard
|
|
|
|
|
|