internal

package
v0.0.0-...-53af28c Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Copyright © 2023 David Aparicio [email protected]

Index

Constants

View Source
const ERROR_STATUS_CODE = 299

Variables

View Source
var BuildDate = "Thu Jan 1 01:00:00 CET 1970" // date -r 0 (Mac), date -d @0 (Linux)
View Source
var ErrOperationNotPermit = errors.New("can't create an Opsgenie alert for OK status")
View Source
var ErrOperationUnknown = errors.New("can't create an Opsgenie alert for an unknown status")
View Source
var ErrStatusCode = errors.New("HTTP Error")
View Source
var GitCommit = "54a8d74ea3cf6fdcadfac10ee4a4f2553d4562f6q"
View Source
var Version = "v0.0.1-SNAPSHOT"

Version GitCommit BuiltDate are set at build-time

Functions

func CloseAlert

func CloseAlert(ctx context.Context, ambariAlert types.Alert, c *util.Config) (err error)

CloseAlert closes an Opsgenie alert and remove it from the AmbariOpgenieMapping map, using the Opsgenie Go SDK.

func CommentAlert

func CommentAlert(ctx context.Context, ambariAlert types.Alert, c *util.Config) (err error)

CommentAlert comments an Opsgenie alert, using the Opsgenie Go SDK.

func CreateAlert

func CreateAlert(ctx context.Context, ambariAlert types.Alert, c *util.Config) (err error)

CreateAlert creates a new Opsgenie alert and save it into the AmbariOpgenieMapping map, using the Opsgenie Go SDK.

func CurrentVersion

func CurrentVersion() string

func GetAmbariAlert

func GetAmbariAlert(ctx context.Context, c *util.Config) (alert []types.Item, err error)

GetAmbariAlert calls the Ambari API to retrieve all alerts of a Hadoop cluster

func OperationNotPossibleError

func OperationNotPossibleError(op string) error

func OperationUnknownError

func OperationUnknownError(op string) error

func SendHearbeat

func SendHearbeat(ctx context.Context, c *util.Config)

SendHearbeat sends a heartbeat every x minutes. First you need to create a hearbeat in opsgenie and must be enabled

Types

This section is empty.

Jump to

Keyboard shortcuts

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