controller

package
v2.5.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2019 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUserPermissionsForContact

func CheckUserPermissionsForContact(dataBase moira.Database, contactID string, userLogin string) (moira.ContactData, *api.ErrorResponse)

CheckUserPermissionsForContact checks contact for existence and permissions for given user

func CheckUserPermissionsForSubscription

func CheckUserPermissionsForSubscription(dataBase moira.Database, subscriptionID string, userLogin string) (moira.SubscriptionData, *api.ErrorResponse)

CheckUserPermissionsForSubscription checks subscription for existence and permissions for given user

func CreateContact

func CreateContact(dataBase moira.Database, contact *dto.Contact, userLogin string) *api.ErrorResponse

CreateContact creates new notification contact for current user

func CreateSubscription

func CreateSubscription(dataBase moira.Database, userLogin string, subscription *dto.Subscription) *api.ErrorResponse

CreateSubscription create or update subscription

func CreateTrigger

func CreateTrigger(dataBase moira.Database, trigger *dto.TriggerModel, timeSeriesNames map[string]bool) (*dto.SaveTriggerResponse, *api.ErrorResponse)

CreateTrigger creates new trigger

func DeleteAllEvents

func DeleteAllEvents(database moira.Database) *api.ErrorResponse

DeleteAllEvents deletes all notification events

func DeleteAllNotifications

func DeleteAllNotifications(database moira.Database) *api.ErrorResponse

DeleteAllNotifications removes all notifications

func DeleteNotification

func DeleteNotification(database moira.Database, notificationKey string) (*dto.NotificationDeleteResponse, *api.ErrorResponse)

DeleteNotification removes all notifications by notification key

func DeletePattern

func DeletePattern(database moira.Database, pattern string) *api.ErrorResponse

DeletePattern deletes trigger pattern

func DeleteTriggerMetric

func DeleteTriggerMetric(dataBase moira.Database, metricName string, triggerID string) *api.ErrorResponse

DeleteTriggerMetric deletes metric from last check and all trigger patterns metrics

func DeleteTriggerNodataMetrics

func DeleteTriggerNodataMetrics(dataBase moira.Database, triggerID string) *api.ErrorResponse

DeleteTriggerNodataMetrics deletes all metric from last check which are in NODATA state. It also deletes all trigger patterns of those metrics

func DeleteTriggerThrottling

func DeleteTriggerThrottling(database moira.Database, triggerID string) *api.ErrorResponse

DeleteTriggerThrottling deletes trigger throttling

func GetAllContacts

func GetAllContacts(database moira.Database) (*dto.ContactList, *api.ErrorResponse)

GetAllContacts gets all moira contacts

func GetAllPatterns

func GetAllPatterns(database moira.Database, logger moira.Logger) (*dto.PatternList, *api.ErrorResponse)

GetAllPatterns get all patterns and triggers and metrics info corresponding to this pattern

func GetAllTags

func GetAllTags(database moira.Database) (*dto.TagsData, *api.ErrorResponse)

GetAllTags gets all tag names

func GetAllTagsAndSubscriptions

func GetAllTagsAndSubscriptions(database moira.Database, logger moira.Logger) (*dto.TagsStatistics, *api.ErrorResponse)

GetAllTagsAndSubscriptions get tags subscriptions and triggerIDs

func GetAllTriggers

func GetAllTriggers(database moira.Database) (*dto.TriggersList, *api.ErrorResponse)

GetAllTriggers gets all moira triggers

func GetNotifications

func GetNotifications(database moira.Database, start int64, end int64) (*dto.NotificationsList, *api.ErrorResponse)

GetNotifications gets all notifications from current page, if end==-1 && start==0 gets all notifications

func GetNotifierState

func GetNotifierState(database moira.Database) (*dto.NotifierState, *api.ErrorResponse)

GetNotifierState return current notifier state

func GetTrigger

func GetTrigger(dataBase moira.Database, triggerID string) (*dto.Trigger, *api.ErrorResponse)

GetTrigger gets trigger with his throttling - next allowed message time

func GetTriggerEvaluationResult

func GetTriggerEvaluationResult(dataBase moira.Database, metricSourceProvider *metricSource.SourceProvider, from, to int64, triggerID string, fetchRealtimeData bool) (*metricSource.TriggerMetricsData, *moira.Trigger, error)

GetTriggerEvaluationResult evaluates every target in trigger and returns result, separated on main and additional targets metrics

func GetTriggerEvents

func GetTriggerEvents(database moira.Database, triggerID string, page int64, size int64) (*dto.EventsList, *api.ErrorResponse)

GetTriggerEvents gets trigger event from current page and all trigger event count

func GetTriggerLastCheck

func GetTriggerLastCheck(dataBase moira.Database, triggerID string) (*dto.TriggerCheck, *api.ErrorResponse)

GetTriggerLastCheck gets trigger last check data

func GetTriggerMetrics

func GetTriggerMetrics(dataBase moira.Database, metricSourceProvider *metricSource.SourceProvider, from, to int64, triggerID string) (*dto.TriggerMetrics, *api.ErrorResponse)

GetTriggerMetrics gets all trigger metrics values, default values from: now - 10min, to: now

func GetTriggerThrottling

func GetTriggerThrottling(database moira.Database, triggerID string) (*dto.ThrottlingResponse, *api.ErrorResponse)

GetTriggerThrottling gets trigger throttling timestamp

func GetUserSettings

func GetUserSettings(database moira.Database, userLogin string) (*dto.UserSettings, *api.ErrorResponse)

GetUserSettings gets user contacts and subscriptions

func GetUserSubscriptions

func GetUserSubscriptions(database moira.Database, userLogin string) (*dto.SubscriptionList, *api.ErrorResponse)

GetUserSubscriptions get all user subscriptions

func RemoveContact

func RemoveContact(database moira.Database, contactID string, userLogin string) *api.ErrorResponse

RemoveContact deletes notification contact for current user and remove contactID from all subscriptions

func RemoveSubscription

func RemoveSubscription(database moira.Database, subscriptionID string) *api.ErrorResponse

RemoveSubscription deletes subscription

func RemoveTag

func RemoveTag(database moira.Database, tagName string) (*dto.MessageResponse, *api.ErrorResponse)

RemoveTag deletes tag by name

func RemoveTrigger

func RemoveTrigger(database moira.Database, triggerID string) *api.ErrorResponse

RemoveTrigger deletes trigger by given triggerID

func SearchTriggers

func SearchTriggers(database moira.Database, searcher moira.Searcher, page int64, size int64, onlyErrors bool, filterTags []string, searchString string) (*dto.TriggersList, *api.ErrorResponse)

SearchTriggers gets trigger page and filter trigger by tags and search request terms

func SendTestContactNotification

func SendTestContactNotification(dataBase moira.Database, contactID string) *api.ErrorResponse

SendTestContactNotification push test notification to verify the correct contact settings

func SendTestNotification

func SendTestNotification(database moira.Database, subscriptionID string) *api.ErrorResponse

SendTestNotification push test notification to verify the correct notification settings

func SetTriggerMaintenance

func SetTriggerMaintenance(database moira.Database, triggerID string, triggerMaintenance dto.TriggerMaintenance, userLogin string, timeCallMaintenance int64) *api.ErrorResponse

SetTriggerMaintenance sets maintenance to metrics and whole trigger

func UpdateContact

func UpdateContact(dataBase moira.Database, contactDTO dto.Contact, contactData moira.ContactData) (dto.Contact, *api.ErrorResponse)

UpdateContact updates notification contact for current user

func UpdateNotifierState

func UpdateNotifierState(database moira.Database, state *dto.NotifierState) *api.ErrorResponse

UpdateNotifierState update current notifier state

func UpdateSubscription

func UpdateSubscription(dataBase moira.Database, subscriptionID string, userLogin string, subscription *dto.Subscription) *api.ErrorResponse

UpdateSubscription updates existing subscription

func UpdateTrigger

func UpdateTrigger(dataBase moira.Database, trigger *dto.TriggerModel, triggerID string, timeSeriesNames map[string]bool) (*dto.SaveTriggerResponse, *api.ErrorResponse)

UpdateTrigger update trigger data and trigger metrics in last state

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL