grafana

package
v0.0.0-...-dc8d137 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatasource

func CreateDatasource(ds Datasource) error

create a new grafana datasource

func CreateOrganization

func CreateOrganization(org Organization) error

create a new grafana organizations

func DeleteDatasource

func DeleteDatasource(ds Datasource) error

delete grafana datasource

func RequestAUTH

func RequestAUTH(method, url string, body []byte) ([]byte, error)

function for making web requests with basic auth

func SwitchUserContext

func SwitchUserContext(org Organization) error

switch to a specific grafana context

func UpdateDatasource

func UpdateDatasource(ds Datasource) error

update existing grafana datasource

Types

type Datasource

type Datasource struct {
	Name          string `json:"name"`
	ID            int    `json:id`
	Type          string `json:"type"`
	URL           string `json:"url"`
	Access        string `json:"access"`
	OrgID         int    `json:"orgId"`
	BasicAuth     bool   `json:"basicAuth"`
	BasicAuthUser string `json:"basicAuthUser"`
	ReadOnly      bool   `json: "readOnly"`
	JSONData      struct {
		HTTPHeaderName1 string `json:"httpHeaderName1"`
	} `json:"jsonData"`
	SecureJSONData struct {
		HTTPHeaderValue1  string `json:"httpHeaderValue1"`
		BasicAuthPassword string `json:"basicAuthPassword"`
	} `json:"secureJsonData"`
}

func GetDatasource

func GetDatasource(dsname string) (Datasource, error)

get grafana datasource

type Organization

type Organization struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Address struct {
		Address1 string `json:"address1"`
		Address2 string `json:"address2"`
		City     string `json:"city"`
		ZipCode  string `json:"zipCode"`
		State    string `json:"state"`
		Country  string `json:"country"`
	} `json:"address"`
}

func GetOrganization

func GetOrganization(orgname string) (Organization, error)

get a specific grafana organization based on the org name

type Organizations

type Organizations []struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

func GetAllOrganizations

func GetAllOrganizations() (Organizations, error)

get all the grafana organizations

Jump to

Keyboard shortcuts

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