diff --git a/docs/sources/developers/http_api/folder_dashboard_search.md b/docs/sources/developers/http_api/folder_dashboard_search.md index e1c2764575c..935b99aa587 100644 --- a/docs/sources/developers/http_api/folder_dashboard_search.md +++ b/docs/sources/developers/http_api/folder_dashboard_search.md @@ -28,6 +28,8 @@ Query parameters: - **tag** – List of tags to search for - **type** – Type to search for, `dash-folder` or `dash-db` - **dashboardIds** – List of dashboard id's to search for +- **dashboardUID** - List of dashboard uid's to search for, It is deprecated since Grafana v9.1, please use dashboardUIDs instead +- **dashboardUIDs** – List of dashboard uid's to search for - **folderIds** – List of folder id's to search in for dashboards - **starred** – Flag indicating if only starred Dashboards should be returned - **limit** – Limit the number of returned results (max is 5000; default is 1000) diff --git a/pkg/api/docs/definitions/search.go b/pkg/api/docs/definitions/search.go index 799880b54c9..4bb937aa98f 100644 --- a/pkg/api/docs/definitions/search.go +++ b/pkg/api/docs/definitions/search.go @@ -42,6 +42,10 @@ type SearchParams struct { // in:query // required: false DashboardIds []int64 `json:"dashboardIds"` + // List of dashboard uid’s to search for + // in:query + // required: false + DashboardUIDs []string `json:"dashboardUIDs"` // List of folder id’s to search in for dashboards // in:query // required: false diff --git a/pkg/api/search.go b/pkg/api/search.go index 042a008ef82..bbb9fa58d8a 100644 --- a/pkg/api/search.go +++ b/pkg/api/search.go @@ -39,7 +39,11 @@ func (hs *HTTPServer) Search(c *models.ReqContext) response.Response { } } - dbUIDs := c.QueryStrings("dashboardUID") + dbUIDs := c.QueryStrings("dashboardUIDs") + if len(dbUIDs) == 0 { + // To keep it for now backward compatible for grafana 9 + dbUIDs = c.QueryStrings("dashboardUID") + } folderIDs := make([]int64, 0) for _, id := range c.QueryStrings("folderIds") { diff --git a/public/api-merged.json b/public/api-merged.json index b607a3b2630..5d59621e810 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -7642,6 +7642,15 @@ "name": "dashboardIds", "in": "query" }, + { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of dashboard uid’s to search for", + "name": "dashboardUIDs", + "in": "query" + }, { "type": "array", "items": { diff --git a/public/api-spec.json b/public/api-spec.json index bfb1de36b1f..dd099f04cd3 100644 --- a/public/api-spec.json +++ b/public/api-spec.json @@ -7061,6 +7061,15 @@ "name": "dashboardIds", "in": "query" }, + { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of dashboard uid’s to search for", + "name": "dashboardUIDs", + "in": "query" + }, { "type": "array", "items": {