Documentation
¶
Index ¶
- Constants
- type AggregationObj
- type AlertOutput
- type AlertQuery
- type AlertRecipients
- type AlertTrigger
- type AlertType
- type AlertsV2Client
- func (c *AlertsV2Client) CreateAlert(alert CreateAlertType) (*AlertType, error)
- func (c *AlertsV2Client) DeleteAlert(alertId int64) error
- func (c *AlertsV2Client) DisableAlert(alert AlertType) (*AlertType, error)
- func (c *AlertsV2Client) EnableAlert(alert AlertType) (*AlertType, error)
- func (c *AlertsV2Client) GetAlert(alertId int64) (*AlertType, error)
- func (c *AlertsV2Client) ListAlerts() ([]AlertType, error)
- func (c *AlertsV2Client) UpdateAlert(alertId int64, alert CreateAlertType) (*AlertType, error)
- type BoolFilter
- type ColumnConfig
- type CreateAlertType
- type FieldError
- type FilterLists
- type ScheduleObj
- type SubAlert
- type SubAlertCorrelation
- type SubAlertOutput
Constants ¶
const ( AggregationTypeSum string = "SUM" AggregationTypeMin string = "MIN" AggregationTypeMax string = "MAX" AggregationTypeAvg string = "AVG" AggregationTypeCount string = "COUNT" AggregationTypeUniqueCount string = "UNIQUE_COUNT" AggregationTypeNone string = "NONE" OperatorLessThan string = "LESS_THAN" OperatorGreaterThan string = "GREATER_THAN" OperatorLessThanOrEquals string = "LESS_THAN_OR_EQUALS" OperatorGreaterThanOrEquals string = "GREATER_THAN_OR_EQUALS" OperatorEquals string = "EQUALS" OperatorNotEquals string = "NOT_EQUALS" SeverityInfo string = "INFO" SeverityLow string = "LOW" SeverityMedium string = "MEDIUM" SeverityHigh string = "HIGH" SeveritySevere string = "SEVERE" SortDesc string = "DESC" SortAsc string = "ASC" OutputTypeJson string = "JSON" OutputTypeTable string = "TABLE" CorrelationOperatorAnd string = "AND" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregationObj ¶
type AlertOutput ¶
type AlertOutput struct { Recipients AlertRecipients `json:"recipients,omitempty"` SuppressNotificationsMinutes int `json:"suppressNotificationsMinutes,omitempty"` Type string `json:"type,omitempty"` }
type AlertQuery ¶
type AlertQuery struct { Query string `json:"query,omitempty"` Filters BoolFilter `json:"filters,omitempty"` GroupBy []string `json:"groupBy,omitempty"` Aggregation AggregationObj `json:"aggregation,omitempty"` ShouldQueryOnAllAccounts bool `json:"shouldQueryOnAllAccounts,omitempty"` AccountIdsToQueryOn []int `json:"accountIdsToQueryOn,omitempty,omitempty"` }
type AlertRecipients ¶
type AlertTrigger ¶
type AlertType ¶
type AlertType struct { AlertId int64 `json:"id"` UpdatedAt string `json:"updatedAt"` UpdatedBy string `json:"updatedBy"` CreatedAt string `json:"createdAt"` CreatedBy string `json:"createdBy"` Enabled bool `json:"enabled"` Title string `json:"title"` Description string `json:"description,omitempty"` Tags []string `json:"tags,omitempty"` Output AlertOutput `json:"output,omitempty"` SearchTimeFrameMinutes int `json:"searchTimeFrameMinutes"` SubComponents []SubAlert `json:"subComponents"` Correlations SubAlertCorrelation `json:"correlations,omitempty"` Schedule ScheduleObj `json:"schedule,omitempty"` }
type AlertsV2Client ¶
func New ¶
func New(apiToken, baseUrl string) (*AlertsV2Client, error)
func (*AlertsV2Client) CreateAlert ¶
func (c *AlertsV2Client) CreateAlert(alert CreateAlertType) (*AlertType, error)
CreateAlert creates an alert, returns the created alert if successful, an error otherwise
func (*AlertsV2Client) DeleteAlert ¶
func (c *AlertsV2Client) DeleteAlert(alertId int64) error
DeleteAlert deletes an alert specified by its unique id, returns an error if a problem is encountered
func (*AlertsV2Client) DisableAlert ¶
func (c *AlertsV2Client) DisableAlert(alert AlertType) (*AlertType, error)
DisableAlert disables an alert given its unique identifier. Returns the alert, an error otherwise
func (*AlertsV2Client) EnableAlert ¶
func (c *AlertsV2Client) EnableAlert(alert AlertType) (*AlertType, error)
EnableAlert enables an alert given its unique identifier. Returns the alert, an error otherwise
func (*AlertsV2Client) GetAlert ¶
func (c *AlertsV2Client) GetAlert(alertId int64) (*AlertType, error)
GetAlert returns an alert given itss unique identifier, an error otherwise
func (*AlertsV2Client) ListAlerts ¶
func (c *AlertsV2Client) ListAlerts() ([]AlertType, error)
ListAlerts returns all the alerts in an array associated with the account identified by the supplied API token, returns an error if any problem occurs during the API call
func (*AlertsV2Client) UpdateAlert ¶
func (c *AlertsV2Client) UpdateAlert(alertId int64, alert CreateAlertType) (*AlertType, error)
UpdateAlert updates an existing alert, based on the supplied alert identifier, using the parameters of the specified alert Returns the updated alert if successful, an error otherwise
type BoolFilter ¶
type BoolFilter struct {
Bool FilterLists `json:"bool,omitempty"`
}
type ColumnConfig ¶
type CreateAlertType ¶
type CreateAlertType struct { Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Tags []string `json:"tags,omitempty"` Output AlertOutput `json:"output,omitempty"` SearchTimeFrameMinutes int `json:"searchTimeFrameMinutes,omitempty"` SubComponents []SubAlert `json:"subComponents,omitempty"` Correlations SubAlertCorrelation `json:"correlations,omitempty"` Enabled string `json:"enabled,omitempty"` Schedule ScheduleObj `json:"schedule,omitempty"` }
type FieldError ¶
func (FieldError) Error ¶
func (e FieldError) Error() string
type FilterLists ¶
type ScheduleObj ¶ added in v1.14.0
type SubAlert ¶
type SubAlert struct { QueryDefinition AlertQuery `json:"queryDefinition,omitempty"` Trigger AlertTrigger `json:"trigger,omitempty"` Output SubAlertOutput `json:"output,omitempty"` }
type SubAlertCorrelation ¶
type SubAlertOutput ¶
type SubAlertOutput struct { Columns []ColumnConfig `json:"columns,omitempty"` ShouldUseAllFields bool `json:"shouldUseAllFields,omitempty"` }