webex

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIURL = "https://webexapis.com/v1/messages"
)
View Source
const FullValidConfigForTesting = `{
	"message" :"test-message",  
	"room_id" :"test-room-id",
	"api_url" :"http://localhost",
	"bot_token" :"12345"
}`

FullValidConfigForTesting is a string representation of a JSON object that contains all fields supported by the notifier Config. It can be used without secrets.

View Source
const FullValidSecretsForTesting = `{
	"bot_token" :"12345-secret"
}`

FullValidSecretsForTesting is a string representation of JSON object that contains all fields that can be overridden from secrets

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Message string `json:"message,omitempty" yaml:"message,omitempty"`
	RoomID  string `json:"room_id,omitempty" yaml:"room_id,omitempty"`
	APIURL  string `json:"api_url,omitempty" yaml:"api_url,omitempty"`
	Token   string `json:"bot_token" yaml:"bot_token"`
}

PLEASE do not touch these settings without taking a look at what we support as part of https://github.com/prometheus/alertmanager/blob/main/notify/webex/webex.go Currently, the Alerting team is unifying channels and (upstream) receivers - any discrepancy is detrimental to that.

func NewConfig

func NewConfig(jsonData json.RawMessage, decryptFn receivers.DecryptFunc) (Config, error)

NewConfig is the constructor for the Webex notifier.

type Notifier

type Notifier struct {
	*receivers.Base
	// contains filtered or unexported fields
}

Notifier is responsible for sending alert notifications as webex messages.

func New

func New(cfg Config, meta receivers.Metadata, template *templates.Template, sender receivers.WebhookSender, images images.Provider, logger logging.Logger, orgID int64) *Notifier

func (*Notifier) Notify

func (wn *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)

Notify implements the Notifier interface.

func (*Notifier) SendResolved

func (wn *Notifier) SendResolved() bool

Jump to

Keyboard shortcuts

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