grafana

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotations

type Annotations struct {
	OrgID       string `json:"__orgId__"`
	ValueString string `json:"__value_string__"`
	Values      string `json:"__values__"`
}

type Client

type Client struct {
	*req.Client
	BaseURL string
}

func NewClient

func NewClient(url, token string) *Client

func (*Client) ListAlert

func (c *Client) ListAlert() (resp []*ListAlertResp, err error)

func (*Client) ListAlertInstance

func (c *Client) ListAlertInstance() (resp []*ListAlertInstanceResp, err error)

type Conditions

type Conditions struct {
	Evaluator Evaluator `json:"evaluator"`
	Operator  Operator  `json:"operator"`
	Query     Query     `json:"query"`
	Reducer   Reducer   `json:"reducer"`
	Type      string    `json:"type"`
}

type Data

type Data struct {
	RefID             string            `json:"refId"`
	QueryType         string            `json:"queryType"`
	RelativeTimeRange RelativeTimeRange `json:"relativeTimeRange"`
	DatasourceUID     string            `json:"datasourceUid"`
}

type Datasource

type Datasource struct {
	Type string `json:"type"`
	UID  string `json:"uid"`
}

type Evaluator

type Evaluator struct {
	Params []int  `json:"params"`
	Type   string `json:"type"`
}

type Labels

type Labels struct {
	AlertRuleUID  string `json:"__alert_rule_uid__"`
	Alertname     string `json:"alertname"`
	GrafanaFolder string `json:"grafana_folder"`
	Handler       string `json:"handler"`
	Instance      string `json:"instance"`
	Job           string `json:"job"`
	Method        string `json:"method"`
	Status        string `json:"status"`
}

type ListAlertInstanceResp

type ListAlertInstanceResp struct {
	Annotations  Annotations `json:"annotations"`
	Fingerprint  string      `json:"fingerprint"`
	Receivers    []Receivers `json:"receivers"`
	Status       Status      `json:"status"`
	GeneratorURL string      `json:"generatorURL"`
	Labels       Labels      `json:"labels"`
}

type ListAlertResp

type ListAlertResp struct {
	ID           int    `json:"id"`
	UID          string `json:"uid"`
	OrgID        int    `json:"orgID"`
	FolderUID    string `json:"folderUID"`
	RuleGroup    string `json:"ruleGroup"`
	Title        string `json:"title"`
	Condition    string `json:"condition"`
	Data         []Data `json:"data"`
	NoDataState  string `json:"noDataState"`
	ExecErrState string `json:"execErrState"`
	For          string `json:"for"`
	IsPaused     bool   `json:"isPaused"`
}

type Model

type Model struct {
	DisableTextWrap     bool   `json:"disableTextWrap"`
	EditorMode          string `json:"editorMode"`
	Expr                string `json:"expr"`
	FullMetaSearch      bool   `json:"fullMetaSearch"`
	IncludeNullMetadata bool   `json:"includeNullMetadata"`
	Instant             bool   `json:"instant"`
	IntervalMs          int    `json:"intervalMs"`
	LegendFormat        string `json:"legendFormat"`
	MaxDataPoints       int    `json:"maxDataPoints"`
	Range               bool   `json:"range"`
	RefID               string `json:"refId"`
	UseBackend          bool   `json:"useBackend"`
}

type Operator

type Operator struct {
	Type string `json:"type"`
}

type Query

type Query struct {
	Params []string `json:"params"`
}

type Receivers

type Receivers struct {
	Active       interface{} `json:"active"`
	Integrations interface{} `json:"integrations"`
	Name         string      `json:"name"`
}

type Reducer

type Reducer struct {
	Params []interface{} `json:"params"`
	Type   string        `json:"type"`
}

type RelativeTimeRange

type RelativeTimeRange struct {
	From int `json:"from"`
	To   int `json:"to"`
}

type Status

type Status struct {
	InhibitedBy []interface{} `json:"inhibitedBy"`
	SilencedBy  []interface{} `json:"silencedBy"`
	State       string        `json:"state"`
}

Jump to

Keyboard shortcuts

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