grafana

package
v0.0.0-...-96b04c8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 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 {
	Host     string
	Port     int
	Username string
	Password string
}

func NewClient

func NewClient() *Client

func (Client) CreateDashboard

func (c Client) CreateDashboard(dataSourceName string) (string, error)

func (Client) CreateDataSource

func (c Client) CreateDataSource(name string, prometheusUrl string) error

func (Client) DeleteDashboard

func (c Client) DeleteDashboard(name string) error

func (Client) DeleteDataSource

func (c Client) DeleteDataSource(name string) error

type Config

type Config struct {
	Host     string
	Port     int
	Username string
	Password string
}

type CreateDashboardRequest

type CreateDashboardRequest struct {
	Dashboard Dashboard
	Overwrite bool
}

type Dashboard

type Dashboard struct {
	Templating    map[string][]map[string]interface{} `json:"templating"`
	Annotations   map[string]interface{}              `json:"annotations"`
	Time          map[string]interface{}              `json:"time"`
	Timepicker    map[string]interface{}              `json:"timepicker"`
	Timezone      string                              `json:"timezone"`
	Title         string                              `json:"title"`
	Uid           string                              `json:"uid"`
	Editable      bool                                `json:"editable"`
	Links         []interface{}                       `json:"links"`
	Panels        []map[string]interface{}            `json:"panels"`
	Version       int                                 `json:"version"`
	SchemaVersion int                                 `json:"schema_version"`
	Tags          []string                            `json:"tags"`
}

func NewDashboard

func NewDashboard(dataSourceName string) *Dashboard

type DataSource

type DataSource struct {
	Name      string `json:"name"`
	Type      string `json:"type"`
	Url       string `json:"url"`
	Access    string `json:"access"`
	BasicAuth bool   `json:"basic_auth"`
}

func NewDataSource

func NewDataSource(name string, url string) *DataSource

type Interface

type Interface interface {
	CreateDataSource(name string, url string) error
	DeleteDataSource(name string) error
	CreateDashboard(dataSourceName string) (string, error)
	DeleteDashboard(name string) error
}

Jump to

Keyboard shortcuts

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