Documentation
¶
Index ¶
- Constants
- func AlertLinkV2Type_Values() []string
- func AlertV2Severity_Values() []string
- type Alert
- type AlertLabelDescriptorV2
- type AlertLinkV2
- type AlertMetricDescriptorV2
- type AlertScopeV2
- type AlertV2Common
- type AlertV2ConfigDowntime
- type AlertV2ConfigEvent
- type AlertV2ConfigMetric
- type AlertV2ConfigPrometheus
- type AlertV2Downtime
- type AlertV2Event
- type AlertV2Metric
- type AlertV2Prometheus
- type CaptureConfigV2
- type Criteria
- type CustomNotification
- type CustomNotificationTemplateV2
- type EntryPoint
- type LabelDescriptorV3
- type Monitor
- type NotificationChannel
- type NotificationChannelConfigV2
- type NotificationChannelOptions
- type NotificationChannelOptionsV2
- type ScopeExpressionV2
- type ScopedSegmentedConfig
- type SegmentCondition
- type SysdigCapture
- type SysdigMonitorClient
- type Team
- type UserRoles
- type UsersList
Constants ¶
View Source
const ( // alert types enum AlertV2AlertType_AdvancedManual = "ADVANCED_MANUAL" AlertV2AlertType_AnomalyDetection = "ANOMALY_DETECTION" AlertV2AlertType_Dowtime = "DOWNTIME" AlertV2AlertType_Event = "EVENT" AlertV2AlertType_GroupOutlier = "GROUP_OUTLIER" AlertV2AlertType_Manual = "MANUAL" AlertV2AlertType_Prometheus = "PROMETHEUS" // severities enum AlertV2Severity_High = "high" AlertV2Severity_Medium = "medium" AlertV2Severity_Low = "low" AlertV2Severity_Info = "info" // alert link type AlertLinkV2Type_Dashboard = "dashboard" AlertLinkV2Type_Runbook = "runbook" // others AlertV2CaptureFilenameRegexp = `.*?\.scap` )
--- Constants --
Variables ¶
This section is empty.
Functions ¶
func AlertLinkV2Type_Values ¶ added in v0.5.41
func AlertLinkV2Type_Values() []string
enums link types values
func AlertV2Severity_Values ¶ added in v0.5.41
func AlertV2Severity_Values() []string
enums severity values
Types ¶
type Alert ¶
type Alert struct {
ID int `json:"id,omitempty"`
Version int `json:"version,omitempty"`
Type string `json:"type"` // computed MANUAL
Name string `json:"name"`
Description string `json:"description"`
Enabled bool `json:"enabled"`
GroupName string `json:"groupName,omitempty"`
NotificationChannelIds []int `json:"notificationChannelIds"`
Filter string `json:"filter"`
Severity int `json:"severity"` // 6 == INFO, 4 == LOW, 2 == MEDIUM, 0 == HIGH // NOT USED
Timespan int `json:"timespan"` // computed 600000000
CustomNotification *CustomNotification `json:"customNotification"`
TeamID int `json:"teamId,omitempty"` // computed
AutoCreated bool `json:"autoCreated"`
SysdigCapture *SysdigCapture `json:"sysdigCapture"`
RateOfChange bool `json:"rateOfChange,omitempty"`
ReNotifyMinutes int `json:"reNotifyMinutes"`
ReNotify bool `json:"reNotify"`
Valid bool `json:"valid"`
SeverityLabel string `json:"severityLabel,omitempty"` // MEDIUM == MEDIUM, LOW == LOW, NONE == INFO, HIGH == HIGH
SegmentBy []string `json:"segmentBy"`
SegmentCondition *SegmentCondition `json:"segmentCondition"`
Criteria *Criteria `json:"criteria,omitempty"`
Monitor []*Monitor `json:"monitor,omitempty"`
Condition string `json:"condition"`
SeverityLevel int `json:"severityLevel,omitempty"` // 0 == MEDIUM, 2 == LOW, 4 == INFO, 6 == HIGH
}
func AlertFromJSON ¶
type AlertLabelDescriptorV2 ¶ added in v0.5.41
type AlertLinkV2 ¶ added in v0.5.41
type AlertMetricDescriptorV2 ¶ added in v0.5.41
type AlertMetricDescriptorV2 struct {
ID string `json:"id"`
}
type AlertScopeV2 ¶ added in v0.5.41
type AlertScopeV2 struct {
Expressions []ScopeExpressionV2 `json:"expressions,omitempty"`
}
AlertScopeV2
type AlertV2Common ¶ added in v0.5.41
type AlertV2Common struct {
ID int `json:"id,omitempty"`
Version int `json:"version,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
DurationSec int `json:"durationSec"`
Type string `json:"type"`
Group string `json:"group,omitempty"`
Severity string `json:"severity"`
TeamID int `json:"teamId,omitempty"`
Enabled bool `json:"enabled"`
NotificationChannelConfigList []NotificationChannelConfigV2 `json:"notificationChannelConfigList"`
CustomNotificationTemplate *CustomNotificationTemplateV2 `json:"customNotificationTemplate,omitempty"`
CaptureConfig *CaptureConfigV2 `json:"captureConfig,omitempty"`
Links []AlertLinkV2 `json:"links"`
}
AlertV2
type AlertV2ConfigDowntime ¶ added in v0.5.44
type AlertV2ConfigDowntime struct {
ScopedSegmentedConfig
ConditionOperator string `json:"conditionOperator"`
Threshold float64 `json:"threshold"`
GroupAggregation string `json:"groupAggregation"`
TimeAggregation string `json:"timeAggregation"`
Metric AlertMetricDescriptorV2 `json:"metric"`
NoDataBehaviour string `json:"noDataBehaviour"`
}
Downtime
type AlertV2ConfigEvent ¶ added in v0.5.44
type AlertV2ConfigEvent struct {
ScopedSegmentedConfig
ConditionOperator string `json:"conditionOperator"`
Threshold float64 `json:"threshold"`
WarningConditionOperator string `json:"warningConditionOperator,omitempty"`
WarningThreshold *float64 `json:"warningThreshold,omitempty"`
Filter string `json:"filter"`
Tags []string `json:"tags"`
}
Event
type AlertV2ConfigMetric ¶ added in v0.5.44
type AlertV2ConfigMetric struct {
ScopedSegmentedConfig
ConditionOperator string `json:"conditionOperator"`
Threshold float64 `json:"threshold"`
WarningConditionOperator string `json:"warningConditionOperator,omitempty"`
WarningThreshold *float64 `json:"warningThreshold,omitempty"`
GroupAggregation string `json:"groupAggregation"`
TimeAggregation string `json:"timeAggregation"`
Metric AlertMetricDescriptorV2 `json:"metric"`
NoDataBehaviour string `json:"noDataBehaviour"`
}
Metric
type AlertV2ConfigPrometheus ¶ added in v0.5.41
type AlertV2ConfigPrometheus struct {
Query string `json:"query"`
}
Prometheus
type AlertV2Downtime ¶ added in v0.5.44
type AlertV2Downtime struct {
AlertV2Common
Config AlertV2ConfigDowntime `json:"config"`
}
func AlertV2DowntimeFromJSON ¶ added in v0.5.44
func AlertV2DowntimeFromJSON(body []byte) AlertV2Downtime
func (*AlertV2Downtime) ToJSON ¶ added in v0.5.44
func (a *AlertV2Downtime) ToJSON() io.Reader
type AlertV2Event ¶ added in v0.5.44
type AlertV2Event struct {
AlertV2Common
Config AlertV2ConfigEvent `json:"config"`
}
func AlertV2EventFromJSON ¶ added in v0.5.44
func AlertV2EventFromJSON(body []byte) AlertV2Event
func (*AlertV2Event) ToJSON ¶ added in v0.5.44
func (a *AlertV2Event) ToJSON() io.Reader
type AlertV2Metric ¶ added in v0.5.44
type AlertV2Metric struct {
AlertV2Common
Config AlertV2ConfigMetric `json:"config"`
}
func AlertV2MetricFromJSON ¶ added in v0.5.44
func AlertV2MetricFromJSON(body []byte) AlertV2Metric
func (*AlertV2Metric) ToJSON ¶ added in v0.5.44
func (a *AlertV2Metric) ToJSON() io.Reader
type AlertV2Prometheus ¶ added in v0.5.41
type AlertV2Prometheus struct {
AlertV2Common
Config AlertV2ConfigPrometheus `json:"config"`
}
func AlertV2PrometheusFromJSON ¶ added in v0.5.41
func AlertV2PrometheusFromJSON(body []byte) AlertV2Prometheus
func (*AlertV2Prometheus) ToJSON ¶ added in v0.5.41
func (a *AlertV2Prometheus) ToJSON() io.Reader
type CaptureConfigV2 ¶ added in v0.5.41
type CustomNotification ¶
type CustomNotification struct {
TitleTemplate string `json:"titleTemplate"`
UseNewTemplate bool `json:"useNewTemplate"`
PrependText string `json:"prependText,omitempty"`
AppendText string `json:"appendText,omitempty"`
}
-------- Alert --------
type CustomNotificationTemplateV2 ¶ added in v0.5.41
type EntryPoint ¶
type LabelDescriptorV3 ¶ added in v0.5.44
type NotificationChannel ¶
type NotificationChannel struct {
ID int `json:"id,omitempty"`
Version int `json:"version,omitempty"`
Type string `json:"type"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Options NotificationChannelOptions `json:"options"`
}
func NotificationChannelFromJSON ¶
func NotificationChannelFromJSON(body []byte) NotificationChannel
func NotificationChannelListFromJSON ¶
func NotificationChannelListFromJSON(body []byte) []NotificationChannel
func (*NotificationChannel) ToJSON ¶
func (n *NotificationChannel) ToJSON() io.Reader
type NotificationChannelConfigV2 ¶ added in v0.5.41
type NotificationChannelConfigV2 struct {
// Type can be one of EMAIL, SNS, SLACK, PAGER_DUTY, VICTOROPS, OPSGENIE, WEBHOOK, IBM_FUNCTION, MS_TEAMS, TEAM_EMAIL, IBM_EVENT_NOTIFICATIONS, PROMETHEUS_ALERT_MANAGER
ChannelID int `json:"channelId,omitempty"`
Type string `json:"type,omitempty"`
Name string `json:"nam,omitempty"`
Enabled bool `json:"enabled,omitempty"`
OverrideOptions NotificationChannelOptionsV2 `json:"overrideOptions"`
}
type NotificationChannelOptions ¶
type NotificationChannelOptions struct {
EmailRecipients []string `json:"emailRecipients,omitempty"` // Type: email
SnsTopicARNs []string `json:"snsTopicARNs,omitempty"` // Type: SNS
APIKey string `json:"apiKey,omitempty"` // Type: VictorOps
RoutingKey string `json:"routingKey,omitempty"` // Type: VictorOps
Url string `json:"url,omitempty"` // Type: OpsGenie, Webhook and Slack
Channel string `json:"channel,omitempty"` // Type: Slack
Account string `json:"account,omitempty"` // Type: PagerDuty
ServiceKey string `json:"serviceKey,omitempty"` // Type: PagerDuty
ServiceName string `json:"serviceName,omitempty"` // Type: PagerDuty
AdditionalHeaders map[string]interface{} `json:"additionalHeaders,omitempty"` // Type: Webhook
NotifyOnOk bool `json:"notifyOnOk"`
NotifyOnResolve bool `json:"notifyOnResolve"`
SendTestNotification bool `json:"sendTestNotification"`
}
type NotificationChannelOptionsV2 ¶ added in v0.5.41
type NotificationChannelOptionsV2 struct {
// commons
NotifyOnAcknowledge bool `json:"notifyOnAcknowledge,omitempty"`
NotifyOnResolve bool `json:"notifyOnResolve,omitempty"`
ReNotifyEverySec *int `json:"reNotifyEverySec"` // must send null to remove this opt
CustomNotificationTemplate *CustomNotificationTemplateV2 `json:"customNotificationTemplate,omitempty"`
Thresholds []string `json:"thresholds"` //Set of thresholds the notification channel will be used for. Possible values [MAIN, WARNING]
}
type ScopeExpressionV2 ¶ added in v0.5.41
type ScopeExpressionV2 struct {
Operand string `json:"operand"` // old dot notation, e.g. "kubernetes.cluster.name"
Descriptor *AlertLabelDescriptorV2 `json:"descriptor,omitempty"`
Operator string `json:"operator"`
Value []string `json:"value"`
}
type ScopedSegmentedConfig ¶ added in v0.5.44
type ScopedSegmentedConfig struct {
Scope *AlertScopeV2 `json:"scope,omitempty"`
SegmentBy []AlertLabelDescriptorV2 `json:"segmentBy"`
}
type SegmentCondition ¶
type SegmentCondition struct {
Type string `json:"type"`
}
type SysdigCapture ¶
type SysdigCapture struct {
Name string `json:"name"`
Filters string `json:"filters,omitempty"`
Duration int `json:"duration"`
Type string `json:"type,omitempty"`
BucketName string `json:"bucketName"`
Folder string `json:"folder,omitempty"`
Enabled bool `json:"enabled"`
StorageID interface{} `json:"storageId,omitempty"`
}
type SysdigMonitorClient ¶
type SysdigMonitorClient interface {
CreateAlert(context.Context, Alert) (Alert, error)
DeleteAlert(context.Context, int) error
UpdateAlert(context.Context, Alert) (Alert, error)
GetAlertById(context.Context, int) (Alert, error)
CreateAlertV2Prometheus(context.Context, AlertV2Prometheus) (AlertV2Prometheus, error)
DeleteAlertV2Prometheus(context.Context, int) error
UpdateAlertV2Prometheus(context.Context, AlertV2Prometheus) (AlertV2Prometheus, error)
GetAlertV2PrometheusById(context.Context, int) (AlertV2Prometheus, error)
CreateAlertV2Event(context.Context, AlertV2Event) (AlertV2Event, error)
DeleteAlertV2Event(context.Context, int) error
UpdateAlertV2Event(context.Context, AlertV2Event) (AlertV2Event, error)
GetAlertV2EventById(context.Context, int) (AlertV2Event, error)
CreateAlertV2Metric(context.Context, AlertV2Metric) (AlertV2Metric, error)
DeleteAlertV2Metric(context.Context, int) error
UpdateAlertV2Metric(context.Context, AlertV2Metric) (AlertV2Metric, error)
GetAlertV2MetricById(context.Context, int) (AlertV2Metric, error)
CreateAlertV2Downtime(context.Context, AlertV2Downtime) (AlertV2Downtime, error)
DeleteAlertV2Downtime(context.Context, int) error
UpdateAlertV2Downtime(context.Context, AlertV2Downtime) (AlertV2Downtime, error)
GetAlertV2DowntimeById(context.Context, int) (AlertV2Downtime, error)
GetLabelDescriptor(ctx context.Context, label string) (LabelDescriptorV3, error)
CreateTeam(context.Context, Team) (Team, error)
GetTeamById(context.Context, int) (Team, error)
UpdateTeam(context.Context, Team) (Team, error)
DeleteTeam(context.Context, int) error
CreateNotificationChannel(context.Context, NotificationChannel) (NotificationChannel, error)
GetNotificationChannelById(context.Context, int) (NotificationChannel, error)
GetNotificationChannelByName(context.Context, string) (NotificationChannel, error)
DeleteNotificationChannel(context.Context, int) error
UpdateNotificationChannel(context.Context, NotificationChannel) (NotificationChannel, error)
GetDashboardByID(context.Context, int) (*model.Dashboard, error)
CreateDashboard(context.Context, *model.Dashboard) (*model.Dashboard, error)
UpdateDashboard(context.Context, *model.Dashboard) (*model.Dashboard, error)
DeleteDashboard(context.Context, int) error
}
func NewSysdigMonitorClient ¶
func NewSysdigMonitorClient(apiToken string, url string, insecure bool) SysdigMonitorClient
func WithExtraHeaders ¶
func WithExtraHeaders(client SysdigMonitorClient, extraHeaders map[string]string) SysdigMonitorClient
type Team ¶
type Team struct {
UserRoles []UserRoles `json:"userRoles"`
Description string `json:"description"`
Name string `json:"name"`
ID int `json:"id,omitempty"`
Version int `json:"version,omitempty"`
Origin string `json:"origin,omitempty"`
LastUpdated int64 `json:"lastUpdated,omitempty"`
EntryPoint EntryPoint `json:"entryPoint"`
Theme string `json:"theme"`
CustomerID int `json:"customerId"`
DateCreated int64 `json:"dateCreated"`
Products []string `json:"products,omitempty"`
Show string `json:"show"`
Immutable bool `json:"immutable"`
CanUseSysdigCapture bool `json:"canUseSysdigCapture"`
CanUseCustomEvents bool `json:"canUseCustomEvents"`
CanUseAwsMetrics bool `json:"canUseAwsMetrics"`
CanUseBeaconMetrics bool `json:"canUseBeaconMetrics"`
UserCount int `json:"userCount"`
Filter string `json:"filter,omitempty"`
DefaultTeam bool `json:"default,omitempty"`
}
-------- Team --------
func TeamFromJSON ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.