remove feature toggle + add libraryPaneldefinition (#34488)
* remove feature toggle + add libraryPaneldefinition * update doc * update comments * Apply suggestions from code review Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * fix typo * remove post trim * update api doc * solve comments and retrigger the test Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
co-authored by
Diana Payton
parent
dbef103fb9
commit
c59a2e1bcf
@@ -15,7 +15,7 @@ Dashboards are exported in Grafana JSON format, and contain everything you need
|
||||
|
||||
The export feature is accessed in the share window which you open by clicking the share button in the dashboard menu.
|
||||
|
||||
{{< docs-imagebox img="/img/docs/export/export-modal.png" max-width="800px" >}}
|
||||
{{< docs-imagebox img="/img/docs/export/export-modal-8-0.png" max-width="800px" >}}
|
||||
|
||||
### Making a dashboard portable
|
||||
|
||||
@@ -25,7 +25,13 @@ add template variables for things like a metric prefix (use constant variable) a
|
||||
A template variable of the type `Constant` will automatically be hidden in
|
||||
the dashboard, and will also be added as a required input when the dashboard is imported.
|
||||
|
||||
## Importing a dashboard
|
||||
### Export dashboard without default values
|
||||
|
||||
To export a dashboard without the default values in order to reduce the exported JSON file size, check the toggle **Export with default values removed** option.
|
||||
|
||||
During import, the removed default values are automatically added back to the dashboard.
|
||||
|
||||
## Import a dashboard
|
||||
|
||||
To import a dashboard click the + icon in the side menu, and then click **Import**.
|
||||
|
||||
|
||||
@@ -440,6 +440,100 @@ Content-Type: application/json
|
||||
## Dashboard Search
|
||||
See [Folder/Dashboard Search API]({{< relref "folder_dashboard_search.md" >}}).
|
||||
|
||||
## Remove default values in dashboard
|
||||
|
||||
`POST /api/dashboards/trim`
|
||||
|
||||
Will remove default values from input dashboard JSON.
|
||||
|
||||
**Example Request for trimming dashboard JSON**:
|
||||
|
||||
```http
|
||||
POST /api/dashboards/uid/trim HTTP/1.1
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||
|
||||
{
|
||||
"meta": {
|
||||
"isStarred": false,
|
||||
"url": "/d/cIBgcSjkk/production-overview",
|
||||
"folderId": 2,
|
||||
"folderUid": "l3KqBxCMz",
|
||||
"slug": "production-overview"
|
||||
},
|
||||
"dashboard": {
|
||||
"id": 112,
|
||||
"panels": [
|
||||
{
|
||||
"datasource": null,
|
||||
"description": "",
|
||||
"gridPos": {
|
||||
"h": 9,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"feedUrl": "https://grafana.com/blog/news.xml",
|
||||
"showImage": true
|
||||
},
|
||||
"pluginVersion": "8.1.0-pre",
|
||||
"title": "Panel Title",
|
||||
"type": "news"
|
||||
}
|
||||
],
|
||||
"title": "test dashboard",
|
||||
"uid": "9lzdzI3Mz",
|
||||
"version": 2
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Example Response**:
|
||||
|
||||
```http
|
||||
HTTP/1.1 200
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"meta": {
|
||||
"folderId": 2,
|
||||
"folderUid": "l3KqBxCMz",
|
||||
"isStarred": false,
|
||||
"slug": "production-overview",
|
||||
"url": "/d/cIBgcSjkk/production-overview"
|
||||
},
|
||||
"dashboard": {
|
||||
"id": 112,
|
||||
"panels": [
|
||||
{
|
||||
"gridPos": {},
|
||||
"id": 2,
|
||||
"options": {
|
||||
"feedUrl": "https://grafana.com/blog/news.xml",
|
||||
"showImage": true
|
||||
},
|
||||
"pluginVersion": "8.1.0-pre",
|
||||
"title": "Panel Title",
|
||||
"type": "news"
|
||||
}
|
||||
],
|
||||
"title": "test dashboard",
|
||||
"uid": "9lzdzI3Mz",
|
||||
"version": 2
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Status Codes:
|
||||
|
||||
- **200** – Trimmed
|
||||
- **400** – Errors (invalid json, missing or invalid fields, etc)
|
||||
- **401** – Unauthorized
|
||||
- **403** – Access denied
|
||||
|
||||
## Deprecated resources
|
||||
Please note that these resource have been deprecated and will be removed in a future release.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user