models

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2020 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	AlertSummary
	Events                 []*string `json:"events" validate:"required"`
	EventsLastEvaluatedKey *string   `json:"eventsLastEvaluatedKey,omitempty"`
}

Alert contains the details of an alert

type AlertSummary

type AlertSummary struct {
	AlertID         *string    `json:"alertId" validate:"required"`
	RuleID          *string    `json:"ruleId" validate:"required"`
	RuleDisplayName *string    `json:"ruleDisplayName,omitempty"`
	RuleVersion     *string    `json:"ruleVersion" validate:"required"`
	DedupString     *string    `json:"dedupString,omitempty"`
	CreationTime    *time.Time `json:"creationTime" validate:"required"`
	UpdateTime      *time.Time `json:"updateTime" validate:"required"`
	EventsMatched   *int       `json:"eventsMatched" validate:"required"`
	Severity        *string    `json:"severity" validate:"required"`
	Title           *string    `json:"title" validate:"required"`
}

AlertSummary contains summary information for an alert

type GetAlertInput

type GetAlertInput struct {
	AlertID                 *string `json:"alertId" validate:"required,hexadecimal,len=32"` // AlertID is an MD5 hash
	EventsPageSize          *int    `json:"eventsPageSize"  validate:"required,min=1,max=50"`
	EventsExclusiveStartKey *string `json:"eventsExclusiveStartKey,omitempty"`
}

GetAlertInput retrieves details for a single alert.

The response will contain by definition all of the events associated with the alert. If `eventPageSize` and `eventPage` are specified, it will returns only the specified events in the response. Example:

{
    "getAlert": {
	    "alertId": "ruleId-2",
        "eventsPageSize": 20
    }
}

type GetAlertOutput

type GetAlertOutput = Alert

GetAlertOutput retrieves details for a single alert.

type LambdaInput

type LambdaInput struct {
	GetAlert   *GetAlertInput   `json:"getAlert"`
	ListAlerts *ListAlertsInput `json:"listAlerts"`
}

LambdaInput is the request structure for the alerts-api Lambda function.

type ListAlertsInput

type ListAlertsInput struct {
	RuleID            *string `json:"ruleId,omitempty"`
	PageSize          *int    `json:"pageSize,omitempty"  validate:"omitempty,min=1,max=50"`
	ExclusiveStartKey *string `json:"exclusiveStartKey,omitempty"`
}

ListAlertsInput lists the alerts in reverse-chronological order (newest to oldest) If "ruleId" is not set, we return all the alerts for the organization If the "exclusiveStartKey" is not set, we return alerts starting from the most recent one. If it is set, the output will return alerts starting from the "exclusiveStartKey" exclusive.

{
    "listAlerts": {
        "ruleId": "My.Rule",
        "pageSize": 25
    }
}

type ListAlertsOutput

type ListAlertsOutput struct {
	// Alerts is a list of alerts sorted by timestamp descending.
	// Alerts with the same timestamp are returned in ascending order of alert ID.
	Alerts []*AlertSummary `json:"alertSummaries"`
	// LastEvaluatedKey contains the last evaluated alert Id.
	// If it is populated it means there are more alerts available
	// If it is nil, it means there are no more alerts to be returned.
	LastEvaluatedKey *string `json:"lastEvaluatedKey,omitempty"`
}

ListAlertsOutput is the returned alert list.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL