Documentation ¶
Index ¶
- Constants
- func Add(mgr manager.Manager, namespace string) error
- type DashboardPipeline
- type DashboardPipelineImpl
- type GrafanaClient
- type GrafanaClientImpl
- func (r *GrafanaClientImpl) CreateOrUpdateDashboard(dashboard []byte, folderID int64, folderName string) (GrafanaResponse, error)
- func (r *GrafanaClientImpl) CreateOrUpdateFolder(folderInputName string) (GrafanaFolderResponse, error)
- func (r *GrafanaClientImpl) DeleteDashboardByUID(UID string) (GrafanaResponse, error)
- func (r *GrafanaClientImpl) DeleteFolder(deleteID *int64) error
- func (r *GrafanaClientImpl) SafeToDelete(dashlist []*v1alpha1.GrafanaDashboardRef, id *int64) bool
- type GrafanaFolderRequest
- type GrafanaFolderResponse
- type GrafanaRequest
- type GrafanaResponse
- type ReconcileGrafanaDashboard
- type SourceType
Constants ¶
View Source
const ( DeleteDashboardByUIDUrl = "%v/api/dashboards/uid/%v" CreateOrUpdateDashboardUrl = "%v/api/dashboards/db" CreateOrUpdateFolderUrl = "%v/api/folders" DeleteFolderByUIDUrl = "%v/api/folders/%v" GetFolderByIDUrl = "%v/api/folders/id/%v" //TODO is this right? VV SearchURL = "%v/api/search?type=dash-db" )
View Source
const (
ControllerName = "controller_grafanadashboard"
)
View Source
const (
NonNamespacedFolderName = "Non-Namespaced"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DashboardPipeline ¶
type DashboardPipeline interface { ProcessDashboard(knownHash string, folderId *int64, folderName string) ([]byte, error) NewHash() string }
func NewDashboardPipeline ¶
func NewDashboardPipeline(client client.Client, dashboard *v1alpha1.GrafanaDashboard, ctx context.Context) DashboardPipeline
type DashboardPipelineImpl ¶
type DashboardPipelineImpl struct { Client client.Client Dashboard *v1alpha1.GrafanaDashboard JSON string Board map[string]interface{} Logger logr.Logger Hash string Context context.Context }
func (*DashboardPipelineImpl) NewHash ¶
func (r *DashboardPipelineImpl) NewHash() string
func (*DashboardPipelineImpl) ProcessDashboard ¶
type GrafanaClient ¶
type GrafanaClient interface { CreateOrUpdateDashboard(dashboard []byte, folderId int64, folderName string) (GrafanaResponse, error) DeleteDashboardByUID(UID string) (GrafanaResponse, error) CreateOrUpdateFolder(folderName string) (GrafanaFolderResponse, error) DeleteFolder(folderID *int64) error SafeToDelete(dashboards []*v1alpha1.GrafanaDashboardRef, folderID *int64) bool }
func NewGrafanaClient ¶
type GrafanaClientImpl ¶
type GrafanaClientImpl struct {
// contains filtered or unexported fields
}
func (*GrafanaClientImpl) CreateOrUpdateDashboard ¶
func (r *GrafanaClientImpl) CreateOrUpdateDashboard(dashboard []byte, folderID int64, folderName string) (GrafanaResponse, error)
Submit dashboard json to grafana
func (*GrafanaClientImpl) CreateOrUpdateFolder ¶ added in v3.6.0
func (r *GrafanaClientImpl) CreateOrUpdateFolder(folderInputName string) (GrafanaFolderResponse, error)
func (*GrafanaClientImpl) DeleteDashboardByUID ¶
func (r *GrafanaClientImpl) DeleteDashboardByUID(UID string) (GrafanaResponse, error)
Delete a dashboard given by a UID
func (*GrafanaClientImpl) DeleteFolder ¶ added in v3.6.0
func (r *GrafanaClientImpl) DeleteFolder(deleteID *int64) error
func (*GrafanaClientImpl) SafeToDelete ¶ added in v3.6.0
func (r *GrafanaClientImpl) SafeToDelete(dashlist []*v1alpha1.GrafanaDashboardRef, id *int64) bool
type GrafanaFolderRequest ¶ added in v3.5.0
type GrafanaFolderRequest struct {
Title string `json:"title"`
}
type GrafanaFolderResponse ¶ added in v3.5.0
type GrafanaRequest ¶
type GrafanaRequest struct { Dashboard json.RawMessage `json:"dashboard"` FolderId int64 `json:"folderId"` FolderName string `json:"folderName"` Overwrite bool `json:"overwrite"` }
type GrafanaResponse ¶
type GrafanaResponse struct { ID *uint `json:"id"` OrgID *uint `json:"orgId"` Message *string `json:"message"` Slug *string `json:"slug"` Version *int `json:"version"` Status *string `json:"resp"` UID *string `json:"uid"` URL *string `json:"url"` FolderId *int64 `json:"folderId"` FolderName string `json:"folderName"` }
type ReconcileGrafanaDashboard ¶
type ReconcileGrafanaDashboard struct {
// contains filtered or unexported fields
}
ReconcileGrafanaDashboard reconciles a GrafanaDashboard object
type SourceType ¶ added in v3.6.0
type SourceType int
const ( SourceTypeJson SourceType = 1 SourceTypeJsonnet SourceType = 2 SourceTypeUnknown SourceType = 3 )
Click to show internal directories.
Click to hide internal directories.