Documentation ¶
Index ¶
- Constants
- func Add(mgr manager.Manager, namespace string) error
- func NewReconciler(mgr manager.Manager) reconcile.Reconciler
- func SetupWithManager(mgr ctrl.Manager, r reconcile.Reconciler, namespace string) error
- type GrafanaChannel
- type GrafanaClient
- type GrafanaClientImpl
- func (r *GrafanaClientImpl) CreateNotificationChannel(channel []byte) (GrafanaResponse, error)
- func (r *GrafanaClientImpl) DeleteNotificationChannelByUID(UID string) (GrafanaResponse, error)
- func (r *GrafanaClientImpl) GetNotificationChannel(UID string) (GrafanaResponse, error)
- func (r *GrafanaClientImpl) UpdateNotificationChannel(channel []byte, UID string) (GrafanaResponse, error)
- type GrafanaNotificationChannelReconciler
- type GrafanaResponse
- type NotificatiomChannelPipelineImpl
- type NotificationChannelPipeline
Constants ¶
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" )
const (
ControllerName = "controller_grafananotificationchannel"
)
Variables ¶
This section is empty.
Functions ¶
func Add ¶
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 ¶
SetupWithManager sets up the controller with the Manager.
Types ¶
type GrafanaChannel ¶
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 ¶
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 ¶
func (r *GrafanaNotificationChannelReconciler) Reconcile(context context.Context, request reconcile.Request) (ctrl.Result, error)
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 (r *NotificatiomChannelPipelineImpl) NewHash() string
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