grafana_datasources

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 5 Imported by: 1

README

Grafana Datasource

To get Grafana Datasource for specific account:

	client, err := grafana_datasources.New(apiToken, test_utils.GetLogzIoBaseUrl())
    datasource, err := client.GetForAccount("my-metrics-account-name")
function func name
get datasource for account func (c *GrafanaDatasourceClient) GetForAccount(accountName string) (*GrafanaDataSource, error)

Documentation

Index

Constants

View Source
const (
	GetAllForAccountGrafanaDatasourceMethod = "GetAllForAccountDatasource"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GrafanaDataSource

type GrafanaDataSource struct {
	Id              int64                  `json:"id,omitempty"`
	Uid             string                 `json:"uid,omitempty"`
	Name            string                 `json:"name"`
	Type            string                 `json:"type"`
	TypeLogoUrl     string                 `json:"typeLogoUrl,omitempty"` // Only returned by the API. Depends on the Type.
	Url             string                 `json:"url"`
	Access          string                 `json:"access"`
	ReadOnly        bool                   `json:"readOnly"` // Only returned by the API. Can be set through the `editable` attribute of provisioned data sources.
	Database        string                 `json:"database,omitempty"`
	User            string                 `json:"user,omitempty"`
	OrgId           int64                  `json:"orgId,omitempty"`
	IsDefault       bool                   `json:"isDefault"`
	BasicAuth       bool                   `json:"basicAuth"`
	BasicAuthUser   string                 `json:"basicAuthUser,omitempty"`
	WithCredentials bool                   `json:"withCredentials,omitempty"`
	JsonData        map[string]interface{} `json:"jsonData,omitempty"`
	SecureJsonData  map[string]interface{} `json:"secureJsonData,omitempty"`
	Version         int                    `json:"version,omitempty"`
}

type GrafanaDatasourceClient

type GrafanaDatasourceClient struct {
	*client.Client
}

func New

func New(apiToken string, baseUrl string) (*GrafanaDatasourceClient, error)

func (*GrafanaDatasourceClient) GetForAccount

func (c *GrafanaDatasourceClient) GetForAccount(accountName string) (*GrafanaDataSource, error)

Jump to

Keyboard shortcuts

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