grafananotificationchannel

package
v4.10.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreateNotificationChannelUrl      = "%v/api/alert-notifications/"
	ReadNotificationChannelByUIDUrl   = "%v/api/alert-notifications/uid/%v"
	UpdateNotificationChannelByUIDUrl = "%v/api/alert-notifications/uid/%v"
	DeleteNotificationChannelByUIDUrl = "%v/api/alert-notifications/uid/%v"
)
View Source
const (
	ControllerName = "controller_grafananotificationchannel"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, namespace string) error

Add creates a new GrafanaNotificationChannel Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

func NewReconciler

func NewReconciler(mgr manager.Manager) reconcile.Reconciler

NewReconciler returns a new reconcile.Reconciler

func SetupWithManager

func SetupWithManager(mgr ctrl.Manager, r reconcile.Reconciler, namespace string) error

SetupWithManager sets up the controller with the Manager.

Types

type GrafanaChannel

type GrafanaChannel struct {
	ID                    *uint   `json:"id"`
	UID                   *string `json:"uid"`
	Name                  *string `json:"name"`
	Type                  *string `json:"type"`
	IsDefault             *bool   `json:"isDefault"`
	SendReminder          *bool   `json:"sendReminder"`
	DisableResolveMessage *bool   `json:"disableResolveMessage"`
}

type GrafanaClient

type GrafanaClient interface {
	CreateNotificationChannel(channel []byte) (GrafanaResponse, error)
	DeleteNotificationChannelByUID(UID string) (GrafanaResponse, error)
	UpdateNotificationChannel(channel []byte, UID string) (GrafanaResponse, error)
	GetNotificationChannel(UID string) (GrafanaResponse, error)
}

func NewGrafanaClient

func NewGrafanaClient(url, user, password string, transport *http.Transport, timeoutSeconds time.Duration) GrafanaClient

type GrafanaClientImpl

type GrafanaClientImpl struct {
	// contains filtered or unexported fields
}

func (*GrafanaClientImpl) CreateNotificationChannel

func (r *GrafanaClientImpl) CreateNotificationChannel(channel []byte) (GrafanaResponse, error)

CreateNotificationChannel Submits channel json to grafana

func (*GrafanaClientImpl) DeleteNotificationChannelByUID

func (r *GrafanaClientImpl) DeleteNotificationChannelByUID(UID string) (GrafanaResponse, error)

DeleteNotificationChannelByUID Deletes a channel given by a UID

func (*GrafanaClientImpl) GetNotificationChannel

func (r *GrafanaClientImpl) GetNotificationChannel(UID string) (GrafanaResponse, error)

GetNotificationChannel Gets channel by UID

func (*GrafanaClientImpl) UpdateNotificationChannel

func (r *GrafanaClientImpl) UpdateNotificationChannel(channel []byte, UID string) (GrafanaResponse, error)

UpdateNotificationChannel Updates existing channel

type GrafanaNotificationChannelReconciler

type GrafanaNotificationChannelReconciler struct {
	Log logr.Logger
	// contains filtered or unexported fields
}

GrafanaNotificationChannelReconciler reconciles a GrafanaNotificationChannel object

func (*GrafanaNotificationChannelReconciler) Reconcile

Reconcile , The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type GrafanaResponse

type GrafanaResponse struct {
	ID                    *uint   `json:"id"`
	UID                   *string `json:"uid"`
	Name                  *string `json:"name"`
	Type                  *string `json:"type"`
	IsDefault             *bool   `json:"isDefault"`
	SendReminder          *bool   `json:"sendReminder"`
	DisableResolveMessage *bool   `json:"disableResolveMessage"`
	Created               *string `json:"created"`
	Updated               *string `json:"updated"`
	Message               *string `json:"message"`
}

type NotificatiomChannelPipelineImpl

type NotificatiomChannelPipelineImpl struct {
	Client              client.Client
	NotificationChannel *v1alpha1.GrafanaNotificationChannel
	JSON                string
	Channel             map[string]interface{}
	Logger              logr.Logger
	Hash                string
}

func (*NotificatiomChannelPipelineImpl) NewHash

func (*NotificatiomChannelPipelineImpl) ProcessNotificationChannel

func (r *NotificatiomChannelPipelineImpl) ProcessNotificationChannel(knownHash string, forceCreate bool) ([]byte, error)

type NotificationChannelPipeline

type NotificationChannelPipeline interface {
	ProcessNotificationChannel(knownHash string, forceCreate bool) ([]byte, error)
	NewHash() string
}

func NewNotificationChannelPipeline

func NewNotificationChannelPipeline(client client.Client, notificationChannel *v1alpha1.GrafanaNotificationChannel) NotificationChannelPipeline

Jump to

Keyboard shortcuts

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