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: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VerificationStatusNotStarted shows that the verification process hasn't started yet
	VerificationStatusNotStarted = "NOT_STARTED"

	// VerificationStatusPending shows that a verification is pending
	VerificationStatusPending = "PENDING"

	// VerificationStatusFailed shows that the verification process has failed
	VerificationStatusFailed = "FAILED"

	// VerificationStatusSuccess shows that a verification is successful
	VerificationStatusSuccess = "SUCCESS"
)

Variables

This section is empty.

Functions

func Validator

func Validator() (*validator.Validate, error)

Validator builds a custom struct validator.

Types

type AddOutputInput

type AddOutputInput struct {
	UserID             *string       `json:"userId" validate:"required,uuid4"`
	DisplayName        *string       `json:"displayName" validate:"required,min=1"`
	OutputConfig       *OutputConfig `json:"outputConfig" validate:"required"`
	DefaultForSeverity []*string     `json:"defaultForSeverity"`
}

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"
}

type AlertOutput

type AlertOutput struct {

	// 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"`

	// VerificationStatus is the current state of the output verification process.
	VerificationStatus *string `json:"verificationStatus"`

	// 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 AlertOutputItem

type AlertOutputItem struct {

	// 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"`

	// EncryptedConfig is the encrypted JSON of the specific output details.
	EncryptedConfig []byte `json:"encryptedConfig"`

	// 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"`

	// VerificationStatus is the current state of the output destination.
	// When an AlertOutput is not in 'VERIFIED' state it cannot be used to send notifications
	VerificationStatus *string `json:"verificationStatus"`
}

AlertOutputItem is the output configuration stored in DynamoDB.

type DefaultOutputs

type DefaultOutputs struct {
	Severity  *string   `json:"severity"`
	OutputIDs []*string `json:"outputIds"`
}

DefaultOutputs is the structure holding the information about default outputs for severity

type DefaultOutputsItem

type DefaultOutputsItem struct {

	//The severity of the (table sort key)
	Severity *string `json:"severity"`

	// Identifies uniquely an alert output
	OutputIDs []*string `json:"outputIds" dynamodbav:"outputIds,stringset"`
}

DefaultOutputsItem is the default output configuration stored in DynamoDB.

type DeleteOutputInput

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

DeleteOutputInput permanently deletes output credentials.

Example:

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

type EmailConfig

type EmailConfig struct {
	DestinationAddress *string `json:"destinationAddress" validate:"required"`
}

EmailConfig defines options for each Email output

type GetDefaultOutputsInput

type GetDefaultOutputsInput struct {
}

GetDefaultOutputsInput is the request sent to return as part of GetDefaultOutputs operation

type GetDefaultOutputsOutput

type GetDefaultOutputsOutput struct {
	Defaults []*DefaultOutputs `json:"defaults"`
}

GetDefaultOutputsOutput is the response of the GetDefaultOutputs operation

type GetOrganizationOutputsInput

type GetOrganizationOutputsInput struct {
}

GetOrganizationOutputsInput fetches all alert output configuration for one organization

Example:

{
    "getOrganizationOutputsInput": {
    }
}

type GetOrganizationOutputsOutput

type GetOrganizationOutputsOutput = []*AlertOutput

GetOrganizationOutputsOutput returns all the alert outputs for one organization

Example:

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

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 GithubConfig

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

GithubConfig defines options for each Github output

type JiraConfig

type JiraConfig struct {
	OrgDomain  *string `json:"orgDomain" validate:"required"`
	ProjectKey *string `json:"projectKey" validate:"required"`
	UserName   *string `json:"userName" validate:"required"`
	APIKey     *string `json:"apiKey" validate:"required"`
	AssigneeID *string `json:"assigneeId"`
}

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"`
	GetOrganizationOutputs *GetOrganizationOutputsInput `json:"getOrganizationOutputs"`
	SetDefaultOutputs      *SetDefaultOutputsInput      `json:"setDefaultOutputs"`
	GetDefaultOutputs      *GetDefaultOutputsInput      `json:"getDefaultOutputs"`
}

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:"required,url"`
}

MsTeamsConfig defines options for each MsTeamsConfig output

type OpsgenieConfig

type OpsgenieConfig struct {
	APIKey *string `json:"apiKey" validate:"required"`
}

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"`

	// SnsConfig contains the configuration for Email alert output
	Email *EmailConfig `json:"email,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"`
}

OutputConfig contains the configuration for the output

type PagerDutyConfig

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

PagerDutyConfig defines options for each PagerDuty output

type SetDefaultOutputsInput

type SetDefaultOutputsInput struct {
	Severity  *string   `json:"severity" validate:"required,oneof=INFO LOW MEDIUM HIGH CRITICAL"`
	OutputIDs []*string `json:"outputIds"`
}

SetDefaultOutputsInput sets the default output for an organization

type SetDefaultOutputsOutput

type SetDefaultOutputsOutput = DefaultOutputs

SetDefaultOutputsOutput is the output of the SetDefaultOutputs operation

type SlackConfig

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

SlackConfig defines options for each Slack output.

type SnsConfig

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

SnsConfig defines options for each SNS topic output

type SqsConfig

type SqsConfig struct {
	QueueURL *string `json:"queueUrl" validate:"required,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:"required,min=1"`
	OutputID           *string       `json:"outputId" validate:"required,uuid4"`
	OutputConfig       *OutputConfig `json:"outputConfig" validate:"required"`
	DefaultForSeverity []*string     `json:"defaultForSeverity"`
}

UpdateOutputInput updates an alert output configuration.

Example:

{
    "updateOutput": {
        "userId": "9d1c5854-f3ea-491c-8a52-0aa0d58cb456",
        "outputId": "7d1c5854-f3ea-491c-8a52-0aa0d58cb456"
    }
}

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