Documentation
¶
Overview ¶
nolint
nolint
nolint
nolint
nolint
nolint
nolint
nolint
nolint
Index ¶
- Constants
- type Contact
- type ContactList
- type ErrProvidedContactsForbidden
- type EventsList
- type MessageResponse
- type MetricsMaintenance
- type NotificationDeleteResponse
- type NotificationsList
- type NotifierState
- type PatternData
- type PatternList
- type SaveTriggerResponse
- type Subscription
- type SubscriptionList
- type TagStatistics
- type TagsData
- type TagsStatistics
- type ThrottlingResponse
- type Trigger
- type TriggerCheck
- type TriggerMaintenance
- type TriggerMetrics
- type TriggerModel
- type TriggersList
- type User
- type UserSettings
Constants ¶
View Source
const (
ErrorMessage = "" /* 168-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contact ¶
type ContactList ¶
type ContactList struct {
List []*moira.ContactData `json:"list"`
}
func (*ContactList) Render ¶
func (*ContactList) Render(w http.ResponseWriter, r *http.Request) error
type ErrProvidedContactsForbidden ¶
type ErrProvidedContactsForbidden struct {
// contains filtered or unexported fields
}
ErrProvidedContactsForbidden used when user try to save subscription with another users contacts
func (ErrProvidedContactsForbidden) Error ¶
func (err ErrProvidedContactsForbidden) Error() string
Error is implementation of golang error interface for ErrProvidedContactsForbidden struct
type EventsList ¶
type EventsList struct {
Page int64 `json:"page"`
Size int64 `json:"size"`
Total int64 `json:"total"`
List []moira.NotificationEvent `json:"list"`
}
func (*EventsList) Render ¶
func (*EventsList) Render(w http.ResponseWriter, r *http.Request) error
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message"`
}
func (*MessageResponse) Render ¶
func (*MessageResponse) Render(w http.ResponseWriter, r *http.Request) error
type MetricsMaintenance ¶
type NotificationDeleteResponse ¶
type NotificationDeleteResponse struct {
Result int64 `json:"result"`
}
func (*NotificationDeleteResponse) Render ¶
func (*NotificationDeleteResponse) Render(w http.ResponseWriter, r *http.Request) error
type NotificationsList ¶
type NotificationsList struct {
Total int64 `json:"total"`
List []*moira.ScheduledNotification `json:"list"`
}
func (*NotificationsList) Render ¶
func (*NotificationsList) Render(w http.ResponseWriter, r *http.Request) error
type NotifierState ¶
func (*NotifierState) Render ¶
func (*NotifierState) Render(w http.ResponseWriter, r *http.Request) error
type PatternData ¶
type PatternData struct {
Metrics []string `json:"metrics"`
Pattern string `json:"pattern"`
Triggers []TriggerModel `json:"triggers"`
}
type PatternList ¶
type PatternList struct {
List []PatternData `json:"list"`
}
func (*PatternList) Render ¶
func (*PatternList) Render(w http.ResponseWriter, r *http.Request) error
type SaveTriggerResponse ¶
func (*SaveTriggerResponse) Render ¶
func (*SaveTriggerResponse) Render(w http.ResponseWriter, r *http.Request) error
type Subscription ¶
type Subscription moira.SubscriptionData
func (*Subscription) Render ¶
func (*Subscription) Render(w http.ResponseWriter, r *http.Request) error
type SubscriptionList ¶
type SubscriptionList struct {
List []moira.SubscriptionData `json:"list"`
}
func (*SubscriptionList) Render ¶
func (*SubscriptionList) Render(w http.ResponseWriter, r *http.Request) error
type TagStatistics ¶
type TagStatistics struct {
TagName string `json:"name"`
Triggers []string `json:"triggers"`
Subscriptions []moira.SubscriptionData `json:"subscriptions"`
}
type TagsStatistics ¶
type TagsStatistics struct {
List []TagStatistics `json:"list"`
}
func (*TagsStatistics) Render ¶
func (*TagsStatistics) Render(w http.ResponseWriter, r *http.Request) error
type ThrottlingResponse ¶
type ThrottlingResponse struct {
Throttling int64 `json:"throttling"`
}
func (*ThrottlingResponse) Render ¶
func (*ThrottlingResponse) Render(w http.ResponseWriter, r *http.Request) error
type Trigger ¶
type Trigger struct {
TriggerModel
Throttling int64 `json:"throttling"`
}
type TriggerCheck ¶
func (*TriggerCheck) Render ¶
func (*TriggerCheck) Render(w http.ResponseWriter, r *http.Request) error
type TriggerMaintenance ¶
type TriggerMetrics ¶
type TriggerMetrics struct {
Main map[string][]*moira.MetricValue `json:"main"`
Additional map[string][]*moira.MetricValue `json:"additional,omitempty"`
}
func (*TriggerMetrics) Render ¶
func (*TriggerMetrics) Render(w http.ResponseWriter, r *http.Request) error
type TriggerModel ¶
type TriggerModel struct {
// Trigger unique ID
ID string `json:"id"`
// Trigger name
Name string `json:"name"`
// Description string
Desc *string `json:"desc,omitempty"`
// Graphite-like targets: t1, t2, ...
Targets []string `json:"targets"`
// WARN threshold
WarnValue *float64 `json:"warn_value"`
// ERROR threshold
ErrorValue *float64 `json:"error_value"`
// Could be: rising, falling, expression
TriggerType string `json:"trigger_type"`
// Set of tags to manipulate subscriptions
Tags []string `json:"tags"`
// When there are no metrics for trigger, Moira will switch metric to TTLState state after TTL seconds
TTLState *moira.TTLState `json:"ttl_state,omitempty"`
// When there are no metrics for trigger, Moira will switch metric to TTLState state after TTL seconds
TTL int64 `json:"ttl,omitempty"`
// Determines when Moira should monitor trigger
Schedule *moira.ScheduleData `json:"sched,omitempty"`
// Used if you need more complex logic than provided by WARN/ERROR values
Expression string `json:"expression"`
// Graphite patterns for trigger
Patterns []string `json:"patterns"`
// Shows if trigger is remote (graphite-backend) based or stored inside Moira-Redis DB
IsRemote bool `json:"is_remote"`
// If true, first event NODATA → OK will be omitted
MuteNewMetrics bool `json:"mute_new_metrics"`
}
TriggerModel is moira.Trigger api representation
func CreateTriggerModel ¶
func CreateTriggerModel(trigger *moira.Trigger) TriggerModel
CreateTriggerModel transforms moira.Trigger to TriggerModel
func (*TriggerModel) ToMoiraTrigger ¶
func (model *TriggerModel) ToMoiraTrigger() *moira.Trigger
ToMoiraTrigger transforms TriggerModel to moira.Trigger
type TriggersList ¶
type TriggersList struct {
Page *int64 `json:"page,omitempty"`
Size *int64 `json:"size,omitempty"`
Total *int64 `json:"total,omitempty"`
List []moira.TriggerCheck `json:"list"`
}
func (*TriggersList) Render ¶
func (*TriggersList) Render(w http.ResponseWriter, r *http.Request) error
type UserSettings ¶
type UserSettings struct {
User
Contacts []moira.ContactData `json:"contacts"`
Subscriptions []moira.SubscriptionData `json:"subscriptions"`
}
func (*UserSettings) Render ¶
func (*UserSettings) Render(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.