From 261191ffd774426d459d5890e83768928118af95 Mon Sep 17 00:00:00 2001 From: Samuel Alfageme Date: Mon, 27 Jan 2020 13:41:15 +0100 Subject: [PATCH] Docs: misc. nitpicks to the HTTP API docs (#21758) * Replace bash/json with http in http_api codeblocks Since http is used elsewhere on the API docs and makes the markdown rendering look different on the blocks that use bash/json * Fix the annotations API link on 'Features' - Noticed the Features/Dashboard Features/Annotations link pointing to the HTTP API was linking itself instead of '../http_api/annotations.md'. - Also add a link on Dashboard Export and Import to its HTTP API. * Add missing links to features in API Index Noticed there was 3 missing references in the API docs index. - https://grafana.com/docs/grafana/latest/http_api/playlist - https://grafana.com/docs/grafana/latest/http_api/datasource_permissions - https://grafana.com/docs/grafana/latest/http_api/external_group_sync Last two are Grafana Enterprise -only, so created a separate subsection for them. --- docs/sources/http_api/_index.md | 6 ++++++ docs/sources/http_api/admin.md | 24 ++++++++++----------- docs/sources/http_api/playlist.md | 28 ++++++++++++------------- docs/sources/reference/annotations.md | 2 +- docs/sources/reference/export_import.md | 2 +- 5 files changed, 34 insertions(+), 28 deletions(-) diff --git a/docs/sources/http_api/_index.md b/docs/sources/http_api/_index.md index 19e35b3505e..621e9284cfb 100644 --- a/docs/sources/http_api/_index.md +++ b/docs/sources/http_api/_index.md @@ -30,6 +30,7 @@ dashboards, creating users and updating data sources. * [Organization API]({{< relref "org.md" >}}) * [Snapshot API]({{< relref "snapshot.md" >}}) * [Annotations API]({{< relref "annotations.md" >}}) +* [Playlists API]({{< relref "playlist.md" >}}) * [Alerting API]({{< relref "alerting.md" >}}) * [Alert Notification Channels API]({{< relref "alerting_notification_channels.md" >}}) * [User API]({{< relref "user.md" >}}) @@ -37,3 +38,8 @@ dashboards, creating users and updating data sources. * [Admin API]({{< relref "admin.md" >}}) * [Preferences API]({{< relref "preferences.md" >}}) * [Other API]({{< relref "other.md" >}}) + +### Grafana Enterprise HTTP APIs + +* [Data Source Permissions API]({{< relref "datasource_permissions.md" >}}) +* [External Group Sync API]({{< relref "external_group_sync.md" >}}) diff --git a/docs/sources/http_api/admin.md b/docs/sources/http_api/admin.md index 13162a9e1d3..125a8e38bb9 100644 --- a/docs/sources/http_api/admin.md +++ b/docs/sources/http_api/admin.md @@ -23,7 +23,7 @@ Only works with Basic Authentication (username and password). See [introduction] **Example Request**: -```bash +```http GET /api/admin/settings Accept: application/json Content-Type: application/json @@ -31,7 +31,7 @@ Content-Type: application/json **Example Response**: -```bash +```http HTTP/1.1 200 Content-Type: application/json @@ -181,7 +181,7 @@ Only works with Basic Authentication (username and password). See [introduction] **Example Request**: -```bash +```http GET /api/admin/stats Accept: application/json Content-Type: application/json @@ -189,7 +189,7 @@ Content-Type: application/json **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json @@ -214,8 +214,8 @@ Content-Type: application/json Create new user. Only works with Basic Authentication (username and password). See [introduction](http://docs.grafana.org/http_api/admin/#admin-api) for an explanation. **Example Request**: -```json +```http POST /api/admin/users HTTP/1.1 Accept: application/json Content-Type: application/json @@ -230,7 +230,7 @@ Content-Type: application/json **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json @@ -246,7 +246,7 @@ Change password for a specific user. **Example Request**: -```json +```http PUT /api/admin/users/2/password HTTP/1.1 Accept: application/json Content-Type: application/json @@ -256,7 +256,7 @@ Content-Type: application/json **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json @@ -271,7 +271,7 @@ Only works with Basic Authentication (username and password). See [introduction] **Example Request**: -```json +```http PUT /api/admin/users/2/permissions HTTP/1.1 Accept: application/json Content-Type: application/json @@ -281,7 +281,7 @@ Content-Type: application/json **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json @@ -296,7 +296,7 @@ Only works with Basic Authentication (username and password). See [introduction] **Example Request**: -```json +```http DELETE /api/admin/users/2 HTTP/1.1 Accept: application/json Content-Type: application/json @@ -304,7 +304,7 @@ Content-Type: application/json **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json diff --git a/docs/sources/http_api/playlist.md b/docs/sources/http_api/playlist.md index 3e4df6bff76..f9aa6a39d77 100644 --- a/docs/sources/http_api/playlist.md +++ b/docs/sources/http_api/playlist.md @@ -20,7 +20,7 @@ Get all existing playlist for the current organization using pagination **Example Request**: -```bash +```http GET /api/playlists HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk @@ -35,7 +35,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json [ @@ -53,7 +53,7 @@ Content-Type: application/json **Example Request**: -```bash +```http GET /api/playlists/1 HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk @@ -61,7 +61,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json { @@ -96,7 +96,7 @@ Content-Type: application/json **Example Request**: -```bash +```http GET /api/playlists/1/items HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk @@ -104,7 +104,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json [ @@ -133,7 +133,7 @@ Content-Type: application/json **Example Request**: -```bash +```http GET /api/playlists/1/dashboards HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk @@ -141,7 +141,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json [ @@ -165,7 +165,7 @@ Content-Type: application/json **Example Request**: -```bash +```http PUT /api/playlists/1 HTTP/1.1 Accept: application/json Content-Type: application/json @@ -192,7 +192,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json { @@ -208,7 +208,7 @@ Content-Type: application/json **Example Request**: -```bash +```http PUT /api/playlists/1 HTTP/1.1 Accept: application/json Content-Type: application/json @@ -237,7 +237,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json { @@ -272,7 +272,7 @@ Content-Type: application/json **Example Request**: -```bash +```http DELETE /api/playlists/1 HTTP/1.1 Accept: application/json Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk @@ -280,7 +280,7 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk **Example Response**: -```json +```http HTTP/1.1 200 Content-Type: application/json {} diff --git a/docs/sources/reference/annotations.md b/docs/sources/reference/annotations.md index 73dd599e2c1..6fe5d4977b2 100644 --- a/docs/sources/reference/annotations.md +++ b/docs/sources/reference/annotations.md @@ -17,7 +17,7 @@ you can get event description and event tags. The text field can include links t ## Native annotations -Grafana v4.6+ comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the [HTTP API]({{< relref "annotations.md" >}}). +Grafana v4.6+ comes with a native annotation store and the ability to add annotation events directly from the graph panel or via the [HTTP API]({{< relref "../http_api/annotations.md" >}}). ## Adding annotations diff --git a/docs/sources/reference/export_import.md b/docs/sources/reference/export_import.md index 79fbc339160..4e29cce77f5 100644 --- a/docs/sources/reference/export_import.md +++ b/docs/sources/reference/export_import.md @@ -9,7 +9,7 @@ weight = 8 # Export and Import -Grafana Dashboards can easily be exported and imported, either from the UI or from the HTTP API. +Grafana Dashboards can easily be exported and imported, either from the UI or from the [HTTP API]({{< relref "../http_api/dashboard.md#create-update-dashboard" >}}). ## Exporting a dashboard