瀏覽代碼

Linked docs from main nav

utkarshcmu 10 年之前
父節點
當前提交
4ff6748eb4

+ 9 - 8
docs/mkdocs.yml

@@ -76,14 +76,15 @@ pages:
 - ['datasources/kairosdb.md', 'Data Sources', 'KairosDB']
 - ['datasources/kairosdb.md', 'Data Sources', 'KairosDB']
 - ['datasources/prometheus.md', 'Data Sources', 'Prometheus']
 - ['datasources/prometheus.md', 'Data Sources', 'Prometheus']
 
 
-- ['http_api/first_steps.md', 'HTTP API', 'Authentication API']
-- ['http_api/dashboards.md', 'HTTP API', 'Dashboards API']
-- ['http_api/data_sources.md', 'HTTP API', 'Data Sources API']
-- ['http_api/orgs.md', 'HTTP API', 'Organisations API']
-- ['http_api/users.md', 'HTTP API', 'Users API']
-- ['http_api/admin.md', 'HTTP API', 'Admin API']
-- ['http_api/snapshots.md', 'HTTP API', 'Snapshots API']
-- ['http_api/general.md', 'HTTP API', 'Other API']
+- ['http_api/overview.md', 'API', 'Overview']
+- ['http_api/auth.md', 'API', 'Authentication API']
+- ['http_api/dashboard.md', 'API', 'Dashboard API']
+- ['http_api/data_source.md', 'API', 'Data Source API']
+- ['http_api/org.md', 'API', 'Organisation API']
+- ['http_api/user.md', 'API', 'User API']
+- ['http_api/admin.md', 'API', 'Admin API']
+- ['http_api/snapshot.md', 'API', 'Snapshot API']
+- ['http_api/other.md', 'API', 'Other API']
 
 
 - ['tutorials/index.md', 'Tutorials', 'Tutorials']
 - ['tutorials/index.md', 'Tutorials', 'Tutorials']
 - ['tutorials/hubot_howto.md', 'Tutorials', 'How To integrate Hubot and Grafana']
 - ['tutorials/hubot_howto.md', 'Tutorials', 'How To integrate Hubot and Grafana']

+ 8 - 8
docs/sources/http_api/admin.md

@@ -4,9 +4,9 @@ page_description: Grafana Admin API Reference
 page_keywords: grafana, admin, http, api, documentation
 page_keywords: grafana, admin, http, api, documentation
 ---
 ---
 
 
-## Admin API
+# Admin API
 
 
-### Settings
+## Settings
 
 
 `GET /api/admin/settings`
 `GET /api/admin/settings`
 
 
@@ -162,7 +162,7 @@ page_keywords: grafana, admin, http, api, documentation
       }
       }
     }
     }
 
 
-### Grafana Stats
+## Grafana Stats
 
 
 `GET /api/admin/stats`
 `GET /api/admin/stats`
 
 
@@ -190,7 +190,7 @@ page_keywords: grafana, admin, http, api, documentation
       "grafana_admin_count":2
       "grafana_admin_count":2
     }
     }
 
 
-### Global Users
+## Global Users
 
 
 `POST /api/admin/users`
 `POST /api/admin/users`
 
 
@@ -217,7 +217,7 @@ Create new user
 
 
     {"id":5,"message":"User created"}
     {"id":5,"message":"User created"}
 
 
-### Password for User
+## Password for User
 
 
 `PUT /api/admin/users/:id/password`
 `PUT /api/admin/users/:id/password`
 
 
@@ -237,7 +237,7 @@ Change password for specific user
 
 
     {"password":"userpassword"}
     {"password":"userpassword"}
 
 
-### Permissions
+## Permissions
 
 
 `PUT /api/admin/users/:id/permissions`
 `PUT /api/admin/users/:id/permissions`
 
 
@@ -255,7 +255,7 @@ Change password for specific user
 
 
     {message: "User permissions updated"}
     {message: "User permissions updated"}
 
 
-### Delete global User
+## Delete global User
 
 
 `DELETE /api/admin/users/:id`
 `DELETE /api/admin/users/:id`
 
 
@@ -271,4 +271,4 @@ Change password for specific user
     HTTP/1.1 200
     HTTP/1.1 200
     Content-Type: application/json
     Content-Type: application/json
 
 
-    {message: "User deleted"}
+    {message: "User deleted"}

+ 0 - 3
docs/sources/http_api/first_steps.md → docs/sources/http_api/auth.md

@@ -6,9 +6,6 @@ page_keywords: grafana, admin, http, api, documentation
 
 
 # Authentication API
 # Authentication API
 
 
-The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving
-dashboards, creating users and updating data sources.
-
 ## Tokens
 ## Tokens
 
 
 Currently you can authenticate via an `API Token` or via a `Session cookie` (acquired using regular login or oauth).
 Currently you can authenticate via an `API Token` or via a `Session cookie` (acquired using regular login or oauth).

+ 11 - 11
docs/sources/http_api/dashboards.md → docs/sources/http_api/dashboard.md

@@ -1,12 +1,12 @@
 ----
 ----
-page_title: Dashboards API
-page_description: Grafana Dashboards API Reference
-page_keywords: grafana, admin, http, api, documentation, dashboards
+page_title: Dashboard API
+page_description: Grafana Dashboard API Reference
+page_keywords: grafana, admin, http, api, documentation, dashboard
 ---
 ---
 
 
-## Dashboards API
+# Dashboard API
 
 
-### Create / Update dashboard
+## Create / Update dashboard
 
 
 `POST /api/dashboards/db`
 `POST /api/dashboards/db`
 
 
@@ -73,7 +73,7 @@ same status code is also used if another dashboard exists with the same title. T
 
 
 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`.
 
 
-### Get dashboard
+## Get dashboard
 
 
 `GET /api/dashboards/db/:slug`
 `GET /api/dashboards/db/:slug`
 
 
@@ -110,7 +110,7 @@ Will return the dashboard given the dashboard slug. Slug is the url friendly ver
       }
       }
     }
     }
 
 
-### Delete dashboard
+## Delete dashboard
 
 
 `DELETE /api/dashboards/db/:slug`
 `DELETE /api/dashboards/db/:slug`
 
 
@@ -130,7 +130,7 @@ The above will delete the dashboard with the specified slug. The slug is the url
 
 
     {"title": "Test"}
     {"title": "Test"}
 
 
-### Gets the home dashboard
+## Gets the home dashboard
 
 
 `GET /api/dashboards/home`
 `GET /api/dashboards/home`
 
 
@@ -186,7 +186,7 @@ Will return the home dashboard.
       }
       }
     }
     }
 
 
-### Tags for Dashboard
+## Tags for Dashboard
 
 
 
 
 `GET /api/dashboards/tags`
 `GET /api/dashboards/tags`
@@ -216,11 +216,11 @@ Get all tabs of dashboards
       }
       }
     ]
     ]
 
 
-### Dashboard from JSON file
+## Dashboard from JSON file
 
 
 `GET /file/:file`
 `GET /file/:file`
 
 
-### Search Dashboards
+## Search Dashboards
 
 
 `GET /api/search/`
 `GET /api/search/`
 
 

+ 10 - 10
docs/sources/http_api/data_sources.md → docs/sources/http_api/data_source.md

@@ -1,12 +1,12 @@
 ----
 ----
-page_title: Data sources API
-page_description: Grafana Data sources API Reference
-page_keywords: grafana, admin, http, api, documentation, datasources
+page_title: Data source API
+page_description: Grafana Data source API Reference
+page_keywords: grafana, admin, http, api, documentation, datasource
 ---
 ---
 
 
-## Data sources API
+# Data source API
 
 
-### Get all datasources
+## Get all datasources
 
 
 `GET /api/datasources`
 `GET /api/datasources`
 
 
@@ -41,7 +41,7 @@ page_keywords: grafana, admin, http, api, documentation, datasources
       }
       }
     ]
     ]
 
 
-### Get a single data sources by Id
+## Get a single data sources by Id
 
 
 `GET /api/datasources/:datasourceId`
 `GET /api/datasources/:datasourceId`
 
 
@@ -74,7 +74,7 @@ page_keywords: grafana, admin, http, api, documentation, datasources
       "jsonData":null
       "jsonData":null
     }
     }
 
 
-### Create data source
+## Create data source
 
 
 `POST /api/datasources`
 `POST /api/datasources`
 
 
@@ -101,7 +101,7 @@ page_keywords: grafana, admin, http, api, documentation, datasources
 
 
     {"id":1,"message":"Datasource added"}
     {"id":1,"message":"Datasource added"}
 
 
-### Update an existing data source
+## Update an existing data source
 
 
 `PUT /api/datasources/:datasourceId`
 `PUT /api/datasources/:datasourceId`
 
 
@@ -136,7 +136,7 @@ page_keywords: grafana, admin, http, api, documentation, datasources
 
 
     {"message":"Datasource updated"}
     {"message":"Datasource updated"}
 
 
-### Delete an existing data source
+## Delete an existing data source
 
 
 `DELETE /api/datasources/:datasourceId`
 `DELETE /api/datasources/:datasourceId`
 
 
@@ -154,7 +154,7 @@ page_keywords: grafana, admin, http, api, documentation, datasources
 
 
     {"message":"Data source deleted"}
     {"message":"Data source deleted"}
 
 
-### Available data source types
+## Available data source types
 
 
 `GET /api/datasources/plugins`
 `GET /api/datasources/plugins`
 
 

+ 19 - 19
docs/sources/http_api/orgs.md → docs/sources/http_api/org.md

@@ -1,12 +1,12 @@
 ----
 ----
-page_title: Organisations API
-page_description: Grafana Organisations API Reference
-page_keywords: grafana, admin, http, api, documentation, orgs, organisations
+page_title: Organisation API
+page_description: Grafana Organisation API Reference
+page_keywords: grafana, admin, http, api, documentation, orgs, organisation
 ---
 ---
 
 
-## Organisation API
+# Organisation API
 
 
-### Get current Organisation
+## Get current Organisation
 
 
 `GET /api/org`
 `GET /api/org`
 
 
@@ -27,7 +27,7 @@ page_keywords: grafana, admin, http, api, documentation, orgs, organisations
       "name":"Main Org."
       "name":"Main Org."
     }
     }
 
 
-### Get Organisation by Id
+## Get Organisation by Id
 
 
 `GET /api/orgs/:orgId`
 `GET /api/orgs/:orgId`
 
 
@@ -56,7 +56,7 @@ page_keywords: grafana, admin, http, api, documentation, orgs, organisations
       }
       }
     }
     }
 
 
-### Get Organisation by Name
+## Get Organisation by Name
 
 
 `GET /api/orgs/name/:orgName`
 `GET /api/orgs/name/:orgName`
 
 
@@ -85,7 +85,7 @@ page_keywords: grafana, admin, http, api, documentation, orgs, organisations
       }
       }
     }
     }
 
 
-### Update current Organisation
+## Update current Organisation
 
 
 `PUT /api/org`
 `PUT /api/org`
 
 
@@ -109,7 +109,7 @@ page_keywords: grafana, admin, http, api, documentation, orgs, organisations
     {"message":"Organization updated"}
     {"message":"Organization updated"}
 
 
 
 
-### Get all users within the actual organisation
+## Get all users within the actual organisation
 
 
 `GET /api/org/users`
 `GET /api/org/users`
 
 
@@ -135,7 +135,7 @@ page_keywords: grafana, admin, http, api, documentation, orgs, organisations
       }
       }
     ]
     ]
 
 
-### Add a new user to the actual organisation
+## Add a new user to the actual organisation
 
 
 `POST /api/org/users`
 `POST /api/org/users`
 
 
@@ -161,7 +161,7 @@ Adds a global user to the actual organisation.
 
 
     {"message":"User added to organization"}
     {"message":"User added to organization"}
 
 
-### Updates the given user
+## Updates the given user
 
 
 `PATCH /api/org/users/:userId`
 `PATCH /api/org/users/:userId`
 
 
@@ -185,7 +185,7 @@ Adds a global user to the actual organisation.
     {"message":"Organization user updated"}
     {"message":"Organization user updated"}
 
 
 
 
-### Delete user in actual organisation
+## Delete user in actual organisation
 
 
 `DELETE /api/org/users/:userId`
 `DELETE /api/org/users/:userId`
 
 
@@ -204,9 +204,9 @@ Adds a global user to the actual organisation.
     {"message":"User removed from organization"}
     {"message":"User removed from organization"}
 
 
 
 
-## Organisations
+# Organisations
 
 
-### Search all Organisations
+## Search all Organisations
 
 
 `GET /api/orgs`
 `GET /api/orgs`
 
 
@@ -229,7 +229,7 @@ Adds a global user to the actual organisation.
       }
       }
     ]
     ]
 
 
-### Update Organisation
+## Update Organisation
 
 
 `PUT /api/orgs/:orgId`
 `PUT /api/orgs/:orgId`
 
 
@@ -254,7 +254,7 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y
 
 
     {"message":"Organization updated"}
     {"message":"Organization updated"}
 
 
-### Get Users in Organisation
+## Get Users in Organisation
 
 
 `GET /api/orgs/:orgId/users`
 `GET /api/orgs/:orgId/users`
 
 
@@ -279,7 +279,7 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y
       }
       }
     ]
     ]
 
 
-### Add User in Organisation
+## Add User in Organisation
 
 
 `POST /api/orgs/:orgId/users`
 `POST /api/orgs/:orgId/users`
 
 
@@ -302,7 +302,7 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y
 
 
     {"message":"User added to organization"}
     {"message":"User added to organization"}
 
 
-### Update Users in Organisation
+## Update Users in Organisation
 
 
 `PATCH /api/orgs/:orgId/users/:userId`
 `PATCH /api/orgs/:orgId/users/:userId`
 
 
@@ -324,7 +324,7 @@ Update Organisation, fields *Adress 1*, *Adress 2*, *City* are not implemented y
 
 
     {"message":"Organization user updated"}
     {"message":"Organization user updated"}
 
 
-### Delete User in Organisation
+## Delete User in Organisation
 
 
 `DELETE /api/orgs/:orgId/users/:userId`
 `DELETE /api/orgs/:orgId/users/:userId`
 
 

+ 7 - 7
docs/sources/http_api/general.md → docs/sources/http_api/other.md

@@ -1,12 +1,12 @@
 ----
 ----
-page_title: General APIs
-page_description: Grafana General API Reference
+page_title: Other APIs
+page_description: Grafana Other API Reference
 page_keywords: grafana, admin, http, api, documentation, dashboards
 page_keywords: grafana, admin, http, api, documentation, dashboards
 ---
 ---
 
 
-## Frontend Settings API
+# Frontend Settings API
 
 
-### Get Settings
+## Get Settings
 
 
 `GET /api/frontend/settings`
 `GET /api/frontend/settings`
 
 
@@ -50,9 +50,9 @@ page_keywords: grafana, admin, http, api, documentation, dashboards
       "defaultDatasource": "Grafana"
       "defaultDatasource": "Grafana"
     }
     }
 
 
-## Login API
+# Login API
 
 
-### Renew session based on remember cookie
+## Renew session based on remember cookie
 
 
 `GET /api/login/ping`
 `GET /api/login/ping`
 
 
@@ -68,4 +68,4 @@ page_keywords: grafana, admin, http, api, documentation, dashboards
     HTTP/1.1 200
     HTTP/1.1 200
     Content-Type: application/json
     Content-Type: application/json
 
 
-    {"message": "Logged in"}
+    {"message": "Logged in"}

+ 21 - 0
docs/sources/http_api/overview.md

@@ -0,0 +1,21 @@
+----
+page_title: HTTP API
+page_description: Grafana HTTP API Reference
+page_keywords: grafana, admin, http, api, documentation
+---
+
+# HTTP API Reference
+
+The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving
+dashboards, creating users and updating data sources.
+
+###Supported HTTP APIs:
+
+* [Authentication API](/http_api/auth/)
+* [Dashboard API](/http_api/dashboard/)
+* [Data Source API](/http_api/data_source/)
+* [Organisation API](/http_api/org/)
+* [User API](/http_api/user/)
+* [Admin API](/http_api/admin/)
+* [Snapshot API](/http_api/snapshot/)
+* [Other API](/http_api/other/)

+ 8 - 8
docs/sources/http_api/snapshots.md → docs/sources/http_api/snapshot.md

@@ -1,12 +1,12 @@
 ----
 ----
-page_title: Snapshots API
-page_description: Grafana Snapshots API Reference
-page_keywords: grafana, admin, http, api, documentation, snapshots, dashboards
+page_title: Snapshot API
+page_description: Grafana Snapshot API Reference
+page_keywords: grafana, admin, http, api, documentation, snapshot, dashboard
 ---
 ---
 
 
-## Snapshots API
+# Snapshot API
 
 
-### Create new snapshot
+## Create new snapshot
 
 
 `POST /api/snapshots`
 `POST /api/snapshots`
 
 
@@ -63,7 +63,7 @@ Keys:
 - **deleteKey** – Key generated to delete the snapshot
 - **deleteKey** – Key generated to delete the snapshot
 - **key** – Key generated to share the dashboard
 - **key** – Key generated to share the dashboard
 
 
-### Get Snapshot by Id
+## Get Snapshot by Id
 
 
 `GET /api/snapshots/:key`
 `GET /api/snapshots/:key`
 
 
@@ -118,7 +118,7 @@ Keys:
         }
         }
     }
     }
 
 
-### Delete Snapshot by Id
+## Delete Snapshot by Id
 
 
 `GET /api/snapshots-delete/:key`
 `GET /api/snapshots-delete/:key`
 
 
@@ -134,4 +134,4 @@ Keys:
     HTTP/1.1 200
     HTTP/1.1 200
     Content-Type: application/json
     Content-Type: application/json
 
 
-    {"message":"Snapshot deleted. It might take an hour before it's cleared from a CDN cache."}
+    {"message":"Snapshot deleted. It might take an hour before it's cleared from a CDN cache."}

+ 15 - 15
docs/sources/http_api/users.md → docs/sources/http_api/user.md

@@ -1,12 +1,12 @@
 ----
 ----
-page_title: Users API
-page_description: Grafana Users API Reference
-page_keywords: grafana, admin, http, api, documentation, users
+page_title: User API
+page_description: Grafana User API Reference
+page_keywords: grafana, admin, http, api, documentation, user
 ---
 ---
 
 
-## Users API
+# User API
 
 
-### Search Users
+## Search Users
 
 
 `GET /api/users`
 `GET /api/users`
 
 
@@ -39,7 +39,7 @@ page_keywords: grafana, admin, http, api, documentation, users
       }
       }
     ]
     ]
 
 
-### Get single user by Id
+## Get single user by Id
 
 
 `GET /api/users/:id`
 `GET /api/users/:id`
 
 
@@ -64,7 +64,7 @@ page_keywords: grafana, admin, http, api, documentation, users
       "isGrafanaAdmin": true
       "isGrafanaAdmin": true
     }
     }
 
 
-### User Update
+## User Update
 
 
 `PUT /api/users/:id`
 `PUT /api/users/:id`
 
 
@@ -90,7 +90,7 @@ page_keywords: grafana, admin, http, api, documentation, users
     {"message":"User updated"}
     {"message":"User updated"}
 
 
 
 
-### Get Organisations for user
+## Get Organisations for user
 
 
 `GET /api/users/:id/orgs`
 `GET /api/users/:id/orgs`
 
 
@@ -116,7 +116,7 @@ page_keywords: grafana, admin, http, api, documentation, users
 
 
 ## User
 ## User
 
 
-### Actual User
+## Actual User
 
 
 `GET /api/user`
 `GET /api/user`
 
 
@@ -141,7 +141,7 @@ page_keywords: grafana, admin, http, api, documentation, users
       "isGrafanaAdmin":true
       "isGrafanaAdmin":true
     }
     }
 
 
-### Change Password
+## Change Password
 
 
 `PUT /api/user/password`
 `PUT /api/user/password`
 
 
@@ -167,7 +167,7 @@ Changes the password for the user
 
 
     {"message":"User password changed"}
     {"message":"User password changed"}
 
 
-### Switch user context
+## Switch user context
 
 
 `POST /api/user/using/:organisationId`
 `POST /api/user/using/:organisationId`
 
 
@@ -187,7 +187,7 @@ Switch user context to the given organisation.
 
 
     {"message":"Active organization changed"}
     {"message":"Active organization changed"}
 
 
-### Organisations of the actual User
+## Organisations of the actual User
 
 
 `GET /api/user/orgs`
 `GET /api/user/orgs`
 
 
@@ -213,7 +213,7 @@ Return a list of all organisations of the current user.
       }
       }
     ]
     ]
 
 
-### Star a dashboard
+## Star a dashboard
 
 
 `POST /api/user/stars/dashboard/:dashboardId`
 `POST /api/user/stars/dashboard/:dashboardId`
 
 
@@ -233,7 +233,7 @@ Stars the given Dashboard for the actual user.
 
 
     {"message":"Dashboard starred!"}
     {"message":"Dashboard starred!"}
 
 
-### Unstar a dashboard
+## Unstar a dashboard
 
 
 `DELETE /api/user/stars/dashboard/:dashboardId`
 `DELETE /api/user/stars/dashboard/:dashboardId`
 
 
@@ -251,4 +251,4 @@ Deletes the starring of the given Dashboard for the actual user.
     HTTP/1.1 200
     HTTP/1.1 200
     Content-Type: application/json
     Content-Type: application/json
 
 
-    {"message":"Dashboard unstarred"}
+    {"message":"Dashboard unstarred"}

+ 1 - 1
docs/sources/installation/migrating_to2.md

@@ -20,7 +20,7 @@ migrate to Grafana 2.0.
 ## Adding Data sources
 ## Adding Data sources
 
 
 The `config.js` file has been deprecated. Data sources are now managed via
 The `config.js` file has been deprecated. Data sources are now managed via
-the UI or [HTTP API](../http_api/first_steps.md). Manage your
+the UI or [HTTP API](../http_api/overview.md). Manage your
 organizations data sources by clicking on the `Data Sources` menu on the
 organizations data sources by clicking on the `Data Sources` menu on the
 side menu (which can be toggled via the Grafana icon in the upper left
 side menu (which can be toggled via the Grafana icon in the upper left
 of your browser).
 of your browser).