2021-03-08 00:02:49 -06:00
|
|
|
package plugindashboards
|
|
|
|
|
|
|
|
import (
|
2021-11-02 07:42:55 -05:00
|
|
|
"context"
|
|
|
|
|
2023-01-18 06:52:41 -06:00
|
|
|
"github.com/grafana/grafana/pkg/services/dashboards"
|
2021-03-08 00:02:49 -06:00
|
|
|
)
|
|
|
|
|
2022-03-10 11:38:04 -06:00
|
|
|
// PluginDashboard plugin dashboard model..
|
|
|
|
type PluginDashboard struct {
|
|
|
|
UID string `json:"uid"`
|
|
|
|
PluginId string `json:"pluginId"`
|
|
|
|
Title string `json:"title"`
|
|
|
|
Imported bool `json:"imported"`
|
|
|
|
ImportedUri string `json:"importedUri"`
|
|
|
|
ImportedUrl string `json:"importedUrl"`
|
|
|
|
Slug string `json:"slug"`
|
|
|
|
DashboardId int64 `json:"dashboardId"`
|
|
|
|
FolderId int64 `json:"folderId"`
|
|
|
|
ImportedRevision int64 `json:"importedRevision"`
|
|
|
|
Revision int64 `json:"revision"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Reference string `json:"path"`
|
|
|
|
Removed bool `json:"removed"`
|
2022-01-28 03:28:33 -06:00
|
|
|
}
|
|
|
|
|
2022-03-10 11:38:04 -06:00
|
|
|
// ListPluginDashboardsRequest request object for listing plugin dashboards.
|
|
|
|
type ListPluginDashboardsRequest struct {
|
|
|
|
OrgID int64
|
|
|
|
PluginID string
|
2021-03-08 00:02:49 -06:00
|
|
|
}
|
|
|
|
|
2022-03-10 11:38:04 -06:00
|
|
|
// ListPluginDashboardsResponse response object for listing plugin dashboards.
|
|
|
|
type ListPluginDashboardsResponse struct {
|
|
|
|
Items []*PluginDashboard
|
2021-03-08 00:02:49 -06:00
|
|
|
}
|
|
|
|
|
2022-03-10 11:38:04 -06:00
|
|
|
// LoadPluginDashboardRequest request object for loading a plugin dashboard.
|
|
|
|
type LoadPluginDashboardRequest struct {
|
|
|
|
PluginID string
|
|
|
|
Reference string
|
2021-03-08 00:02:49 -06:00
|
|
|
}
|
|
|
|
|
2022-03-10 11:38:04 -06:00
|
|
|
// LoadPluginDashboardResponse response object for loading a plugin dashboard.
|
|
|
|
type LoadPluginDashboardResponse struct {
|
2023-01-18 06:52:41 -06:00
|
|
|
Dashboard *dashboards.Dashboard
|
2021-03-08 00:02:49 -06:00
|
|
|
}
|
|
|
|
|
2022-03-10 11:38:04 -06:00
|
|
|
// Service interface for listing plugin dashboards.
|
|
|
|
type Service interface {
|
|
|
|
// ListPluginDashboards list plugin dashboards identified by org/plugin.
|
|
|
|
ListPluginDashboards(ctx context.Context, req *ListPluginDashboardsRequest) (*ListPluginDashboardsResponse, error)
|
2021-03-08 00:02:49 -06:00
|
|
|
|
2022-03-10 11:38:04 -06:00
|
|
|
// LoadPluginDashboard loads a plugin dashboard identified by plugin and reference.
|
|
|
|
LoadPluginDashboard(ctx context.Context, req *LoadPluginDashboardRequest) (*LoadPluginDashboardResponse, error)
|
2021-03-08 00:02:49 -06:00
|
|
|
}
|