models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: AGPL-3.0, Apache-2.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 {
	AlertID                *string    `json:"alertId"`
	RuleID                 *string    `json:"ruleId"`
	CreationTime           *time.Time `json:"creationTime"`
	LastEventMatched       *time.Time `json:"lastEventMatched"`
	MatchedEventNum        *int       `json:"matchedEventNum"`
	Events                 []*string  `json:"events"`
	EventsLastEvaluatedKey *string    `json:"eventsLastEvaluatedKey,omitempty"`
}

Alert contains the details of an alert

type AlertItem

type AlertItem struct {
	AlertID          *string    `json:"alertId"`
	RuleID           *string    `json:"ruleId"`
	CreationTime     *time.Time `json:"creationTime"`
	LastEventMatched *time.Time `json:"lastEventMatched"`
	EventHashes      [][]byte   `json:"eventHashes"`
}

AlertItem is a DDB representation of an Alert

type AlertSummary

type AlertSummary struct {
	AlertID          *string    `json:"alertId"`
	RuleID           *string    `json:"ruleId"`
	CreationTime     *time.Time `json:"creationTime"`
	LastEventMatched *time.Time `json:"lastEventMatched"`
	EventsMatched    *int       `json:"eventsMatched"`
	Severity         *string    `json:"severity"`
}

AlertSummary contains summary information for an alert

type GetAlertInput

type GetAlertInput struct {
	AlertID                 *string `json:"alertId" validate:"required"`
	EventsPageSize          *int    `json:"eventsPageSize,omitempty"  validate:"omitempty,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"
    }
}

type GetAlertOutput

type GetAlertOutput = Alert

GetAlertOutput retrieves details for a single alert.

Example:

{
    "getAlert": {
	    "alertId": "ruleId-2"
    }
}

type GetEventInput

type GetEventInput struct {
	EventID *string `json:"eventId" validate:"required"`
}

GetEventInput retrieves a single event

type GetEventOutput

type GetEventOutput struct {
	Event *string `json:"event"`
}

GetEventOutput contains the event

type LambdaInput

type LambdaInput struct {
	GetAlert   *GetAlertInput   `json:"getAlert"`
	GetEvent   *GetEventInput   `json:"getEvent"`
	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