Documentation ¶
Index ¶
- func SetInstance(i Ops)
- type AlertManagerOps
- type Client
- func (c *Client) CreateAlertManager(alertmanager *monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error)
- func (c *Client) CreatePrometheus(prometheus *monitoringv1.Prometheus) (*monitoringv1.Prometheus, error)
- func (c *Client) CreatePrometheusRule(rule *monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error)
- func (c *Client) CreateServiceMonitor(serviceMonitor *monitoringv1.ServiceMonitor) (*monitoringv1.ServiceMonitor, error)
- func (c *Client) DeleteAlertManager(name, namespace string) error
- func (c *Client) DeletePrometheus(name, namespace string) error
- func (c *Client) DeletePrometheusRule(name, namespace string) error
- func (c *Client) DeleteServiceMonitor(name, namespace string) error
- func (c *Client) GetAlertManager(name string, namespace string) (*monitoringv1.Alertmanager, error)
- func (c *Client) GetPrometheus(name string, namespace string) (*monitoringv1.Prometheus, error)
- func (c *Client) GetPrometheusRule(name string, namespace string) (*monitoringv1.PrometheusRule, error)
- func (c *Client) GetServiceMonitor(name string, namespace string) (*monitoringv1.ServiceMonitor, error)
- func (c *Client) ListAlertManagers(namespace string) (*monitoringv1.AlertmanagerList, error)
- func (c *Client) ListPrometheusRules(namespace string) (*monitoringv1.PrometheusRuleList, error)
- func (c *Client) ListPrometheuses(namespace string) (*monitoringv1.PrometheusList, error)
- func (c *Client) ListServiceMonitors(namespace string) (*monitoringv1.ServiceMonitorList, error)
- func (c *Client) SetConfig(cfg *rest.Config)
- func (c *Client) UpdateAlertManager(alertmanager *monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error)
- func (c *Client) UpdatePrometheus(prometheus *monitoringv1.Prometheus) (*monitoringv1.Prometheus, error)
- func (c *Client) UpdatePrometheusRule(rule *monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error)
- func (c *Client) UpdateServiceMonitor(serviceMonitor *monitoringv1.ServiceMonitor) (*monitoringv1.ServiceMonitor, error)
- type Ops
- type PodOps
- type RuleOps
- type ServiceMonitorOps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInstance ¶
func SetInstance(i Ops)
SetInstance replaces the instance with the provided one. Should be used only for testing purposes.
Types ¶
type AlertManagerOps ¶
type AlertManagerOps interface { // ListAlertManagers lists all alertmanager instances in a given namespace ListAlertManagers(namespace string) (*monitoringv1.AlertmanagerList, error) // GetAlertManager gets the alert manager that matches the given name GetAlertManager(name, namespace string) (*monitoringv1.Alertmanager, error) // CreateAlertManager creates the given alert manager CreateAlertManager(*monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error) // UpdateAlertManager updates the given alert manager UpdateAlertManager(*monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error) // DeleteAlertManager deletes the given alert manager DeleteAlertManager(name, namespace string) error }
AlertManagerOps is an interface to perform AlertManager operations
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper for the prometheus operator client.
func NewForConfig ¶
NewForConfig builds a new client for the given config.
func (*Client) CreateAlertManager ¶
func (c *Client) CreateAlertManager(alertmanager *monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error)
CreateAlertManager creates the given alert manager
func (*Client) CreatePrometheus ¶
func (c *Client) CreatePrometheus(prometheus *monitoringv1.Prometheus) (*monitoringv1.Prometheus, error)
CreatePrometheus creates the given prometheus
func (*Client) CreatePrometheusRule ¶
func (c *Client) CreatePrometheusRule(rule *monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error)
CreatePrometheusRule creates the given prometheus rule
func (*Client) CreateServiceMonitor ¶
func (c *Client) CreateServiceMonitor(serviceMonitor *monitoringv1.ServiceMonitor) (*monitoringv1.ServiceMonitor, error)
CreateServiceMonitor creates the given service monitor
func (*Client) DeleteAlertManager ¶
DeleteAlertManager deletes the given alert manager
func (*Client) DeletePrometheus ¶
DeletePrometheus deletes the given prometheus
func (*Client) DeletePrometheusRule ¶
DeletePrometheusRule deletes the given prometheus rule
func (*Client) DeleteServiceMonitor ¶
DeleteServiceMonitor deletes the given service monitor
func (*Client) GetAlertManager ¶
func (c *Client) GetAlertManager(name string, namespace string) (*monitoringv1.Alertmanager, error)
GetAlertManager gets the alert manager that matches the given name
func (*Client) GetPrometheus ¶
func (c *Client) GetPrometheus(name string, namespace string) (*monitoringv1.Prometheus, error)
GetPrometheus gets the prometheus instance that matches the given name
func (*Client) GetPrometheusRule ¶
func (c *Client) GetPrometheusRule(name string, namespace string) (*monitoringv1.PrometheusRule, error)
GetPrometheusRule gets the prometheus rule that matches the given name
func (*Client) GetServiceMonitor ¶
func (c *Client) GetServiceMonitor(name string, namespace string) (*monitoringv1.ServiceMonitor, error)
GetServiceMonitor gets the service monitor instance that matches the given name
func (*Client) ListAlertManagers ¶
func (c *Client) ListAlertManagers(namespace string) (*monitoringv1.AlertmanagerList, error)
ListAlertManagers lists all alertmanager instances in a given namespace
func (*Client) ListPrometheusRules ¶
func (c *Client) ListPrometheusRules(namespace string) (*monitoringv1.PrometheusRuleList, error)
ListPrometheusRules creates the given prometheus rule
func (*Client) ListPrometheuses ¶
func (c *Client) ListPrometheuses(namespace string) (*monitoringv1.PrometheusList, error)
ListPrometheuses lists all prometheus instances in a given namespace
func (*Client) ListServiceMonitors ¶
func (c *Client) ListServiceMonitors(namespace string) (*monitoringv1.ServiceMonitorList, error)
ListServiceMonitors lists all servicemonitors in a given namespace
func (*Client) UpdateAlertManager ¶
func (c *Client) UpdateAlertManager(alertmanager *monitoringv1.Alertmanager) (*monitoringv1.Alertmanager, error)
UpdateAlertManager updates the given alert manager
func (*Client) UpdatePrometheus ¶
func (c *Client) UpdatePrometheus(prometheus *monitoringv1.Prometheus) (*monitoringv1.Prometheus, error)
UpdatePrometheus updates the given prometheus
func (*Client) UpdatePrometheusRule ¶
func (c *Client) UpdatePrometheusRule(rule *monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error)
UpdatePrometheusRule updates the given prometheus rule
func (*Client) UpdateServiceMonitor ¶
func (c *Client) UpdateServiceMonitor(serviceMonitor *monitoringv1.ServiceMonitor) (*monitoringv1.ServiceMonitor, error)
UpdateServiceMonitor updates the given service monitor
type Ops ¶
type Ops interface { ServiceMonitorOps PodOps RuleOps AlertManagerOps // SetConfig sets the config and resets the client SetConfig(config *rest.Config) }
Ops is an interface to perform Prometheus object operations.
func NewInstanceFromConfigFile ¶
NewInstanceFromConfigFile returns new instance of client by using given config file
type PodOps ¶
type PodOps interface { // ListPrometheuses lists all prometheus instances in a given namespace ListPrometheuses(namespace string) (*monitoringv1.PrometheusList, error) // GetPrometheus gets the prometheus instance that matches the given name GetPrometheus(name, namespace string) (*monitoringv1.Prometheus, error) // CreatePrometheus creates the given prometheus CreatePrometheus(*monitoringv1.Prometheus) (*monitoringv1.Prometheus, error) // UpdatePrometheus updates the given prometheus UpdatePrometheus(*monitoringv1.Prometheus) (*monitoringv1.Prometheus, error) // DeletePrometheus deletes the given prometheus DeletePrometheus(name, namespace string) error }
PodOps is an interface to perform Prometheus operations
type RuleOps ¶
type RuleOps interface { // ListPrometheusRules creates the given prometheus rule ListPrometheusRules(namespace string) (*monitoringv1.PrometheusRuleList, error) // GetPrometheusRule gets the prometheus rule that matches the given name GetPrometheusRule(name, namespace string) (*monitoringv1.PrometheusRule, error) // CreatePrometheusRule creates the given prometheus rule CreatePrometheusRule(*monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error) // UpdatePrometheusRule updates the given prometheus rule UpdatePrometheusRule(*monitoringv1.PrometheusRule) (*monitoringv1.PrometheusRule, error) // DeletePrometheusRule deletes the given prometheus rule DeletePrometheusRule(name, namespace string) error }
RuleOps is an interface to perform PrometheusRule operations
type ServiceMonitorOps ¶
type ServiceMonitorOps interface { // ListServiceMonitors lists all servicemonitors in a given namespace ListServiceMonitors(namespace string) (*monitoringv1.ServiceMonitorList, error) // GetServiceMonitor gets the service monitor instance that matches the given name GetServiceMonitor(name, namespace string) (*monitoringv1.ServiceMonitor, error) // CreateServiceMonitor creates the given service monitor CreateServiceMonitor(*monitoringv1.ServiceMonitor) (*monitoringv1.ServiceMonitor, error) // UpdateServiceMonitor updates the given service monitor UpdateServiceMonitor(*monitoringv1.ServiceMonitor) (*monitoringv1.ServiceMonitor, error) // DeleteServiceMonitor deletes the given service monitor DeleteServiceMonitor(name, namespace string) error }
ServiceMonitorOps is an interface to perform ServiceMonitor operations