Documentation ¶
Index ¶
- func DeleteExtinctMonitors(monitors []string, tags []string) error
- func GetMock(ctrl *gomock.Controller) *mocks.MockClientAPI
- type ClientAPI
- type DDMonitorManager
- func (ddman *DDMonitorManager) AddOrUpdate(monitor *ddapi.Monitor) (*ddapi.Monitor, error)
- func (ddman *DDMonitorManager) DeleteMonitor(monitor *ddapi.Monitor) error
- func (ddman *DDMonitorManager) DeleteMonitors(tags []string) error
- func (ddman *DDMonitorManager) GetProvisionedMonitor(monitor *ddapi.Monitor) (*ddapi.Monitor, error)
- func (ddman *DDMonitorManager) GetProvisionedMonitors() ([]ddapi.Monitor, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteExtinctMonitors ¶
DeleteExtinctMonitors gathers monitors configured with all tags in variable tags; If any are not present in variable monitors they get deleted.
func GetMock ¶
func GetMock(ctrl *gomock.Controller) *mocks.MockClientAPI
GetMock will return a mock datadog client API
Types ¶
type ClientAPI ¶
type ClientAPI interface { CreateMonitor(*ddapi.Monitor) (*ddapi.Monitor, error) DeleteMonitor(id int) error GetMonitorsByMonitorTags(tags []string) ([]ddapi.Monitor, error) MuteMonitorScope(id int, muteMonitorScope *ddapi.MuteMonitorScope) error UnmuteMonitor(id int) error UpdateMonitor(*ddapi.Monitor) error }
ClientAPI defines the interface for the Datadog client, for testing purposes
type DDMonitorManager ¶
type DDMonitorManager struct { Datadog ClientAPI // contains filtered or unexported fields }
DDMonitorManager is a higher-level wrapper around the Datadog API
func GetInstance ¶
func GetInstance() *DDMonitorManager
GetInstance returns a singleton DDMonitorManager, creating it if necessary
func (*DDMonitorManager) AddOrUpdate ¶
AddOrUpdate will create a monitor if it doesn't exist or update one if it does. It returns the Id of the monitor created or updated.
func (*DDMonitorManager) DeleteMonitor ¶
func (ddman *DDMonitorManager) DeleteMonitor(monitor *ddapi.Monitor) error
DeleteMonitor deletes a monitor
func (*DDMonitorManager) DeleteMonitors ¶
func (ddman *DDMonitorManager) DeleteMonitors(tags []string) error
DeleteMonitors deletes monitors containing the specified tags.
func (*DDMonitorManager) GetProvisionedMonitor ¶
func (ddman *DDMonitorManager) GetProvisionedMonitor(monitor *ddapi.Monitor) (*ddapi.Monitor, error)
GetProvisionedMonitor returns a monitor with the same name from Datadog.
func (*DDMonitorManager) GetProvisionedMonitors ¶
func (ddman *DDMonitorManager) GetProvisionedMonitors() ([]ddapi.Monitor, error)
GetProvisionedMonitors returns a collection of monitors managed by astro.