models

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddOutputInput

type AddOutputInput struct {
	UserID             *string       `json:"userId" validate:"required,uuid4"`
	DisplayName        *string       `json:"displayName" validate:"required,min=1,excludesall='<>&\""`
	OutputConfig       *OutputConfig `json:"outputConfig" validate:"required"`
	DefaultForSeverity []*string     `json:"defaultForSeverity"`
	AlertTypes         []string      `json:"alertTypes" validate:"omitempty,dive,oneof=RULE RULE_ERROR POLICY"`
}

AddOutputInput adds a new encrypted alert output to DynamoDB.

Example:

{
    "addOutput": {
        "displayName": "alert-channel",
        "userId": "f6cfad0a-9bb0-4681-9503-02c54cc979c7",
        "slack": {
            "webhookURL": "https://hooks.slack.com/services/..."
        }
    }
}

type AddOutputOutput

type AddOutputOutput = AlertOutput

AddOutputOutput returns a randomly generated UUID for the output.

Example:

{
    "displayName": "alert-channel",
    "outputId": "7d1c5854-f3ea-491c-8a52-0aa0d58cb456",
    "outputType": "slack",
	   "alertTypes": ["RULE", "RULE_ERROR", "POLICY"],
}

type AlertOutput

type AlertOutput struct {
	// AlertTypes is a whitelist of alert types to send to this destination.
	// To be backwards compatible, we cannot have a `min=1` and an empty list == all types.
	AlertTypes []string `json:"alertTypes" validate:"omitempty,dive,oneof=RULE RULE_ERROR POLICY"`

	// The user ID of the user that created the alert output
	CreatedBy *string `json:"createdBy"`

	// The time in epoch seconds when the alert output was created
	CreationTime *string `json:"creationTime"`

	// DisplayName is the user-provided name, e.g. "alert-channel".
	DisplayName *string `json:"displayName"`

	// The user ID of the user that last modified the alert output last
	LastModifiedBy *string `json:"lastModifiedBy"`

	// The time in epoch seconds when the alert output was last modified
	LastModifiedTime *string `json:"lastModifiedTime"`

	// Identifies uniquely an alert output (table sort key)
	OutputID *string `json:"outputId"`

	// OutputType is the output class, e.g. "slack", "sns".
	// ("type" is a reserved Dynamo keyword, so we use "OutputType" instead)
	OutputType *string `json:"outputType"`

	// OutputConfig contains the configuration for this output
	OutputConfig *OutputConfig `json:"outputConfig"`

	// DefaultForSeverity defines the alert severities that will be forwarded through this output
	DefaultForSeverity []*string `json:"defaultForSeverity"`
}

AlertOutput contains the information for alert output configuration

type AsanaConfig added in v0.2.0

type AsanaConfig struct {
	PersonalAccessToken string   `json:"personalAccessToken" validate:"omitempty,min=1"`
	ProjectGids         []string `json:"projectGids" validate:"omitempty,min=1,dive,required"`
}

AsanaConfig defines options for each Asana output

type CustomWebhookConfig added in v1.5.0

type CustomWebhookConfig struct {
	WebhookURL string `json:"webhookURL" validate:"omitempty,url"`
}

CustomWebhookConfig defines options for each CustomWebhook output

type DeleteOutputInput

type DeleteOutputInput struct {
	OutputID *string `json:"outputId" validate:"required,uuid4"`
}

DeleteOutputInput permanently deletes output credentials.

Example:

{
    "deleteOutput": {
        "outputId": "7d1c5854-f3ea-491c-8a52-0aa0d58cb456"
    }
}

type GetOutputInput

type GetOutputInput struct {
	OutputID *string `json:"outputId" validate:"required,uuid4"`
}

GetOutputInput fetches the configuration for a specific alert output id of an organization

type GetOutputOutput

type GetOutputOutput = AlertOutput

GetOutputOutput contains the configuration for an alert

type GetOutputsInput added in v0.1.1

type GetOutputsInput struct {
}

GetOutputsInput fetches all alert output configuration for one organization

Example:

{
    "getOutputs": {
    }
}

type GetOutputsOutput added in v0.1.1

type GetOutputsOutput = []*AlertOutput

GetOutputsOutput returns all the alert outputs for one organization

Example:

{
    "displayName": "alert-channel",
    "outputId": "7d1c5854-f3ea-491c-8a52-0aa0d58cb456",
    "outputType": "slack"
}

type GetOutputsWithSecretsInput added in v1.5.0

type GetOutputsWithSecretsInput struct {
}

GetOutputsWithSecretsInput fetches all alert output configuration for one organization without redacting their secrets

type GithubConfig

type GithubConfig struct {
	RepoName string `json:"repoName"`
	Token    string `json:"token"`
}

GithubConfig defines options for each Github output

type JiraConfig

type JiraConfig struct {
	OrgDomain  string   `json:"orgDomain" validate:"url"`
	ProjectKey string   `json:"projectKey" validate:"required"`
	UserName   string   `json:"userName" validate:"required"`
	APIKey     string   `json:"apiKey"`
	AssigneeID string   `json:"assigneeId"`
	Type       string   `json:"issueType"`
	Labels     []string `json:"labels" validate:"required,dive,min=1"`
}

JiraConfig defines options for each Jira output

type LambdaInput

type LambdaInput struct {
	AddOutput             *AddOutputInput             `json:"addOutput"`
	UpdateOutput          *UpdateOutputInput          `json:"updateOutput"`
	GetOutput             *GetOutputInput             `json:"getOutput"`
	DeleteOutput          *DeleteOutputInput          `json:"deleteOutput"`
	GetOutputs            *GetOutputsInput            `json:"getOutputs"`
	GetOutputsWithSecrets *GetOutputsWithSecretsInput `json:"getOutputsWithSecrets"`
}

LambdaInput is the invocation event expected by the Lambda function.

Exactly one action must be specified.

type MsTeamsConfig

type MsTeamsConfig struct {
	WebhookURL string `json:"webhookURL" validate:"omitempty,url"`
}

MsTeamsConfig defines options for each MsTeams output

type OpsgenieConfig

type OpsgenieConfig struct {
	APIKey        string `json:"apiKey"`
	ServiceRegion string `json:"serviceRegion" validate:"oneof=US EU"`
}

OpsgenieConfig defines options for each Opsgenie output

type OutputConfig

type OutputConfig struct {
	// SlackConfig contains the configuration for Slack alert output
	Slack *SlackConfig `json:"slack,omitempty"`

	// SnsConfig contains the configuration for SNS alert output
	Sns *SnsConfig `json:"sns,omitempty"`

	// PagerDuty contains the configuration for PagerDuty alert output
	PagerDuty *PagerDutyConfig `json:"pagerDuty,omitempty"`

	// Github contains the configuration for Github alert output
	Github *GithubConfig `json:"github,omitempty"`

	// Jira contains the configuration for Jira alert output
	Jira *JiraConfig `json:"jira,omitempty"`

	// Opsgenie contains the configuration for Opsgenie alert output
	Opsgenie *OpsgenieConfig `json:"opsgenie,omitempty"`

	// MsTeams contains the configuration for MsTeams alert output
	MsTeams *MsTeamsConfig `json:"msTeams,omitempty"`

	// SqsConfig contains the configuration for SQS alert output
	Sqs *SqsConfig `json:"sqs,omitempty"`

	// AsanaConfig contains the configuration for Asana alert output
	Asana *AsanaConfig `json:"asana,omitempty"`

	// CustomWebhook contains the configuration for a Custom Webhook alert output
	CustomWebhook *CustomWebhookConfig `json:"customWebhook,omitempty"`
}

OutputConfig contains the configuration for the output

type PagerDutyConfig

type PagerDutyConfig struct {
	IntegrationKey string `json:"integrationKey" validate:"omitempty,hexadecimal,len=32"`
}

PagerDutyConfig defines options for each PagerDuty output

type SlackConfig

type SlackConfig struct {
	WebhookURL string `json:"webhookURL" validate:"omitempty,url"` // https://hooks.slack.com/services/...
}

SlackConfig defines options for each Slack output.

type SnsConfig

type SnsConfig struct {
	TopicArn string `json:"topicArn" validate:"omitempty,snsArn"`
}

SnsConfig defines options for each SNS topic output

type SqsConfig

type SqsConfig struct {
	QueueURL string `json:"queueUrl" validate:"omitempty,url"`
}

SqsConfig defines options for each Sqs topic output

type UpdateOutputInput

type UpdateOutputInput struct {
	UserID             *string       `json:"userId" validate:"required,uuid4"`
	DisplayName        *string       `json:"displayName" validate:"omitempty,min=1,excludesall='<>&\""`
	OutputID           *string       `json:"outputId" validate:"required,uuid4"`
	OutputConfig       *OutputConfig `json:"outputConfig"`
	DefaultForSeverity []*string     `json:"defaultForSeverity"`
	AlertTypes         []string      `json:"alertTypes" validate:"omitempty,dive,oneof=RULE RULE_ERROR POLICY"`
}

UpdateOutputInput updates an alert output configuration.

Example:

{
    "updateOutput": {
        "userId": "9d1c5854-f3ea-491c-8a52-0aa0d58cb456",
        "outputId": "7d1c5854-f3ea-491c-8a52-0aa0d58cb456",
	       "alertTypes": ["RULE", "RULE_ERROR", "POLICY"]
    }
}

type UpdateOutputOutput

type UpdateOutputOutput = AlertOutput

UpdateOutputOutput returns the new updated output

Example:

{
    "displayName": "alert-channel",
    "outputId": "7d1c5854-f3ea-491c-8a52-0aa0d58cb456",
    "outputType": "slack"
}

Jump to

Keyboard shortcuts

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