Documentation
¶
Index ¶
- func CreateDatasource(grafanapi string, ds Datasource) error
- func CreateOrganization(grafanapi string, org Organization) error
- func DeleteDatasource(grafanapi string, ds Datasource) error
- func RequestAUTH(method, url string, body []byte) ([]byte, error)
- func SwitchUserContext(grafanapi string, org Organization) error
- func UpdateDatasource(grafanapi string, ds Datasource) error
- type Datasource
- type Organization
- type Organizations
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDatasource ¶
func CreateDatasource(grafanapi string, ds Datasource) error
create a new grafana datasource
func CreateOrganization ¶
func CreateOrganization(grafanapi string, org Organization) error
create a new grafana organizations
func DeleteDatasource ¶
func DeleteDatasource(grafanapi string, ds Datasource) error
delete grafana datasource
func RequestAUTH ¶
function for making web requests with basic auth
func SwitchUserContext ¶
func SwitchUserContext(grafanapi string, org Organization) error
switch to a specific grafana context
func UpdateDatasource ¶
func UpdateDatasource(grafanapi string, 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(grafanapi, 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(grafanapi string, orgname string) (Organization, error)
get a specific grafana organization based on the org name
type Organizations ¶
func GetAllOrganizations ¶
func GetAllOrganizations(grafanapi string) (Organizations, error)
get all the grafana organizations
Click to show internal directories.
Click to hide internal directories.