Documentation
¶
Overview ¶
Package azuremonitor provides an in-memory mock implementation of Azure Monitor.
Index ¶
- type Mock
- func (m *Mock) CreateAlarm(_ context.Context, cfg driver.AlarmConfig) error
- func (m *Mock) CreateNotificationChannel(_ context.Context, cfg driver.NotificationChannelConfig) (*driver.NotificationChannelInfo, error)
- func (m *Mock) DeleteAlarm(_ context.Context, name string) error
- func (m *Mock) DeleteNotificationChannel(_ context.Context, id string) error
- func (m *Mock) DescribeAlarms(_ context.Context, names []string) ([]driver.AlarmInfo, error)
- func (m *Mock) GetAlarmHistory(_ context.Context, alarmName string, limit int) ([]driver.AlarmHistoryEntry, error)
- func (m *Mock) GetMetricData(_ context.Context, input driver.GetMetricInput) (*driver.MetricDataResult, error)
- func (m *Mock) GetNotificationChannel(_ context.Context, id string) (*driver.NotificationChannelInfo, error)
- func (m *Mock) ListMetrics(_ context.Context, namespace string) ([]string, error)
- func (m *Mock) ListNotificationChannels(_ context.Context) ([]driver.NotificationChannelInfo, error)
- func (m *Mock) PutMetricData(_ context.Context, data []driver.MetricDatum) error
- func (m *Mock) SetAlarmState(_ context.Context, name, state, reason string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is an in-memory mock implementation of the Azure Monitor service.
func (*Mock) CreateAlarm ¶
CreateAlarm creates or updates a metric alert rule with the given configuration.
func (*Mock) CreateNotificationChannel ¶ added in v1.4.0
func (m *Mock) CreateNotificationChannel( _ context.Context, cfg driver.NotificationChannelConfig, ) (*driver.NotificationChannelInfo, error)
CreateNotificationChannel creates a new notification channel (action group) and returns its info.
func (*Mock) DeleteAlarm ¶
DeleteAlarm deletes the metric alert rule with the given name.
func (*Mock) DeleteNotificationChannel ¶ added in v1.4.0
DeleteNotificationChannel deletes the notification channel (action group) with the given ID.
func (*Mock) DescribeAlarms ¶
DescribeAlarms returns alarms matching the given names, or all alarms if names is empty.
func (*Mock) GetAlarmHistory ¶ added in v1.4.0
func (m *Mock) GetAlarmHistory(_ context.Context, alarmName string, limit int) ([]driver.AlarmHistoryEntry, error)
GetAlarmHistory returns alarm history entries filtered by alarm name, limited by limit.
func (*Mock) GetMetricData ¶
func (m *Mock) GetMetricData(_ context.Context, input driver.GetMetricInput) (*driver.MetricDataResult, error)
GetMetricData retrieves metric data for the given query, filtering by time range and computing the requested statistic.
func (*Mock) GetNotificationChannel ¶ added in v1.4.0
func (m *Mock) GetNotificationChannel(_ context.Context, id string) (*driver.NotificationChannelInfo, error)
GetNotificationChannel returns the notification channel (action group) with the given ID.
func (*Mock) ListMetrics ¶
ListMetrics returns unique metric names for the given namespace.
func (*Mock) ListNotificationChannels ¶ added in v1.4.0
func (m *Mock) ListNotificationChannels(_ context.Context) ([]driver.NotificationChannelInfo, error)
ListNotificationChannels returns all notification channels (action groups).
func (*Mock) PutMetricData ¶
PutMetricData stores metric data points and evaluates any matching alarms.