grafanadashboard

package
v3.0.0-...-f89e67c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeleteDashboardByUIDUrl    = "%v/api/dashboards/uid/%v"
	CreateOrUpdateDashboardUrl = "%v/api/dashboards/db"
)
View Source
const (
	ControllerName = "controller_grafanadashboard"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, namespace string) error

Add creates a new GrafanaDashboard Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

Types

type DashboardPipeline

type DashboardPipeline interface {
	ProcessDashboard(knownHash string) ([]byte, error)
	NewHash() string
}

func NewDashboardPipeline

func NewDashboardPipeline(dashboard *v1alpha1.GrafanaDashboard, fixAnnotations bool, fixHeights bool) DashboardPipeline

type DashboardPipelineImpl

type DashboardPipelineImpl struct {
	Dashboard      *v1alpha1.GrafanaDashboard
	JSON           string
	Board          map[string]interface{}
	Logger         logr.Logger
	Hash           string
	FixAnnotations bool
	FixHeights     bool
}

func (*DashboardPipelineImpl) NewHash

func (r *DashboardPipelineImpl) NewHash() string

func (*DashboardPipelineImpl) ProcessDashboard

func (r *DashboardPipelineImpl) ProcessDashboard(knownHash string) ([]byte, error)

type GrafanaClient

type GrafanaClient interface {
	CreateOrUpdateDashboard(dashboard []byte) (GrafanaResponse, error)
	DeleteDashboardByUID(UID string) (GrafanaResponse, error)
}

func NewGrafanaClient

func NewGrafanaClient(url, user, password string, timeoutSeconds time.Duration) GrafanaClient

type GrafanaClientImpl

type GrafanaClientImpl struct {
	// contains filtered or unexported fields
}

func (*GrafanaClientImpl) CreateOrUpdateDashboard

func (r *GrafanaClientImpl) CreateOrUpdateDashboard(dashboard []byte) (GrafanaResponse, error)

Submit dashboard json to grafana

func (*GrafanaClientImpl) DeleteDashboardByUID

func (r *GrafanaClientImpl) DeleteDashboardByUID(UID string) (GrafanaResponse, error)

Delete a dashboard given by a UID

type GrafanaRequest

type GrafanaRequest struct {
	Dashboard json.RawMessage `json:"dashboard"`
	FolderId  int             `json:"folderId"`
	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"`
}

type ReconcileGrafanaDashboard

type ReconcileGrafanaDashboard struct {
	// contains filtered or unexported fields
}

ReconcileGrafanaDashboard reconciles a GrafanaDashboard object

func (*ReconcileGrafanaDashboard) Reconcile

The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL