grafana

package
v0.0.0-...-d596a3d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*roundtrip.Client
}

Client is the Grafana HTTP API client

func NewClient

func NewClient() (*Client, error)

NewClient returns a Grafana HTTP API client

func (*Client) CreateDashboard

func (c *Client) CreateDashboard(ctx context.Context, data string) error

CreateDashboard creates a new dashboard from the provided dashboard data

func (*Client) DeleteDashboard

func (c *Client) DeleteDashboard(ctx context.Context, data string) error

DeleteDashboard deletes a dashboard specified with data. data is expected to be JSON-encoded and contain a field named `title` which names the dashboard to delete.

func (*Client) Health

func (c *Client) Health(ctx context.Context) error

Health checks the status of Grafana HTTP API

type CreateDashboardRequest

type CreateDashboardRequest struct {
	// Dashboard is the dashboard data
	Dashboard map[string]interface{} `json:"dashboard"`
	// Overwrite is whether to overwrite existing dashboard with newer version or with same dashboard title
	Overwrite bool `json:"overwrite"`
}

CreateDashboardRequest is request to create a new dashboard

Jump to

Keyboard shortcuts

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