Documentation
¶
Index ¶
- Variables
- type Client
- func (c Client) GetAlert(id int) (json.RawMessage, error)
- func (c Client) GetAlerts() (json.RawMessage, error)
- func (c Client) GetDashboard(id int) (json.RawMessage, error)
- func (c Client) GetDashboards() (DashboardsResponse, error)
- func (c Client) GetDowntime(id int) (json.RawMessage, error)
- func (c Client) GetDowntimes() (Downtimes, error)
- func (c Client) GetMonitor(id int) (json.RawMessage, error)
- func (c Client) GetMonitorWithDependencies(id int, includeDowntime bool) (*MonitorWithDependencies, error)
- func (c Client) GetMonitors() (MonitorsResponse, error)
- func (c Client) GetScreenboard(id int) (json.RawMessage, error)
- func (c Client) GetScreenboards() (ScreenBoardsResponse, error)
- func (c Client) UpdateAlert(alert json.RawMessage) error
- func (c Client) UpdateDashboard(dash json.RawMessage) error
- func (c Client) UpdateDowntime(downtime json.RawMessage) error
- func (c Client) UpdateMonitor(monitor json.RawMessage) error
- func (c Client) UpdateMonitorWithDependencies(m *MonitorWithDependencies) error
- func (c Client) UpdateScreenboard(screen json.RawMessage) error
- type Component
- type DashboardsResponse
- type Downtime
- type Downtimes
- type MonitorWithDependencies
- type MonitorsResponse
- type Option
- type ScreenBoardsResponse
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidDashboard is returned if the passed dashboard object is invalid. ErrInvalidDashboard = errors.New("invalid dashboard") // ErrInvalidMonitor is returned if the passed monitor object is invalid. ErrInvalidMonitor = errors.New("invalid monitor") // ErrInvalidDowntime is returned if the passed downtime object is invalid. ErrInvalidDowntime = errors.New("invalid downtime") // ErrInvalidScreenboard is returned if the passed screen board object is invalid. ErrInvalidScreenboard = errors.New("invalid screenboard") // ErrInvalidAlert s returned if the passed alert object in invalid. ErrInvalidAlert = errors.New("invalid alert") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a datadog API.
func (Client) GetAlert ¶
func (c Client) GetAlert(id int) (json.RawMessage, error)
GetAlert returns an alert with a given ID.
func (Client) GetAlerts ¶
func (c Client) GetAlerts() (json.RawMessage, error)
GetAlerts returns a list of alerts.
func (Client) GetDashboard ¶
func (c Client) GetDashboard(id int) (json.RawMessage, error)
GetDashboard returns a raw json of dashboard.
func (Client) GetDashboards ¶
func (c Client) GetDashboards() (DashboardsResponse, error)
GetDashboards returns a list of dashboards.
func (Client) GetDowntime ¶
func (c Client) GetDowntime(id int) (json.RawMessage, error)
GetDowntime returns a downtime
func (Client) GetDowntimes ¶
GetDowntimes returns a downtimes
func (Client) GetMonitor ¶
func (c Client) GetMonitor(id int) (json.RawMessage, error)
GetMonitor returns a monitor by ID
func (Client) GetMonitorWithDependencies ¶
func (c Client) GetMonitorWithDependencies(id int, includeDowntime bool) (*MonitorWithDependencies, error)
GetMonitorWithDependencies returns a monitor with dependencies.
func (Client) GetMonitors ¶
func (c Client) GetMonitors() (MonitorsResponse, error)
GetMonitors returns a list of all monitors.
func (Client) GetScreenboard ¶
func (c Client) GetScreenboard(id int) (json.RawMessage, error)
GetScreenboard returns a raw json representation of a screen board.
func (Client) GetScreenboards ¶
func (c Client) GetScreenboards() (ScreenBoardsResponse, error)
GetScreenboards returns a json raw message response from calling /api/v1/dash
func (Client) UpdateAlert ¶
func (c Client) UpdateAlert(alert json.RawMessage) error
UpdateAlert updates an alert from raw message.
func (Client) UpdateDashboard ¶
func (c Client) UpdateDashboard(dash json.RawMessage) error
UpdateDashboard updates the dashboard from json raw message.
func (Client) UpdateDowntime ¶
func (c Client) UpdateDowntime(downtime json.RawMessage) error
UpdateDowntime updates a downtime.
func (Client) UpdateMonitor ¶
func (c Client) UpdateMonitor(monitor json.RawMessage) error
UpdateMonitor updates a monitor from raw message.
func (Client) UpdateMonitorWithDependencies ¶
func (c Client) UpdateMonitorWithDependencies(m *MonitorWithDependencies) error
UpdateMonitorWithDependencies will update the dashboard and dependencies.
func (Client) UpdateScreenboard ¶
func (c Client) UpdateScreenboard(screen json.RawMessage) error
UpdateScreenboard updates the screen board from a given raw json message.
type DashboardsResponse ¶
type DashboardsResponse json.RawMessage
DashboardsResponse represents a response by GetDashboards method.
type Downtime ¶
type Downtime struct { MonitorID int `json:"monitor_id"` OrgID int `json:"org_id"` Disabled bool `json:"disabled"` Start uint64 `json:"start"` End uint64 `json:"end"` CreatorID int `json:"creator_id"` ID int `json:"id"` UpdaterID int `json:"updater_id"` Message string `json:"message"` }
Downtime represents a downtime structure
type Downtimes ¶
type Downtimes []*Downtime
Downtimes is a list of downtimes
func (Downtimes) GetByMonitorID ¶
GetByMonitorID returns a downtime by a monitor ID.
type MonitorWithDependencies ¶
type MonitorWithDependencies struct { Monitor json.RawMessage `json:"monitor"` Alert json.RawMessage `json:"alert"` Downtime json.RawMessage `json:"downtime"` }
MonitorWithDependencies represents a monitor with dependencies like Alert and Downtime.
type MonitorsResponse ¶
type MonitorsResponse json.RawMessage
MonitorsResponse represents a response from calling /api/v1/monitor endpoint
type Option ¶
Option is a functional parameter for datadog client.
func WithRemoveDashboardFields ¶
WithRemoveDashboardFields sets fields to be removed from a dashboard response. Nested fields are supported via comma for example (dash.modified) will remove the modified field from a nested dict under "dash" endpoint /api/v1/dash/<id>
func WithRemoveMonitorFields ¶
WithRemoveMonitorFields sets fields to be removed from monitor response. endpoint /api/v1/monitor/<id>
func WithRemoveScreenBoardFields ¶
WithRemoveScreenBoardFields sets fields to be removed from screen board response. endpoint /api/v1/screen/<id>
type ScreenBoardsResponse ¶
type ScreenBoardsResponse json.RawMessage
ScreenBoardsResponse represents a response from calling /api/v1/dash endpoint