definitions

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Grafana Alerting API.

Package definitions includes the types required for generating or consuming an OpenAPI spec for the Grafana Alerting API.

 Schemes: http, https
 BasePath: /api
 Version: 1.1.0

 Consumes:
 - application/json

 Produces:
 - application/json

 Security:
 - basic

SecurityDefinitions:
basic:
  type: basic

swagger:meta

Index

Constants

View Source
const (
	GrafanaReceiverType      = definition.GrafanaReceiverType
	AlertmanagerReceiverType = definition.AlertmanagerReceiverType
)
View Source
const (
	StateAlerting = iota
	StatePending
	StateError
	StateNoData
	StateNormal
)
View Source
const RedactedValue = "[REDACTED]"

Variables

View Source
var (
	AsGrafanaRoute = definition.AsGrafanaRoute
	AllReceivers   = definition.AllReceivers
)

Functions

func AlertsByImportance

func AlertsByImportance(a1, a2 *Alert) bool

AlertsByImportance orders alerts by importance. An alert is more important than another alert if its status has higher importance. For example, "alerting" is more important than "normal". If two alerts have the same importance then the ordering is based on their ActiveAt time and their labels.

func RuleGroupsByFileAndName

func RuleGroupsByFileAndName(a1, a2 *RuleGroup) bool

Types

type Ack

type Ack struct{}

swagger:model

type Alert

type Alert struct {
	// required: true
	Labels overrideLabels `json:"labels"`
	// required: true
	Annotations overrideLabels `json:"annotations"`
	// required: true
	State    string     `json:"state"`
	ActiveAt *time.Time `json:"activeAt"`
	// required: true
	Value string `json:"value"`
}

Alert has info for an alert. swagger:model

type AlertDiscovery

type AlertDiscovery struct {
	// required: true
	Alerts []*Alert `json:"alerts"`
}

AlertDiscovery has info for all active alerts. swagger:model

type AlertGroup

type AlertGroup = amv2.AlertGroup

type AlertGroups

type AlertGroups = amv2.AlertGroups

swagger:model alertGroups

type AlertInstancesResponse

type AlertInstancesResponse struct {
	// Instances is an array of arrow encoded dataframes
	// each frame has a single row, and a column for each instance (alert identified by unique labels) with a boolean value (firing/not firing)
	Instances [][]byte `json:"instances"`
}

swagger:model

type AlertManagerNotReady

type AlertManagerNotReady struct{}

swagger:model

type AlertQuery

type AlertQuery struct {
	// RefID is the unique identifier of the query, set by the frontend call.
	RefID string `json:"refId"`
	// QueryType is an optional identifier for the type of query.
	// It can be used to distinguish different types of queries.
	QueryType string `json:"queryType"`
	// RelativeTimeRange is the relative Start and End of the query as sent by the frontend.
	RelativeTimeRange RelativeTimeRange `json:"relativeTimeRange"`

	// Grafana data source unique identifier; it should be '__expr__' for a Server Side Expression operation.
	DatasourceUID string `json:"datasourceUid"`

	// JSON is the raw JSON query and includes the above properties as well as custom properties.
	Model json.RawMessage `json:"model"`
}

AlertQuery represents a single query associated with an alert definition.

type AlertQueryExport

type AlertQueryExport struct {
	RefID             string                  `json:"refId" yaml:"refId" hcl:"ref_id"`
	QueryType         *string                 `json:"queryType,omitempty" yaml:"queryType,omitempty" hcl:"query_type"`
	RelativeTimeRange RelativeTimeRangeExport `json:"relativeTimeRange,omitempty" yaml:"relativeTimeRange,omitempty" hcl:"relative_time_range,block"`
	DatasourceUID     string                  `json:"datasourceUid" yaml:"datasourceUid" hcl:"datasource_uid"`
	Model             map[string]any          `json:"model" yaml:"model"`
	ModelString       string                  `json:"-" yaml:"-" hcl:"model"`
}

AlertQueryExport is the provisioned export of models.AlertQuery.

type AlertResponse

type AlertResponse struct {
	// in: body
	DiscoveryBase
	// in: body
	Data AlertDiscovery `json:"data"`
}

swagger:model

type AlertRuleExport

type AlertRuleExport struct {
	UID          string              `json:"uid,omitempty" yaml:"uid,omitempty"`
	Title        string              `json:"title" yaml:"title" hcl:"name"`
	Condition    string              `json:"condition" yaml:"condition" hcl:"condition"`
	Data         []AlertQueryExport  `json:"data" yaml:"data" hcl:"data,block"`
	DashboardUID *string             `json:"dashboardUid,omitempty" yaml:"dashboardUid,omitempty"`
	PanelID      *int64              `json:"panelId,omitempty" yaml:"panelId,omitempty"`
	NoDataState  NoDataState         `json:"noDataState" yaml:"noDataState" hcl:"no_data_state"`
	ExecErrState ExecutionErrorState `json:"execErrState" yaml:"execErrState" hcl:"exec_err_state"`
	For          model.Duration      `json:"for" yaml:"for"`
	// ForString is used to:
	// - Only export the for field for HCL if it is non-zero.
	// - Format the Prometheus model.Duration type properly for HCL.
	ForString            *string                              `json:"-" yaml:"-" hcl:"for"`
	Annotations          *map[string]string                   `json:"annotations,omitempty" yaml:"annotations,omitempty" hcl:"annotations"`
	Labels               *map[string]string                   `json:"labels,omitempty" yaml:"labels,omitempty" hcl:"labels"`
	IsPaused             bool                                 `json:"isPaused" yaml:"isPaused" hcl:"is_paused"`
	NotificationSettings *AlertRuleNotificationSettingsExport `json:"notification_settings,omitempty" yaml:"notification_settings,omitempty" hcl:"notification_settings,block"`
	Record               *AlertRuleRecordExport               `json:"record,omitempty" yaml:"record,omitempty" hcl:"record"`
}

AlertRuleExport is the provisioned file export of models.AlertRule.

type AlertRuleGroup

type AlertRuleGroup struct {
	Title     string                 `json:"title"`
	FolderUID string                 `json:"folderUid"`
	Interval  int64                  `json:"interval"`
	Rules     []ProvisionedAlertRule `json:"rules"`
}

swagger:model

type AlertRuleGroupExport

type AlertRuleGroupExport struct {
	OrgID           int64             `json:"orgId" yaml:"orgId" hcl:"org_id"`
	Name            string            `json:"name" yaml:"name" hcl:"name"`
	Folder          string            `json:"folder" yaml:"folder"`
	FolderUID       string            `json:"-" yaml:"-" hcl:"folder_uid"`
	Interval        model.Duration    `json:"interval" yaml:"interval"`
	IntervalSeconds int64             `json:"-" yaml:"-" hcl:"interval_seconds"`
	Rules           []AlertRuleExport `json:"rules" yaml:"rules" hcl:"rule,block"`
}

AlertRuleGroupExport is the provisioned file export of AlertRuleGroupV1.

type AlertRuleGroupMetadata

type AlertRuleGroupMetadata struct {
	Interval int64 `json:"interval"`
}

swagger:model

type AlertRuleGroupPayload

type AlertRuleGroupPayload struct {
	// in:body
	Body AlertRuleGroup
}

swagger:parameters RoutePutAlertRuleGroup

type AlertRuleHeaders

type AlertRuleHeaders struct {
	// in:header
	XDisableProvenance string `json:"X-Disable-Provenance"`
}

swagger:parameters RoutePostAlertRule RoutePutAlertRule RouteDeleteAlertRule RoutePutAlertRuleGroup

type AlertRuleNotificationSettings

type AlertRuleNotificationSettings struct {
	// Name of the receiver to send notifications to.
	// required: true
	// example: grafana-default-email
	Receiver string `json:"receiver"`

	// Override the labels by which incoming alerts are grouped together. For example, multiple alerts coming in for
	// cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels
	// use the special value '...' as the sole label name.
	// This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what
	// you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.
	// Must include 'alertname' and 'grafana_folder' if not using '...'.
	// default: ["alertname", "grafana_folder"]
	// example: ["alertname", "grafana_folder", "cluster"]
	GroupBy []string `json:"group_by,omitempty"`

	// Override how long to initially wait to send a notification for a group of alerts. Allows to wait for an
	// inhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.)
	// example: 30s
	GroupWait *model.Duration `json:"group_wait,omitempty"`

	// Override how long to wait before sending a notification about new alerts that are added to a group of alerts for
	// which an initial notification has already been sent. (Usually ~5m or more.)
	// example: 5m
	GroupInterval *model.Duration `json:"group_interval,omitempty"`

	// Override how long to wait before sending a notification again if it has already been sent successfully for an
	// alert. (Usually ~3h or more).
	// Note that this parameter is implicitly bound by Alertmanager's `--data.retention` configuration flag.
	// Notifications will be resent after either repeat_interval or the data retention period have passed, whichever
	// occurs first. `repeat_interval` should not be less than `group_interval`.
	// example: 4h
	RepeatInterval *model.Duration `json:"repeat_interval,omitempty"`

	// Override the times when notifications should be muted. These must match the name of a mute time interval defined
	// in the alertmanager configuration mute_time_intervals section. When muted it will not send any notifications, but
	// otherwise acts normally.
	// example: ["maintenance"]
	MuteTimeIntervals []string `json:"mute_time_intervals,omitempty"`
}

swagger:model

type AlertRuleNotificationSettingsExport

type AlertRuleNotificationSettingsExport struct {
	Receiver          string   `yaml:"receiver,omitempty" json:"receiver,omitempty" hcl:"contact_point"` // TF -> `contact_point`
	GroupBy           []string `yaml:"group_by,omitempty" json:"group_by,omitempty" hcl:"group_by"`
	GroupWait         *string  `yaml:"group_wait,omitempty" json:"group_wait,omitempty" hcl:"group_wait,optional"`
	GroupInterval     *string  `yaml:"group_interval,omitempty" json:"group_interval,omitempty" hcl:"group_interval,optional"`
	RepeatInterval    *string  `yaml:"repeat_interval,omitempty" json:"repeat_interval,omitempty" hcl:"repeat_interval,optional"`
	MuteTimeIntervals []string `yaml:"mute_time_intervals,omitempty" json:"mute_time_intervals,omitempty" hcl:"mute_timings"` // TF -> `mute_timings`
}

AlertRuleNotificationSettingsExport is the provisioned export of models.NotificationSettings.

type AlertRulePayload

type AlertRulePayload struct {
	// in:body
	Body ProvisionedAlertRule
}

swagger:parameters RoutePostAlertRule RoutePutAlertRule

type AlertRuleRecordExport

type AlertRuleRecordExport struct {
	Metric string `json:"metric" yaml:"metric" hcl:"metric"`
	From   string `json:"from" yaml:"from" hcl:"from"`
}

Record is the provisioned export of models.Record.

type AlertRuleUIDReference

type AlertRuleUIDReference struct {
	// Alert rule UID
	// in:path
	UID string
}

swagger:parameters RouteGetAlertRule RoutePutAlertRule RouteDeleteAlertRule RouteGetAlertRuleExport

type AlertRulesExportParameters

type AlertRulesExportParameters struct {
	ExportQueryParams
	// UIDs of folders from which to export rules
	// in:query
	// required:false
	FolderUID []string `json:"folderUid"`

	// Name of group of rules to export. Must be specified only together with a single folder UID
	// in:query
	// required: false
	GroupName string `json:"group"`

	// UID of alert rule to export. If specified, parameters folderUid and group must be empty.
	// in:query
	// required: false
	RuleUID string `json:"ruleUid"`
}

swagger:parameters RouteGetAlertRulesExport RouteGetRulesForExport

type AlertingFileExport

type AlertingFileExport struct {
	APIVersion    int64                      `json:"apiVersion" yaml:"apiVersion"`
	Groups        []AlertRuleGroupExport     `json:"groups,omitempty" yaml:"groups,omitempty"`
	ContactPoints []ContactPointExport       `json:"contactPoints,omitempty" yaml:"contactPoints,omitempty"`
	Policies      []NotificationPolicyExport `json:"policies,omitempty" yaml:"policies,omitempty"`
	MuteTimings   []MuteTimeIntervalExport   `json:"muteTimes,omitempty" yaml:"muteTimes,omitempty"`
}

AlertingFileExport is the full provisioned file export. swagger:model

type AlertingRule

type AlertingRule struct {
	// State can be "pending", "firing", "inactive".
	// required: true
	State string `json:"state,omitempty"`
	// required: true
	Name string `json:"name,omitempty"`
	// required: true
	Query    string  `json:"query,omitempty"`
	Duration float64 `json:"duration,omitempty"`
	// required: true
	Annotations overrideLabels `json:"annotations,omitempty"`
	// required: true
	ActiveAt       *time.Time       `json:"activeAt,omitempty"`
	Alerts         []Alert          `json:"alerts,omitempty"`
	Totals         map[string]int64 `json:"totals,omitempty"`
	TotalsFiltered map[string]int64 `json:"totalsFiltered,omitempty"`
	Rule
}

adapted from cortex swagger:model

type AlertingStatus

type AlertingStatus struct {
	AlertmanagersChoice      AlertmanagersChoice `json:"alertmanagersChoice"`
	NumExternalAlertmanagers int                 `json:"numExternalAlertmanagers"`
}

swagger:model

type AlertmanagerIntegration

type AlertmanagerIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"` // TODO change when https://github.com/hashicorp/hcl/issues/290 is fixed

	URL      string  `json:"url" yaml:"url" hcl:"url"`
	User     *string `json:"basicAuthUser,omitempty" yaml:"basicAuthUser,omitempty" hcl:"basic_auth_user"`
	Password *Secret `json:"basicAuthPassword,omitempty" yaml:"basicAuthPassword,omitempty" hcl:"basic_auth_password"`
}

type AlertmanagersChoice

type AlertmanagersChoice string

swagger:enum AlertmanagersChoice

const (
	AllAlertmanagers           AlertmanagersChoice = "all"
	InternalAlertmanager       AlertmanagersChoice = "internal"
	ExternalAlertmanagers      AlertmanagersChoice = "external"
	HandleGrafanaManagedAlerts                     = "handleGrafanaManagedAlerts"
)

type AlertsBy

type AlertsBy func(a1, a2 *Alert) bool

AlertsBy is a function that defines the ordering of alerts.

func (AlertsBy) Sort

func (by AlertsBy) Sort(alerts []Alert)

func (AlertsBy) TopK

func (by AlertsBy) TopK(alerts []Alert, k int) []Alert

TopK returns the highest k elements. It does not modify the input.

type AlertsHeap

type AlertsHeap struct {
	AlertsSorter
}

AlertsHeap extends AlertsSorter for use with container/heap functions.

func (*AlertsHeap) Pop

func (h *AlertsHeap) Pop() any

func (*AlertsHeap) Push

func (h *AlertsHeap) Push(x any)

type AlertsParams

type AlertsParams struct {

	// Show active alerts
	// in: query
	// required: false
	// default: true
	Active bool `json:"active"`

	// Show silenced alerts
	// in: query
	// required: false
	// default: true
	Silenced bool `json:"silenced"`

	// Show inhibited alerts
	// in: query
	// required: false
	// default: true
	Inhibited bool `json:"inhibited"`

	// A list of matchers to filter alerts by
	// in: query
	// required: false
	Matchers []string `json:"filter"`

	// A regex matching receivers to filter alerts by
	// in: query
	// required: false
	Receivers string `json:"receiver"`
}

swagger:parameters RouteGetAMAlerts RouteGetAMAlertGroups RouteGetGrafanaAMAlerts RouteGetGrafanaAMAlertGroups

type AlertsSorter

type AlertsSorter struct {
	// contains filtered or unexported fields
}

func (AlertsSorter) Len

func (s AlertsSorter) Len() int

func (AlertsSorter) Less

func (s AlertsSorter) Less(i, j int) bool

func (AlertsSorter) Swap

func (s AlertsSorter) Swap(i, j int)

type ApiRuleNode

type ApiRuleNode struct {
	Record        string            `yaml:"record,omitempty" json:"record,omitempty"`
	Alert         string            `yaml:"alert,omitempty" json:"alert,omitempty"`
	Expr          string            `yaml:"expr" json:"expr"`
	For           *model.Duration   `yaml:"for,omitempty" json:"for,omitempty"`
	KeepFiringFor *model.Duration   `yaml:"keep_firing_for,omitempty" json:"keep_firing_for,omitempty"`
	Labels        map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
	Annotations   map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
}

type Backend

type Backend int
const (
	GrafanaBackend Backend = iota
	AlertmanagerBackend
	LoTexRulerBackend
)

func (Backend) String

func (b Backend) String() string

type BacktestConfig

type BacktestConfig struct {
	From     time.Time      `json:"from"`
	To       time.Time      `json:"to"`
	Interval model.Duration `json:"interval,omitempty"`

	Condition string         `json:"condition"`
	Data      []AlertQuery   `json:"data"`
	For       model.Duration `json:"for,omitempty"`

	Title       string            `json:"title"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`

	NoDataState NoDataState `json:"no_data_state"`
}

swagger:model

type BacktestConfigRequest

type BacktestConfigRequest struct {
	// in:body
	Body BacktestConfig
}

swagger:parameters BacktestConfig

type BacktestResult

type BacktestResult data.Frame

swagger:model

type BodyAlertingConfig

type BodyAlertingConfig struct {
	// in:body
	Body PostableUserConfig
}

swagger:parameters RoutePostAlertingConfig RoutePostGrafanaAlertingConfig

type Config

type Config = definition.Config

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type ContactPoint

type ContactPoint struct {
	Name         string                    `json:"name" yaml:"name" hcl:"name"`
	Alertmanager []AlertmanagerIntegration `json:"alertmanager" yaml:"alertmanager" hcl:"alertmanager,block"`
	Dingding     []DingdingIntegration     `json:"dingding" yaml:"dingding" hcl:"dingding,block"`
	Discord      []DiscordIntegration      `json:"discord" yaml:"discord" hcl:"discord,block"`
	Email        []EmailIntegration        `json:"email" yaml:"email" hcl:"email,block"`
	Googlechat   []GooglechatIntegration   `json:"googlechat" yaml:"googlechat" hcl:"googlechat,block"`
	Kafka        []KafkaIntegration        `json:"kafka" yaml:"kafka" hcl:"kafka,block"`
	Line         []LineIntegration         `json:"line" yaml:"line" hcl:"line,block"`
	Opsgenie     []OpsgenieIntegration     `json:"opsgenie" yaml:"opsgenie" hcl:"opsgenie,block"`
	Pagerduty    []PagerdutyIntegration    `json:"pagerduty" yaml:"pagerduty" hcl:"pagerduty,block"`
	OnCall       []OnCallIntegration       `json:"oncall" yaml:"oncall" hcl:"oncall,block"`
	Pushover     []PushoverIntegration     `json:"pushover" yaml:"pushover" hcl:"pushover,block"`
	Sensugo      []SensugoIntegration      `json:"sensugo" yaml:"sensugo" hcl:"sensugo,block"`
	Slack        []SlackIntegration        `json:"slack" yaml:"slack" hcl:"slack,block"`
	Sns          []SnsIntegration          `json:"sns" yaml:"sns" hcl:"sns,block"`
	Teams        []TeamsIntegration        `json:"teams" yaml:"teams" hcl:"teams,block"`
	Telegram     []TelegramIntegration     `json:"telegram" yaml:"telegram" hcl:"telegram,block"`
	Threema      []ThreemaIntegration      `json:"threema" yaml:"threema" hcl:"threema,block"`
	Victorops    []VictoropsIntegration    `json:"victorops" yaml:"victorops" hcl:"victorops,block"`
	Webhook      []WebhookIntegration      `json:"webhook" yaml:"webhook" hcl:"webhook,block"`
	Wecom        []WecomIntegration        `json:"wecom" yaml:"wecom" hcl:"wecom,block"`
	Webex        []WebexIntegration        `json:"webex" yaml:"webex" hcl:"webex,block"`
}

type ContactPointExport

type ContactPointExport struct {
	OrgID     int64            `json:"orgId" yaml:"orgId"`
	Name      string           `json:"name" yaml:"name"`
	Receivers []ReceiverExport `json:"receivers" yaml:"receivers"`
}

ContactPointExport is the provisioned file export of alerting.ContactPointV1.

type ContactPointHeaders

type ContactPointHeaders struct {
	// in:header
	XDisableProvenance string `json:"X-Disable-Provenance"`
}

swagger:parameters RoutePostContactpoints RoutePutContactpoint

type ContactPointParams

type ContactPointParams struct {
	// Filter by name
	// in: query
	// required: false
	Name string `json:"name"`
}

swagger:parameters RouteGetContactpoints RouteGetContactpointsExport

type ContactPointPayload

type ContactPointPayload struct {
	// in:body
	Body EmbeddedContactPoint
}

swagger:parameters RoutePostContactpoints RoutePutContactpoint

type ContactPointUIDReference

type ContactPointUIDReference struct {
	// UID is the contact point unique identifier
	// in:path
	UID string
}

swagger:parameters RoutePutContactpoint RouteDeleteContactpoints

type ContactPoints

type ContactPoints []EmbeddedContactPoint

swagger:model

type CreateSilenceParams

type CreateSilenceParams struct {
	// in:body
	Silence PostableSilence
}

swagger:parameters RouteCreateSilence RouteCreateGrafanaSilence

type DatasourceUIDReference

type DatasourceUIDReference struct {
	// DatasoureUID should be the datasource UID identifier
	// in:path
	DatasourceUID string
}

alertmanager routes swagger:parameters RoutePostAlertingConfig RouteGetAlertingConfig RouteDeleteAlertingConfig RouteGetAMStatus RouteGetAMAlerts RoutePostAMAlerts RouteGetAMAlertGroups RouteGetSilences RouteCreateSilence RouteGetSilence RouteDeleteSilence RoutePostAlertingConfig testing routes swagger:parameters RouteTestRuleConfig prom routes swagger:parameters RouteGetRuleStatuses RouteGetAlertStatuses ruler routes swagger:parameters RouteGetRulesConfig RoutePostNameRulesConfig RouteGetNamespaceRulesConfig RouteDeleteNamespaceRulesConfig RouteGetRulegGroupConfig RouteDeleteRuleGroupConfig

type DecryptQueryParams

type DecryptQueryParams struct {
	// Whether any contained secure settings should be decrypted or left redacted. Redacted settings will contain RedactedValue instead. Currently, only org admin can view decrypted secure settings.
	// in: query
	// required: false
	// default: false
	Decrypt bool `json:"decrypt"`
}

swagger:parameters RouteGetContactpointsExport RouteGetContactpointExport

type DingdingIntegration

type DingdingIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	URL         string  `json:"url,omitempty" yaml:"url,omitempty" hcl:"url"`
	MessageType *string `json:"msgType,omitempty" yaml:"msgType,omitempty" hcl:"message_type"`
	Title       *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Message     *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
}

type DiscordIntegration

type DiscordIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	WebhookURL         Secret  `json:"url" yaml:"url" hcl:"url"`
	Title              *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Message            *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
	AvatarURL          *string `json:"avatar_url,omitempty" yaml:"avatar_url,omitempty" hcl:"avatar_url"`
	UseDiscordUsername *bool   `json:"use_discord_username,omitempty" yaml:"use_discord_username,omitempty" hcl:"use_discord_username"`
}

type DiscoveryBase

type DiscoveryBase struct {
	// required: true
	Status string `json:"status"`
	// required: false
	ErrorType v1.ErrorType `json:"errorType,omitempty"`
	// required: false
	Error string `json:"error,omitempty"`
}

swagger:model

func (DiscoveryBase) HTTPStatusCode

func (d DiscoveryBase) HTTPStatusCode() int

HTTPStatusCode returns the HTTP status code for a given Prometheus style error.

type Duration

type Duration time.Duration

Duration is a type used for marshalling durations.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() (any, error)

func (Duration) String

func (d Duration) String() string

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(unmarshal func(any) error) error

type EmailIntegration

type EmailIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	Addresses []string `json:"addresses" yaml:"addresses" hcl:"addresses"`

	SingleEmail *bool   `json:"singleEmail,omitempty" yaml:"singleEmail,omitempty" hcl:"single_email"`
	Message     *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
	Subject     *string `json:"subject,omitempty" yaml:"subject,omitempty" hcl:"subject"`
}

type EmbeddedContactPoint

type EmbeddedContactPoint struct {
	// UID is the unique identifier of the contact point. The UID can be
	// set by the user.
	// required: false
	// minLength: 1
	// maxLength: 40
	// pattern: ^[a-zA-Z0-9\-\_]+$
	// example: my_external_reference
	UID string `json:"uid"`
	// Name is used as grouping key in the UI. Contact points with the
	// same name will be grouped in the UI.
	// example: webhook_1
	Name string `json:"name" binding:"required"`
	// required: true
	// example: webhook
	// enum: alertmanager, dingding, discord, email, googlechat, kafka, line, opsgenie, pagerduty, pushover, sensugo, slack, teams, telegram, threema, victorops, webhook, wecom
	Type string `json:"type" binding:"required"`
	// required: true
	Settings *simplejson.Json `json:"settings" binding:"required"`
	// example: false
	DisableResolveMessage bool `json:"disableResolveMessage"`
	// readonly: true
	Provenance string `json:"provenance,omitempty"`
}

EmbeddedContactPoint is the contact point type that is used by grafanas embedded alertmanager implementation. swagger:model

func (*EmbeddedContactPoint) ResourceID

func (e *EmbeddedContactPoint) ResourceID() string

func (*EmbeddedContactPoint) ResourceType

func (e *EmbeddedContactPoint) ResourceType() string

type EncryptFn

type EncryptFn func(ctx context.Context, payload []byte) ([]byte, error)

type EvalAlertConditionCommand

type EvalAlertConditionCommand struct {
	Condition string       `json:"condition"`
	Data      []AlertQuery `json:"data"`
	Now       time.Time    `json:"now"`
}

EvalAlertConditionCommand is the command for evaluating a condition

func (*EvalAlertConditionCommand) UnmarshalJSON

func (cmd *EvalAlertConditionCommand) UnmarshalJSON(b []byte) error

type EvalQueriesPayload

type EvalQueriesPayload struct {
	Condition string       `json:"condition"`
	Data      []AlertQuery `json:"data"`
	Now       time.Time    `json:"now"`
}

swagger:model

type EvalQueriesRequest

type EvalQueriesRequest struct {
	// in:body
	Body EvalQueriesPayload
}

swagger:parameters RouteEvalQueries

type EvalQueriesResponse

type EvalQueriesResponse = backend.QueryDataResponse

swagger:model

type ExecutionErrorState

type ExecutionErrorState string

swagger:enum ExecutionErrorState

const (
	OkErrState       ExecutionErrorState = "OK"
	AlertingErrState ExecutionErrorState = "Alerting"
	ErrorErrState    ExecutionErrorState = "Error"
)

type ExportQueryParams

type ExportQueryParams struct {
	// Whether to initiate a download of the file or not.
	// in: query
	// required: false
	// default: false
	Download bool `json:"download"`

	// Format of the downloaded file. Supported yaml, json or hcl. Accept header can also be used, but the query parameter will take precedence.
	// in: query
	// required: false
	// default: yaml
	// enum: yaml,json,hcl
	Format string `json:"format"`
}

swagger:parameters RouteGetAlertRuleGroupExport RouteGetAlertRuleExport RouteGetContactpointsExport RouteGetContactpointExport RoutePostRulesGroupForExport RouteExportMuteTimings RouteExportMuteTiming

type ExtendedReceiver

type ExtendedReceiver struct {
	EmailConfigs     config.EmailConfig      `yaml:"email_configs,omitempty" json:"email_configs,omitempty"`
	PagerdutyConfigs config.PagerdutyConfig  `yaml:"pagerduty_configs,omitempty" json:"pagerduty_configs,omitempty"`
	SlackConfigs     config.SlackConfig      `yaml:"slack_configs,omitempty" json:"slack_configs,omitempty"`
	WebhookConfigs   config.WebhookConfig    `yaml:"webhook_configs,omitempty" json:"webhook_configs,omitempty"`
	OpsGenieConfigs  config.OpsGenieConfig   `yaml:"opsgenie_configs,omitempty" json:"opsgenie_configs,omitempty"`
	WechatConfigs    config.WechatConfig     `yaml:"wechat_configs,omitempty" json:"wechat_configs,omitempty"`
	PushoverConfigs  config.PushoverConfig   `yaml:"pushover_configs,omitempty" json:"pushover_configs,omitempty"`
	VictorOpsConfigs config.VictorOpsConfig  `yaml:"victorops_configs,omitempty" json:"victorops_configs,omitempty"`
	GrafanaReceiver  PostableGrafanaReceiver `yaml:"grafana_managed_receiver,omitempty" json:"grafana_managed_receiver,omitempty"`
}

swagger:model

type Failure

type Failure ResponseDetails

swagger:model

type FolderUIDPathParam

type FolderUIDPathParam struct {
	// in:path
	FolderUID string `json:"FolderUID"`
}

swagger:parameters RouteGetAlertRuleGroup RoutePutAlertRuleGroup RouteGetAlertRuleGroupExport RouteDeleteAlertRuleGroup

type ForbiddenError

type ForbiddenError struct {
	// The response message
	// in: body
	Body errutil.PublicError `json:"body"`
}

swagger:model

type GenericPublicError

type GenericPublicError struct {
	// The response message
	// in: body
	Body errutil.PublicError `json:"body"`
}

swagger:model

type GetAllIntervalsResponse

type GetAllIntervalsResponse struct {
	// in:body
	Body []GettableTimeIntervals
}

swagger:response GetAllIntervalsResponse

type GetDeleteSilenceParams

type GetDeleteSilenceParams struct {
	// in:path
	SilenceId string
}

swagger:parameters RouteGetSilence RouteDeleteSilence RouteGetGrafanaSilence RouteDeleteGrafanaSilence

type GetGrafanaAlertStatusesParams

type GetGrafanaAlertStatusesParams struct {
	// Include Grafana specific labels as part of the response.
	// in: query
	// required: false
	// default: false
	IncludeInternalLabels bool `json:"includeInternalLabels"`
}

swagger:parameters RouteGetGrafanaAlertStatuses

type GetGrafanaRuleStatusesParams

type GetGrafanaRuleStatusesParams struct {
	// Include Grafana specific labels as part of the response.
	// in: query
	// required: false
	// default: false
	IncludeInternalLabels bool `json:"includeInternalLabels"`

	// Filter the list of rules to those that belong to the specified dashboard UID.
	// in: query
	// required: false
	DashboardUID string

	// Filter the list of rules to those that belong to the specified panel ID. Dashboard UID must be specified.
	// in: query
	// required: false
	PanelID int64
}

swagger:parameters RouteGetGrafanaRuleStatuses

type GetIntervalsByNameResponse

type GetIntervalsByNameResponse struct {
	// in:body
	Body GettableTimeIntervals
}

swagger:response GetIntervalsByNameResponse

type GetReceiverParams

type GetReceiverParams struct {
	// in:path
	// required: true
	Name string `json:"name"`
	// in:query
	// required: false
	Decrypt bool `json:"decrypt"`
}

swagger:parameters RouteGetReceiver

type GetReceiverResponse

type GetReceiverResponse struct {
	// in:body
	Body GettableApiReceiver
}

swagger:response GetReceiverResponse

type GetReceiversParams

type GetReceiversParams struct {
	// in:query
	// required: false
	Names []string `json:"names"`
	// in:query
	// required: false
	Limit int `json:"limit"`
	// in:query
	// required: false
	Offset int `json:"offset"`
	// in:query
	// required: false
	Decrypt bool `json:"decrypt"`
}

swagger:parameters RouteGetReceivers

type GetReceiversResponse

type GetReceiversResponse struct {
	// in:body
	Body []GettableApiReceiver
}

swagger:response GetReceiversResponse

type GetSilencesParams

type GetSilencesParams struct {
	// in:query
	Filter []string `json:"filter"`
	// Return rule metadata with silence.
	// in:query
	// required:false
	RuleMetadata bool `json:"ruleMetadata"`
	// Return access control metadata with silence.
	// in:query
	// required:false
	AccessControl bool `json:"accesscontrol"`
}

swagger:parameters RouteGetSilences RouteGetGrafanaSilences

type GettableAlert

type GettableAlert = amv2.GettableAlert

type GettableAlertmanagers

type GettableAlertmanagers struct {
	Status string                 `json:"status"`
	Data   v1.AlertManagersResult `json:"data"`
}

swagger:model

type GettableAlerts

type GettableAlerts = amv2.GettableAlerts

swagger:model gettableAlerts

type GettableApiAlertingConfig

type GettableApiAlertingConfig struct {
	Config              `yaml:",inline"`
	MuteTimeProvenances map[string]Provenance `yaml:"muteTimeProvenances,omitempty" json:"muteTimeProvenances,omitempty"`
	// Override with our superset receiver type
	Receivers []*GettableApiReceiver `yaml:"receivers,omitempty" json:"receivers,omitempty"`
}

func (*GettableApiAlertingConfig) GetMuteTimeIntervals

func (c *GettableApiAlertingConfig) GetMuteTimeIntervals() []config.MuteTimeInterval

func (*GettableApiAlertingConfig) GetReceivers

func (c *GettableApiAlertingConfig) GetReceivers() []*GettableApiReceiver

func (*GettableApiAlertingConfig) GetRoute

func (c *GettableApiAlertingConfig) GetRoute() *Route

func (*GettableApiAlertingConfig) GetTimeIntervals

func (c *GettableApiAlertingConfig) GetTimeIntervals() []config.TimeInterval

func (*GettableApiAlertingConfig) UnmarshalJSON

func (c *GettableApiAlertingConfig) UnmarshalJSON(b []byte) error

func (*GettableApiAlertingConfig) UnmarshalYAML

func (c *GettableApiAlertingConfig) UnmarshalYAML(value *yaml.Node) error

type GettableApiReceiver

type GettableApiReceiver struct {
	config.Receiver          `yaml:",inline"`
	GettableGrafanaReceivers `yaml:",inline"`
}

func (*GettableApiReceiver) GetName

func (r *GettableApiReceiver) GetName() string

func (*GettableApiReceiver) Type

func (*GettableApiReceiver) UnmarshalJSON

func (r *GettableApiReceiver) UnmarshalJSON(b []byte) error

type GettableExtendedRuleNode

type GettableExtendedRuleNode struct {
	// note: this works with yaml v3 but not v2 (the inline tag isn't accepted on pointers in v2)
	*ApiRuleNode `yaml:",inline"`
	//GrafanaManagedAlert yaml.Node `yaml:"grafana_alert,omitempty"`
	GrafanaManagedAlert *GettableGrafanaRule `yaml:"grafana_alert,omitempty" json:"grafana_alert,omitempty"`
}

func (*GettableExtendedRuleNode) Type

func (*GettableExtendedRuleNode) UnmarshalJSON

func (n *GettableExtendedRuleNode) UnmarshalJSON(b []byte) error

type GettableGrafanaReceiver

type GettableGrafanaReceiver struct {
	UID                   string          `json:"uid"`
	Name                  string          `json:"name"`
	Type                  string          `json:"type"`
	DisableResolveMessage bool            `json:"disableResolveMessage"`
	Settings              RawMessage      `json:"settings,omitempty"`
	SecureFields          map[string]bool `json:"secureFields"`
	Provenance            Provenance      `json:"provenance,omitempty"`
}

type GettableGrafanaReceivers

type GettableGrafanaReceivers struct {
	GrafanaManagedReceivers []*GettableGrafanaReceiver `yaml:"grafana_managed_receiver_configs,omitempty" json:"grafana_managed_receiver_configs,omitempty"`
}

type GettableGrafanaRule

type GettableGrafanaRule struct {
	ID                   int64                          `json:"id" yaml:"id"`
	OrgID                int64                          `json:"orgId" yaml:"orgId"`
	Title                string                         `json:"title" yaml:"title"`
	Condition            string                         `json:"condition" yaml:"condition"`
	Data                 []AlertQuery                   `json:"data" yaml:"data"`
	Updated              time.Time                      `json:"updated" yaml:"updated"`
	IntervalSeconds      int64                          `json:"intervalSeconds" yaml:"intervalSeconds"`
	Version              int64                          `json:"version" yaml:"version"`
	UID                  string                         `json:"uid" yaml:"uid"`
	NamespaceUID         string                         `json:"namespace_uid" yaml:"namespace_uid"`
	RuleGroup            string                         `json:"rule_group" yaml:"rule_group"`
	NoDataState          NoDataState                    `json:"no_data_state" yaml:"no_data_state"`
	ExecErrState         ExecutionErrorState            `json:"exec_err_state" yaml:"exec_err_state"`
	Provenance           Provenance                     `json:"provenance,omitempty" yaml:"provenance,omitempty"`
	IsPaused             bool                           `json:"is_paused" yaml:"is_paused"`
	NotificationSettings *AlertRuleNotificationSettings `json:"notification_settings,omitempty" yaml:"notification_settings,omitempty"`
	Record               *Record                        `json:"record,omitempty" yaml:"record,omitempty"`
}

swagger:model

type GettableGrafanaSilence

type GettableGrafanaSilence struct {
	*GettableSilence `json:",inline"`
	Metadata         *SilenceMetadata `json:"metadata,omitempty"`
	// example: {"read": true, "write": false, "create": false}
	Permissions map[SilencePermission]bool `json:"accessControl,omitempty"`
}

swagger:model gettableGrafanaSilence

func (GettableGrafanaSilence) MarshalJSON

func (s GettableGrafanaSilence) MarshalJSON() ([]byte, error)

Correctly embed the GettableSilence into the GettableGrafanaSilence struct. This is needed because GettableSilence has a custom UnmarshalJSON method.

type GettableGrafanaSilences

type GettableGrafanaSilences []*GettableGrafanaSilence

swagger:model gettableGrafanaSilences

type GettableHistoricUserConfig

type GettableHistoricUserConfig struct {
	ID                      int64                     `yaml:"id" json:"id"`
	TemplateFiles           map[string]string         `yaml:"template_files" json:"template_files"`
	TemplateFileProvenances map[string]Provenance     `yaml:"template_file_provenances,omitempty" json:"template_file_provenances,omitempty"`
	AlertmanagerConfig      GettableApiAlertingConfig `yaml:"alertmanager_config" json:"alertmanager_config"`
	LastApplied             *strfmt.DateTime          `yaml:"last_applied,omitempty" json:"last_applied,omitempty"`
}

type GettableHistoricUserConfigs

type GettableHistoricUserConfigs struct {
	// in:body
	Body []GettableHistoricUserConfig
}

swagger:response GettableHistoricUserConfigs

type GettableNGalertConfig

type GettableNGalertConfig struct {
	AlertmanagersChoice AlertmanagersChoice `json:"alertmanagersChoice"`
}

swagger:model

type GettableRuleGroupConfig

type GettableRuleGroupConfig struct {
	Name          string                     `yaml:"name" json:"name"`
	Interval      model.Duration             `yaml:"interval,omitempty" json:"interval,omitempty"`
	SourceTenants []string                   `yaml:"source_tenants,omitempty" json:"source_tenants,omitempty"`
	Rules         []GettableExtendedRuleNode `yaml:"rules" json:"rules"`
}

swagger:model

func (*GettableRuleGroupConfig) Type

func (c *GettableRuleGroupConfig) Type() (backend Backend)

Type requires validate has been called and just checks the first rule type

func (*GettableRuleGroupConfig) UnmarshalJSON

func (c *GettableRuleGroupConfig) UnmarshalJSON(b []byte) error

type GettableSilence

type GettableSilence = amv2.GettableSilence

type GettableSilences

type GettableSilences = amv2.GettableSilences

swagger:model gettableSilences

type GettableStatus

type GettableStatus struct {
	// cluster
	// Required: true
	Cluster *amv2.ClusterStatus `json:"cluster"`

	// config
	// Required: true
	Config *PostableApiAlertingConfig `json:"config"`

	// uptime
	// Required: true
	// Format: date-time
	Uptime *strfmt.DateTime `json:"uptime"`

	// version info
	// Required: true
	VersionInfo *amv2.VersionInfo `json:"versionInfo"`
}

swagger:model

func NewGettableStatus

func NewGettableStatus(cfg *PostableApiAlertingConfig) *GettableStatus

func (*GettableStatus) UnmarshalJSON

func (s *GettableStatus) UnmarshalJSON(b []byte) error

type GettableTimeIntervals

type GettableTimeIntervals struct {
	Name          string             `json:"name" hcl:"name"`
	TimeIntervals []TimeIntervalItem `json:"time_intervals" hcl:"intervals,block"`
	Version       string             `json:"version,omitempty"`
	Provenance    Provenance         `json:"provenance,omitempty"`
}

swagger:model

type GettableUserConfig

type GettableUserConfig struct {
	TemplateFiles           map[string]string         `yaml:"template_files" json:"template_files"`
	TemplateFileProvenances map[string]Provenance     `yaml:"template_file_provenances,omitempty" json:"template_file_provenances,omitempty"`
	AlertmanagerConfig      GettableApiAlertingConfig `yaml:"alertmanager_config" json:"alertmanager_config"`
	// contains filtered or unexported fields
}

swagger:model

func (*GettableUserConfig) GetGrafanaReceiverMap

func (c *GettableUserConfig) GetGrafanaReceiverMap() map[string]*GettableGrafanaReceiver

GetGrafanaReceiverMap returns a map that associates UUIDs to grafana receivers

func (*GettableUserConfig) MarshalJSON

func (c *GettableUserConfig) MarshalJSON() ([]byte, error)

func (*GettableUserConfig) UnmarshalYAML

func (c *GettableUserConfig) UnmarshalYAML(value *yaml.Node) error

type GooglechatIntegration

type GooglechatIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	URL string `json:"url" yaml:"url" hcl:"url"`

	Title   *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Message *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
}

type HistoricalConfigId

type HistoricalConfigId struct {
	// Id should be the id of the GettableHistoricUserConfig
	// in:path
	Id int64 `json:"id"`
}

swagger:parameters RoutePostGrafanaAlertingConfigHistoryActivate

type Integration

type Integration = amv2.Integration

type KafkaIntegration

type KafkaIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	Endpoint Secret `json:"kafkaRestProxy" yaml:"kafkaRestProxy" hcl:"rest_proxy_url"`
	Topic    string `json:"kafkaTopic" yaml:"kafkaTopic" hcl:"topic"`

	Description    *string `json:"description,omitempty" yaml:"description,omitempty" hcl:"description"`
	Details        *string `json:"details,omitempty" yaml:"details,omitempty" hcl:"details"`
	Username       *string `json:"username,omitempty" yaml:"username,omitempty" hcl:"username"`
	Password       *Secret `json:"password,omitempty" yaml:"password,omitempty" hcl:"password"`
	APIVersion     *string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty" hcl:"api_version"`
	KafkaClusterID *string `json:"kafkaClusterId,omitempty" yaml:"kafkaClusterId,omitempty" hcl:"cluster_id"`
}

type LineIntegration

type LineIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	Token Secret `json:"token" yaml:"token" hcl:"token"`

	Title       *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Description *string `json:"description,omitempty" yaml:"description,omitempty" hcl:"description"`
}

type MatcherExport

type MatcherExport struct {
	Label string `yaml:"-" json:"-" hcl:"label"`
	Match string `yaml:"-" json:"-" hcl:"match"`
	Value string `yaml:"-" json:"-" hcl:"value"`
}

type MultiStatus

type MultiStatus struct{}

swagger:model

type MuteTimeInterval

type MuteTimeInterval struct {
	config.MuteTimeInterval `json:",inline" yaml:",inline"`
	Version                 string     `json:"version,omitempty"`
	Provenance              Provenance `json:"provenance,omitempty"`
}

swagger:model

func (*MuteTimeInterval) ResourceID

func (mt *MuteTimeInterval) ResourceID() string

func (*MuteTimeInterval) ResourceType

func (mt *MuteTimeInterval) ResourceType() string

func (*MuteTimeInterval) Validate

func (mt *MuteTimeInterval) Validate() error

type MuteTimeIntervalExport

type MuteTimeIntervalExport struct {
	OrgID                   int64 `json:"orgId" yaml:"orgId"`
	config.MuteTimeInterval `json:",inline" yaml:",inline"`
}

type MuteTimeIntervalExportHcl

type MuteTimeIntervalExportHcl struct {
	Name          string                  `json:"name" hcl:"name"`
	TimeIntervals []TimeIntervalExportHcl `json:"time_intervals" hcl:"intervals,block"`
}

MuteTimeIntervalExportHcl is a representation of the MuteTimeInterval in HCL

type MuteTimingHeaders

type MuteTimingHeaders struct {
	// in:header
	XDisableProvenance string `json:"X-Disable-Provenance"`
}

swagger:parameters RoutePostMuteTiming RoutePutMuteTiming RouteDeleteMuteTiming

type MuteTimingPayload

type MuteTimingPayload struct {
	// in:body
	Body MuteTimeInterval
}

swagger:parameters RoutePostMuteTiming RoutePutMuteTiming

type MuteTimings

type MuteTimings []MuteTimeInterval

swagger:model

type NGalertConfig

type NGalertConfig struct {
	// in:body
	Body PostableNGalertConfig
}

swagger:parameters RoutePostNGalertConfig

type NamespaceConfig

type NamespaceConfig struct {
	// The UID of the rule folder
	// in:path
	Namespace string
	// in:body
	Body PostableRuleGroupConfig
}

swagger:parameters RoutePostNameRulesConfig RoutePostNameGrafanaRulesConfig RoutePostRulesGroupForExport

type NamespaceConfigResponse

type NamespaceConfigResponse map[string][]GettableRuleGroupConfig

swagger:model

type NoDataState

type NoDataState string

swagger:enum NoDataState

const (
	Alerting NoDataState = "Alerting"
	NoData   NoDataState = "NoData"
	OK       NoDataState = "OK"
)

type NotFound

type NotFound struct{}

swagger:model

type NotificationPolicyExport

type NotificationPolicyExport struct {
	OrgID        int64 `json:"orgId" yaml:"orgId"`
	*RouteExport `yaml:",inline"`
}

NotificationPolicyExport is the provisioned file export of alerting.NotificiationPolicyV1.

type NotificationTemplate

type NotificationTemplate struct {
	Name       string     `json:"name"`
	Template   string     `json:"template"`
	Provenance Provenance `json:"provenance,omitempty"`
}

swagger:model

func (*NotificationTemplate) ResourceID

func (t *NotificationTemplate) ResourceID() string

func (*NotificationTemplate) ResourceType

func (t *NotificationTemplate) ResourceType() string

func (*NotificationTemplate) Validate

func (t *NotificationTemplate) Validate() error

type NotificationTemplateContent

type NotificationTemplateContent struct {
	Template string `json:"template"`
}

type NotificationTemplateHeaders

type NotificationTemplateHeaders struct {
	// in:header
	XDisableProvenance string `json:"X-Disable-Provenance"`
}

swagger:parameters RoutePutTemplate

type NotificationTemplatePayload

type NotificationTemplatePayload struct {
	// in:body
	Body NotificationTemplateContent
}

swagger:parameters RoutePutTemplate

type NotificationTemplates

type NotificationTemplates []NotificationTemplate

swagger:model

type ObjectMatchers

type ObjectMatchers = definition.ObjectMatchers

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type OnCallIntegration

type OnCallIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	URL string `json:"url" yaml:"url" hcl:"url"`

	HTTPMethod               *string `json:"httpMethod,omitempty" yaml:"httpMethod,omitempty" hcl:"http_method"`
	MaxAlerts                *int64  `json:"maxAlerts,omitempty" yaml:"maxAlerts,omitempty" hcl:"max_alerts"`
	AuthorizationScheme      *string `json:"authorization_scheme,omitempty" yaml:"authorization_scheme,omitempty" hcl:"authorization_scheme"`
	AuthorizationCredentials *Secret `json:"authorization_credentials,omitempty" yaml:"authorization_credentials,omitempty" hcl:"authorization_credentials"`
	User                     *string `json:"username,omitempty" yaml:"username,omitempty" hcl:"basic_auth_user"`
	Password                 *Secret `json:"password,omitempty" yaml:"password,omitempty" hcl:"basic_auth_password"`
	Title                    *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Message                  *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
}

type OpsgenieIntegration

type OpsgenieIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	APIKey Secret `json:"apiKey" yaml:"apiKey" hcl:"api_key"`

	APIUrl           *string                        `json:"apiUrl,omitempty" yaml:"apiUrl,omitempty" hcl:"url"`
	Message          *string                        `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
	Description      *string                        `json:"description,omitempty" yaml:"description,omitempty" hcl:"description"`
	AutoClose        *bool                          `json:"autoClose,omitempty" yaml:"autoClose,omitempty" hcl:"auto_close"`
	OverridePriority *bool                          `json:"overridePriority,omitempty" yaml:"overridePriority,omitempty" hcl:"override_priority"`
	SendTagsAs       *string                        `json:"sendTagsAs,omitempty" yaml:"sendTagsAs,omitempty" hcl:"send_tags_as"`
	Responders       []OpsgenieIntegrationResponder `json:"responders,omitempty" yaml:"responders,omitempty" hcl:"responders,block"`
}

type OpsgenieIntegrationResponder

type OpsgenieIntegrationResponder struct {
	ID       *string `json:"id,omitempty" yaml:"id,omitempty" hcl:"id"`
	Name     *string `json:"name,omitempty" yaml:"name,omitempty" hcl:"name"`
	Username *string `json:"username,omitempty" yaml:"username,omitempty" hcl:"username"`
	Type     string  `json:"type" yaml:"type" hcl:"type"`
}

type PagerdutyIntegration

type PagerdutyIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	Key Secret `json:"integrationKey" yaml:"integrationKey" hcl:"integration_key"`

	Severity  *string            `json:"severity,omitempty" yaml:"severity,omitempty" hcl:"severity"`
	Class     *string            `json:"class,omitempty" yaml:"class,omitempty" hcl:"class"`
	Component *string            `json:"component,omitempty" yaml:"component,omitempty" hcl:"component"`
	Group     *string            `json:"group,omitempty" yaml:"group,omitempty" hcl:"group"`
	Summary   *string            `json:"summary,omitempty" yaml:"summary,omitempty" hcl:"summary"`
	Source    *string            `json:"source,omitempty" yaml:"source,omitempty" hcl:"source"`
	Client    *string            `json:"client,omitempty" yaml:"client,omitempty" hcl:"client"`
	ClientURL *string            `json:"client_url,omitempty" yaml:"client_url,omitempty" hcl:"client_url"`
	Details   *map[string]string `json:"details,omitempty" yaml:"details,omitempty" hcl:"details"`
	URL       *string            `json:"url,omitempty" yaml:"url,omitempty" hcl:"url"`
}

type PathGetRuleByUIDParams

type PathGetRuleByUIDParams struct {
	// in: path
	RuleUID string
}

swagger:parameters RouteGetRuleByUID

type PathGetRulesParams

type PathGetRulesParams struct {
	// in: query
	DashboardUID string
	// in: query
	PanelID int64
}

swagger:parameters RouteGetRulesConfig RouteGetGrafanaRulesConfig

type PathNamespaceConfig

type PathNamespaceConfig struct {
	// The UID of the rule folder
	// in: path
	Namespace string
}

swagger:parameters RouteGetNamespaceRulesConfig RouteDeleteNamespaceRulesConfig RouteGetNamespaceGrafanaRulesConfig RouteDeleteNamespaceGrafanaRulesConfig

type PathRouleGroupConfig

type PathRouleGroupConfig struct {
	// The UID of the rule folder
	// in: path
	Namespace string
	// in: path
	Groupname string
}

swagger:parameters RouteGetRulegGroupConfig RouteDeleteRuleGroupConfig RouteGetGrafanaRuleGroupConfig RouteDeleteGrafanaRuleGroupConfig

type PermissionDenied

type PermissionDenied struct{}

swagger:model

type PolicyTreeHeaders

type PolicyTreeHeaders struct {
	// in:header
	XDisableProvenance string `json:"X-Disable-Provenance"`
}

swagger:parameters RoutePutPolicyTree

type Policytree

type Policytree struct {
	// The new notification routing tree to use
	// in:body
	Body Route
}

swagger:parameters RoutePutPolicyTree

type PostSilencesOKBody

type PostSilencesOKBody struct {
	// silence ID
	SilenceID string `json:"silenceID,omitempty"`
}

swagger:model postSilencesOKBody

type PostableAlerts

type PostableAlerts struct {
	// in:body
	PostableAlerts []amv2.PostableAlert `yaml:"" json:""`
}

swagger:parameters RoutePostAMAlerts

type PostableApiAlertingConfig

type PostableApiAlertingConfig = definition.PostableApiAlertingConfig

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type PostableApiReceiver

type PostableApiReceiver = definition.PostableApiReceiver

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type PostableExtendedRuleNode

type PostableExtendedRuleNode struct {
	// note: this works with yaml v3 but not v2 (the inline tag isn't accepted on pointers in v2)
	*ApiRuleNode `yaml:",inline"`
	//GrafanaManagedAlert yaml.Node `yaml:"grafana_alert,omitempty"`
	GrafanaManagedAlert *PostableGrafanaRule `yaml:"grafana_alert,omitempty" json:"grafana_alert,omitempty"`
}

func (*PostableExtendedRuleNode) Type

func (*PostableExtendedRuleNode) UnmarshalJSON

func (n *PostableExtendedRuleNode) UnmarshalJSON(b []byte) error

type PostableExtendedRuleNodeExtended

type PostableExtendedRuleNodeExtended struct {
	// required: true
	Rule PostableExtendedRuleNode `json:"rule"`
	// example: okrd3I0Vz
	NamespaceUID string `json:"folderUid"`
	// example: project_x
	NamespaceTitle string `json:"folderTitle"`
	// example: eval_group_1
	RuleGroup string `json:"ruleGroup"`
}

swagger:model

func (*PostableExtendedRuleNodeExtended) UnmarshalJSON

func (n *PostableExtendedRuleNodeExtended) UnmarshalJSON(b []byte) error

type PostableGrafanaReceiver

type PostableGrafanaReceiver = definition.PostableGrafanaReceiver

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type PostableGrafanaReceivers

type PostableGrafanaReceivers = definition.PostableGrafanaReceivers

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type PostableGrafanaRule

type PostableGrafanaRule struct {
	Title                string                         `json:"title" yaml:"title"`
	Condition            string                         `json:"condition" yaml:"condition"`
	Data                 []AlertQuery                   `json:"data" yaml:"data"`
	UID                  string                         `json:"uid" yaml:"uid"`
	NoDataState          NoDataState                    `json:"no_data_state" yaml:"no_data_state"`
	ExecErrState         ExecutionErrorState            `json:"exec_err_state" yaml:"exec_err_state"`
	IsPaused             *bool                          `json:"is_paused" yaml:"is_paused"`
	NotificationSettings *AlertRuleNotificationSettings `json:"notification_settings" yaml:"notification_settings"`
	Record               *Record                        `json:"record" yaml:"record"`
}

swagger:model

type PostableNGalertConfig

type PostableNGalertConfig struct {
	AlertmanagersChoice AlertmanagersChoice `json:"alertmanagersChoice"`
}

swagger:model

type PostableRuleGroupConfig

type PostableRuleGroupConfig struct {
	Name     string                     `yaml:"name" json:"name"`
	Interval model.Duration             `yaml:"interval,omitempty" json:"interval,omitempty"`
	Rules    []PostableExtendedRuleNode `yaml:"rules" json:"rules"`
}

swagger:model

func (*PostableRuleGroupConfig) Type

func (c *PostableRuleGroupConfig) Type() (backend Backend)

Type requires validate has been called and just checks the first rule type

func (*PostableRuleGroupConfig) UnmarshalJSON

func (c *PostableRuleGroupConfig) UnmarshalJSON(b []byte) error

type PostableSilence

type PostableSilence = amv2.PostableSilence

type PostableTimeIntervals

type PostableTimeIntervals struct {
	Name          string             `json:"name" hcl:"name"`
	Version       string             `json:"version,omitempty"`
	TimeIntervals []TimeIntervalItem `json:"time_intervals" hcl:"intervals,block"`
}

swagger:model

type PostableUserConfig

type PostableUserConfig struct {
	TemplateFiles      map[string]string         `yaml:"template_files" json:"template_files"`
	AlertmanagerConfig PostableApiAlertingConfig `yaml:"alertmanager_config" json:"alertmanager_config"`
	// contains filtered or unexported fields
}

swagger:model

func (*PostableUserConfig) Decrypt

func (c *PostableUserConfig) Decrypt(decryptFn func(payload []byte) ([]byte, error)) (PostableUserConfig, error)

Decrypt returns a copy of the configuration struct with decrypted secure settings in receivers.

func (*PostableUserConfig) GetGrafanaReceiverMap

func (c *PostableUserConfig) GetGrafanaReceiverMap() map[string]*PostableGrafanaReceiver

GetGrafanaReceiverMap returns a map that associates UUIDs to grafana receivers

func (*PostableUserConfig) MarshalYAML

func (c *PostableUserConfig) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaller.

func (*PostableUserConfig) UnmarshalJSON

func (c *PostableUserConfig) UnmarshalJSON(b []byte) error

func (*PostableUserConfig) UnmarshalYAML

func (c *PostableUserConfig) UnmarshalYAML(value *yaml.Node) error

type Provenance

type Provenance = definition.Provenance

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type ProvisionedAlertRule

type ProvisionedAlertRule struct {
	ID int64 `json:"id"`
	// required: false
	// minLength: 1
	// maxLength: 40
	// pattern: ^[a-zA-Z0-9-_]+$
	UID string `json:"uid"`
	// required: true
	OrgID int64 `json:"orgID"`
	// required: true
	// example: project_x
	FolderUID string `json:"folderUID"`
	// required: true
	// minLength: 1
	// maxLength: 190
	// example: eval_group_1
	RuleGroup string `json:"ruleGroup"`
	// required: true
	// minLength: 1
	// maxLength: 190
	// example: Always firing
	Title string `json:"title"`
	// required: true
	// example: A
	Condition string `json:"condition"`
	// required: true
	// example: [{"refId":"A","queryType":"","relativeTimeRange":{"from":0,"to":0},"datasourceUid":"__expr__","model":{"conditions":[{"evaluator":{"params":[0,0],"type":"gt"},"operator":{"type":"and"},"query":{"params":[]},"reducer":{"params":[],"type":"avg"},"type":"query"}],"datasource":{"type":"__expr__","uid":"__expr__"},"expression":"1 == 1","hide":false,"intervalMs":1000,"maxDataPoints":43200,"refId":"A","type":"math"}}]
	Data []AlertQuery `json:"data"`
	// readonly: true
	Updated time.Time `json:"updated,omitempty"`
	// required: true
	NoDataState NoDataState `json:"noDataState"`
	// required: true
	ExecErrState ExecutionErrorState `json:"execErrState"`
	// required: true
	For model.Duration `json:"for"`
	// example: {"runbook_url": "https://supercoolrunbook.com/page/13"}
	Annotations map[string]string `json:"annotations,omitempty"`
	// example: {"team": "sre-team-1"}
	Labels map[string]string `json:"labels,omitempty"`
	// readonly: true
	Provenance Provenance `json:"provenance,omitempty"`
	// example: false
	IsPaused bool `json:"isPaused"`
	// example: {"receiver":"email","group_by":["alertname","grafana_folder","cluster"],"group_wait":"30s","group_interval":"1m","repeat_interval":"4d","mute_time_intervals":["Weekends","Holidays"]}
	NotificationSettings *AlertRuleNotificationSettings `json:"notification_settings"`
	//example: {"metric":"grafana_alerts_ratio", "from":"A"}
	Record *Record `json:"record"`
}

type ProvisionedAlertRules

type ProvisionedAlertRules []ProvisionedAlertRule

swagger:model

type PushoverIntegration

type PushoverIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	UserKey  Secret `json:"userKey" yaml:"userKey" hcl:"user_key"`
	APIToken Secret `json:"apiToken" yaml:"apiToken" hcl:"api_token"`

	AlertingPriority *int64  `json:"priority,omitempty" yaml:"priority,omitempty" hcl:"priority"`
	OKPriority       *int64  `json:"okPriority,omitempty" yaml:"okPriority,omitempty" hcl:"ok_priority"`
	Retry            *int64  `json:"retry,omitempty" yaml:"retry,omitempty" hcl:"retry"`
	Expire           *int64  `json:"expire,omitempty" yaml:"expire,omitempty" hcl:"expire"`
	Device           *string `json:"device,omitempty" yaml:"device,omitempty" hcl:"device"`
	AlertingSound    *string `json:"sound,omitempty" yaml:"sound,omitempty" hcl:"sound"`
	OKSound          *string `json:"okSound,omitempty" yaml:"okSound,omitempty" hcl:"ok_sound"`
	Title            *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Message          *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
	UploadImage      *bool   `json:"uploadImage,omitempty" yaml:"uploadImage,omitempty" hcl:"upload_image"`
}

type RawMessage

type RawMessage = definition.RawMessage

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type Receiver

type Receiver = amv2.Receiver

type ReceiverExport

type ReceiverExport struct {
	UID                   string     `json:"uid" yaml:"uid"`
	Type                  string     `json:"type" yaml:"type"`
	Settings              RawMessage `json:"settings" yaml:"settings"`
	DisableResolveMessage bool       `json:"disableResolveMessage" yaml:"disableResolveMessage"`
}

ReceiverExport is the provisioned file export of alerting.ReceiverV1.

type ReceiverType

type ReceiverType = definition.ReceiverType

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type ReceiversResponse

type ReceiversResponse struct {
	// in:body
	Body []amv2.Receiver
}

swagger:response receiversResponse

type Record

type Record struct {
	// Name of the recorded metric.
	// required: true
	// example: grafana_alerts_ratio
	Metric string `json:"metric" yaml:"metric"`
	// Which expression node should be used as the input for the recorded metric.
	// required: true
	// example: A
	From string `json:"from" yaml:"from"`
}

swagger:model

type RelativeTimeRange

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

RelativeTimeRange is the per query start and end time for requests.

type RelativeTimeRangeExport

type RelativeTimeRangeExport struct {
	FromSeconds int64 `json:"from" yaml:"from" hcl:"from"`
	ToSeconds   int64 `json:"to" yaml:"to" hcl:"to"`
}

type ResponseDetails

type ResponseDetails struct {
	Msg string `json:"msg"`
}

swagger:model

type Route

type Route = definition.Route

Alias all the needed Alertmanager types, functions and constants so that they can be imported directly from grafana/alerting without having to modify any of the usage within Grafana.

type RouteDeleteMuteTimingParam

type RouteDeleteMuteTimingParam struct {
	// Mute timing name
	// in:path
	Name string `json:"name"`

	// Version of mute timing to use for optimistic concurrency. Leave empty to disable validation
	// in:query
	Version string `json:"version"`
}

swagger:parameters stable RouteDeleteMuteTiming

type RouteExport

type RouteExport struct {
	Receiver string `yaml:"receiver,omitempty" json:"receiver,omitempty" hcl:"contact_point"`

	GroupByStr *[]string `yaml:"group_by,omitempty" json:"group_by,omitempty" hcl:"group_by"`
	// Deprecated. Remove before v1.0 release.
	Match map[string]string `yaml:"match,omitempty" json:"match,omitempty"`
	// Deprecated. Remove before v1.0 release.
	MatchRE             config.MatchRegexps `yaml:"match_re,omitempty" json:"match_re,omitempty"`
	Matchers            config.Matchers     `yaml:"matchers,omitempty" json:"matchers,omitempty"`
	ObjectMatchers      ObjectMatchers      `yaml:"object_matchers,omitempty" json:"object_matchers,omitempty"`
	ObjectMatchersSlice []*MatcherExport    `yaml:"-" json:"-" hcl:"matcher,block"`
	MuteTimeIntervals   *[]string           `yaml:"mute_time_intervals,omitempty" json:"mute_time_intervals,omitempty" hcl:"mute_timings"`
	Continue            *bool               `yaml:"continue,omitempty" json:"continue,omitempty" hcl:"continue,optional"` // Added omitempty to yaml for a cleaner export.
	Routes              []*RouteExport      `yaml:"routes,omitempty" json:"routes,omitempty" hcl:"policy,block"`

	GroupWait      *string `yaml:"group_wait,omitempty" json:"group_wait,omitempty" hcl:"group_wait,optional"`
	GroupInterval  *string `yaml:"group_interval,omitempty" json:"group_interval,omitempty" hcl:"group_interval,optional"`
	RepeatInterval *string `yaml:"repeat_interval,omitempty" json:"repeat_interval,omitempty" hcl:"repeat_interval,optional"`
}

RouteExport is the provisioned file export of definitions.Route. This is needed to hide fields that aren't useable in provisioning file format. An alternative would be to define a custom MarshalJSON and MarshalYAML that excludes them.

type RouteGetGrafanaAlertingConfigHistoryParams

type RouteGetGrafanaAlertingConfigHistoryParams struct {
	// Limit response to n historic configurations.
	// in:query
	Limit int `json:"limit"`
}

swagger:parameters RouteGetGrafanaAlertingConfigHistory

type RouteGetMuteTimingParam

type RouteGetMuteTimingParam struct {
	// Mute timing name
	// in:path
	Name string `json:"name"`
}

swagger:parameters RouteGetTemplate RouteGetMuteTiming RoutePutMuteTiming stable RouteExportMuteTiming

type RouteGetTemplateParam

type RouteGetTemplateParam struct {
	// Template Name
	// in:path
	Name string `json:"name"`
}

swagger:parameters RouteGetTemplate RoutePutTemplate RouteDeleteTemplate

type RouteTimeIntervalNameParam

type RouteTimeIntervalNameParam struct {
	// Time interval name
	// in:path
	Name string `json:"name"`
}

swagger:parameters RouteNotificationsGetTimeInterval

type Rule

type Rule struct {
	// required: true
	Name string `json:"name"`
	// required: true
	Query  string         `json:"query"`
	Labels overrideLabels `json:"labels,omitempty"`
	// required: true
	Health    string `json:"health"`
	LastError string `json:"lastError,omitempty"`
	// required: true
	Type           string    `json:"type"`
	LastEvaluation time.Time `json:"lastEvaluation"`
	EvaluationTime float64   `json:"evaluationTime"`
}

adapted from cortex swagger:model

type RuleDiscovery

type RuleDiscovery struct {
	// required: true
	RuleGroups []RuleGroup      `json:"groups"`
	Totals     map[string]int64 `json:"totals,omitempty"`
}

swagger:model

type RuleGroup

type RuleGroup struct {
	// required: true
	Name string `json:"name"`
	// required: true
	File string `json:"file"`
	// In order to preserve rule ordering, while exposing type (alerting or recording)
	// specific properties, both alerting and recording rules are exposed in the
	// same array.
	// required: true
	Rules  []AlertingRule   `json:"rules"`
	Totals map[string]int64 `json:"totals"`
	// required: true
	Interval       float64   `json:"interval"`
	LastEvaluation time.Time `json:"lastEvaluation"`
	EvaluationTime float64   `json:"evaluationTime"`
}

swagger:model

type RuleGroupConfigResponse

type RuleGroupConfigResponse struct {
	GettableRuleGroupConfig
}

swagger:model

type RuleGroupPathParam

type RuleGroupPathParam struct {
	// in:path
	Group string `json:"Group"`
}

swagger:parameters RouteGetAlertRuleGroup RoutePutAlertRuleGroup RouteGetAlertRuleGroupExport RouteDeleteAlertRuleGroup

type RuleGroupsBy

type RuleGroupsBy func(a1, a2 *RuleGroup) bool

RuleGroupsBy is a function that defines the ordering of Rule Groups.

func (RuleGroupsBy) Sort

func (by RuleGroupsBy) Sort(groups []RuleGroup)

type RuleGroupsSorter

type RuleGroupsSorter struct {
	// contains filtered or unexported fields
}

func (RuleGroupsSorter) Len

func (s RuleGroupsSorter) Len() int

func (RuleGroupsSorter) Less

func (s RuleGroupsSorter) Less(i, j int) bool

func (RuleGroupsSorter) Swap

func (s RuleGroupsSorter) Swap(i, j int)

type RuleResponse

type RuleResponse struct {
	// in: body
	DiscoveryBase
	// in: body
	Data RuleDiscovery `json:"data"`
}

swagger:model

type RuleType

type RuleType int
const (
	GrafanaManagedRule RuleType = iota
	LoTexManagedRule
)

type Secret

type Secret string // TODO implement masking fields when models are used

A string that contain sensitive information.

type SensugoIntegration

type SensugoIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	URL    string `json:"url" yaml:"url" hcl:"url"`
	APIKey Secret `json:"apikey" yaml:"apikey" hcl:"api_key"`

	Entity    *string `json:"entity,omitempty" yaml:"entity,omitempty" hcl:"entity"`
	Check     *string `json:"check,omitempty" yaml:"check,omitempty" hcl:"check"`
	Namespace *string `json:"namespace,omitempty" yaml:"namespace,omitempty" hcl:"namespace"`
	Handler   *string `json:"handler,omitempty" yaml:"handler,omitempty" hcl:"handler"`
	Message   *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
}

type SigV4Config

type SigV4Config struct {
	Region    string `json:"region,omitempty" yaml:"region,omitempty" hcl:"region"`
	AccessKey string `json:"access_key,omitempty" yaml:"access_key,omitempty" hcl:"access_key"`
	SecretKey string `json:"secret_key,omitempty" yaml:"secret_key,omitempty" hcl:"secret_key"`
	Profile   string `json:"profile,omitempty" yaml:"profile,omitempty" hcl:"profile"`
	RoleARN   string `json:"role_arn,omitempty" yaml:"role_arn,omitempty" hcl:"role_arn"`
}

type SilenceMetadata

type SilenceMetadata struct {
	RuleUID   string `json:"rule_uid,omitempty"`
	RuleTitle string `json:"rule_title,omitempty"`
	FolderUID string `json:"folder_uid,omitempty"`
}

type SilencePermission

type SilencePermission string
const (
	SilencePermissionRead   SilencePermission = "read"
	SilencePermissionCreate SilencePermission = "create"
	SilencePermissionWrite  SilencePermission = "write"
)

type SlackIntegration

type SlackIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	EndpointURL    *string `json:"endpointUrl,omitempty" yaml:"endpointUrl,omitempty" hcl:"endpoint_url"`
	URL            *Secret `json:"url,omitempty" yaml:"url,omitempty" hcl:"url"`
	Token          *Secret `json:"token,omitempty" yaml:"token,omitempty" hcl:"token"`
	Recipient      *string `json:"recipient,omitempty" yaml:"recipient,omitempty" hcl:"recipient"`
	Text           *string `json:"text,omitempty" yaml:"text,omitempty" hcl:"text"`
	Title          *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Username       *string `json:"username,omitempty" yaml:"username,omitempty" hcl:"username"`
	IconEmoji      *string `json:"icon_emoji,omitempty" yaml:"icon_emoji,omitempty" hcl:"icon_emoji"`
	IconURL        *string `json:"icon_url,omitempty" yaml:"icon_url,omitempty" hcl:"icon_url"`
	MentionChannel *string `json:"mentionChannel,omitempty" yaml:"mentionChannel,omitempty" hcl:"mention_channel"`
	MentionUsers   *string `json:"mentionUsers,omitempty" yaml:"mentionUsers,omitempty" hcl:"mention_users"`
	MentionGroups  *string `json:"mentionGroups,omitempty" yaml:"mentionGroups,omitempty" hcl:"mention_groups"`
}

type SmtpNotEnabled

type SmtpNotEnabled ResponseDetails

swagger:model

type SnsIntegration

type SnsIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	APIUrl      *string            `yaml:"api_url,omitempty" json:"api_url,omitempty" hcl:"api_url"`
	Sigv4       SigV4Config        `yaml:"sigv4" json:"sigv4" hcl:"sigv4,block"`
	TopicARN    *string            `yaml:"topic_arn,omitempty" json:"topic_arn,omitempty" hcl:"topic_arn"`
	PhoneNumber *string            `yaml:"phone_number,omitempty" json:"phone_number,omitempty" hcl:"phone_number"`
	TargetARN   *string            `yaml:"target_arn,omitempty" json:"target_arn,omitempty" hcl:"target_arn"`
	Subject     *string            `yaml:"subject,omitempty" json:"subject,omitempty" hcl:"subject"`
	Message     *string            `yaml:"message,omitempty" json:"message,omitempty" hcl:"message"`
	Attributes  *map[string]string `yaml:"attributes,omitempty" json:"attributes,omitempty" hcl:"attributes"`
}

type StateByImportance

type StateByImportance int

type StateHistory

type StateHistory struct {
	// in:body
	Results *data.Frame `json:"results"`
}

swagger:response StateHistory

type Success

type Success ResponseDetails

swagger:model

type TeamsIntegration

type TeamsIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	URL Secret `json:"url,omitempty" yaml:"url,omitempty" hcl:"url"`

	Message      *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
	Title        *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	SectionTitle *string `json:"sectiontitle,omitempty" yaml:"sectiontitle,omitempty" hcl:"section_title"`
}

type TelegramIntegration

type TelegramIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	BotToken        Secret `json:"bottoken" yaml:"bottoken" hcl:"token"`
	ChatID          string `json:"chatid,omitempty" yaml:"chatid,omitempty" hcl:"chat_id"`
	MessageThreadID string `json:"message_thread_id,omitempty" yaml:"message_thread_id,omitempty" hcl:"message_thread_id"`

	Message               *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
	ParseMode             *string `json:"parse_mode,omitempty" yaml:"parse_mode,omitempty" hcl:"parse_mode"`
	DisableWebPagePreview *bool   `json:"disable_web_page_preview,omitempty" yaml:"disable_web_page_preview,omitempty" hcl:"disable_web_page_preview"`
	ProtectContent        *bool   `json:"protect_content,omitempty" yaml:"protect_content,omitempty" hcl:"protect_content"`
	DisableNotifications  *bool   `json:"disable_notifications,omitempty" yaml:"disable_notifications,omitempty" hcl:"disable_notifications"`
}

type TemplateErrorKind

type TemplateErrorKind string

swagger:enum TemplateErrorKind

const (
	InvalidTemplate TemplateErrorKind = "invalid_template"
	ExecutionError  TemplateErrorKind = "execution_error"
)

type TestGrafanaRuleRequest

type TestGrafanaRuleRequest struct {
	// in:body
	Body PostableExtendedRuleNodeExtended
}

swagger:parameters RouteTestRuleGrafanaConfig

type TestGrafanaRuleResponse

type TestGrafanaRuleResponse struct {
	// in:body
	Body []amv2.PostableAlert
}

swagger:response TestGrafanaRuleResponse

type TestReceiverConfigResult

type TestReceiverConfigResult struct {
	Name   string `json:"name"`
	UID    string `json:"uid"`
	Status string `json:"status"`
	Error  string `json:"error,omitempty"`
}

swagger:model

type TestReceiverRequest

type TestReceiverRequest struct {
	// in:body
	Body ExtendedReceiver
}

swagger:parameters RouteTestReceiverConfig

type TestReceiverResult

type TestReceiverResult struct {
	Name    string                     `json:"name"`
	Configs []TestReceiverConfigResult `json:"grafana_managed_receiver_configs"`
}

swagger:model

type TestReceiversConfigAlertParams

type TestReceiversConfigAlertParams struct {
	Annotations model.LabelSet `yaml:"annotations,omitempty" json:"annotations,omitempty"`
	Labels      model.LabelSet `yaml:"labels,omitempty" json:"labels,omitempty"`
}

type TestReceiversConfigBodyParams

type TestReceiversConfigBodyParams struct {
	Alert     *TestReceiversConfigAlertParams `yaml:"alert,omitempty" json:"alert,omitempty"`
	Receivers []*PostableApiReceiver          `yaml:"receivers,omitempty" json:"receivers,omitempty"`
}

type TestReceiversConfigParams

type TestReceiversConfigParams struct {
	// in:body
	Body TestReceiversConfigBodyParams
}

swagger:parameters RoutePostTestGrafanaReceivers

type TestReceiversResult

type TestReceiversResult struct {
	Alert      TestReceiversConfigAlertParams `json:"alert"`
	Receivers  []TestReceiverResult           `json:"receivers"`
	NotifiedAt time.Time                      `json:"notified_at"`
}

swagger:model

type TestRulePayload

type TestRulePayload struct {
	// Example: (node_filesystem_avail_bytes{fstype!="",job="integrations/node_exporter"} node_filesystem_size_bytes{fstype!="",job="integrations/node_exporter"} * 100 < 5 and node_filesystem_readonly{fstype!="",job="integrations/node_exporter"} == 0)
	Expr string `json:"expr,omitempty"`
	// GrafanaManagedCondition for grafana alerts
	GrafanaManagedCondition *EvalAlertConditionCommand `json:"grafana_condition,omitempty"`
}

swagger:model

func (*TestRulePayload) Type

func (p *TestRulePayload) Type() (backend Backend)

func (*TestRulePayload) UnmarshalJSON

func (p *TestRulePayload) UnmarshalJSON(b []byte) error

type TestRuleRequest

type TestRuleRequest struct {
	// in:body
	Body TestRulePayload
}

swagger:parameters RouteTestRuleConfig

type TestRuleResponse

type TestRuleResponse struct {
	Alerts                promql.Vector          `json:"alerts"`
	GrafanaAlertInstances AlertInstancesResponse `json:"grafana_alert_instances"`
}

swagger:model

type TestTemplatesConfigBodyParams

type TestTemplatesConfigBodyParams struct {
	// Alerts to use as data when testing the template.
	Alerts []*amv2.PostableAlert `json:"alerts"`

	// Template string to test.
	Template string `json:"template"`

	// Name of the template file.
	Name string `json:"name"`
}

type TestTemplatesConfigParams

type TestTemplatesConfigParams struct {
	// in:body
	Body TestTemplatesConfigBodyParams
}

swagger:parameters RoutePostTestGrafanaTemplates

type TestTemplatesErrorResult

type TestTemplatesErrorResult struct {
	// Name of the associated template for this error. Will be empty if the Kind is "invalid_template".
	Name string `json:"name,omitempty"`

	// Kind of template error that occurred.
	Kind TemplateErrorKind `json:"kind"`

	// Error message.
	Message string `json:"message"`
}

type TestTemplatesResult

type TestTemplatesResult struct {
	// Name of the associated template definition for this result.
	Name string `json:"name"`

	// Interpolated value of the template.
	Text string `json:"text"`
}

type TestTemplatesResults

type TestTemplatesResults struct {
	Results []TestTemplatesResult      `json:"results,omitempty"`
	Errors  []TestTemplatesErrorResult `json:"errors,omitempty"`
}

swagger:model

type ThreemaIntegration

type ThreemaIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	GatewayID   string `json:"gateway_id" yaml:"gateway_id" hcl:"gateway_id"`
	RecipientID string `json:"recipient_id" yaml:"recipient_id" hcl:"recipient_id"`
	APISecret   Secret `json:"api_secret" yaml:"api_secret" hcl:"api_secret"`

	Title       *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Description *string `json:"description,omitempty" yaml:"description,omitempty" hcl:"description"`
}

type TimeIntervalExportHcl

type TimeIntervalExportHcl struct {
	Times       []TimeRangeExportHcl `json:"times,omitempty" hcl:"times,block"`
	Weekdays    *[]string            `json:"weekdays,omitempty" hcl:"weekdays"`
	DaysOfMonth *[]string            `json:"days_of_month,omitempty" hcl:"days_of_month"`
	Months      *[]string            `json:"months,omitempty" hcl:"months"`
	Years       *[]string            `json:"years,omitempty" hcl:"years"`
	Location    *string              `json:"location,omitempty" hcl:"location"`
}

TimeIntervalExportHcl is a representation of the timeinterval.TimeInterval in HCL

type TimeIntervalItem

type TimeIntervalItem struct {
	Times       []TimeIntervalTimeRange `json:"times,omitempty" hcl:"times,block"`
	Weekdays    *[]string               `json:"weekdays,omitempty" hcl:"weekdays"`
	DaysOfMonth *[]string               `json:"days_of_month,omitempty" hcl:"days_of_month"`
	Months      *[]string               `json:"months,omitempty" hcl:"months"`
	Years       *[]string               `json:"years,omitempty" hcl:"years"`
	Location    *string                 `json:"location,omitempty" hcl:"location"`
}

type TimeIntervalTimeRange

type TimeIntervalTimeRange struct {
	StartMinute string `json:"start_time" hcl:"start"`
	EndMinute   string `json:"end_time" hcl:"end"`
}

type TimeRangeExportHcl

type TimeRangeExportHcl struct {
	StartMinute string `json:"start_time" hcl:"start"`
	EndMinute   string `json:"end_time" hcl:"end"`
}

TimeRangeExportHcl is a representation of the timeinterval.TimeRange in HCL

type UpdateRuleGroupResponse

type UpdateRuleGroupResponse struct {
	Message string   `json:"message"`
	Created []string `json:"created,omitempty"`
	Updated []string `json:"updated,omitempty"`
	Deleted []string `json:"deleted,omitempty"`
}

swagger:model

type ValidationError

type ValidationError struct {
	// example: error message
	Msg string `json:"msg"`
}

swagger:model

type VictoropsIntegration

type VictoropsIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	URL string `json:"url" yaml:"url" hcl:"url"`

	MessageType *string `json:"messageType,omitempty" yaml:"messageType,omitempty" hcl:"message_type"`
	Title       *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Description *string `json:"description,omitempty" yaml:"description,omitempty" hcl:"description"`
}

type WebexIntegration

type WebexIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	Token Secret `json:"bot_token" yaml:"bot_token" hcl:"token"`

	APIURL  *string `json:"api_url,omitempty" yaml:"api_url,omitempty" hcl:"api_url"`
	Message *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
	RoomID  *string `json:"room_id,omitempty" yaml:"room_id,omitempty" hcl:"room_id"`
}

type WebhookIntegration

type WebhookIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	URL string `json:"url" yaml:"url" hcl:"url"`

	HTTPMethod               *string `json:"httpMethod,omitempty" yaml:"httpMethod,omitempty" hcl:"http_method"`
	MaxAlerts                *int64  `json:"maxAlerts,omitempty" yaml:"maxAlerts,omitempty" hcl:"max_alerts"`
	AuthorizationScheme      *string `json:"authorization_scheme,omitempty" yaml:"authorization_scheme,omitempty" hcl:"authorization_scheme"`
	AuthorizationCredentials *Secret `json:"authorization_credentials,omitempty" yaml:"authorization_credentials,omitempty" hcl:"authorization_credentials"`
	User                     *string `json:"username,omitempty" yaml:"username,omitempty" hcl:"basic_auth_user"`
	Password                 *Secret `json:"password,omitempty" yaml:"password,omitempty" hcl:"basic_auth_password"`
	Title                    *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	Message                  *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
}

type WecomIntegration

type WecomIntegration struct {
	DisableResolveMessage *bool `json:"-" yaml:"-" hcl:"disable_resolve_message"`

	URL     *Secret `json:"url,omitempty" yaml:"url,omitempty" hcl:"url"`
	Secret  *Secret `json:"secret,omitempty" yaml:"secret,omitempty" hcl:"secret"`
	AgentID *string `json:"agent_id,omitempty" yaml:"agent_id,omitempty" hcl:"agent_id"`
	CorpID  *string `json:"corp_id,omitempty" yaml:"corp_id,omitempty" hcl:"corp_id"`
	Message *string `json:"message,omitempty" yaml:"message,omitempty" hcl:"message"`
	Title   *string `json:"title,omitempty" yaml:"title,omitempty" hcl:"title"`
	MsgType *string `json:"msgtype,omitempty" yaml:"msgtype,omitempty" hcl:"msg_type"`
	ToUser  *string `json:"touser,omitempty" yaml:"touser,omitempty" hcl:"to_user"`
}

Jump to

Keyboard shortcuts

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