Documentation
¶
Index ¶
- Constants
- func ListAlertingPolicyResources(ctx context.Context, c Client) ([]core.IntegrationResource, error)
- func ListNotificationChannelResources(ctx context.Context, c Client) ([]core.IntegrationResource, error)
- func ListSnoozeResources(ctx context.Context, c Client) ([]core.IntegrationResource, error)
- func SetClientFactory(...)
- type AlertPolicyNodeMetadata
- type Client
- type ConditionSpec
- type CreateAlertingPolicy
- func (c *CreateAlertingPolicy) Cancel(ctx core.ExecutionContext) error
- func (c *CreateAlertingPolicy) Cleanup(ctx core.SetupContext) error
- func (c *CreateAlertingPolicy) Color() string
- func (c *CreateAlertingPolicy) Configuration() []configuration.Field
- func (c *CreateAlertingPolicy) Description() string
- func (c *CreateAlertingPolicy) Documentation() string
- func (c *CreateAlertingPolicy) ExampleOutput() map[string]any
- func (c *CreateAlertingPolicy) Execute(ctx core.ExecutionContext) error
- func (c *CreateAlertingPolicy) HandleHook(ctx core.ActionHookContext) error
- func (c *CreateAlertingPolicy) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *CreateAlertingPolicy) Hooks() []core.Hook
- func (c *CreateAlertingPolicy) Icon() string
- func (c *CreateAlertingPolicy) Label() string
- func (c *CreateAlertingPolicy) Name() string
- func (c *CreateAlertingPolicy) OutputChannels(configuration any) []core.OutputChannel
- func (c *CreateAlertingPolicy) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *CreateAlertingPolicy) Setup(ctx core.SetupContext) error
- type CreateAlertingPolicySpec
- type CreateSnooze
- func (c *CreateSnooze) Cancel(ctx core.ExecutionContext) error
- func (c *CreateSnooze) Cleanup(ctx core.SetupContext) error
- func (c *CreateSnooze) Color() string
- func (c *CreateSnooze) Configuration() []configuration.Field
- func (c *CreateSnooze) Description() string
- func (c *CreateSnooze) Documentation() string
- func (c *CreateSnooze) ExampleOutput() map[string]any
- func (c *CreateSnooze) Execute(ctx core.ExecutionContext) error
- func (c *CreateSnooze) HandleHook(ctx core.ActionHookContext) error
- func (c *CreateSnooze) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *CreateSnooze) Hooks() []core.Hook
- func (c *CreateSnooze) Icon() string
- func (c *CreateSnooze) Label() string
- func (c *CreateSnooze) Name() string
- func (c *CreateSnooze) OutputChannels(configuration any) []core.OutputChannel
- func (c *CreateSnooze) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *CreateSnooze) Setup(ctx core.SetupContext) error
- type CreateSnoozeSpec
- type DeleteAlertingPolicy
- func (d *DeleteAlertingPolicy) Cancel(ctx core.ExecutionContext) error
- func (d *DeleteAlertingPolicy) Cleanup(ctx core.SetupContext) error
- func (d *DeleteAlertingPolicy) Color() string
- func (d *DeleteAlertingPolicy) Configuration() []configuration.Field
- func (d *DeleteAlertingPolicy) Description() string
- func (d *DeleteAlertingPolicy) Documentation() string
- func (d *DeleteAlertingPolicy) ExampleOutput() map[string]any
- func (d *DeleteAlertingPolicy) Execute(ctx core.ExecutionContext) error
- func (d *DeleteAlertingPolicy) HandleHook(ctx core.ActionHookContext) error
- func (d *DeleteAlertingPolicy) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (d *DeleteAlertingPolicy) Hooks() []core.Hook
- func (d *DeleteAlertingPolicy) Icon() string
- func (d *DeleteAlertingPolicy) Label() string
- func (d *DeleteAlertingPolicy) Name() string
- func (d *DeleteAlertingPolicy) OutputChannels(configuration any) []core.OutputChannel
- func (d *DeleteAlertingPolicy) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (d *DeleteAlertingPolicy) Setup(ctx core.SetupContext) error
- type DeleteAlertingPolicySpec
- type ExpireSnooze
- func (e *ExpireSnooze) Cancel(ctx core.ExecutionContext) error
- func (e *ExpireSnooze) Cleanup(ctx core.SetupContext) error
- func (e *ExpireSnooze) Color() string
- func (e *ExpireSnooze) Configuration() []configuration.Field
- func (e *ExpireSnooze) Description() string
- func (e *ExpireSnooze) Documentation() string
- func (e *ExpireSnooze) ExampleOutput() map[string]any
- func (e *ExpireSnooze) Execute(ctx core.ExecutionContext) error
- func (e *ExpireSnooze) HandleHook(ctx core.ActionHookContext) error
- func (e *ExpireSnooze) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (e *ExpireSnooze) Hooks() []core.Hook
- func (e *ExpireSnooze) Icon() string
- func (e *ExpireSnooze) Label() string
- func (e *ExpireSnooze) Name() string
- func (e *ExpireSnooze) OutputChannels(configuration any) []core.OutputChannel
- func (e *ExpireSnooze) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (e *ExpireSnooze) Setup(ctx core.SetupContext) error
- type ExpireSnoozeSpec
- type GetAlertingPolicy
- func (g *GetAlertingPolicy) Cancel(ctx core.ExecutionContext) error
- func (g *GetAlertingPolicy) Cleanup(ctx core.SetupContext) error
- func (g *GetAlertingPolicy) Color() string
- func (g *GetAlertingPolicy) Configuration() []configuration.Field
- func (g *GetAlertingPolicy) Description() string
- func (g *GetAlertingPolicy) Documentation() string
- func (g *GetAlertingPolicy) ExampleOutput() map[string]any
- func (g *GetAlertingPolicy) Execute(ctx core.ExecutionContext) error
- func (g *GetAlertingPolicy) HandleHook(ctx core.ActionHookContext) error
- func (g *GetAlertingPolicy) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (g *GetAlertingPolicy) Hooks() []core.Hook
- func (g *GetAlertingPolicy) Icon() string
- func (g *GetAlertingPolicy) Label() string
- func (g *GetAlertingPolicy) Name() string
- func (g *GetAlertingPolicy) OutputChannels(configuration any) []core.OutputChannel
- func (g *GetAlertingPolicy) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (g *GetAlertingPolicy) Setup(ctx core.SetupContext) error
- type GetAlertingPolicySpec
- type GetSnooze
- func (g *GetSnooze) Cancel(ctx core.ExecutionContext) error
- func (g *GetSnooze) Cleanup(ctx core.SetupContext) error
- func (g *GetSnooze) Color() string
- func (g *GetSnooze) Configuration() []configuration.Field
- func (g *GetSnooze) Description() string
- func (g *GetSnooze) Documentation() string
- func (g *GetSnooze) ExampleOutput() map[string]any
- func (g *GetSnooze) Execute(ctx core.ExecutionContext) error
- func (g *GetSnooze) HandleHook(ctx core.ActionHookContext) error
- func (g *GetSnooze) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (g *GetSnooze) Hooks() []core.Hook
- func (g *GetSnooze) Icon() string
- func (g *GetSnooze) Label() string
- func (g *GetSnooze) Name() string
- func (g *GetSnooze) OutputChannels(configuration any) []core.OutputChannel
- func (g *GetSnooze) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (g *GetSnooze) Setup(ctx core.SetupContext) error
- type GetSnoozeSpec
- type KeyValueSpec
- type OnAlert
- func (t *OnAlert) Cleanup(ctx core.TriggerContext) error
- func (t *OnAlert) Color() string
- func (t *OnAlert) Configuration() []configuration.Field
- func (t *OnAlert) Description() string
- func (t *OnAlert) Documentation() string
- func (t *OnAlert) ExampleData() map[string]any
- func (t *OnAlert) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)
- func (t *OnAlert) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (t *OnAlert) Hooks() []core.Hook
- func (t *OnAlert) Icon() string
- func (t *OnAlert) Label() string
- func (t *OnAlert) Name() string
- func (t *OnAlert) Setup(ctx core.TriggerContext) error
- type OnAlertConfiguration
- type OnAlertMetadata
- type PromQLSpec
- type SnoozeNodeMetadata
- type UpdateAlertingPolicy
- func (u *UpdateAlertingPolicy) Cancel(ctx core.ExecutionContext) error
- func (u *UpdateAlertingPolicy) Cleanup(ctx core.SetupContext) error
- func (u *UpdateAlertingPolicy) Color() string
- func (u *UpdateAlertingPolicy) Configuration() []configuration.Field
- func (u *UpdateAlertingPolicy) Description() string
- func (u *UpdateAlertingPolicy) Documentation() string
- func (u *UpdateAlertingPolicy) ExampleOutput() map[string]any
- func (u *UpdateAlertingPolicy) Execute(ctx core.ExecutionContext) error
- func (u *UpdateAlertingPolicy) HandleHook(ctx core.ActionHookContext) error
- func (u *UpdateAlertingPolicy) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (u *UpdateAlertingPolicy) Hooks() []core.Hook
- func (u *UpdateAlertingPolicy) Icon() string
- func (u *UpdateAlertingPolicy) Label() string
- func (u *UpdateAlertingPolicy) Name() string
- func (u *UpdateAlertingPolicy) OutputChannels(configuration any) []core.OutputChannel
- func (u *UpdateAlertingPolicy) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (u *UpdateAlertingPolicy) Setup(ctx core.SetupContext) error
- type UpdateAlertingPolicySpec
Constants ¶
const ( ResourceTypeAlertPolicy = "alertPolicy" ResourceTypeNotificationChannel = "notificationChannel" ResourceTypeSnooze = "snooze" )
const AlertPayloadType = "gcp.monitoring.alert"
AlertPayloadType is the event type emitted for each matching incident.
Variables ¶
This section is empty.
Functions ¶
func ListAlertingPolicyResources ¶
ListAlertingPolicyResources lists the alert policies in the project, keyed by resource name so the Get/Delete/Update components can target one directly.
func ListNotificationChannelResources ¶
func ListNotificationChannelResources(ctx context.Context, c Client) ([]core.IntegrationResource, error)
ListNotificationChannelResources lists the notification channels in the project so they can be attached to a policy.
func ListSnoozeResources ¶ added in v0.26.0
ListSnoozeResources lists the snoozes in the project so the Get/Expire components can target one directly.
func SetClientFactory ¶
func SetClientFactory(fn func(httpCtx core.HTTPContext, integration core.IntegrationContext) (Client, error))
Types ¶
type AlertPolicyNodeMetadata ¶
type AlertPolicyNodeMetadata struct {
PolicyName string `json:"policyName" mapstructure:"policyName"`
DisplayName string `json:"displayName" mapstructure:"displayName"`
ID string `json:"id" mapstructure:"id"`
}
AlertPolicyNodeMetadata is stored on the node at Setup so the collapsed UI can show the policy's human-readable display name instead of its numeric ID.
type Client ¶
type Client interface {
GetURL(ctx context.Context, fullURL string) ([]byte, error)
PostURL(ctx context.Context, fullURL string, body any) ([]byte, error)
PatchURL(ctx context.Context, fullURL string, body any) ([]byte, error)
DeleteURL(ctx context.Context, fullURL string) ([]byte, error)
ProjectID() string
}
Client is the interface used by Cloud Monitoring components to call the API. Alert policies live on monitoring.googleapis.com (a different host than Compute), so every call uses the fully-qualified *URL helpers.
type ConditionSpec ¶
type ConditionSpec struct {
MetricType string `mapstructure:"metricType"`
Comparison string `mapstructure:"comparison"`
Threshold *float64 `mapstructure:"threshold"`
Duration string `mapstructure:"duration"`
Aligner string `mapstructure:"aligner"`
AlignmentPeriod string `mapstructure:"alignmentPeriod"`
CrossSeriesReducer string `mapstructure:"crossSeriesReducer"`
GroupByFields []string `mapstructure:"groupByFields"`
TriggerType string `mapstructure:"triggerType"`
TriggerValue *float64 `mapstructure:"triggerValue"`
}
ConditionSpec is one threshold condition within an alerting policy.
type CreateAlertingPolicy ¶
type CreateAlertingPolicy struct{}
func (*CreateAlertingPolicy) Cancel ¶
func (c *CreateAlertingPolicy) Cancel(ctx core.ExecutionContext) error
func (*CreateAlertingPolicy) Cleanup ¶
func (c *CreateAlertingPolicy) Cleanup(ctx core.SetupContext) error
func (*CreateAlertingPolicy) Color ¶
func (c *CreateAlertingPolicy) Color() string
func (*CreateAlertingPolicy) Configuration ¶
func (c *CreateAlertingPolicy) Configuration() []configuration.Field
func (*CreateAlertingPolicy) Description ¶
func (c *CreateAlertingPolicy) Description() string
func (*CreateAlertingPolicy) Documentation ¶
func (c *CreateAlertingPolicy) Documentation() string
func (*CreateAlertingPolicy) ExampleOutput ¶
func (c *CreateAlertingPolicy) ExampleOutput() map[string]any
func (*CreateAlertingPolicy) Execute ¶
func (c *CreateAlertingPolicy) Execute(ctx core.ExecutionContext) error
func (*CreateAlertingPolicy) HandleHook ¶
func (c *CreateAlertingPolicy) HandleHook(ctx core.ActionHookContext) error
func (*CreateAlertingPolicy) HandleWebhook ¶
func (c *CreateAlertingPolicy) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*CreateAlertingPolicy) Hooks ¶
func (c *CreateAlertingPolicy) Hooks() []core.Hook
func (*CreateAlertingPolicy) Icon ¶
func (c *CreateAlertingPolicy) Icon() string
func (*CreateAlertingPolicy) Label ¶
func (c *CreateAlertingPolicy) Label() string
func (*CreateAlertingPolicy) Name ¶
func (c *CreateAlertingPolicy) Name() string
func (*CreateAlertingPolicy) OutputChannels ¶
func (c *CreateAlertingPolicy) OutputChannels(configuration any) []core.OutputChannel
func (*CreateAlertingPolicy) ProcessQueueItem ¶
func (c *CreateAlertingPolicy) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*CreateAlertingPolicy) Setup ¶
func (c *CreateAlertingPolicy) Setup(ctx core.SetupContext) error
type CreateAlertingPolicySpec ¶
type CreateAlertingPolicySpec struct {
DisplayName string `mapstructure:"displayName"`
PromQL PromQLSpec `mapstructure:",squash"`
Conditions []ConditionSpec `mapstructure:"conditions"`
Combiner string `mapstructure:"combiner"`
Severity string `mapstructure:"severity"`
NotificationChannels []string `mapstructure:"notificationChannels"`
UserLabels []KeyValueSpec `mapstructure:"userLabels"`
Enabled *bool `mapstructure:"enabled"`
AutoClose string `mapstructure:"autoClose"`
NotificationRateLimit string `mapstructure:"notificationRateLimit"`
Documentation string `mapstructure:"documentation"`
DocumentationSubject string `mapstructure:"documentationSubject"`
}
type CreateSnooze ¶ added in v0.26.0
type CreateSnooze struct{}
func (*CreateSnooze) Cancel ¶ added in v0.26.0
func (c *CreateSnooze) Cancel(ctx core.ExecutionContext) error
func (*CreateSnooze) Cleanup ¶ added in v0.26.0
func (c *CreateSnooze) Cleanup(ctx core.SetupContext) error
func (*CreateSnooze) Color ¶ added in v0.26.0
func (c *CreateSnooze) Color() string
func (*CreateSnooze) Configuration ¶ added in v0.26.0
func (c *CreateSnooze) Configuration() []configuration.Field
func (*CreateSnooze) Description ¶ added in v0.26.0
func (c *CreateSnooze) Description() string
func (*CreateSnooze) Documentation ¶ added in v0.26.0
func (c *CreateSnooze) Documentation() string
func (*CreateSnooze) ExampleOutput ¶ added in v0.26.0
func (c *CreateSnooze) ExampleOutput() map[string]any
func (*CreateSnooze) Execute ¶ added in v0.26.0
func (c *CreateSnooze) Execute(ctx core.ExecutionContext) error
func (*CreateSnooze) HandleHook ¶ added in v0.26.0
func (c *CreateSnooze) HandleHook(ctx core.ActionHookContext) error
func (*CreateSnooze) HandleWebhook ¶ added in v0.26.0
func (c *CreateSnooze) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*CreateSnooze) Hooks ¶ added in v0.26.0
func (c *CreateSnooze) Hooks() []core.Hook
func (*CreateSnooze) Icon ¶ added in v0.26.0
func (c *CreateSnooze) Icon() string
func (*CreateSnooze) Label ¶ added in v0.26.0
func (c *CreateSnooze) Label() string
func (*CreateSnooze) Name ¶ added in v0.26.0
func (c *CreateSnooze) Name() string
func (*CreateSnooze) OutputChannels ¶ added in v0.26.0
func (c *CreateSnooze) OutputChannels(configuration any) []core.OutputChannel
func (*CreateSnooze) ProcessQueueItem ¶ added in v0.26.0
func (c *CreateSnooze) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*CreateSnooze) Setup ¶ added in v0.26.0
func (c *CreateSnooze) Setup(ctx core.SetupContext) error
type CreateSnoozeSpec ¶ added in v0.26.0
type DeleteAlertingPolicy ¶
type DeleteAlertingPolicy struct{}
func (*DeleteAlertingPolicy) Cancel ¶
func (d *DeleteAlertingPolicy) Cancel(ctx core.ExecutionContext) error
func (*DeleteAlertingPolicy) Cleanup ¶
func (d *DeleteAlertingPolicy) Cleanup(ctx core.SetupContext) error
func (*DeleteAlertingPolicy) Color ¶
func (d *DeleteAlertingPolicy) Color() string
func (*DeleteAlertingPolicy) Configuration ¶
func (d *DeleteAlertingPolicy) Configuration() []configuration.Field
func (*DeleteAlertingPolicy) Description ¶
func (d *DeleteAlertingPolicy) Description() string
func (*DeleteAlertingPolicy) Documentation ¶
func (d *DeleteAlertingPolicy) Documentation() string
func (*DeleteAlertingPolicy) ExampleOutput ¶
func (d *DeleteAlertingPolicy) ExampleOutput() map[string]any
func (*DeleteAlertingPolicy) Execute ¶
func (d *DeleteAlertingPolicy) Execute(ctx core.ExecutionContext) error
func (*DeleteAlertingPolicy) HandleHook ¶
func (d *DeleteAlertingPolicy) HandleHook(ctx core.ActionHookContext) error
func (*DeleteAlertingPolicy) HandleWebhook ¶
func (d *DeleteAlertingPolicy) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*DeleteAlertingPolicy) Hooks ¶
func (d *DeleteAlertingPolicy) Hooks() []core.Hook
func (*DeleteAlertingPolicy) Icon ¶
func (d *DeleteAlertingPolicy) Icon() string
func (*DeleteAlertingPolicy) Label ¶
func (d *DeleteAlertingPolicy) Label() string
func (*DeleteAlertingPolicy) Name ¶
func (d *DeleteAlertingPolicy) Name() string
func (*DeleteAlertingPolicy) OutputChannels ¶
func (d *DeleteAlertingPolicy) OutputChannels(configuration any) []core.OutputChannel
func (*DeleteAlertingPolicy) ProcessQueueItem ¶
func (d *DeleteAlertingPolicy) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*DeleteAlertingPolicy) Setup ¶
func (d *DeleteAlertingPolicy) Setup(ctx core.SetupContext) error
type DeleteAlertingPolicySpec ¶
type DeleteAlertingPolicySpec struct {
AlertPolicy string `mapstructure:"alertPolicy"`
}
type ExpireSnooze ¶ added in v0.26.0
type ExpireSnooze struct{}
func (*ExpireSnooze) Cancel ¶ added in v0.26.0
func (e *ExpireSnooze) Cancel(ctx core.ExecutionContext) error
func (*ExpireSnooze) Cleanup ¶ added in v0.26.0
func (e *ExpireSnooze) Cleanup(ctx core.SetupContext) error
func (*ExpireSnooze) Color ¶ added in v0.26.0
func (e *ExpireSnooze) Color() string
func (*ExpireSnooze) Configuration ¶ added in v0.26.0
func (e *ExpireSnooze) Configuration() []configuration.Field
func (*ExpireSnooze) Description ¶ added in v0.26.0
func (e *ExpireSnooze) Description() string
func (*ExpireSnooze) Documentation ¶ added in v0.26.0
func (e *ExpireSnooze) Documentation() string
func (*ExpireSnooze) ExampleOutput ¶ added in v0.26.0
func (e *ExpireSnooze) ExampleOutput() map[string]any
func (*ExpireSnooze) Execute ¶ added in v0.26.0
func (e *ExpireSnooze) Execute(ctx core.ExecutionContext) error
func (*ExpireSnooze) HandleHook ¶ added in v0.26.0
func (e *ExpireSnooze) HandleHook(ctx core.ActionHookContext) error
func (*ExpireSnooze) HandleWebhook ¶ added in v0.26.0
func (e *ExpireSnooze) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*ExpireSnooze) Hooks ¶ added in v0.26.0
func (e *ExpireSnooze) Hooks() []core.Hook
func (*ExpireSnooze) Icon ¶ added in v0.26.0
func (e *ExpireSnooze) Icon() string
func (*ExpireSnooze) Label ¶ added in v0.26.0
func (e *ExpireSnooze) Label() string
func (*ExpireSnooze) Name ¶ added in v0.26.0
func (e *ExpireSnooze) Name() string
func (*ExpireSnooze) OutputChannels ¶ added in v0.26.0
func (e *ExpireSnooze) OutputChannels(configuration any) []core.OutputChannel
func (*ExpireSnooze) ProcessQueueItem ¶ added in v0.26.0
func (e *ExpireSnooze) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*ExpireSnooze) Setup ¶ added in v0.26.0
func (e *ExpireSnooze) Setup(ctx core.SetupContext) error
type ExpireSnoozeSpec ¶ added in v0.26.0
type ExpireSnoozeSpec struct {
Snooze string `mapstructure:"snooze"`
}
type GetAlertingPolicy ¶
type GetAlertingPolicy struct{}
func (*GetAlertingPolicy) Cancel ¶
func (g *GetAlertingPolicy) Cancel(ctx core.ExecutionContext) error
func (*GetAlertingPolicy) Cleanup ¶
func (g *GetAlertingPolicy) Cleanup(ctx core.SetupContext) error
func (*GetAlertingPolicy) Color ¶
func (g *GetAlertingPolicy) Color() string
func (*GetAlertingPolicy) Configuration ¶
func (g *GetAlertingPolicy) Configuration() []configuration.Field
func (*GetAlertingPolicy) Description ¶
func (g *GetAlertingPolicy) Description() string
func (*GetAlertingPolicy) Documentation ¶
func (g *GetAlertingPolicy) Documentation() string
func (*GetAlertingPolicy) ExampleOutput ¶
func (g *GetAlertingPolicy) ExampleOutput() map[string]any
func (*GetAlertingPolicy) Execute ¶
func (g *GetAlertingPolicy) Execute(ctx core.ExecutionContext) error
func (*GetAlertingPolicy) HandleHook ¶
func (g *GetAlertingPolicy) HandleHook(ctx core.ActionHookContext) error
func (*GetAlertingPolicy) HandleWebhook ¶
func (g *GetAlertingPolicy) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*GetAlertingPolicy) Hooks ¶
func (g *GetAlertingPolicy) Hooks() []core.Hook
func (*GetAlertingPolicy) Icon ¶
func (g *GetAlertingPolicy) Icon() string
func (*GetAlertingPolicy) Label ¶
func (g *GetAlertingPolicy) Label() string
func (*GetAlertingPolicy) Name ¶
func (g *GetAlertingPolicy) Name() string
func (*GetAlertingPolicy) OutputChannels ¶
func (g *GetAlertingPolicy) OutputChannels(configuration any) []core.OutputChannel
func (*GetAlertingPolicy) ProcessQueueItem ¶
func (g *GetAlertingPolicy) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*GetAlertingPolicy) Setup ¶
func (g *GetAlertingPolicy) Setup(ctx core.SetupContext) error
type GetAlertingPolicySpec ¶
type GetAlertingPolicySpec struct {
AlertPolicy string `mapstructure:"alertPolicy"`
}
type GetSnooze ¶ added in v0.26.0
type GetSnooze struct{}
func (*GetSnooze) Cancel ¶ added in v0.26.0
func (g *GetSnooze) Cancel(ctx core.ExecutionContext) error
func (*GetSnooze) Cleanup ¶ added in v0.26.0
func (g *GetSnooze) Cleanup(ctx core.SetupContext) error
func (*GetSnooze) Configuration ¶ added in v0.26.0
func (g *GetSnooze) Configuration() []configuration.Field
func (*GetSnooze) Description ¶ added in v0.26.0
func (*GetSnooze) Documentation ¶ added in v0.26.0
func (*GetSnooze) ExampleOutput ¶ added in v0.26.0
func (*GetSnooze) Execute ¶ added in v0.26.0
func (g *GetSnooze) Execute(ctx core.ExecutionContext) error
func (*GetSnooze) HandleHook ¶ added in v0.26.0
func (g *GetSnooze) HandleHook(ctx core.ActionHookContext) error
func (*GetSnooze) HandleWebhook ¶ added in v0.26.0
func (g *GetSnooze) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*GetSnooze) OutputChannels ¶ added in v0.26.0
func (g *GetSnooze) OutputChannels(configuration any) []core.OutputChannel
func (*GetSnooze) ProcessQueueItem ¶ added in v0.26.0
type GetSnoozeSpec ¶ added in v0.26.0
type GetSnoozeSpec struct {
Snooze string `mapstructure:"snooze"`
}
type KeyValueSpec ¶
KeyValueSpec is one user label (key/value pair).
type OnAlert ¶ added in v0.26.0
type OnAlert struct{}
func (*OnAlert) Configuration ¶ added in v0.26.0
func (t *OnAlert) Configuration() []configuration.Field
func (*OnAlert) Description ¶ added in v0.26.0
func (*OnAlert) Documentation ¶ added in v0.26.0
func (*OnAlert) ExampleData ¶ added in v0.26.0
func (*OnAlert) HandleHook ¶ added in v0.26.0
func (*OnAlert) HandleWebhook ¶ added in v0.26.0
func (t *OnAlert) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
type OnAlertConfiguration ¶ added in v0.26.0
type OnAlertConfiguration struct {
States []string `json:"states" mapstructure:"states"`
}
type OnAlertMetadata ¶ added in v0.26.0
type PromQLSpec ¶ added in v0.26.0
type PromQLSpec struct {
ConditionKind string `mapstructure:"conditionKind"`
Query string `mapstructure:"promqlQuery"`
Duration string `mapstructure:"promqlDuration"`
EvaluationInterval string `mapstructure:"promqlEvaluationInterval"`
}
PromQLSpec holds the PromQL-condition inputs (used when conditionKind=promql).
type SnoozeNodeMetadata ¶ added in v0.26.0
type SnoozeNodeMetadata struct {
SnoozeName string `json:"snoozeName" mapstructure:"snoozeName"`
DisplayName string `json:"displayName" mapstructure:"displayName"`
ID string `json:"id" mapstructure:"id"`
}
SnoozeNodeMetadata is stored on the node at Setup so the collapsed UI can show the snooze's human-readable display name instead of its numeric ID.
type UpdateAlertingPolicy ¶
type UpdateAlertingPolicy struct{}
func (*UpdateAlertingPolicy) Cancel ¶
func (u *UpdateAlertingPolicy) Cancel(ctx core.ExecutionContext) error
func (*UpdateAlertingPolicy) Cleanup ¶
func (u *UpdateAlertingPolicy) Cleanup(ctx core.SetupContext) error
func (*UpdateAlertingPolicy) Color ¶
func (u *UpdateAlertingPolicy) Color() string
func (*UpdateAlertingPolicy) Configuration ¶
func (u *UpdateAlertingPolicy) Configuration() []configuration.Field
func (*UpdateAlertingPolicy) Description ¶
func (u *UpdateAlertingPolicy) Description() string
func (*UpdateAlertingPolicy) Documentation ¶
func (u *UpdateAlertingPolicy) Documentation() string
func (*UpdateAlertingPolicy) ExampleOutput ¶
func (u *UpdateAlertingPolicy) ExampleOutput() map[string]any
func (*UpdateAlertingPolicy) Execute ¶
func (u *UpdateAlertingPolicy) Execute(ctx core.ExecutionContext) error
func (*UpdateAlertingPolicy) HandleHook ¶
func (u *UpdateAlertingPolicy) HandleHook(ctx core.ActionHookContext) error
func (*UpdateAlertingPolicy) HandleWebhook ¶
func (u *UpdateAlertingPolicy) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*UpdateAlertingPolicy) Hooks ¶
func (u *UpdateAlertingPolicy) Hooks() []core.Hook
func (*UpdateAlertingPolicy) Icon ¶
func (u *UpdateAlertingPolicy) Icon() string
func (*UpdateAlertingPolicy) Label ¶
func (u *UpdateAlertingPolicy) Label() string
func (*UpdateAlertingPolicy) Name ¶
func (u *UpdateAlertingPolicy) Name() string
func (*UpdateAlertingPolicy) OutputChannels ¶
func (u *UpdateAlertingPolicy) OutputChannels(configuration any) []core.OutputChannel
func (*UpdateAlertingPolicy) ProcessQueueItem ¶
func (u *UpdateAlertingPolicy) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*UpdateAlertingPolicy) Setup ¶
func (u *UpdateAlertingPolicy) Setup(ctx core.SetupContext) error
type UpdateAlertingPolicySpec ¶
type UpdateAlertingPolicySpec struct {
AlertPolicy string `mapstructure:"alertPolicy"`
DisplayName string `mapstructure:"displayName"`
PromQL PromQLSpec `mapstructure:",squash"`
Conditions []ConditionSpec `mapstructure:"conditions"`
Combiner string `mapstructure:"combiner"`
Severity string `mapstructure:"severity"`
NotificationChannels []string `mapstructure:"notificationChannels"`
UserLabels []KeyValueSpec `mapstructure:"userLabels"`
Enabled string `mapstructure:"enabled"`
AutoClose string `mapstructure:"autoClose"`
NotificationRateLimit string `mapstructure:"notificationRateLimit"`
Documentation string `mapstructure:"documentation"`
DocumentationSubject string `mapstructure:"documentationSubject"`
}