[v3.2] Add grafana dashboard importing API (#11)

* Add API to import grafana templates to kubesphere dashboard
* Merge and fix the latest codes from kubesphere #2501

Signed-off-by: zhu733756 <talonzhu@yunify.com>
This commit is contained in:
zhu733756
2021-08-16 11:41:29 +08:00
committed by zhu733756
parent 9df6df5544
commit 242ceb54f6
217 changed files with 119028 additions and 96 deletions

37
vendor/github.com/grafana-tools/sdk/annotation.go generated vendored Normal file
View File

@@ -0,0 +1,37 @@
package sdk
// AnnotationResponse is representation of an existing annotation
type AnnotationResponse struct {
ID uint `json:"id"`
AlertID uint `json:"alertId"`
DashboardID uint `json:"dashboardId,omitempty"`
PanelID uint `json:"panelId,omitempty"`
UserID uint `json:"userId,omitempty"`
UserName string `json:"userName,omitempty"`
NewState string `json:"newState,omitempty"`
PrevState string `json:"prevState,omitempty"`
Time int64 `json:"time,omitempty"`
TimeEnd int64 `json:"timeEnd,omitempty"`
Tags []string `json:"tags,omitempty"`
Text string `json:"text,omitempty"`
Type string `json:"type"`
Data map[string]interface{} `json:"data"`
}
// CreateAnnotationRequest is a request to create a new annotation
type CreateAnnotationRequest struct {
DashboardID uint `json:"dashboardId,omitempty"`
PanelID uint `json:"panelId,omitempty"`
Time int64 `json:"time,omitempty"`
TimeEnd int64 `json:"timeEnd,omitempty"`
Tags []string `json:"tags,omitempty"`
Text string `json:"text,omitempty"`
}
// PatchAnnotationRequest is a request to patch an existing annotation
type PatchAnnotationRequest struct {
Time int64 `json:"time,omitempty"`
TimeEnd int64 `json:"timeEnd,omitempty"`
Tags []string `json:"tags,omitempty"`
Text string `json:"text,omitempty"`
}