v1beta1

package
v0.0.0-...-1b233ce Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertsKind       = "Alert"
	AlertName        = "alerts"
	AlertSinguleName = "alert"
)
View Source
const (
	NotifiersKind        = "Notifier"
	NotifierName         = "notifiers"
	NotifierSingularName = "notifier"
)
View Source
const (
	RecipientsKind        = "Recipient"
	RecipientName         = "recipients"
	RecipientSingularName = "recipient"
)
View Source
const (
	Group = "monitoring.rancher.io"
)

Variables

View Source
var Version = "v1beta1"

Functions

func SetConfigDefaults

func SetConfigDefaults(config *rest.Config)

func UnstructuredFromAlert

func UnstructuredFromAlert(p *Alert) (*unstructured.Unstructured, error)

func UnstructuredFromNotifier

func UnstructuredFromNotifier(p *Notifier) (*unstructured.Unstructured, error)

func UnstructuredFromRecipient

func UnstructuredFromRecipient(p *Recipient) (*unstructured.Unstructured, error)

Types

type Alert

type Alert struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              AlertSpec `json:"spec"`
	//TODO: check what should do with status
	Status *AlertStatus `json:"status,omitempty"`
}

func AlertFromUnstructured

func AlertFromUnstructured(r *unstructured.Unstructured) (*Alert, error)

type AlertInterface

type AlertInterface interface {
	Create(*Alert) (*Alert, error)
	Get(name string, opts metav1.GetOptions) (*Alert, error)
	Update(*Alert) (*Alert, error)
	Delete(name string, options *metav1.DeleteOptions) error
	//List(opts metav1.ListOptions) (runtime.Object, error)
	List(opts metav1.ListOptions) (*AlertList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
	DeleteCollection(dopts *metav1.DeleteOptions, lopts metav1.ListOptions) error
}

type AlertList

type AlertList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []*Alert `json:"items"`
}

type AlertSpec

type AlertSpec struct {
	PodMetadata *metav1.ObjectMeta `json:"podMetadata,omitempty"`

	Name         string          `json:"name,omitempty"`
	SendResolved bool            `json:"sendResolved,omitempty"`
	Severity     string          `json:"severity, omitempty"`
	Object       string          `json:"object, omitempty"`
	ObjectID     string          `json:"objectId, omitempty"`
	ServiceRule  ServiceRuleSpec `json:"serviceRule, omitempty"`
	RecipientID  string          `json:"recipientId, omitempty"`
}

type AlertStatus

type AlertStatus struct {
	Paused bool `json:"paused"`
}

TODO: decide the field in status

type AlertsGetter

type AlertsGetter interface {
	Alerts(namespace string) AlertInterface
}

type EmailConfigSpec

type EmailConfigSpec struct {
	SMTPFrom         string `json:"smtpFrom"`
	SMTPSmartHost    string `json:"smtpSmartHost"`
	SMTPAuthUserName string `json:"smtpAuthUsername"`
	SMTPAuthPassword string `json:"smtpAuthPassword"`
	SMTPAuthSecret   string `json:"smtpAuthSecret"`
	SMTPAuthIdentity string `json:"smtpAuthIdentity"`
	SMTPRequireTLS   bool   `json:"smtpRequiredTls"`
}

type EmailRecipientSpec

type EmailRecipientSpec struct {
	Address string `json:"address"`
}

type MonitoringV1Client

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

func NewForConfig

func NewForConfig(c *rest.Config) (*MonitoringV1Client, error)

func (*MonitoringV1Client) Alerts

func (c *MonitoringV1Client) Alerts(namespace string) AlertInterface

func (*MonitoringV1Client) Notifiers

func (c *MonitoringV1Client) Notifiers(namespace string) NotifierInterface

func (*MonitoringV1Client) RESTClient

func (c *MonitoringV1Client) RESTClient() rest.Interface

func (*MonitoringV1Client) Recipients

func (c *MonitoringV1Client) Recipients(namespace string) RecipientInterface

type MonitoringV1Interface

type MonitoringV1Interface interface {
	RESTClient() rest.Interface
	NotifiersGetter
	RecipientsGetter
	AlertsGetter
}

type Notifier

type Notifier struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              NotifierSpec `json:"spec"`
	//TODO: check what should do with status
	Status *NotifierStatus `json:"status,omitempty"`
}

func NotifierFromUnstructured

func NotifierFromUnstructured(r *unstructured.Unstructured) (*Notifier, error)

type NotifierInterface

type NotifierInterface interface {
	Create(*Notifier) (*Notifier, error)
	Get(name string, opts metav1.GetOptions) (*Notifier, error)
	Update(*Notifier) (*Notifier, error)
	Delete(name string, options *metav1.DeleteOptions) error
	//List(opts metav1.ListOptions) (runtime.Object, error)
	List(opts metav1.ListOptions) (*NotifierList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
	DeleteCollection(dopts *metav1.DeleteOptions, lopts metav1.ListOptions) error
}

type NotifierList

type NotifierList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []*Notifier `json:"items"`
}

type NotifierSpec

type NotifierSpec struct {
	PodMetadata     *metav1.ObjectMeta   `json:"podMetadata,omitempty"`
	Type            string               `json:"type,omitempty"`
	EmailConfig     *EmailConfigSpec     `json:"emailConfig,omitempty"`
	SlackConfig     *SlackConfigSpec     `json:"slackConfig,omitempty"`
	PagerDutyConfig *PagerDutyConfigSpec `json:"pagerdutyConfig,omitempty"`
}

type NotifierStatus

type NotifierStatus struct {
	Paused bool `json:"paused"`
}

TODO: decide the field in status

type NotifiersGetter

type NotifiersGetter interface {
	Notifiers(namespace string) NotifierInterface
}

type PagerDutyConfigSpec

type PagerDutyConfigSpec struct {
	PagerDutyUrl string `json:"pagerdutyUrl"`
}

type PagerDutyRecipientSpec

type PagerDutyRecipientSpec struct {
	ServiceKey string `json:"serviceKey"`
}

type Recipient

type Recipient struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              RecipientSpec `json:"spec"`

	//TODO: check what should do with status
	Status *RecipientStatus `json:"status,omitempty"`
}

func RecipientFromUnstructured

func RecipientFromUnstructured(r *unstructured.Unstructured) (*Recipient, error)

type RecipientInterface

type RecipientInterface interface {
	Create(*Recipient) (*Recipient, error)
	Get(name string, opts metav1.GetOptions) (*Recipient, error)
	Update(*Recipient) (*Recipient, error)
	Delete(name string, options *metav1.DeleteOptions) error
	//List(opts metav1.ListOptions) (runtime.Object, error)
	List(opts metav1.ListOptions) (*RecipientList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
	DeleteCollection(dopts *metav1.DeleteOptions, lopts metav1.ListOptions) error
}

type RecipientList

type RecipientList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []*Recipient `json:"items"`
}

type RecipientSpec

type RecipientSpec struct {
	PodMetadata        *metav1.ObjectMeta      `json:"podMetadata,omitempty"`
	Type               string                  `json:"type,omitempty"`
	EmailRecipient     *EmailRecipientSpec     `json:"emailRecipient,omitempty"`
	SlackRecipient     *SlackRecipientSpec     `json:"slackRecipient,omitempty"`
	PagerDutyRecipient *PagerDutyRecipientSpec `json:"pagerdutyRecipient,omitempty"`
}

type RecipientStatus

type RecipientStatus struct {
	Paused bool `json:"paused"`
}

TODO: decide the field in status

type RecipientsGetter

type RecipientsGetter interface {
	Recipients(namespace string) RecipientInterface
}

type ServiceRuleSpec

type ServiceRuleSpec struct {
	UnhealthyPercetage string `json:"unhealthyPercentage, omitempty"`
}

type SlackConfigSpec

type SlackConfigSpec struct {
	SlackApiUrl string `json:"slackApiUrl"`
}

type SlackRecipientSpec

type SlackRecipientSpec struct {
	Channel string `json:"channel"`
}

Jump to

Keyboard shortcuts

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