[Dashboard] Revert feature toggle trimdefaults (#34888)

* Revert "solve comments and retrigger the test"

This reverts commit f08d2d9eca1912f89a535d7231e653ff26987a5c.

* Revert "update api doc"

This reverts commit cc09ceb8535fe54f654355d393d1c7f6809518e1.

* Revert "remove post trim"

This reverts commit 46fe8ed596ada5a047a337088278a4195b05fead.

* Revert "fix typo"

This reverts commit 3b3ceee16ed56d982035016d7a1c795972af6de9.

* Revert "Apply suggestions from code review"

This reverts commit 3b7f3b8e15c9d3f8ed1abb14a4f4013ffdc16d27.

* Revert "update comments"

This reverts commit b9c6260876b02b821ea91f4f2d080efe359d1787.

* Revert "update doc"

This reverts commit 8e4c4d7c93e9a1c58322e4cfca447c3b4dee148b.

* Revert "remove feature toggle + add libraryPaneldefinition"

This reverts commit d01cfcc2edd2cfcd675f658e85ad580ac995eb47.

* fix some typos

* Update public/app/features/dashboard/components/ShareModal/ShareExport.tsx

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Update docs/sources/dashboards/export-import.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* fix comments

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
This commit is contained in:
ying-jeanne
2021-05-29 04:29:30 +08:00
committed by GitHub
parent f16b2c40c1
commit b391e43472
7 changed files with 26 additions and 109 deletions

View File

@ -440,100 +440,6 @@ 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/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.