Add remaining k8s endpoints for Folders (#93146)

* Add remaining Folders k8s endpoints

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

* Remove duplicated import

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
This commit is contained in:
maicon
2024-09-12 14:38:27 -03:00
committed by GitHub
parent f8fa5286a1
commit d1d578785c
3 changed files with 78 additions and 4 deletions
+3
View File
@@ -448,9 +448,12 @@ func (hs *HTTPServer) registerRoutes() {
if hs.Features.IsEnabledGlobally(featuremgmt.FlagKubernetesFolders) {
// Use k8s client to implement legacy API
handler := newFolderK8sHandler(hs)
folderRoute.Get("/", handler.searchFolders)
folderRoute.Post("/", handler.createFolder)
folderRoute.Group("/:uid", func(folderUidRoute routing.RouteRegister) {
folderUidRoute.Get("/", handler.getFolder)
folderUidRoute.Delete("/", handler.deleteFolder)
folderUidRoute.Put("/:uid", handler.updateFolder)
})
} else {
idScope := dashboards.ScopeFoldersProvider.GetResourceScope(ac.Parameter(":id"))