Versions in this module Expand all Collapse all v0 v0.1.1 Nov 26, 2024 v0.0.1 Nov 26, 2024 Changes in this version + func FormatAlertsTable(alerts []Annotation) string + type Alert struct + Annotations struct{ ... } + EndsAt time.Time + Fingerprint string + GeneratorURL string + Labels map[string]string + Receivers []struct{ ... } + StartsAt time.Time + Status struct{ ... } + UpdatedAt time.Time + type AlertGroupsResponse struct + Alerts []Alert + Labels struct{ ... } + Receiver struct{ ... } + type AlertManagerClient struct + func (g *AlertManagerClient) GetAlertGroups() ([]AlertGroupsResponse, *resty.Response, error) + func (g *AlertManagerClient) GetAlterManagerAlerts() ([]interface{}, *resty.Response, error) + type AlertRulerClient struct + func (g *AlertRulerClient) GetAlertsForDashboard(dashboardUID string) (map[string][]interface{}, *resty.Response, error) + func (g *AlertRulerClient) PostAlert(dashboardUID string) (map[string][]interface{}, *resty.Response, error) + type Annotation struct + AlertID int64 + Created CustomTime + DashboardID int64 + DashboardUID string + Data interface{} + ID int64 + NewState string + PanelID int64 + PrevState string + Tags []interface{} + Text string + Time CustomTime + TimeEnd CustomTime + Updated CustomTime + type AnnotationsQueryParams struct + AlertID *int + DashboardID *int + DashboardUID *string + From *time.Time + Limit *int + To *time.Time + Type *string + type Client struct + AlertManager *AlertManagerClient + AlertRuler *AlertRulerClient + func NewGrafanaClient(url, apiKey string) *Client + func (c *Client) DeleteAnnotation(annotationID int64) (*resty.Response, error) + func (c *Client) GetAlertRulesForDashboardID(dashboardID string) ([]ProvisionedAlertRule, error) + func (c *Client) GetAlertsRules() ([]ProvisionedAlertRule, *resty.Response, error) + func (c *Client) GetAnnotations(params AnnotationsQueryParams) ([]Annotation, *resty.Response, error) + func (c *Client) GetDashboard(uid string) (GetDashboardResponse, *resty.Response, error) + func (c *Client) GetDatasources() (map[string]string, *resty.Response, error) + func (c *Client) PostAnnotation(annotation PostAnnotation) (PostAnnotationResponse, *resty.Response, error) + func (c *Client) PostDashboard(dashboard PostDashboardRequest) (GrafanaResponse, *resty.Response, error) + type CustomTime struct + func (ct *CustomTime) UnmarshalJSON(b []byte) error + type GetDashboardResponse struct + Dashboard *dashboard.Dashboard + Meta map[string]interface{} + type GrafanaResponse struct + ID *uint + Message *string + OrgID *uint + Slug *string + Status *string + UID *string + URL *string + Version *int + type PostAnnotation struct + DashboardID *int + DashboardUID string + PanelID *int + Tags []string + Text string + Time *time.Time + TimeEnd *time.Time + type PostAnnotationResponse struct + ID int64 + Message string + type PostDashboardRequest struct + Dashboard interface{} + FolderID int + Overwrite bool + type ProvisionedAlertRule struct + Annotations map[string]string + Data []interface{} + ExecErrState string + FolderUID string + ID int64 + Labels map[string]string + RuleGroup string + Title string + UID string + UpdatedAt time.Time + func (p ProvisionedAlertRule) String() string