Documentation ¶
Overview ¶
Package api contains base API implementation of unified alerting
* *Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) * *Do not manually edit these files, please find ngalert/api/swagger-codegen/ for commands on how to generate them.
Package api contains base API implementation of unified alerting
* *Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) * *Do not manually edit these files, please find ngalert/api/swagger-codegen/ for commands on how to generate them.
Package api contains base API implementation of unified alerting
* *Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) * *Do not manually edit these files, please find ngalert/api/swagger-codegen/ for commands on how to generate them.
Package api contains base API implementation of unified alerting
* *Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) * *Do not manually edit these files, please find ngalert/api/swagger-codegen/ for commands on how to generate them.
Package api contains base API implementation of unified alerting
* *Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) * *Do not manually edit these files, please find ngalert/api/swagger-codegen/ for commands on how to generate them.
Package api contains base API implementation of unified alerting
* *Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) * *Do not manually edit these files, please find ngalert/api/swagger-codegen/ for commands on how to generate them.
Index ¶
- Constants
- Variables
- func ErrResp(status int, err error, msg string, args ...interface{}) *response.NormalResponse
- func NewFakeAlertInstanceManager(t *testing.T) *fakeAlertInstanceManager
- type API
- func (api *API) RegisterAPIEndpoints(m *metrics.API)
- func (api *API) RegisterAlertmanagerApiEndpoints(srv AlertmanagerApi, m *metrics.API)
- func (api *API) RegisterConfigurationApiEndpoints(srv ConfigurationApi, m *metrics.API)
- func (api *API) RegisterPrometheusApiEndpoints(srv PrometheusApi, m *metrics.API)
- func (api *API) RegisterProvisioningApiEndpoints(srv ProvisioningApi, m *metrics.API)
- func (api *API) RegisterRulerApiEndpoints(srv RulerApi, m *metrics.API)
- func (api *API) RegisterTestingApiEndpoints(srv TestingApi, m *metrics.API)
- type AlertRuleService
- type AlertingProxy
- type AlertingStore
- type Alertmanager
- type AlertmanagerApi
- type AlertmanagerApiHandler
- func (f *AlertmanagerApiHandler) RouteCreateGrafanaSilence(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteCreateSilence(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteDeleteAlertingConfig(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteDeleteGrafanaAlertingConfig(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteDeleteGrafanaSilence(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteDeleteSilence(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetAMAlertGroups(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetAMAlerts(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetAMStatus(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetAlertingConfig(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetGrafanaAMAlertGroups(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetGrafanaAMAlerts(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetGrafanaAMStatus(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetGrafanaAlertingConfig(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetGrafanaReceivers(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetGrafanaSilence(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetGrafanaSilences(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetSilence(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RouteGetSilences(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RoutePostAMAlerts(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RoutePostAlertingConfig(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RoutePostGrafanaAMAlerts(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RoutePostGrafanaAlertingConfig(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RoutePostTestGrafanaReceivers(ctx *models.ReqContext) response.Response
- func (f *AlertmanagerApiHandler) RoutePostTestReceivers(ctx *models.ReqContext) response.Response
- type AlertmanagerSrv
- func (srv AlertmanagerSrv) AlertmanagerFor(orgID int64) (Alertmanager, *response.NormalResponse)
- func (srv AlertmanagerSrv) RouteCreateSilence(c *models.ReqContext, postableSilence apimodels.PostableSilence) response.Response
- func (srv AlertmanagerSrv) RouteDeleteAlertingConfig(c *models.ReqContext) response.Response
- func (srv AlertmanagerSrv) RouteDeleteSilence(c *models.ReqContext, silenceID string) response.Response
- func (srv AlertmanagerSrv) RouteGetAMAlertGroups(c *models.ReqContext) response.Response
- func (srv AlertmanagerSrv) RouteGetAMAlerts(c *models.ReqContext) response.Response
- func (srv AlertmanagerSrv) RouteGetAMStatus(c *models.ReqContext) response.Response
- func (srv AlertmanagerSrv) RouteGetAlertingConfig(c *models.ReqContext) response.Response
- func (srv AlertmanagerSrv) RouteGetReceivers(c *models.ReqContext) response.Response
- func (srv AlertmanagerSrv) RouteGetSilence(c *models.ReqContext, silenceID string) response.Response
- func (srv AlertmanagerSrv) RouteGetSilences(c *models.ReqContext) response.Response
- func (srv AlertmanagerSrv) RoutePostAMAlerts(_ *models.ReqContext, _ apimodels.PostableAlerts) response.Response
- func (srv AlertmanagerSrv) RoutePostAlertingConfig(c *models.ReqContext, body apimodels.PostableUserConfig) response.Response
- func (srv AlertmanagerSrv) RoutePostTestReceivers(c *models.ReqContext, body apimodels.TestReceiversConfigBodyParams) response.Response
- type ConditionValidator
- type ConfigSrv
- func (srv ConfigSrv) RouteDeleteNGalertConfig(c *models.ReqContext) response.Response
- func (srv ConfigSrv) RouteGetAlertingStatus(c *models.ReqContext) response.Response
- func (srv ConfigSrv) RouteGetAlertmanagers(c *models.ReqContext) response.Response
- func (srv ConfigSrv) RouteGetNGalertConfig(c *models.ReqContext) response.Response
- func (srv ConfigSrv) RoutePostNGalertConfig(c *models.ReqContext, body apimodels.PostableNGalertConfig) response.Response
- type ConfigurationApi
- type ConfigurationApiHandler
- func (f *ConfigurationApiHandler) RouteDeleteNGalertConfig(ctx *models.ReqContext) response.Response
- func (f *ConfigurationApiHandler) RouteGetAlertmanagers(ctx *models.ReqContext) response.Response
- func (f *ConfigurationApiHandler) RouteGetNGalertConfig(ctx *models.ReqContext) response.Response
- func (f *ConfigurationApiHandler) RouteGetStatus(ctx *models.ReqContext) response.Response
- func (f *ConfigurationApiHandler) RoutePostNGalertConfig(ctx *models.ReqContext) response.Response
- type ContactPointService
- type ExternalAlertmanagerProvider
- type LotexAM
- func (am *LotexAM) RouteCreateSilence(ctx *models.ReqContext, silenceBody apimodels.PostableSilence) response.Response
- func (am *LotexAM) RouteDeleteAlertingConfig(ctx *models.ReqContext) response.Response
- func (am *LotexAM) RouteDeleteSilence(ctx *models.ReqContext, silenceID string) response.Response
- func (am *LotexAM) RouteGetAMAlertGroups(ctx *models.ReqContext) response.Response
- func (am *LotexAM) RouteGetAMAlerts(ctx *models.ReqContext) response.Response
- func (am *LotexAM) RouteGetAMStatus(ctx *models.ReqContext) response.Response
- func (am *LotexAM) RouteGetAlertingConfig(ctx *models.ReqContext) response.Response
- func (am *LotexAM) RouteGetSilence(ctx *models.ReqContext, silenceID string) response.Response
- func (am *LotexAM) RouteGetSilences(ctx *models.ReqContext) response.Response
- func (am *LotexAM) RoutePostAMAlerts(ctx *models.ReqContext, alerts apimodels.PostableAlerts) response.Response
- func (am *LotexAM) RoutePostAlertingConfig(ctx *models.ReqContext, config apimodels.PostableUserConfig) response.Response
- func (am *LotexAM) RoutePostTestReceivers(ctx *models.ReqContext, config apimodels.TestReceiversConfigBodyParams) response.Response
- type LotexProm
- type LotexRuler
- func (r *LotexRuler) RouteDeleteNamespaceRulesConfig(ctx *models.ReqContext, namespace string) response.Response
- func (r *LotexRuler) RouteDeleteRuleGroupConfig(ctx *models.ReqContext, namespace string, group string) response.Response
- func (r *LotexRuler) RouteGetNamespaceRulesConfig(ctx *models.ReqContext, namespace string) response.Response
- func (r *LotexRuler) RouteGetRulegGroupConfig(ctx *models.ReqContext, namespace string, group string) response.Response
- func (r *LotexRuler) RouteGetRulesConfig(ctx *models.ReqContext) response.Response
- func (r *LotexRuler) RoutePostNameRulesConfig(ctx *models.ReqContext, conf apimodels.PostableRuleGroupConfig, ns string) response.Response
- type MuteTimingService
- type NotificationPolicyService
- type PrometheusApi
- type PrometheusApiHandler
- func (f *PrometheusApiHandler) RouteGetAlertStatuses(ctx *models.ReqContext) response.Response
- func (f *PrometheusApiHandler) RouteGetGrafanaAlertStatuses(ctx *models.ReqContext) response.Response
- func (f *PrometheusApiHandler) RouteGetGrafanaRuleStatuses(ctx *models.ReqContext) response.Response
- func (f *PrometheusApiHandler) RouteGetRuleStatuses(ctx *models.ReqContext) response.Response
- type PrometheusSrv
- type ProvisioningApi
- type ProvisioningApiHandler
- func (f *ProvisioningApiHandler) RouteDeleteAlertRule(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteDeleteContactpoints(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteDeleteMuteTiming(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteDeleteTemplate(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteGetAlertRule(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteGetAlertRuleGroup(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteGetContactpoints(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteGetMuteTiming(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteGetMuteTimings(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteGetPolicyTree(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteGetTemplate(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteGetTemplates(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePostAlertRule(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePostContactpoints(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePostMuteTiming(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePutAlertRule(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePutAlertRuleGroup(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePutContactpoint(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePutMuteTiming(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePutPolicyTree(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RoutePutTemplate(ctx *models.ReqContext) response.Response
- func (f *ProvisioningApiHandler) RouteResetPolicyTree(ctx *models.ReqContext) response.Response
- type ProvisioningSrv
- func (srv *ProvisioningSrv) RouteDeleteAlertRule(c *models.ReqContext, UID string) response.Response
- func (srv *ProvisioningSrv) RouteDeleteContactPoint(c *models.ReqContext, UID string) response.Response
- func (srv *ProvisioningSrv) RouteDeleteMuteTiming(c *models.ReqContext, name string) response.Response
- func (srv *ProvisioningSrv) RouteDeleteTemplate(c *models.ReqContext, name string) response.Response
- func (srv *ProvisioningSrv) RouteGetAlertRuleGroup(c *models.ReqContext, folder string, group string) response.Response
- func (srv *ProvisioningSrv) RouteGetContactPoints(c *models.ReqContext) response.Response
- func (srv *ProvisioningSrv) RouteGetMuteTiming(c *models.ReqContext, name string) response.Response
- func (srv *ProvisioningSrv) RouteGetMuteTimings(c *models.ReqContext) response.Response
- func (srv *ProvisioningSrv) RouteGetPolicyTree(c *models.ReqContext) response.Response
- func (srv *ProvisioningSrv) RouteGetTemplate(c *models.ReqContext, name string) response.Response
- func (srv *ProvisioningSrv) RouteGetTemplates(c *models.ReqContext) response.Response
- func (srv *ProvisioningSrv) RoutePostAlertRule(c *models.ReqContext, ar definitions.ProvisionedAlertRule) response.Response
- func (srv *ProvisioningSrv) RoutePostContactPoint(c *models.ReqContext, cp definitions.EmbeddedContactPoint) response.Response
- func (srv *ProvisioningSrv) RoutePostMuteTiming(c *models.ReqContext, mt definitions.MuteTimeInterval) response.Response
- func (srv *ProvisioningSrv) RoutePutAlertRule(c *models.ReqContext, ar definitions.ProvisionedAlertRule, UID string) response.Response
- func (srv *ProvisioningSrv) RoutePutAlertRuleGroup(c *models.ReqContext, ag definitions.AlertRuleGroup, folderUID string, ...) response.Response
- func (srv *ProvisioningSrv) RoutePutContactPoint(c *models.ReqContext, cp definitions.EmbeddedContactPoint, UID string) response.Response
- func (srv *ProvisioningSrv) RoutePutMuteTiming(c *models.ReqContext, mt definitions.MuteTimeInterval, name string) response.Response
- func (srv *ProvisioningSrv) RoutePutPolicyTree(c *models.ReqContext, tree definitions.Route) response.Response
- func (srv *ProvisioningSrv) RoutePutTemplate(c *models.ReqContext, body definitions.MessageTemplateContent, name string) response.Response
- func (srv *ProvisioningSrv) RouteResetPolicyTree(c *models.ReqContext) response.Response
- func (srv *ProvisioningSrv) RouteRouteGetAlertRule(c *models.ReqContext, UID string) response.Response
- type RuleStore
- type RulerApi
- type RulerApiHandler
- func (f *RulerApiHandler) RouteDeleteGrafanaRuleGroupConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteDeleteNamespaceGrafanaRulesConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteDeleteNamespaceRulesConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteDeleteRuleGroupConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteGetGrafanaRuleGroupConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteGetGrafanaRulesConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteGetNamespaceGrafanaRulesConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteGetNamespaceRulesConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteGetRulegGroupConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RouteGetRulesConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RoutePostNameGrafanaRulesConfig(ctx *models.ReqContext) response.Response
- func (f *RulerApiHandler) RoutePostNameRulesConfig(ctx *models.ReqContext) response.Response
- type RulerSrv
- func (srv RulerSrv) RouteDeleteAlertRules(c *models.ReqContext, namespaceTitle string, group string) response.Response
- func (srv RulerSrv) RouteGetNamespaceRulesConfig(c *models.ReqContext, namespaceTitle string) response.Response
- func (srv RulerSrv) RouteGetRulesConfig(c *models.ReqContext) response.Response
- func (srv RulerSrv) RouteGetRulesGroupConfig(c *models.ReqContext, namespaceTitle string, ruleGroup string) response.Response
- func (srv RulerSrv) RoutePostNameRulesConfig(c *models.ReqContext, ruleGroupConfig apimodels.PostableRuleGroupConfig, ...) response.Response
- type TemplateService
- type TestingApi
- type TestingApiHandler
- type TestingApiSrv
- func (srv TestingApiSrv) RouteEvalQueries(c *models.ReqContext, cmd apimodels.EvalQueriesPayload) response.Response
- func (srv TestingApiSrv) RouteTestGrafanaRuleConfig(c *models.ReqContext, body apimodels.TestRulePayload) response.Response
- func (srv TestingApiSrv) RouteTestRuleConfig(c *models.ReqContext, body apimodels.TestRulePayload, datasourceUID string) response.Response
- type UnknownReceiverError
Constants ¶
const ( Prometheus = "prometheus" Cortex = "cortex" Mimir = "mimir" )
const ( PrometheusDatasourceType = "prometheus" LokiDatasourceType = "loki" )
Variables ¶
var (
ErrAuthorization = errors.New("user is not authorized")
)
var NotImplementedResp = ErrResp(http.StatusNotImplemented, errors.New("endpoint not implemented"), "")
Functions ¶
func ErrResp ¶
func ErrResp(status int, err error, msg string, args ...interface{}) *response.NormalResponse
ErrorResp creates a response with a visible error
Types ¶
type API ¶
type API struct { Cfg *setting.Cfg DatasourceCache datasources.CacheService DatasourceService datasources.DataSourceService RouteRegister routing.RouteRegister ExpressionService *expr.Service QuotaService quota.Service Schedule schedule.ScheduleService TransactionManager provisioning.TransactionManager ProvenanceStore provisioning.ProvisioningStore RuleStore RuleStore AlertingStore AlertingStore AdminConfigStore store.AdminConfigurationStore DataProxy *datasourceproxy.DataSourceProxyService MultiOrgAlertmanager *notifier.MultiOrgAlertmanager StateManager *state.Manager AccessControl accesscontrol.AccessControl Policies *provisioning.NotificationPolicyService ContactPointService *provisioning.ContactPointService Templates *provisioning.TemplateService MuteTimings *provisioning.MuteTimingService AlertRules *provisioning.AlertRuleService AlertsRouter *sender.AlertsRouter }
API handlers.
func (*API) RegisterAPIEndpoints ¶
RegisterAPIEndpoints registers API handlers
func (*API) RegisterAlertmanagerApiEndpoints ¶
func (api *API) RegisterAlertmanagerApiEndpoints(srv AlertmanagerApi, m *metrics.API)
func (*API) RegisterConfigurationApiEndpoints ¶
func (api *API) RegisterConfigurationApiEndpoints(srv ConfigurationApi, m *metrics.API)
func (*API) RegisterPrometheusApiEndpoints ¶
func (api *API) RegisterPrometheusApiEndpoints(srv PrometheusApi, m *metrics.API)
func (*API) RegisterProvisioningApiEndpoints ¶
func (api *API) RegisterProvisioningApiEndpoints(srv ProvisioningApi, m *metrics.API)
func (*API) RegisterRulerApiEndpoints ¶
func (*API) RegisterTestingApiEndpoints ¶
func (api *API) RegisterTestingApiEndpoints(srv TestingApi, m *metrics.API)
type AlertRuleService ¶
type AlertRuleService interface { GetAlertRule(ctx context.Context, orgID int64, ruleUID string) (alerting_models.AlertRule, alerting_models.Provenance, error) CreateAlertRule(ctx context.Context, rule alerting_models.AlertRule, provenance alerting_models.Provenance, userID int64) (alerting_models.AlertRule, error) UpdateAlertRule(ctx context.Context, rule alerting_models.AlertRule, provenance alerting_models.Provenance) (alerting_models.AlertRule, error) DeleteAlertRule(ctx context.Context, orgID int64, ruleUID string, provenance alerting_models.Provenance) error GetRuleGroup(ctx context.Context, orgID int64, folder, group string) (alerting_models.AlertRuleGroup, error) ReplaceRuleGroup(ctx context.Context, orgID int64, group alerting_models.AlertRuleGroup, userID int64, provenance alerting_models.Provenance) error }
type AlertingProxy ¶
type AlertingProxy struct { DataProxy *datasourceproxy.DataSourceProxyService // contains filtered or unexported fields }
type AlertingStore ¶
type AlertingStore interface {
GetLatestAlertmanagerConfiguration(ctx context.Context, query *models.GetLatestAlertmanagerConfigurationQuery) error
}
type Alertmanager ¶
type Alertmanager interface { // Configuration SaveAndApplyConfig(ctx context.Context, config *apimodels.PostableUserConfig) error SaveAndApplyDefaultConfig(ctx context.Context) error GetStatus() apimodels.GettableStatus // Silences CreateSilence(ps *apimodels.PostableSilence) (string, error) DeleteSilence(silenceID string) error GetSilence(silenceID string) (apimodels.GettableSilence, error) ListSilences(filter []string) (apimodels.GettableSilences, error) // Alerts GetAlerts(active, silenced, inhibited bool, filter []string, receiver string) (apimodels.GettableAlerts, error) GetAlertGroups(active, silenced, inhibited bool, filter []string, receiver string) (apimodels.AlertGroups, error) // Receivers GetReceivers(ctx context.Context) apimodels.Receivers TestReceivers(ctx context.Context, c apimodels.TestReceiversConfigBodyParams) (*notifier.TestReceiversResult, error) }
type AlertmanagerApi ¶
type AlertmanagerApi interface { RouteCreateGrafanaSilence(*models.ReqContext) response.Response RouteCreateSilence(*models.ReqContext) response.Response RouteDeleteAlertingConfig(*models.ReqContext) response.Response RouteDeleteGrafanaAlertingConfig(*models.ReqContext) response.Response RouteDeleteGrafanaSilence(*models.ReqContext) response.Response RouteDeleteSilence(*models.ReqContext) response.Response RouteGetAMAlertGroups(*models.ReqContext) response.Response RouteGetAMAlerts(*models.ReqContext) response.Response RouteGetAMStatus(*models.ReqContext) response.Response RouteGetAlertingConfig(*models.ReqContext) response.Response RouteGetGrafanaAMAlertGroups(*models.ReqContext) response.Response RouteGetGrafanaAMAlerts(*models.ReqContext) response.Response RouteGetGrafanaAMStatus(*models.ReqContext) response.Response RouteGetGrafanaAlertingConfig(*models.ReqContext) response.Response RouteGetGrafanaReceivers(*models.ReqContext) response.Response RouteGetGrafanaSilence(*models.ReqContext) response.Response RouteGetGrafanaSilences(*models.ReqContext) response.Response RouteGetSilence(*models.ReqContext) response.Response RouteGetSilences(*models.ReqContext) response.Response RoutePostAMAlerts(*models.ReqContext) response.Response RoutePostAlertingConfig(*models.ReqContext) response.Response RoutePostGrafanaAMAlerts(*models.ReqContext) response.Response RoutePostGrafanaAlertingConfig(*models.ReqContext) response.Response RoutePostTestGrafanaReceivers(*models.ReqContext) response.Response RoutePostTestReceivers(*models.ReqContext) response.Response }
type AlertmanagerApiHandler ¶
type AlertmanagerApiHandler struct { AMSvc *LotexAM GrafanaSvc *AlertmanagerSrv DatasourceCache datasources.CacheService }
func NewForkingAM ¶
func NewForkingAM(datasourceCache datasources.CacheService, proxy *LotexAM, grafana *AlertmanagerSrv) *AlertmanagerApiHandler
NewForkingAM implements a set of routes that proxy to various Alertmanager-compatible backends.
func (*AlertmanagerApiHandler) RouteCreateGrafanaSilence ¶
func (f *AlertmanagerApiHandler) RouteCreateGrafanaSilence(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteCreateSilence ¶
func (f *AlertmanagerApiHandler) RouteCreateSilence(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteDeleteAlertingConfig ¶
func (f *AlertmanagerApiHandler) RouteDeleteAlertingConfig(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteDeleteGrafanaAlertingConfig ¶
func (f *AlertmanagerApiHandler) RouteDeleteGrafanaAlertingConfig(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteDeleteGrafanaSilence ¶
func (f *AlertmanagerApiHandler) RouteDeleteGrafanaSilence(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteDeleteSilence ¶
func (f *AlertmanagerApiHandler) RouteDeleteSilence(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetAMAlertGroups ¶
func (f *AlertmanagerApiHandler) RouteGetAMAlertGroups(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetAMAlerts ¶
func (f *AlertmanagerApiHandler) RouteGetAMAlerts(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetAMStatus ¶
func (f *AlertmanagerApiHandler) RouteGetAMStatus(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetAlertingConfig ¶
func (f *AlertmanagerApiHandler) RouteGetAlertingConfig(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetGrafanaAMAlertGroups ¶
func (f *AlertmanagerApiHandler) RouteGetGrafanaAMAlertGroups(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetGrafanaAMAlerts ¶
func (f *AlertmanagerApiHandler) RouteGetGrafanaAMAlerts(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetGrafanaAMStatus ¶
func (f *AlertmanagerApiHandler) RouteGetGrafanaAMStatus(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetGrafanaAlertingConfig ¶
func (f *AlertmanagerApiHandler) RouteGetGrafanaAlertingConfig(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetGrafanaReceivers ¶
func (f *AlertmanagerApiHandler) RouteGetGrafanaReceivers(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetGrafanaSilence ¶
func (f *AlertmanagerApiHandler) RouteGetGrafanaSilence(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetGrafanaSilences ¶
func (f *AlertmanagerApiHandler) RouteGetGrafanaSilences(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetSilence ¶
func (f *AlertmanagerApiHandler) RouteGetSilence(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RouteGetSilences ¶
func (f *AlertmanagerApiHandler) RouteGetSilences(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RoutePostAMAlerts ¶
func (f *AlertmanagerApiHandler) RoutePostAMAlerts(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RoutePostAlertingConfig ¶
func (f *AlertmanagerApiHandler) RoutePostAlertingConfig(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RoutePostGrafanaAMAlerts ¶
func (f *AlertmanagerApiHandler) RoutePostGrafanaAMAlerts(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RoutePostGrafanaAlertingConfig ¶
func (f *AlertmanagerApiHandler) RoutePostGrafanaAlertingConfig(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RoutePostTestGrafanaReceivers ¶
func (f *AlertmanagerApiHandler) RoutePostTestGrafanaReceivers(ctx *models.ReqContext) response.Response
func (*AlertmanagerApiHandler) RoutePostTestReceivers ¶
func (f *AlertmanagerApiHandler) RoutePostTestReceivers(ctx *models.ReqContext) response.Response
type AlertmanagerSrv ¶
type AlertmanagerSrv struct {
// contains filtered or unexported fields
}
func (AlertmanagerSrv) AlertmanagerFor ¶
func (srv AlertmanagerSrv) AlertmanagerFor(orgID int64) (Alertmanager, *response.NormalResponse)
func (AlertmanagerSrv) RouteCreateSilence ¶
func (srv AlertmanagerSrv) RouteCreateSilence(c *models.ReqContext, postableSilence apimodels.PostableSilence) response.Response
func (AlertmanagerSrv) RouteDeleteAlertingConfig ¶
func (srv AlertmanagerSrv) RouteDeleteAlertingConfig(c *models.ReqContext) response.Response
func (AlertmanagerSrv) RouteDeleteSilence ¶
func (srv AlertmanagerSrv) RouteDeleteSilence(c *models.ReqContext, silenceID string) response.Response
func (AlertmanagerSrv) RouteGetAMAlertGroups ¶
func (srv AlertmanagerSrv) RouteGetAMAlertGroups(c *models.ReqContext) response.Response
func (AlertmanagerSrv) RouteGetAMAlerts ¶
func (srv AlertmanagerSrv) RouteGetAMAlerts(c *models.ReqContext) response.Response
func (AlertmanagerSrv) RouteGetAMStatus ¶
func (srv AlertmanagerSrv) RouteGetAMStatus(c *models.ReqContext) response.Response
func (AlertmanagerSrv) RouteGetAlertingConfig ¶
func (srv AlertmanagerSrv) RouteGetAlertingConfig(c *models.ReqContext) response.Response
func (AlertmanagerSrv) RouteGetReceivers ¶
func (srv AlertmanagerSrv) RouteGetReceivers(c *models.ReqContext) response.Response
func (AlertmanagerSrv) RouteGetSilence ¶
func (srv AlertmanagerSrv) RouteGetSilence(c *models.ReqContext, silenceID string) response.Response
func (AlertmanagerSrv) RouteGetSilences ¶
func (srv AlertmanagerSrv) RouteGetSilences(c *models.ReqContext) response.Response
func (AlertmanagerSrv) RoutePostAMAlerts ¶
func (srv AlertmanagerSrv) RoutePostAMAlerts(_ *models.ReqContext, _ apimodels.PostableAlerts) response.Response
func (AlertmanagerSrv) RoutePostAlertingConfig ¶
func (srv AlertmanagerSrv) RoutePostAlertingConfig(c *models.ReqContext, body apimodels.PostableUserConfig) response.Response
func (AlertmanagerSrv) RoutePostTestReceivers ¶
func (srv AlertmanagerSrv) RoutePostTestReceivers(c *models.ReqContext, body apimodels.TestReceiversConfigBodyParams) response.Response
type ConditionValidator ¶
type ConfigSrv ¶
type ConfigSrv struct {
// contains filtered or unexported fields
}
func (ConfigSrv) RouteDeleteNGalertConfig ¶
func (srv ConfigSrv) RouteDeleteNGalertConfig(c *models.ReqContext) response.Response
func (ConfigSrv) RouteGetAlertingStatus ¶
func (srv ConfigSrv) RouteGetAlertingStatus(c *models.ReqContext) response.Response
func (ConfigSrv) RouteGetAlertmanagers ¶
func (srv ConfigSrv) RouteGetAlertmanagers(c *models.ReqContext) response.Response
func (ConfigSrv) RouteGetNGalertConfig ¶
func (srv ConfigSrv) RouteGetNGalertConfig(c *models.ReqContext) response.Response
func (ConfigSrv) RoutePostNGalertConfig ¶
func (srv ConfigSrv) RoutePostNGalertConfig(c *models.ReqContext, body apimodels.PostableNGalertConfig) response.Response
type ConfigurationApi ¶
type ConfigurationApi interface { RouteDeleteNGalertConfig(*models.ReqContext) response.Response RouteGetAlertmanagers(*models.ReqContext) response.Response RouteGetNGalertConfig(*models.ReqContext) response.Response RouteGetStatus(*models.ReqContext) response.Response RoutePostNGalertConfig(*models.ReqContext) response.Response }
type ConfigurationApiHandler ¶
type ConfigurationApiHandler struct {
// contains filtered or unexported fields
}
ConfigurationApiHandler always forwards requests to grafana backend
func NewConfiguration ¶
func NewConfiguration(grafana *ConfigSrv) *ConfigurationApiHandler
func (*ConfigurationApiHandler) RouteDeleteNGalertConfig ¶
func (f *ConfigurationApiHandler) RouteDeleteNGalertConfig(ctx *models.ReqContext) response.Response
func (*ConfigurationApiHandler) RouteGetAlertmanagers ¶
func (f *ConfigurationApiHandler) RouteGetAlertmanagers(ctx *models.ReqContext) response.Response
func (*ConfigurationApiHandler) RouteGetNGalertConfig ¶
func (f *ConfigurationApiHandler) RouteGetNGalertConfig(ctx *models.ReqContext) response.Response
func (*ConfigurationApiHandler) RouteGetStatus ¶
func (f *ConfigurationApiHandler) RouteGetStatus(ctx *models.ReqContext) response.Response
func (*ConfigurationApiHandler) RoutePostNGalertConfig ¶
func (f *ConfigurationApiHandler) RoutePostNGalertConfig(ctx *models.ReqContext) response.Response
type ContactPointService ¶
type ContactPointService interface { GetContactPoints(ctx context.Context, q provisioning.ContactPointQuery) ([]definitions.EmbeddedContactPoint, error) CreateContactPoint(ctx context.Context, orgID int64, contactPoint definitions.EmbeddedContactPoint, p alerting_models.Provenance) (definitions.EmbeddedContactPoint, error) UpdateContactPoint(ctx context.Context, orgID int64, contactPoint definitions.EmbeddedContactPoint, p alerting_models.Provenance) error DeleteContactPoint(ctx context.Context, orgID int64, uid string) error }
type LotexAM ¶
type LotexAM struct { *AlertingProxy // contains filtered or unexported fields }
func NewLotexAM ¶
func NewLotexAM(proxy *AlertingProxy, log log.Logger) *LotexAM
func (*LotexAM) RouteCreateSilence ¶
func (am *LotexAM) RouteCreateSilence(ctx *models.ReqContext, silenceBody apimodels.PostableSilence) response.Response
func (*LotexAM) RouteDeleteAlertingConfig ¶
func (am *LotexAM) RouteDeleteAlertingConfig(ctx *models.ReqContext) response.Response
func (*LotexAM) RouteDeleteSilence ¶
func (*LotexAM) RouteGetAMAlertGroups ¶
func (am *LotexAM) RouteGetAMAlertGroups(ctx *models.ReqContext) response.Response
func (*LotexAM) RouteGetAMAlerts ¶
func (am *LotexAM) RouteGetAMAlerts(ctx *models.ReqContext) response.Response
func (*LotexAM) RouteGetAMStatus ¶
func (am *LotexAM) RouteGetAMStatus(ctx *models.ReqContext) response.Response
func (*LotexAM) RouteGetAlertingConfig ¶
func (am *LotexAM) RouteGetAlertingConfig(ctx *models.ReqContext) response.Response
func (*LotexAM) RouteGetSilence ¶
func (*LotexAM) RouteGetSilences ¶
func (am *LotexAM) RouteGetSilences(ctx *models.ReqContext) response.Response
func (*LotexAM) RoutePostAMAlerts ¶
func (am *LotexAM) RoutePostAMAlerts(ctx *models.ReqContext, alerts apimodels.PostableAlerts) response.Response
func (*LotexAM) RoutePostAlertingConfig ¶
func (am *LotexAM) RoutePostAlertingConfig(ctx *models.ReqContext, config apimodels.PostableUserConfig) response.Response
func (*LotexAM) RoutePostTestReceivers ¶
func (am *LotexAM) RoutePostTestReceivers(ctx *models.ReqContext, config apimodels.TestReceiversConfigBodyParams) response.Response
type LotexProm ¶
type LotexProm struct { *AlertingProxy // contains filtered or unexported fields }
func NewLotexProm ¶
func NewLotexProm(proxy *AlertingProxy, log log.Logger) *LotexProm
func (*LotexProm) RouteGetAlertStatuses ¶
func (p *LotexProm) RouteGetAlertStatuses(ctx *models.ReqContext) response.Response
func (*LotexProm) RouteGetRuleStatuses ¶
func (p *LotexProm) RouteGetRuleStatuses(ctx *models.ReqContext) response.Response
type LotexRuler ¶
type LotexRuler struct { *AlertingProxy // contains filtered or unexported fields }
func NewLotexRuler ¶
func NewLotexRuler(proxy *AlertingProxy, log log.Logger) *LotexRuler
func (*LotexRuler) RouteDeleteNamespaceRulesConfig ¶
func (r *LotexRuler) RouteDeleteNamespaceRulesConfig(ctx *models.ReqContext, namespace string) response.Response
func (*LotexRuler) RouteDeleteRuleGroupConfig ¶
func (r *LotexRuler) RouteDeleteRuleGroupConfig(ctx *models.ReqContext, namespace string, group string) response.Response
func (*LotexRuler) RouteGetNamespaceRulesConfig ¶
func (r *LotexRuler) RouteGetNamespaceRulesConfig(ctx *models.ReqContext, namespace string) response.Response
func (*LotexRuler) RouteGetRulegGroupConfig ¶
func (r *LotexRuler) RouteGetRulegGroupConfig(ctx *models.ReqContext, namespace string, group string) response.Response
func (*LotexRuler) RouteGetRulesConfig ¶
func (r *LotexRuler) RouteGetRulesConfig(ctx *models.ReqContext) response.Response
func (*LotexRuler) RoutePostNameRulesConfig ¶
func (r *LotexRuler) RoutePostNameRulesConfig(ctx *models.ReqContext, conf apimodels.PostableRuleGroupConfig, ns string) response.Response
type MuteTimingService ¶
type MuteTimingService interface { GetMuteTimings(ctx context.Context, orgID int64) ([]definitions.MuteTimeInterval, error) CreateMuteTiming(ctx context.Context, mt definitions.MuteTimeInterval, orgID int64) (*definitions.MuteTimeInterval, error) UpdateMuteTiming(ctx context.Context, mt definitions.MuteTimeInterval, orgID int64) (*definitions.MuteTimeInterval, error) DeleteMuteTiming(ctx context.Context, name string, orgID int64) error }
type NotificationPolicyService ¶
type NotificationPolicyService interface { GetPolicyTree(ctx context.Context, orgID int64) (definitions.Route, error) UpdatePolicyTree(ctx context.Context, orgID int64, tree definitions.Route, p alerting_models.Provenance) error ResetPolicyTree(ctx context.Context, orgID int64) (definitions.Route, error) }
type PrometheusApi ¶
type PrometheusApi interface { RouteGetAlertStatuses(*models.ReqContext) response.Response RouteGetGrafanaAlertStatuses(*models.ReqContext) response.Response RouteGetGrafanaRuleStatuses(*models.ReqContext) response.Response RouteGetRuleStatuses(*models.ReqContext) response.Response }
type PrometheusApiHandler ¶
type PrometheusApiHandler struct { ProxySvc *LotexProm GrafanaSvc *PrometheusSrv DatasourceCache datasources.CacheService }
func NewForkingProm ¶
func NewForkingProm(datasourceCache datasources.CacheService, proxy *LotexProm, grafana *PrometheusSrv) *PrometheusApiHandler
NewForkingProm implements a set of routes that proxy to various Prometheus-compatible backends.
func (*PrometheusApiHandler) RouteGetAlertStatuses ¶
func (f *PrometheusApiHandler) RouteGetAlertStatuses(ctx *models.ReqContext) response.Response
func (*PrometheusApiHandler) RouteGetGrafanaAlertStatuses ¶
func (f *PrometheusApiHandler) RouteGetGrafanaAlertStatuses(ctx *models.ReqContext) response.Response
func (*PrometheusApiHandler) RouteGetGrafanaRuleStatuses ¶
func (f *PrometheusApiHandler) RouteGetGrafanaRuleStatuses(ctx *models.ReqContext) response.Response
func (*PrometheusApiHandler) RouteGetRuleStatuses ¶
func (f *PrometheusApiHandler) RouteGetRuleStatuses(ctx *models.ReqContext) response.Response
type PrometheusSrv ¶
type PrometheusSrv struct {
// contains filtered or unexported fields
}
func (PrometheusSrv) RouteGetAlertStatuses ¶
func (srv PrometheusSrv) RouteGetAlertStatuses(c *models.ReqContext) response.Response
func (PrometheusSrv) RouteGetRuleStatuses ¶
func (srv PrometheusSrv) RouteGetRuleStatuses(c *models.ReqContext) response.Response
type ProvisioningApi ¶
type ProvisioningApi interface { RouteDeleteAlertRule(*models.ReqContext) response.Response RouteDeleteContactpoints(*models.ReqContext) response.Response RouteDeleteMuteTiming(*models.ReqContext) response.Response RouteDeleteTemplate(*models.ReqContext) response.Response RouteGetAlertRule(*models.ReqContext) response.Response RouteGetAlertRuleGroup(*models.ReqContext) response.Response RouteGetContactpoints(*models.ReqContext) response.Response RouteGetMuteTiming(*models.ReqContext) response.Response RouteGetMuteTimings(*models.ReqContext) response.Response RouteGetPolicyTree(*models.ReqContext) response.Response RouteGetTemplate(*models.ReqContext) response.Response RouteGetTemplates(*models.ReqContext) response.Response RoutePostAlertRule(*models.ReqContext) response.Response RoutePostContactpoints(*models.ReqContext) response.Response RoutePostMuteTiming(*models.ReqContext) response.Response RoutePutAlertRule(*models.ReqContext) response.Response RoutePutAlertRuleGroup(*models.ReqContext) response.Response RoutePutContactpoint(*models.ReqContext) response.Response RoutePutMuteTiming(*models.ReqContext) response.Response RoutePutPolicyTree(*models.ReqContext) response.Response RoutePutTemplate(*models.ReqContext) response.Response RouteResetPolicyTree(*models.ReqContext) response.Response }
type ProvisioningApiHandler ¶
type ProvisioningApiHandler struct {
// contains filtered or unexported fields
}
func NewProvisioningApi ¶
func NewProvisioningApi(svc *ProvisioningSrv) *ProvisioningApiHandler
func (*ProvisioningApiHandler) RouteDeleteAlertRule ¶
func (f *ProvisioningApiHandler) RouteDeleteAlertRule(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteDeleteContactpoints ¶
func (f *ProvisioningApiHandler) RouteDeleteContactpoints(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteDeleteMuteTiming ¶
func (f *ProvisioningApiHandler) RouteDeleteMuteTiming(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteDeleteTemplate ¶
func (f *ProvisioningApiHandler) RouteDeleteTemplate(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteGetAlertRule ¶
func (f *ProvisioningApiHandler) RouteGetAlertRule(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteGetAlertRuleGroup ¶
func (f *ProvisioningApiHandler) RouteGetAlertRuleGroup(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteGetContactpoints ¶
func (f *ProvisioningApiHandler) RouteGetContactpoints(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteGetMuteTiming ¶
func (f *ProvisioningApiHandler) RouteGetMuteTiming(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteGetMuteTimings ¶
func (f *ProvisioningApiHandler) RouteGetMuteTimings(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteGetPolicyTree ¶
func (f *ProvisioningApiHandler) RouteGetPolicyTree(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteGetTemplate ¶
func (f *ProvisioningApiHandler) RouteGetTemplate(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteGetTemplates ¶
func (f *ProvisioningApiHandler) RouteGetTemplates(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePostAlertRule ¶
func (f *ProvisioningApiHandler) RoutePostAlertRule(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePostContactpoints ¶
func (f *ProvisioningApiHandler) RoutePostContactpoints(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePostMuteTiming ¶
func (f *ProvisioningApiHandler) RoutePostMuteTiming(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePutAlertRule ¶
func (f *ProvisioningApiHandler) RoutePutAlertRule(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePutAlertRuleGroup ¶
func (f *ProvisioningApiHandler) RoutePutAlertRuleGroup(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePutContactpoint ¶
func (f *ProvisioningApiHandler) RoutePutContactpoint(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePutMuteTiming ¶
func (f *ProvisioningApiHandler) RoutePutMuteTiming(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePutPolicyTree ¶
func (f *ProvisioningApiHandler) RoutePutPolicyTree(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RoutePutTemplate ¶
func (f *ProvisioningApiHandler) RoutePutTemplate(ctx *models.ReqContext) response.Response
func (*ProvisioningApiHandler) RouteResetPolicyTree ¶
func (f *ProvisioningApiHandler) RouteResetPolicyTree(ctx *models.ReqContext) response.Response
type ProvisioningSrv ¶
type ProvisioningSrv struct {
// contains filtered or unexported fields
}
func (*ProvisioningSrv) RouteDeleteAlertRule ¶
func (srv *ProvisioningSrv) RouteDeleteAlertRule(c *models.ReqContext, UID string) response.Response
func (*ProvisioningSrv) RouteDeleteContactPoint ¶
func (srv *ProvisioningSrv) RouteDeleteContactPoint(c *models.ReqContext, UID string) response.Response
func (*ProvisioningSrv) RouteDeleteMuteTiming ¶
func (srv *ProvisioningSrv) RouteDeleteMuteTiming(c *models.ReqContext, name string) response.Response
func (*ProvisioningSrv) RouteDeleteTemplate ¶
func (srv *ProvisioningSrv) RouteDeleteTemplate(c *models.ReqContext, name string) response.Response
func (*ProvisioningSrv) RouteGetAlertRuleGroup ¶
func (srv *ProvisioningSrv) RouteGetAlertRuleGroup(c *models.ReqContext, folder string, group string) response.Response
func (*ProvisioningSrv) RouteGetContactPoints ¶
func (srv *ProvisioningSrv) RouteGetContactPoints(c *models.ReqContext) response.Response
func (*ProvisioningSrv) RouteGetMuteTiming ¶
func (srv *ProvisioningSrv) RouteGetMuteTiming(c *models.ReqContext, name string) response.Response
func (*ProvisioningSrv) RouteGetMuteTimings ¶
func (srv *ProvisioningSrv) RouteGetMuteTimings(c *models.ReqContext) response.Response
func (*ProvisioningSrv) RouteGetPolicyTree ¶
func (srv *ProvisioningSrv) RouteGetPolicyTree(c *models.ReqContext) response.Response
func (*ProvisioningSrv) RouteGetTemplate ¶
func (srv *ProvisioningSrv) RouteGetTemplate(c *models.ReqContext, name string) response.Response
func (*ProvisioningSrv) RouteGetTemplates ¶
func (srv *ProvisioningSrv) RouteGetTemplates(c *models.ReqContext) response.Response
func (*ProvisioningSrv) RoutePostAlertRule ¶
func (srv *ProvisioningSrv) RoutePostAlertRule(c *models.ReqContext, ar definitions.ProvisionedAlertRule) response.Response
func (*ProvisioningSrv) RoutePostContactPoint ¶
func (srv *ProvisioningSrv) RoutePostContactPoint(c *models.ReqContext, cp definitions.EmbeddedContactPoint) response.Response
func (*ProvisioningSrv) RoutePostMuteTiming ¶
func (srv *ProvisioningSrv) RoutePostMuteTiming(c *models.ReqContext, mt definitions.MuteTimeInterval) response.Response
func (*ProvisioningSrv) RoutePutAlertRule ¶
func (srv *ProvisioningSrv) RoutePutAlertRule(c *models.ReqContext, ar definitions.ProvisionedAlertRule, UID string) response.Response
func (*ProvisioningSrv) RoutePutAlertRuleGroup ¶
func (srv *ProvisioningSrv) RoutePutAlertRuleGroup(c *models.ReqContext, ag definitions.AlertRuleGroup, folderUID string, group string) response.Response
func (*ProvisioningSrv) RoutePutContactPoint ¶
func (srv *ProvisioningSrv) RoutePutContactPoint(c *models.ReqContext, cp definitions.EmbeddedContactPoint, UID string) response.Response
func (*ProvisioningSrv) RoutePutMuteTiming ¶
func (srv *ProvisioningSrv) RoutePutMuteTiming(c *models.ReqContext, mt definitions.MuteTimeInterval, name string) response.Response
func (*ProvisioningSrv) RoutePutPolicyTree ¶
func (srv *ProvisioningSrv) RoutePutPolicyTree(c *models.ReqContext, tree definitions.Route) response.Response
func (*ProvisioningSrv) RoutePutTemplate ¶
func (srv *ProvisioningSrv) RoutePutTemplate(c *models.ReqContext, body definitions.MessageTemplateContent, name string) response.Response
func (*ProvisioningSrv) RouteResetPolicyTree ¶
func (srv *ProvisioningSrv) RouteResetPolicyTree(c *models.ReqContext) response.Response
func (*ProvisioningSrv) RouteRouteGetAlertRule ¶
func (srv *ProvisioningSrv) RouteRouteGetAlertRule(c *models.ReqContext, UID string) response.Response
type RuleStore ¶
type RuleStore interface { GetUserVisibleNamespaces(context.Context, int64, *user.SignedInUser) (map[string]*models.Folder, error) GetNamespaceByTitle(context.Context, string, int64, *user.SignedInUser, bool) (*models.Folder, error) GetAlertRulesGroupByRuleUID(ctx context.Context, query *ngmodels.GetAlertRulesGroupByRuleUIDQuery) error ListAlertRules(ctx context.Context, query *ngmodels.ListAlertRulesQuery) error // InsertAlertRules will insert all alert rules passed into the function // and return the map of uuid to id. InsertAlertRules(ctx context.Context, rule []ngmodels.AlertRule) (map[string]int64, error) UpdateAlertRules(ctx context.Context, rule []ngmodels.UpdateRule) error DeleteAlertRulesByUID(ctx context.Context, orgID int64, ruleUID ...string) error // IncreaseVersionForAllRulesInNamespace Increases version for all rules that have specified namespace. Returns all rules that belong to the namespace IncreaseVersionForAllRulesInNamespace(ctx context.Context, orgID int64, namespaceUID string) ([]ngmodels.AlertRuleKeyWithVersion, error) }
RuleStore is the interface for persisting alert rules and instances
type RulerApi ¶
type RulerApi interface { RouteDeleteGrafanaRuleGroupConfig(*models.ReqContext) response.Response RouteDeleteNamespaceGrafanaRulesConfig(*models.ReqContext) response.Response RouteDeleteNamespaceRulesConfig(*models.ReqContext) response.Response RouteDeleteRuleGroupConfig(*models.ReqContext) response.Response RouteGetGrafanaRuleGroupConfig(*models.ReqContext) response.Response RouteGetGrafanaRulesConfig(*models.ReqContext) response.Response RouteGetNamespaceGrafanaRulesConfig(*models.ReqContext) response.Response RouteGetNamespaceRulesConfig(*models.ReqContext) response.Response RouteGetRulegGroupConfig(*models.ReqContext) response.Response RouteGetRulesConfig(*models.ReqContext) response.Response RoutePostNameGrafanaRulesConfig(*models.ReqContext) response.Response RoutePostNameRulesConfig(*models.ReqContext) response.Response }
type RulerApiHandler ¶
type RulerApiHandler struct { LotexRuler *LotexRuler GrafanaRuler *RulerSrv DatasourceCache datasources.CacheService }
RulerApiHandler will validate and proxy requests to the correct backend type depending on the datasource.
func NewForkingRuler ¶
func NewForkingRuler(datasourceCache datasources.CacheService, lotex *LotexRuler, grafana *RulerSrv) *RulerApiHandler
func (*RulerApiHandler) RouteDeleteGrafanaRuleGroupConfig ¶
func (f *RulerApiHandler) RouteDeleteGrafanaRuleGroupConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteDeleteNamespaceGrafanaRulesConfig ¶
func (f *RulerApiHandler) RouteDeleteNamespaceGrafanaRulesConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteDeleteNamespaceRulesConfig ¶
func (f *RulerApiHandler) RouteDeleteNamespaceRulesConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteDeleteRuleGroupConfig ¶
func (f *RulerApiHandler) RouteDeleteRuleGroupConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteGetGrafanaRuleGroupConfig ¶
func (f *RulerApiHandler) RouteGetGrafanaRuleGroupConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteGetGrafanaRulesConfig ¶
func (f *RulerApiHandler) RouteGetGrafanaRulesConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteGetNamespaceGrafanaRulesConfig ¶
func (f *RulerApiHandler) RouteGetNamespaceGrafanaRulesConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteGetNamespaceRulesConfig ¶
func (f *RulerApiHandler) RouteGetNamespaceRulesConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteGetRulegGroupConfig ¶
func (f *RulerApiHandler) RouteGetRulegGroupConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RouteGetRulesConfig ¶
func (f *RulerApiHandler) RouteGetRulesConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RoutePostNameGrafanaRulesConfig ¶
func (f *RulerApiHandler) RoutePostNameGrafanaRulesConfig(ctx *models.ReqContext) response.Response
func (*RulerApiHandler) RoutePostNameRulesConfig ¶
func (f *RulerApiHandler) RoutePostNameRulesConfig(ctx *models.ReqContext) response.Response
type RulerSrv ¶
func (RulerSrv) RouteDeleteAlertRules ¶
func (srv RulerSrv) RouteDeleteAlertRules(c *models.ReqContext, namespaceTitle string, group string) response.Response
RouteDeleteAlertRules deletes all alert rules the user is authorized to access in the given namespace or, if non-empty, a specific group of rules in the namespace. Returns http.StatusUnauthorized if user does not have access to any of the rules that match the filter. Returns http.StatusBadRequest if all rules that match the filter and the user is authorized to delete are provisioned.
func (RulerSrv) RouteGetNamespaceRulesConfig ¶
func (srv RulerSrv) RouteGetNamespaceRulesConfig(c *models.ReqContext, namespaceTitle string) response.Response
RouteGetNamespaceRulesConfig returns all rules in a specific folder that user has access to
func (RulerSrv) RouteGetRulesConfig ¶
func (srv RulerSrv) RouteGetRulesConfig(c *models.ReqContext) response.Response
RouteGetRulesConfig returns all alert rules that are available to the current user
func (RulerSrv) RouteGetRulesGroupConfig ¶
func (srv RulerSrv) RouteGetRulesGroupConfig(c *models.ReqContext, namespaceTitle string, ruleGroup string) response.Response
RouteGetRulesGroupConfig returns rules that belong to a specific group in a specific namespace (folder). If user does not have access to at least one of the rule in the group, returns status 401 Unauthorized
func (RulerSrv) RoutePostNameRulesConfig ¶
func (srv RulerSrv) RoutePostNameRulesConfig(c *models.ReqContext, ruleGroupConfig apimodels.PostableRuleGroupConfig, namespaceTitle string) response.Response
type TemplateService ¶
type TemplateService interface { GetTemplates(ctx context.Context, orgID int64) (map[string]string, error) SetTemplate(ctx context.Context, orgID int64, tmpl definitions.MessageTemplate) (definitions.MessageTemplate, error) DeleteTemplate(ctx context.Context, orgID int64, name string) error }
type TestingApi ¶
type TestingApi interface { RouteEvalQueries(*models.ReqContext) response.Response RouteTestRuleConfig(*models.ReqContext) response.Response RouteTestRuleGrafanaConfig(*models.ReqContext) response.Response }
type TestingApiHandler ¶
type TestingApiHandler struct {
// contains filtered or unexported fields
}
TestingApiHandler always forwards requests to grafana backend
func NewTestingApi ¶
func NewTestingApi(svc *TestingApiSrv) *TestingApiHandler
func (*TestingApiHandler) RouteEvalQueries ¶
func (f *TestingApiHandler) RouteEvalQueries(ctx *models.ReqContext) response.Response
func (*TestingApiHandler) RouteTestRuleConfig ¶
func (f *TestingApiHandler) RouteTestRuleConfig(ctx *models.ReqContext) response.Response
func (*TestingApiHandler) RouteTestRuleGrafanaConfig ¶
func (f *TestingApiHandler) RouteTestRuleGrafanaConfig(ctx *models.ReqContext) response.Response
type TestingApiSrv ¶
type TestingApiSrv struct { *AlertingProxy DatasourceCache datasources.CacheService // contains filtered or unexported fields }
func (TestingApiSrv) RouteEvalQueries ¶
func (srv TestingApiSrv) RouteEvalQueries(c *models.ReqContext, cmd apimodels.EvalQueriesPayload) response.Response
func (TestingApiSrv) RouteTestGrafanaRuleConfig ¶
func (srv TestingApiSrv) RouteTestGrafanaRuleConfig(c *models.ReqContext, body apimodels.TestRulePayload) response.Response
func (TestingApiSrv) RouteTestRuleConfig ¶
func (srv TestingApiSrv) RouteTestRuleConfig(c *models.ReqContext, body apimodels.TestRulePayload, datasourceUID string) response.Response
type UnknownReceiverError ¶
type UnknownReceiverError struct {
UID string
}
func (UnknownReceiverError) Error ¶
func (e UnknownReceiverError) Error() string
Source Files ¶
- api.go
- api_alertmanager.go
- api_alertmanager_guards.go
- api_configuration.go
- api_prometheus.go
- api_prometheus_test_fixtures.go
- api_provisioning.go
- api_ruler.go
- api_ruler_validation.go
- api_testing.go
- authorization.go
- configuration.go
- errors.go
- forking_alertmanager.go
- forking_prometheus.go
- forking_ruler.go
- generated_base_api_alertmanager.go
- generated_base_api_configuration.go
- generated_base_api_prometheus.go
- generated_base_api_provisioning.go
- generated_base_api_ruler.go
- generated_base_api_testing.go
- lotex_am.go
- lotex_prom.go
- lotex_ruler.go
- persist.go
- promql_compat.go
- provisioning.go
- testing.go
- testing_api.go
- util.go