Documentation
¶
Index ¶
- Constants
- Variables
- func APIDNSSuffix(region string) string
- func AlarmConsoleURL(region, alarmName string) string
- func ConsoleHost(region string) string
- func EC2AutomationARN(region, action string) string
- func EncodeDimensions(dimensions []Dimension) (string, error)
- func FormatDimensions(dimensions []Dimension) string
- func ListAlarms(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
- func ListLogGroups(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
- func ListMetricDimensions(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
- func ListMetricNames(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
- func ListNamespaces(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
- func PartitionForRegion(region string) string
- type AddLogEvent
- func (c *AddLogEvent) Cancel(ctx core.ExecutionContext) error
- func (c *AddLogEvent) Cleanup(ctx core.SetupContext) error
- func (c *AddLogEvent) Color() string
- func (c *AddLogEvent) Configuration() []configuration.Field
- func (c *AddLogEvent) Description() string
- func (c *AddLogEvent) Documentation() string
- func (c *AddLogEvent) ExampleOutput() map[string]any
- func (c *AddLogEvent) Execute(ctx core.ExecutionContext) error
- func (c *AddLogEvent) HandleHook(ctx core.ActionHookContext) error
- func (c *AddLogEvent) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *AddLogEvent) Hooks() []core.Hook
- func (c *AddLogEvent) Icon() string
- func (c *AddLogEvent) Label() string
- func (c *AddLogEvent) Name() string
- func (c *AddLogEvent) OutputChannels(configuration any) []core.OutputChannel
- func (c *AddLogEvent) Setup(ctx core.SetupContext) error
- type AddLogEventConfiguration
- type AlarmState
- type AlarmStateChangeDetail
- type Client
- func (c *Client) DeleteAlarms(alarmNames ...string) error
- func (c *Client) DescribeAlarm(alarmName string) (*MetricAlarm, error)
- func (c *Client) ListAlarms() ([]MetricAlarm, error)
- func (c *Client) ListMetrics(namespace, metricName string) ([]Metric, error)
- func (c *Client) PutMetricAlarm(input PutMetricAlarmInput) error
- type CreateAlarm
- func (c *CreateAlarm) Cancel(_ core.ExecutionContext) error
- func (c *CreateAlarm) Cleanup(_ core.SetupContext) error
- func (c *CreateAlarm) Color() string
- func (c *CreateAlarm) Configuration() []configuration.Field
- func (c *CreateAlarm) Description() string
- func (c *CreateAlarm) Documentation() string
- func (c *CreateAlarm) ExampleOutput() map[string]any
- func (c *CreateAlarm) Execute(ctx core.ExecutionContext) error
- func (c *CreateAlarm) HandleHook(_ core.ActionHookContext) error
- func (c *CreateAlarm) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *CreateAlarm) Hooks() []core.Hook
- func (c *CreateAlarm) Icon() string
- func (c *CreateAlarm) Label() string
- func (c *CreateAlarm) Name() string
- func (c *CreateAlarm) OutputChannels(_ any) []core.OutputChannel
- func (c *CreateAlarm) Setup(ctx core.SetupContext) error
- type CreateAlarmConfiguration
- type CreateAlarmNodeMetadata
- type DeleteAlarm
- func (c *DeleteAlarm) Cancel(_ core.ExecutionContext) error
- func (c *DeleteAlarm) Cleanup(_ core.SetupContext) error
- func (c *DeleteAlarm) Color() string
- func (c *DeleteAlarm) Configuration() []configuration.Field
- func (c *DeleteAlarm) Description() string
- func (c *DeleteAlarm) Documentation() string
- func (c *DeleteAlarm) ExampleOutput() map[string]any
- func (c *DeleteAlarm) Execute(ctx core.ExecutionContext) error
- func (c *DeleteAlarm) HandleHook(_ core.ActionHookContext) error
- func (c *DeleteAlarm) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *DeleteAlarm) Hooks() []core.Hook
- func (c *DeleteAlarm) Icon() string
- func (c *DeleteAlarm) Label() string
- func (c *DeleteAlarm) Name() string
- func (c *DeleteAlarm) OutputChannels(_ any) []core.OutputChannel
- func (c *DeleteAlarm) Setup(ctx core.SetupContext) error
- type DeleteAlarmConfiguration
- type DeleteAlarmNodeMetadata
- type Dimension
- type GetAlarm
- func (c *GetAlarm) Cancel(_ core.ExecutionContext) error
- func (c *GetAlarm) Cleanup(_ core.SetupContext) error
- func (c *GetAlarm) Color() string
- func (c *GetAlarm) Configuration() []configuration.Field
- func (c *GetAlarm) Description() string
- func (c *GetAlarm) Documentation() string
- func (c *GetAlarm) ExampleOutput() map[string]any
- func (c *GetAlarm) Execute(ctx core.ExecutionContext) error
- func (c *GetAlarm) HandleHook(_ core.ActionHookContext) error
- func (c *GetAlarm) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *GetAlarm) Hooks() []core.Hook
- func (c *GetAlarm) Icon() string
- func (c *GetAlarm) Label() string
- func (c *GetAlarm) Name() string
- func (c *GetAlarm) OutputChannels(_ any) []core.OutputChannel
- func (c *GetAlarm) Setup(ctx core.SetupContext) error
- type GetAlarmConfiguration
- type GetAlarmNodeMetadata
- type LogEvent
- type LogGroup
- type LogsClient
- func (c *LogsClient) CreateLogStream(logGroupName, logStreamName string) error
- func (c *LogsClient) DescribeLogGroups(namePrefix string) ([]LogGroup, error)
- func (c *LogsClient) GetQueryResults(queryID string) (*QueryResults, error)
- func (c *LogsClient) PutLogEvents(logGroupName, logStreamName string, events []LogEvent) error
- func (c *LogsClient) StartQuery(input StartQueryInput) (string, error)
- func (c *LogsClient) StopQuery(queryID string) error
- type Metric
- type MetricAlarm
- type OnAlarm
- func (p *OnAlarm) Cleanup(ctx core.TriggerContext) error
- func (p *OnAlarm) Color() string
- func (p *OnAlarm) Configuration() []configuration.Field
- func (p *OnAlarm) Description() string
- func (p *OnAlarm) Documentation() string
- func (t *OnAlarm) ExampleData() map[string]any
- func (p *OnAlarm) HandleHook(ctx core.TriggerHookContext) (map[string]any, error)
- func (p *OnAlarm) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (p *OnAlarm) Hooks() []core.Hook
- func (p *OnAlarm) Icon() string
- func (p *OnAlarm) Label() string
- func (p *OnAlarm) Name() string
- func (p *OnAlarm) OnIntegrationMessage(ctx core.IntegrationMessageContext) error
- func (p *OnAlarm) Setup(ctx core.TriggerContext) error
- type OnAlarmConfiguration
- type OnAlarmMetadata
- type PutMetricAlarmInput
- type QueryLogs
- func (c *QueryLogs) Cancel(ctx core.ExecutionContext) error
- func (c *QueryLogs) Cleanup(ctx core.SetupContext) error
- func (c *QueryLogs) Color() string
- func (c *QueryLogs) Configuration() []configuration.Field
- func (c *QueryLogs) Description() string
- func (c *QueryLogs) Documentation() string
- func (c *QueryLogs) ExampleOutput() map[string]any
- func (c *QueryLogs) Execute(ctx core.ExecutionContext) error
- func (c *QueryLogs) HandleHook(ctx core.ActionHookContext) error
- func (c *QueryLogs) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *QueryLogs) Hooks() []core.Hook
- func (c *QueryLogs) Icon() string
- func (c *QueryLogs) Label() string
- func (c *QueryLogs) Name() string
- func (c *QueryLogs) OutputChannels(configuration any) []core.OutputChannel
- func (c *QueryLogs) Setup(ctx core.SetupContext) error
- type QueryLogsConfiguration
- type QueryLogsExecutionMetadata
- type QueryResults
- type QueryStatistics
- type ResultField
- type StartQueryInput
- type ThresholdCondition
- type UpdateAlarm
- func (c *UpdateAlarm) Cancel(_ core.ExecutionContext) error
- func (c *UpdateAlarm) Cleanup(_ core.SetupContext) error
- func (c *UpdateAlarm) Color() string
- func (c *UpdateAlarm) Configuration() []configuration.Field
- func (c *UpdateAlarm) Description() string
- func (c *UpdateAlarm) Documentation() string
- func (c *UpdateAlarm) ExampleOutput() map[string]any
- func (c *UpdateAlarm) Execute(ctx core.ExecutionContext) error
- func (c *UpdateAlarm) HandleHook(_ core.ActionHookContext) error
- func (c *UpdateAlarm) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *UpdateAlarm) Hooks() []core.Hook
- func (c *UpdateAlarm) Icon() string
- func (c *UpdateAlarm) Label() string
- func (c *UpdateAlarm) Name() string
- func (c *UpdateAlarm) OutputChannels(_ any) []core.OutputChannel
- func (c *UpdateAlarm) Setup(ctx core.SetupContext) error
- type UpdateAlarmConfiguration
- type UpdateAlarmNodeMetadata
Constants ¶
const ( AlarmStateOK = "OK" AlarmStateAlarm = "ALARM" AlarmStateInsufficientData = "INSUFFICIENT_DATA" )
const ( CreateAlarmPayloadType = "aws.cloudwatch.alarm" UpdateAlarmPayloadType = "aws.cloudwatch.alarm" GetAlarmPayloadType = "aws.cloudwatch.alarm" DeleteAlarmPayloadType = "aws.cloudwatch.alarm.deleted" )
const ( Source = "aws.cloudwatch" DetailTypeAlarmStateChange = "CloudWatch Alarm State Change" )
const AddLogEventPayloadType = "aws.cloudwatch.logEvent"
const (
QueryLogsPayloadType = "aws.cloudwatch.queryResult"
)
const (
StatisticAverage = "Average"
)
const UnitUnsetValue = "unset"
UnitUnsetValue removes an alarm's unit. CloudWatch has no "no unit" unit — omitting the parameter is what clears it — but a select cannot submit a blank value, so the option carries this sentinel and the components map it to empty. Note this is distinct from the real "None" unit, which still filters datapoints.
Variables ¶
var AlarmComparisonOperatorOptions = []configuration.FieldOption{
{Label: "Greater Than Threshold", Value: "GreaterThanThreshold"},
{Label: "Greater Than Or Equal To Threshold", Value: "GreaterThanOrEqualToThreshold"},
{Label: "Less Than Threshold", Value: "LessThanThreshold"},
{Label: "Less Than Or Equal To Threshold", Value: "LessThanOrEqualToThreshold"},
}
var AlarmEC2ActionOptions = []configuration.FieldOption{
{Label: "Recover", Value: "recover"},
{Label: "Reboot", Value: "reboot"},
{Label: "Stop", Value: "stop"},
{Label: "Terminate", Value: "terminate"},
}
AlarmEC2ActionOptions are the EC2 automations CloudWatch can run itself when an alarm fires. Each value maps to arn:aws:automate:<region>:ec2:<value>.
var AlarmStatisticOptions = []configuration.FieldOption{ {Label: "Average", Value: StatisticAverage}, {Label: "Sum", Value: "Sum"}, {Label: "Minimum", Value: "Minimum"}, {Label: "Maximum", Value: "Maximum"}, {Label: "Sample Count", Value: "SampleCount"}, }
var AlarmTreatMissingDataOptions = []configuration.FieldOption{
{Label: "Missing", Value: "missing"},
{Label: "Ignore", Value: "ignore"},
{Label: "Breaching", Value: "breaching"},
{Label: "Not Breaching", Value: "notBreaching"},
}
var AlarmUnitClearOption = configuration.FieldOption{ Label: "No unit", Value: UnitUnsetValue, Description: "Remove the unit so the alarm matches datapoints of any unit", }
AlarmUnitClearOption lets an update remove a unit that matches no datapoints.
var AlarmUnitOptions = []configuration.FieldOption{
{Label: "None", Value: "None", Description: "The literal None unit, not the absence of one"},
{Label: "Percent", Value: "Percent"},
{Label: "Count", Value: "Count"},
{Label: "Count/Second", Value: "Count/Second"},
{Label: "Seconds", Value: "Seconds"},
{Label: "Microseconds", Value: "Microseconds"},
{Label: "Milliseconds", Value: "Milliseconds"},
{Label: "Bytes", Value: "Bytes"},
{Label: "Kilobytes", Value: "Kilobytes"},
{Label: "Megabytes", Value: "Megabytes"},
{Label: "Gigabytes", Value: "Gigabytes"},
{Label: "Terabytes", Value: "Terabytes"},
{Label: "Bits", Value: "Bits"},
{Label: "Kilobits", Value: "Kilobits"},
{Label: "Megabits", Value: "Megabits"},
{Label: "Gigabits", Value: "Gigabits"},
{Label: "Terabits", Value: "Terabits"},
{Label: "Bytes/Second", Value: "Bytes/Second"},
{Label: "Kilobytes/Second", Value: "Kilobytes/Second"},
{Label: "Megabytes/Second", Value: "Megabytes/Second"},
{Label: "Gigabytes/Second", Value: "Gigabytes/Second"},
{Label: "Terabytes/Second", Value: "Terabytes/Second"},
{Label: "Bits/Second", Value: "Bits/Second"},
{Label: "Kilobits/Second", Value: "Kilobits/Second"},
{Label: "Megabits/Second", Value: "Megabits/Second"},
{Label: "Gigabits/Second", Value: "Gigabits/Second"},
{Label: "Terabits/Second", Value: "Terabits/Second"},
}
AlarmUnitOptions are the metric units accepted by PutMetricAlarm.
var AllAlarmStates = []configuration.FieldOption{ { Label: "OK", Value: AlarmStateOK, }, { Label: "ALARM", Value: AlarmStateAlarm, }, { Label: "INSUFFICIENT_DATA", Value: AlarmStateInsufficientData, }, }
Functions ¶
func APIDNSSuffix ¶
APIDNSSuffix returns the domain AWS service endpoints hang off in a region. GovCloud shares the default suffix; only China differs.
func AlarmConsoleURL ¶
AlarmConsoleURL builds the CloudWatch console link for an alarm.
func ConsoleHost ¶
ConsoleHost returns the AWS console host serving a region.
func EC2AutomationARN ¶
EC2AutomationARN builds the ARN for an EC2 automation action.
func EncodeDimensions ¶
EncodeDimensions serializes a dimension set into the value stored in the component configuration. JSON keeps values with separators unambiguous.
func FormatDimensions ¶
func ListAlarms ¶
func ListAlarms(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
func ListLogGroups ¶
func ListLogGroups(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
func ListMetricDimensions ¶
func ListMetricDimensions(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
ListMetricDimensions lists the dimension sets a metric is published with. A metric is identified by its namespace, name and full dimension set, so each resource carries the whole set, JSON-encoded.
func ListMetricNames ¶
func ListMetricNames(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
func ListNamespaces ¶
func ListNamespaces(ctx core.ListResourcesContext, resourceType string) ([]core.IntegrationResource, error)
func PartitionForRegion ¶
PartitionForRegion returns the ARN partition a region belongs to.
Types ¶
type AddLogEvent ¶
type AddLogEvent struct{}
func (*AddLogEvent) Cancel ¶
func (c *AddLogEvent) Cancel(ctx core.ExecutionContext) error
func (*AddLogEvent) Cleanup ¶
func (c *AddLogEvent) Cleanup(ctx core.SetupContext) error
func (*AddLogEvent) Color ¶
func (c *AddLogEvent) Color() string
func (*AddLogEvent) Configuration ¶
func (c *AddLogEvent) Configuration() []configuration.Field
func (*AddLogEvent) Description ¶
func (c *AddLogEvent) Description() string
func (*AddLogEvent) Documentation ¶
func (c *AddLogEvent) Documentation() string
func (*AddLogEvent) ExampleOutput ¶
func (c *AddLogEvent) ExampleOutput() map[string]any
func (*AddLogEvent) Execute ¶
func (c *AddLogEvent) Execute(ctx core.ExecutionContext) error
func (*AddLogEvent) HandleHook ¶
func (c *AddLogEvent) HandleHook(ctx core.ActionHookContext) error
func (*AddLogEvent) HandleWebhook ¶
func (c *AddLogEvent) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*AddLogEvent) Hooks ¶
func (c *AddLogEvent) Hooks() []core.Hook
func (*AddLogEvent) Icon ¶
func (c *AddLogEvent) Icon() string
func (*AddLogEvent) Label ¶
func (c *AddLogEvent) Label() string
func (*AddLogEvent) Name ¶
func (c *AddLogEvent) Name() string
func (*AddLogEvent) OutputChannels ¶
func (c *AddLogEvent) OutputChannels(configuration any) []core.OutputChannel
func (*AddLogEvent) Setup ¶
func (c *AddLogEvent) Setup(ctx core.SetupContext) error
type AddLogEventConfiguration ¶
type AddLogEventConfiguration struct {
Region string `json:"region" mapstructure:"region"`
LogGroup string `json:"logGroup" mapstructure:"logGroup"`
LogStream string `json:"logStream" mapstructure:"logStream"`
Message string `json:"message" mapstructure:"message"`
Timestamp string `json:"timestamp" mapstructure:"timestamp"`
Timezone string `json:"timezone" mapstructure:"timezone"`
}
type AlarmState ¶
type AlarmStateChangeDetail ¶
type AlarmStateChangeDetail struct {
AlarmName string `json:"alarmName" mapstructure:"alarmName"`
State AlarmState `json:"state" mapstructure:"state"`
PreviousState AlarmState `json:"previousState" mapstructure:"previousState"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides CloudWatch alarm and metric operations through signed HTTP requests.
func NewClient ¶
func NewClient(httpCtx core.HTTPContext, credentials *aws.Credentials, region string) *Client
NewClient creates a region-scoped CloudWatch client.
func (*Client) DeleteAlarms ¶
DeleteAlarms removes the named alarms. CloudWatch accepts up to 100 per call and deletes none of them if any name is syntactically invalid.
func (*Client) DescribeAlarm ¶
func (c *Client) DescribeAlarm(alarmName string) (*MetricAlarm, error)
func (*Client) ListAlarms ¶
func (c *Client) ListAlarms() ([]MetricAlarm, error)
func (*Client) ListMetrics ¶
ListMetrics returns the metrics available in the region, optionally narrowed down to a namespace and a metric name.
func (*Client) PutMetricAlarm ¶
func (c *Client) PutMetricAlarm(input PutMetricAlarmInput) error
type CreateAlarm ¶
type CreateAlarm struct{}
func (*CreateAlarm) Cancel ¶
func (c *CreateAlarm) Cancel(_ core.ExecutionContext) error
func (*CreateAlarm) Cleanup ¶
func (c *CreateAlarm) Cleanup(_ core.SetupContext) error
func (*CreateAlarm) Color ¶
func (c *CreateAlarm) Color() string
func (*CreateAlarm) Configuration ¶
func (c *CreateAlarm) Configuration() []configuration.Field
func (*CreateAlarm) Description ¶
func (c *CreateAlarm) Description() string
func (*CreateAlarm) Documentation ¶
func (c *CreateAlarm) Documentation() string
func (*CreateAlarm) ExampleOutput ¶
func (c *CreateAlarm) ExampleOutput() map[string]any
func (*CreateAlarm) Execute ¶
func (c *CreateAlarm) Execute(ctx core.ExecutionContext) error
func (*CreateAlarm) HandleHook ¶
func (c *CreateAlarm) HandleHook(_ core.ActionHookContext) error
func (*CreateAlarm) HandleWebhook ¶
func (c *CreateAlarm) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*CreateAlarm) Hooks ¶
func (c *CreateAlarm) Hooks() []core.Hook
func (*CreateAlarm) Icon ¶
func (c *CreateAlarm) Icon() string
func (*CreateAlarm) Label ¶
func (c *CreateAlarm) Label() string
func (*CreateAlarm) Name ¶
func (c *CreateAlarm) Name() string
func (*CreateAlarm) OutputChannels ¶
func (c *CreateAlarm) OutputChannels(_ any) []core.OutputChannel
func (*CreateAlarm) Setup ¶
func (c *CreateAlarm) Setup(ctx core.SetupContext) error
type CreateAlarmConfiguration ¶
type CreateAlarmConfiguration struct {
Region string `json:"region" mapstructure:"region"`
AlarmName string `json:"alarmName" mapstructure:"alarmName"`
Namespace string `json:"namespace" mapstructure:"namespace"`
MetricName string `json:"metricName" mapstructure:"metricName"`
Dimensions string `json:"dimensions" mapstructure:"dimensions"`
Statistic string `json:"statistic" mapstructure:"statistic"`
ComparisonOperator string `json:"comparisonOperator" mapstructure:"comparisonOperator"`
Threshold float64 `json:"threshold" mapstructure:"threshold"`
Period int `json:"period" mapstructure:"period"`
EvaluationPeriods int `json:"evaluationPeriods" mapstructure:"evaluationPeriods"`
DatapointsToAlarm int `json:"datapointsToAlarm" mapstructure:"datapointsToAlarm"`
AlarmDescription string `json:"alarmDescription" mapstructure:"alarmDescription"`
TreatMissingData string `json:"treatMissingData" mapstructure:"treatMissingData"`
Unit string `json:"unit" mapstructure:"unit"`
ActionsEnabled bool `json:"actionsEnabled" mapstructure:"actionsEnabled"`
AlarmActions []string `json:"alarmActions" mapstructure:"alarmActions"`
EC2Action string `json:"ec2Action" mapstructure:"ec2Action"`
OKActions []string `json:"okActions" mapstructure:"okActions"`
InsufficientDataActions []string `json:"insufficientDataActions" mapstructure:"insufficientDataActions"`
}
type CreateAlarmNodeMetadata ¶
type CreateAlarmNodeMetadata struct {
Region string `json:"region" mapstructure:"region"`
AlarmName string `json:"alarmName" mapstructure:"alarmName"`
Namespace string `json:"namespace" mapstructure:"namespace"`
MetricName string `json:"metricName" mapstructure:"metricName"`
Dimensions string `json:"dimensions" mapstructure:"dimensions"`
}
type DeleteAlarm ¶
type DeleteAlarm struct{}
func (*DeleteAlarm) Cancel ¶
func (c *DeleteAlarm) Cancel(_ core.ExecutionContext) error
func (*DeleteAlarm) Cleanup ¶
func (c *DeleteAlarm) Cleanup(_ core.SetupContext) error
func (*DeleteAlarm) Color ¶
func (c *DeleteAlarm) Color() string
func (*DeleteAlarm) Configuration ¶
func (c *DeleteAlarm) Configuration() []configuration.Field
func (*DeleteAlarm) Description ¶
func (c *DeleteAlarm) Description() string
func (*DeleteAlarm) Documentation ¶
func (c *DeleteAlarm) Documentation() string
func (*DeleteAlarm) ExampleOutput ¶
func (c *DeleteAlarm) ExampleOutput() map[string]any
func (*DeleteAlarm) Execute ¶
func (c *DeleteAlarm) Execute(ctx core.ExecutionContext) error
func (*DeleteAlarm) HandleHook ¶
func (c *DeleteAlarm) HandleHook(_ core.ActionHookContext) error
func (*DeleteAlarm) HandleWebhook ¶
func (c *DeleteAlarm) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*DeleteAlarm) Hooks ¶
func (c *DeleteAlarm) Hooks() []core.Hook
func (*DeleteAlarm) Icon ¶
func (c *DeleteAlarm) Icon() string
func (*DeleteAlarm) Label ¶
func (c *DeleteAlarm) Label() string
func (*DeleteAlarm) Name ¶
func (c *DeleteAlarm) Name() string
func (*DeleteAlarm) OutputChannels ¶
func (c *DeleteAlarm) OutputChannels(_ any) []core.OutputChannel
func (*DeleteAlarm) Setup ¶
func (c *DeleteAlarm) Setup(ctx core.SetupContext) error
type DeleteAlarmNodeMetadata ¶
type Dimension ¶
type Dimension struct {
Name string `json:"name" mapstructure:"name"`
Value string `json:"value" mapstructure:"value"`
}
func DecodeDimensions ¶
type GetAlarm ¶
type GetAlarm struct{}
func (*GetAlarm) Configuration ¶
func (c *GetAlarm) Configuration() []configuration.Field
func (*GetAlarm) Description ¶
func (*GetAlarm) Documentation ¶
func (*GetAlarm) ExampleOutput ¶
func (*GetAlarm) HandleHook ¶
func (c *GetAlarm) HandleHook(_ core.ActionHookContext) error
func (*GetAlarm) HandleWebhook ¶
func (c *GetAlarm) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*GetAlarm) OutputChannels ¶
func (c *GetAlarm) OutputChannels(_ any) []core.OutputChannel
type GetAlarmConfiguration ¶
type GetAlarmNodeMetadata ¶
type LogsClient ¶
type LogsClient struct {
// contains filtered or unexported fields
}
LogsClient talks to the CloudWatch Logs API.
func NewLogsClient ¶
func NewLogsClient(httpCtx core.HTTPContext, credentials *aws.Credentials, region string) *LogsClient
func (*LogsClient) CreateLogStream ¶
func (c *LogsClient) CreateLogStream(logGroupName, logStreamName string) error
CreateLogStream creates a log stream in a log group. Callers should treat common.IsAlreadyExistsErr(err) as success since streams only need to exist once.
func (*LogsClient) DescribeLogGroups ¶
func (c *LogsClient) DescribeLogGroups(namePrefix string) ([]LogGroup, error)
DescribeLogGroups lists log groups whose name starts with namePrefix (all log groups when empty).
func (*LogsClient) GetQueryResults ¶
func (c *LogsClient) GetQueryResults(queryID string) (*QueryResults, error)
GetQueryResults retrieves the current status and rows for a Logs Insights query.
func (*LogsClient) PutLogEvents ¶
func (c *LogsClient) PutLogEvents(logGroupName, logStreamName string, events []LogEvent) error
PutLogEvents uploads a batch of log events to a log stream. Events must be in chronological order, per the CloudWatch Logs API contract.
func (*LogsClient) StartQuery ¶
func (c *LogsClient) StartQuery(input StartQueryInput) (string, error)
StartQuery starts a CloudWatch Logs Insights query and returns its query ID.
func (*LogsClient) StopQuery ¶
func (c *LogsClient) StopQuery(queryID string) error
StopQuery cancels a running Logs Insights query so it stops consuming the account's concurrent query quota.
type Metric ¶
type Metric struct {
Namespace string `json:"namespace" mapstructure:"namespace"`
MetricName string `json:"metricName" mapstructure:"metricName"`
Dimensions []Dimension `json:"dimensions" mapstructure:"dimensions"`
}
Metric identifies a CloudWatch metric: a namespace, a name and a dimension set.
type MetricAlarm ¶
type MetricAlarm struct {
AlarmName string `json:"alarmName" mapstructure:"alarmName"`
AlarmArn string `json:"alarmArn" mapstructure:"alarmArn"`
AlarmDescription string `json:"alarmDescription" mapstructure:"alarmDescription"`
AlarmConfigurationUpdatedTimestamp string `json:"alarmConfigurationUpdatedTimestamp" mapstructure:"alarmConfigurationUpdatedTimestamp"`
ActionsEnabled bool `json:"actionsEnabled" mapstructure:"actionsEnabled"`
Namespace string `json:"namespace" mapstructure:"namespace"`
MetricName string `json:"metricName" mapstructure:"metricName"`
Dimensions []Dimension `json:"dimensions" mapstructure:"dimensions"`
Statistic string `json:"statistic" mapstructure:"statistic"`
ExtendedStatistic string `json:"extendedStatistic" mapstructure:"extendedStatistic"`
Unit string `json:"unit" mapstructure:"unit"`
Period int `json:"period" mapstructure:"period"`
EvaluationPeriods int `json:"evaluationPeriods" mapstructure:"evaluationPeriods"`
DatapointsToAlarm int `json:"datapointsToAlarm" mapstructure:"datapointsToAlarm"`
Threshold float64 `json:"threshold" mapstructure:"threshold"`
ThresholdMetricID string `json:"thresholdMetricId" mapstructure:"thresholdMetricId"`
ComparisonOperator string `json:"comparisonOperator" mapstructure:"comparisonOperator"`
TreatMissingData string `json:"treatMissingData" mapstructure:"treatMissingData"`
EvaluateLowSampleCountPercentile string `json:"evaluateLowSampleCountPercentile" mapstructure:"evaluateLowSampleCountPercentile"`
StateValue string `json:"stateValue" mapstructure:"stateValue"`
StateReason string `json:"stateReason" mapstructure:"stateReason"`
StateReasonData string `json:"stateReasonData" mapstructure:"stateReasonData"`
StateUpdatedTimestamp string `json:"stateUpdatedTimestamp" mapstructure:"stateUpdatedTimestamp"`
StateTransitionedTimestamp string `json:"stateTransitionedTimestamp" mapstructure:"stateTransitionedTimestamp"`
AlarmActions []string `json:"alarmActions" mapstructure:"alarmActions"`
OKActions []string `json:"okActions" mapstructure:"okActions"`
InsufficientDataActions []string `json:"insufficientDataActions" mapstructure:"insufficientDataActions"`
Region string `json:"region" mapstructure:"region"`
ConsoleURL string `json:"consoleUrl" mapstructure:"consoleUrl"`
// HasMetricQueries marks an alarm defined by a Metrics array — metric math,
// anomaly detection or a Metrics Insights query. Those cannot be expressed
// with the single-metric fields, so they are never rewritten.
HasMetricQueries bool `json:"-" mapstructure:"-"`
}
type OnAlarm ¶
type OnAlarm struct{}
func (*OnAlarm) Configuration ¶
func (p *OnAlarm) Configuration() []configuration.Field
func (*OnAlarm) Description ¶
func (*OnAlarm) Documentation ¶
func (*OnAlarm) ExampleData ¶
func (*OnAlarm) HandleHook ¶ added in v0.18.0
func (*OnAlarm) HandleWebhook ¶
func (p *OnAlarm) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*OnAlarm) OnIntegrationMessage ¶
func (p *OnAlarm) OnIntegrationMessage(ctx core.IntegrationMessageContext) error
type OnAlarmConfiguration ¶
type OnAlarmConfiguration struct {
Region string `json:"region" mapstructure:"region"`
Alarms []configuration.Predicate `json:"alarms" mapstructure:"alarms"`
State string `json:"state" mapstructure:"state"`
}
type OnAlarmMetadata ¶
type PutMetricAlarmInput ¶
type PutMetricAlarmInput struct {
AlarmName string
AlarmDescription string
Namespace string
MetricName string
Dimensions []Dimension
Statistic string
ExtendedStatistic string
Unit string
Period int
EvaluationPeriods int
DatapointsToAlarm int
Threshold float64
ComparisonOperator string
TreatMissingData string
ActionsEnabled bool
// EvaluateLowSampleCountPercentile applies to percentile alarms only.
// It must be carried over on update, or CloudWatch resets it to its default.
EvaluateLowSampleCountPercentile string
// Action ARNs executed on each state transition. A nil slice clears the actions.
AlarmActions []string
OKActions []string
InsufficientDataActions []string
// IncludeAlarmDescription sends AlarmDescription even when empty, to clear an existing description.
IncludeAlarmDescription bool
}
PutMetricAlarmInput carries the full desired alarm state. CloudWatch replaces the whole alarm configuration on every PutMetricAlarm call, so callers updating an existing alarm must seed this from the current alarm.
type QueryLogs ¶
type QueryLogs struct{}
func (*QueryLogs) Configuration ¶
func (c *QueryLogs) Configuration() []configuration.Field
func (*QueryLogs) Description ¶
func (*QueryLogs) Documentation ¶
func (*QueryLogs) ExampleOutput ¶
func (*QueryLogs) HandleHook ¶
func (c *QueryLogs) HandleHook(ctx core.ActionHookContext) error
func (*QueryLogs) HandleWebhook ¶
func (c *QueryLogs) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*QueryLogs) OutputChannels ¶
func (c *QueryLogs) OutputChannels(configuration any) []core.OutputChannel
type QueryLogsConfiguration ¶
type QueryLogsConfiguration struct {
Region string `json:"region" mapstructure:"region"`
LogGroups []string `json:"logGroups" mapstructure:"logGroups"`
QueryString string `json:"queryString" mapstructure:"queryString"`
LookbackPeriod string `json:"lookbackPeriod" mapstructure:"lookbackPeriod"`
Limit int `json:"limit" mapstructure:"limit"`
}
type QueryLogsExecutionMetadata ¶
type QueryLogsExecutionMetadata struct {
QueryID string `json:"queryId" mapstructure:"queryId"`
Region string `json:"region" mapstructure:"region"`
LogGroups []string `json:"logGroups" mapstructure:"logGroups"`
QueryString string `json:"queryString" mapstructure:"queryString"`
Start string `json:"start" mapstructure:"start"`
End string `json:"end" mapstructure:"end"`
PollAttempts int `json:"pollAttempts" mapstructure:"pollAttempts"`
}
type QueryResults ¶
type QueryResults struct {
Status string `json:"status"`
Results [][]ResultField `json:"results"`
Statistics QueryStatistics `json:"statistics"`
}
type QueryStatistics ¶
type ResultField ¶
type StartQueryInput ¶
type ThresholdCondition ¶
type UpdateAlarm ¶
type UpdateAlarm struct{}
func (*UpdateAlarm) Cancel ¶
func (c *UpdateAlarm) Cancel(_ core.ExecutionContext) error
func (*UpdateAlarm) Cleanup ¶
func (c *UpdateAlarm) Cleanup(_ core.SetupContext) error
func (*UpdateAlarm) Color ¶
func (c *UpdateAlarm) Color() string
func (*UpdateAlarm) Configuration ¶
func (c *UpdateAlarm) Configuration() []configuration.Field
func (*UpdateAlarm) Description ¶
func (c *UpdateAlarm) Description() string
func (*UpdateAlarm) Documentation ¶
func (c *UpdateAlarm) Documentation() string
func (*UpdateAlarm) ExampleOutput ¶
func (c *UpdateAlarm) ExampleOutput() map[string]any
func (*UpdateAlarm) Execute ¶
func (c *UpdateAlarm) Execute(ctx core.ExecutionContext) error
func (*UpdateAlarm) HandleHook ¶
func (c *UpdateAlarm) HandleHook(_ core.ActionHookContext) error
func (*UpdateAlarm) HandleWebhook ¶
func (c *UpdateAlarm) HandleWebhook(_ core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*UpdateAlarm) Hooks ¶
func (c *UpdateAlarm) Hooks() []core.Hook
func (*UpdateAlarm) Icon ¶
func (c *UpdateAlarm) Icon() string
func (*UpdateAlarm) Label ¶
func (c *UpdateAlarm) Label() string
func (*UpdateAlarm) Name ¶
func (c *UpdateAlarm) Name() string
func (*UpdateAlarm) OutputChannels ¶
func (c *UpdateAlarm) OutputChannels(_ any) []core.OutputChannel
func (*UpdateAlarm) Setup ¶
func (c *UpdateAlarm) Setup(ctx core.SetupContext) error
type UpdateAlarmConfiguration ¶
type UpdateAlarmConfiguration struct {
Region string `json:"region" mapstructure:"region"`
AlarmName string `json:"alarm" mapstructure:"alarm"`
ThresholdCondition ThresholdCondition `json:"thresholdCondition" mapstructure:"thresholdCondition"`
Statistic string `json:"statistic" mapstructure:"statistic"`
Period int `json:"period" mapstructure:"period"`
EvaluationPeriods int `json:"evaluationPeriods" mapstructure:"evaluationPeriods"`
DatapointsToAlarm int `json:"datapointsToAlarm" mapstructure:"datapointsToAlarm"`
AlarmDescription string `json:"alarmDescription" mapstructure:"alarmDescription"`
TreatMissingData string `json:"treatMissingData" mapstructure:"treatMissingData"`
Unit string `json:"unit" mapstructure:"unit"`
ActionsEnabled string `json:"actionsEnabled" mapstructure:"actionsEnabled"`
AlarmActions []string `json:"alarmActions" mapstructure:"alarmActions"`
EC2Action string `json:"ec2Action" mapstructure:"ec2Action"`
OKActions []string `json:"okActions" mapstructure:"okActions"`
InsufficientDataActions []string `json:"insufficientDataActions" mapstructure:"insufficientDataActions"`
}