monitor

package
v0.3.10-0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertCloneDashboardOptions

type AlertCloneDashboardOptions struct {
	ID        string `help:"ID of alart " json:"-"`
	CloneName string `json:"clone_name" help:"new dashboard name"`
}

func (*AlertCloneDashboardOptions) GetId

func (*AlertCloneDashboardOptions) Params

type AlertClonePanelOptions

type AlertClonePanelOptions struct {
	ID             string `help:"ID of alart " json:"-"`
	PanelId        string `help:"ID of alertPanel" json:"panel_id"`
	ClonePanelName string `help:"new panel name" json:"clone_panel_name"`
}

func (*AlertClonePanelOptions) GetId

func (o *AlertClonePanelOptions) GetId() string

func (*AlertClonePanelOptions) Params

type AlertConditionOptions

type AlertConditionOptions struct {
	REDUCER    string   `help:"Metric query reducer, e.g. 'avg'" choices:"avg|sum|min|max|count|last|median"`
	DATABASE   string   `help:"Metric database, e.g. 'telegraf'"`
	METRIC     string   `help:"Query metric format <measurement>.<field>, e.g. 'cpu.cpu_usage'"`
	COMPARATOR string   `help:"Evaluator compare" choices:"gt|lt"`
	THRESHOLD  float64  `help:"Alert threshold"`
	Period     string   `help:"Query metric period e.g. '5m', '1h'" default:"5m"`
	Tag        []string `help:"Query tag, e.g. 'zone=zon0,name=vmname'"`
}

func (AlertConditionOptions) Params

type AlertCreateOptions

type AlertCreateOptions struct {
	AlertConditionOptions
	AlertStatesOptions
	NAME      string `help:"Name of the alert"`
	Frequency string `help:"Alert execute frequency, e.g. '5m', '1h'"`
	Enabled   bool   `help:"Enable alert"`
	Level     string `help:"Alert level"`
	For       string `help:"For time duration"`
}

func (AlertCreateOptions) Params

func (opt AlertCreateOptions) Params() (jsonutils.JSONObject, error)

type AlertDashBoardCreateOptions

type AlertDashBoardCreateOptions struct {
	apis.ScopedResourceCreateInput
	NAME    string `help:"Name of bashboard"`
	Refresh string `help:"dashboard query refresh priod e.g. 1m|5m"`
}

func (*AlertDashBoardCreateOptions) Params

type AlertDashBoardDeleteOptions

type AlertDashBoardDeleteOptions struct {
	ID string `json:"-"`
}

func (*AlertDashBoardDeleteOptions) GetId

func (*AlertDashBoardDeleteOptions) Params

type AlertDashBoardListOptions

type AlertDashBoardListOptions struct {
	options.BaseListOptions
}

func (*AlertDashBoardListOptions) Params

type AlertDashBoardShowOptions

type AlertDashBoardShowOptions struct {
	ID string `help:"ID of Metric " json:"-"`
}

func (*AlertDashBoardShowOptions) GetId

func (o *AlertDashBoardShowOptions) GetId() string

func (*AlertDashBoardShowOptions) Params

type AlertDeleteOptions

type AlertDeleteOptions struct {
	ID []string `help:"ID of alert to delete"`
}

func (AlertDeleteOptions) GetIds

func (o AlertDeleteOptions) GetIds() []string

func (AlertDeleteOptions) Params

type AlertListOptions

type AlertListOptions struct {
	options.BaseListOptions
}

func (AlertListOptions) Params

type AlertNotificationAttachOptions

type AlertNotificationAttachOptions struct {
	ALERT        string `help:"ID or name of alert"`
	NOTIFICATION string `help:"ID or name of alert notification"`
	UsedBy       string `help:"UsedBy annotation"`
}

type AlertNotificationListOptions

type AlertNotificationListOptions struct {
	options.BaseListOptions
	Alert        string `help:"ID or name of alert" short-token:"a"`
	Notification string `help:"ID or name of notification" short-token:"n"`
}

func (AlertNotificationListOptions) Params

type AlertPanelCreateOptions

type AlertPanelCreateOptions struct {
	apis.ScopedResourceCreateInput

	DashboardId string `help:"id of attached dashboard"`
	NAME        string `help:"Name of bashboard"`
	Metric      string `help:"Metric name, include measurement and field, e.g. vm_cpu.usage_active" required:"true"`
	Database    string
	Interval    string `help:"query aggregation interval e.g. 1m|5s"`
	From        string `help:"query start time e.g. 5m|6h"`
	To          string `help:"query end time"`
}

func (*AlertPanelCreateOptions) Params

type AlertPanelDeleteOptions

type AlertPanelDeleteOptions struct {
	ID string `json:"-"`
}

func (*AlertPanelDeleteOptions) GetId

func (o *AlertPanelDeleteOptions) GetId() string

func (*AlertPanelDeleteOptions) Params

type AlertPanelListOptions

type AlertPanelListOptions struct {
	options.BaseListOptions
	DashboardId string `help:"id of attached dashboard"`
}

func (*AlertPanelListOptions) Params

type AlertPanelShowOptions

type AlertPanelShowOptions struct {
	ID string `help:"ID of Metric " json:"-"`
}

func (*AlertPanelShowOptions) GetId

func (o *AlertPanelShowOptions) GetId() string

func (*AlertPanelShowOptions) Params

type AlertPauseOptions

type AlertPauseOptions struct {
	ID      string `help:"ID of alert to delete"`
	UnPause bool   `help:"Unpause alert"`
}

func (AlertPauseOptions) Description

func (o AlertPauseOptions) Description() string

func (AlertPauseOptions) GetId

func (o AlertPauseOptions) GetId() string

func (AlertPauseOptions) Params

type AlertRecordListOptions

type AlertRecordListOptions struct {
	options.BaseListOptions

	AlertId  string   `help:"id of alert"`
	Level    string   `help:"alert level"`
	State    string   `help:"alert state"`
	ResTypes []string `json:"res_types"`
	ResName  string   `json:"res_name"`
	Alerting bool     `json:"alerting"`
}

func (*AlertRecordListOptions) Params

type AlertRecordShieldCreateOptions

type AlertRecordShieldCreateOptions struct {
	apis.ScopedResourceCreateInput

	AlertId string `json:"alert_id" help:"common alert Id" required:"true"`
	ResType string `json:"res_type" help:"resource tyge" choices:"host|guest|redis|oss|rds|cloudaccount"`
	ResName string `json:"res_name" help:"resource name" required:"true"`
	ResId   string `json:"res_id" help:"resource id" required:"true"`

	ShieldPeriod string `json:"shield_period" help:"shield time eg:'1m,2h'" required:"true"`
}

func (*AlertRecordShieldCreateOptions) Params

type AlertRecordShieldDeleteOptions

type AlertRecordShieldDeleteOptions struct {
	ID string `json:"-"`
}

func (*AlertRecordShieldDeleteOptions) GetId

func (*AlertRecordShieldDeleteOptions) Params

type AlertRecordShieldListOptions

type AlertRecordShieldListOptions struct {
	options.BaseListOptions

	AlertId   string   `help:"id of alert"`
	Alertname string   `json:"alertname"`
	ResName   string   `json:"res_name"`
	ResTypes  []string `json:"res_types"`
}

func (*AlertRecordShieldListOptions) Params

type AlertRecordShieldShowOptions

type AlertRecordShieldShowOptions struct {
	ID string `help:"ID of Metric " json:"-"`
}

func (*AlertRecordShieldShowOptions) GetId

func (*AlertRecordShieldShowOptions) Params

type AlertRecordShowOptions

type AlertRecordShowOptions struct {
	ID string `help:"ID of Metric " json:"-"`
}

func (*AlertRecordShowOptions) GetId

func (o *AlertRecordShowOptions) GetId() string

func (*AlertRecordShowOptions) Params

type AlertRecordTotalOptions

type AlertRecordTotalOptions struct {
	ID string `help:"total-alert" json:"-"`
	options.BaseListOptions
}

func (*AlertRecordTotalOptions) GetId

func (o *AlertRecordTotalOptions) GetId() string

func (*AlertRecordTotalOptions) Params

type AlertResourceAlertListOptions

type AlertResourceAlertListOptions struct {
	options.BaseListOptions
	Resource string `help:"ID or name of alert resource"`
	Alert    string `help:"ID or name of alert"`
}

func (AlertResourceAlertListOptions) GetMasterOpt

func (o AlertResourceAlertListOptions) GetMasterOpt() string

func (AlertResourceAlertListOptions) GetSlaveOpt

func (o AlertResourceAlertListOptions) GetSlaveOpt() string

func (AlertResourceAlertListOptions) Params

type AlertResourceDeleteOptions

type AlertResourceDeleteOptions struct {
	ID []string `help:"ID of alert resource to delete"`
}

func (AlertResourceDeleteOptions) GetIds

func (o AlertResourceDeleteOptions) GetIds() []string

func (AlertResourceDeleteOptions) Params

type AlertResourceListOptions

type AlertResourceListOptions struct {
	options.BaseListOptions
	Type string `json:"type"`
}

func (AlertResourceListOptions) Params

type AlertResourceShowOptions

type AlertResourceShowOptions struct {
	ID string `help:"ID or name of the alert resource" json:"-"`
}

func (AlertResourceShowOptions) GetId

func (o AlertResourceShowOptions) GetId() string

func (AlertResourceShowOptions) Params

type AlertShowOptions

type AlertShowOptions struct {
	ID string `help:"ID or name of the alert" json:"-"`
}

func (AlertShowOptions) GetId

func (o AlertShowOptions) GetId() string

func (AlertShowOptions) Params

type AlertStatesOptions

type AlertStatesOptions struct {
	NoDataState         string `help:"Set state when no data"`
	ExecutionErrorState string `help:"Set state when execution error"`
}

type AlertTestRunOptions

type AlertTestRunOptions struct {
	ID    string `help:"ID of alert to delete"`
	Debug bool   `help:"Show more debug info"`
}

type AlertUpdateOptions

type AlertUpdateOptions struct {
	ID        string `help:"ID or name of the alert"`
	Name      string `help:"Update alert name"`
	Frequency string `help:"Alert execute frequency, e.g. '5m', '1h'"`
	AlertStatesOptions
}

func (AlertUpdateOptions) GetId

func (opt AlertUpdateOptions) GetId() string

func (AlertUpdateOptions) Params

func (opt AlertUpdateOptions) Params() (jsonutils.JSONObject, error)

type CommonAlertConditionOptions

type CommonAlertConditionOptions struct {
	AlertConditionOptions
}

func (CommonAlertConditionOptions) Params

type CommonAlertCreateOptions

type CommonAlertCreateOptions struct {
	apis.Meta
	monitor.CommonAlertCreateBaseInput

	CommonAlertConditionOptions
	AlertStatesOptions

	NAME string `help:"Name of the alert"`
	// 报警级别
	Level string `json:"level"`
}

func (*CommonAlertCreateOptions) Params

type CommonAlertDeleteOptions

type CommonAlertDeleteOptions struct {
	ID    []string `help:"ID of alart"`
	Force bool     `help:"force to delete alert"`
}

func (*CommonAlertDeleteOptions) GetIds

func (o *CommonAlertDeleteOptions) GetIds() []string

func (*CommonAlertDeleteOptions) Params

type CommonAlertListOptions

type CommonAlertListOptions struct {
	options.BaseListOptions
	// 报警类型
	AlertType string `help:"common alert type" choices:"normal|system"`
	Level     string `help:"common alert notify level" choices:"normal|important|fatal"`
}

func (*CommonAlertListOptions) Params

type CommonAlertShowOptions

type CommonAlertShowOptions struct {
	ID string `help:"ID of alart " json:"-"`
}

func (*CommonAlertShowOptions) GetId

func (o *CommonAlertShowOptions) GetId() string

func (*CommonAlertShowOptions) Params

type CommonAlertUpdateOptions

type CommonAlertUpdateOptions struct {
	ID         string `help:"ID of alart " json:"-"`
	Period     string `help:"exec period of alert" json:"period"`
	Comparator string `help:"Alarm policy threshold comparison method" json:"comparator" `
	Threshold  string `help:"Alarm policy threshold" json:"threshold"`
}

func (*CommonAlertUpdateOptions) GetId

func (o *CommonAlertUpdateOptions) GetId() string

func (*CommonAlertUpdateOptions) Params

type DataSourceCreateOptions

type DataSourceCreateOptions struct {
	NAME string
}

type DataSourceDeleteOptions

type DataSourceDeleteOptions struct {
	ID string `json:"-"`
}

type DataSourceListOptions

type DataSourceListOptions struct {
	options.BaseListOptions
}

type InfluxdbShemaListOptions

type InfluxdbShemaListOptions struct {
}

type InfluxdbShemaShowOptions

type InfluxdbShemaShowOptions struct {
	ID          string `help:"attribute of the inluxdb" choices:"databases|measurements|metric-measurement"`
	Database    string `help:"influxdb database"`
	Measurement string `help:"influxdb table"`
}

func (InfluxdbShemaShowOptions) Params

type MetricDeleteOptions

type MetricDeleteOptions struct {
	ID string `help:"ID of Metric " json:"-"`
}

func (*MetricDeleteOptions) GetId

func (o *MetricDeleteOptions) GetId() string

func (*MetricDeleteOptions) Params

type MetricFieldDeleteOptions

type MetricFieldDeleteOptions struct {
	ID string `help:"ID of Metric " json:"-"`
}

func (*MetricFieldDeleteOptions) GetId

func (o *MetricFieldDeleteOptions) GetId() string

func (*MetricFieldDeleteOptions) Params

type MetricFieldShowOptions

type MetricFieldShowOptions struct {
	ID string `help:"ID of Metric " json:"-"`
}

func (*MetricFieldShowOptions) GetId

func (o *MetricFieldShowOptions) GetId() string

func (*MetricFieldShowOptions) Params

type MetricFieldUpdateOptions

type MetricFieldUpdateOptions struct {
	ID          string `help:"ID of Metric " required:"true" positional:"true"`
	DisplayName string `help:"The name of the field customization" required:"true"`
	Name        string `help:"Name of Field" required:"true"`
	Unit        string `help:"Unit of Field" choices:"%|bps|Mbps|Bps|cps|count|ms|byte" required:"true"`
}

func (*MetricFieldUpdateOptions) GetId

func (o *MetricFieldUpdateOptions) GetId() string

func (*MetricFieldUpdateOptions) Params

type MetricShowOptions

type MetricShowOptions struct {
	ID string `help:"ID of Metric " json:"-"`
}

func (*MetricShowOptions) GetId

func (o *MetricShowOptions) GetId() string

func (*MetricShowOptions) Params

type MetricUpdateOptions

type MetricUpdateOptions struct {
	ID                     string `help:"ID of Metric " required:"true" positional:"true"`
	ResType                string `help:"Resource properties of measurement e.g. guest/host/redis/oss/rds" required:"true"`
	MeasurementDisplayName string `help:"The name of the measurement customization" required:"true"`
	FieldName              string `help:"Name of Field" required:"true"`
	FieldDisplayName       string `help:"The name of the field customization" required:"true"`
	Unit                   string `help:"Unit of Field" choices:"%|bps|Mbps|Bps|cps|count|ms|byte" required:"true"`
}

func (*MetricUpdateOptions) GetId

func (o *MetricUpdateOptions) GetId() string

func (*MetricUpdateOptions) Params

type MigrationAlertCreateOptions

type MigrationAlertCreateOptions struct {
	NAME        string   `help:"Name of the migration alert"`
	METRIC      string   `help:"Metric type" choices:"cpu.usage_active.gt|mem.available.lt"`
	THRESHOLD   float64  `help:"Metric threshold"`
	Period      string   `help:"Period of execution, e.g. '5m', '1h'" default:"5m"`
	SourceHost  []string `help:"Source hosts' id or name"`
	SourceGuest []string `help:"Source guests's id or name"`
	TargetHost  []string `help:"Target hosts' id or name"`
}

func (*MigrationAlertCreateOptions) Params

type MigrationAlertListOptions

type MigrationAlertListOptions struct {
	options.BaseListOptions
	MetricType string `help:"Migration alert metric type" choices:"cpu.usage_active|mem.available"`
}

func (*MigrationAlertListOptions) Params

type MigrationAlertShowOptions

type MigrationAlertShowOptions struct {
	ID string `help:"ID of alart " json:"-"`
}

func (*MigrationAlertShowOptions) GetId

func (o *MigrationAlertShowOptions) GetId() string

func (*MigrationAlertShowOptions) Params

type MonitorMetricFieldListOptions

type MonitorMetricFieldListOptions struct {
	options.BaseListOptions
	Names       []string `help:"name of field"`
	Unit        string   `help:"Unit of Field " choices:"%|bps|Mbps|Bps|cps|count|ms|byte"`
	DisplayName string   `help:"The name of the field customization"`
}

func (*MonitorMetricFieldListOptions) Params

type MonitorMetricListOptions

type MonitorMetricListOptions struct {
	options.BaseListOptions
	MeasurementName        []string `help:"name of Measurement"`
	ResType                string   `help:"Resource properties of measurement e.g. guest/host/redis/oss/rds"`
	MeasurementDisplayName string   `help:"The name of the measurement customization"`
	FieldName              []string `help:"Name of Field"`
	Unit                   string   `help:"Unit of Field " choices:"%|bps|Mbps|Bps|cps|count|ms|byte"`
	FieldDisplayName       string   `help:"The name of the field customization"`
}

func (*MonitorMetricListOptions) Params

type MonitorResourceAlertListOptions

type MonitorResourceAlertListOptions struct {
	options.BaseListOptions
	MonitorResourceId string `help:"ID of monitor resource" json:"monitor_resource_id"`
	AlertId           string `help:"ID  of alert" json:"alert_id"`
	Alerting          bool   `help:"search alerting resource" json:"alerting"`
	SendState         string `json:"send_state"`
}

func (*MonitorResourceAlertListOptions) GetMasterOpt

func (o *MonitorResourceAlertListOptions) GetMasterOpt() string

func (*MonitorResourceAlertListOptions) GetSlaveOpt

func (o *MonitorResourceAlertListOptions) GetSlaveOpt() string

func (*MonitorResourceAlertListOptions) Params

type MonitorResourceJointAlertOptions

type MonitorResourceJointAlertOptions struct {
}

func (*MonitorResourceJointAlertOptions) GetId

func (*MonitorResourceJointAlertOptions) Params

type NotificationCreateOptions

type NotificationCreateOptions struct {
	NAME string `help:"notification config name"`
	NotificationFields
}

func (NotificationCreateOptions) Params

type NotificationDeleteOptions

type NotificationDeleteOptions struct {
	ID []string `help:"ID or name of the alert notification config" json:"-"`
}

type NotificationDingDingCreateOptions

type NotificationDingDingCreateOptions struct {
	NotificationCreateOptions
	URL     string `help:"dingding webhook url"`
	MsgType string `help:"message type" choices:"markdown|actionCard" default:"markdown"`
}

func (NotificationDingDingCreateOptions) Params

type NotificationFeishuCreateOptions

type NotificationFeishuCreateOptions struct {
	NotificationCreateOptions
	APPID     string `help:"feishu robot appId"`
	APPSECRET string `help:"feishu robt appSecret"`
}

func (NotificationFeishuCreateOptions) Params

type NotificationFields

type NotificationFields struct {
	Frequency             string `help:"notify frequency, e.g. 5m, 1h"`
	IsDefault             *bool  `help:"set as default notification"`
	DisableResolveMessage *bool  `help:"disable notify recover message"`
	SendReminder          *bool  `help:"send reminder"`
}

type NotificationListOptions

type NotificationListOptions struct {
	options.BaseListOptions
}

type NotificationShowOptions

type NotificationShowOptions struct {
	ID string `help:"ID or name of the alert notification config" json:"-"`
}

type NotificationUpdateOptions

type NotificationUpdateOptions struct {
	NotificationFields

	ID                  string `help:"ID or name of the alert notification config" json:"-"`
	DisableDefault      *bool  `help:"disable as default notification" json:"-"`
	ResolveMessage      *bool  `help:"enable notify recover message" json:"-"`
	DisableSendReminder *bool  `help:"disable send reminder" json:"-"`
}

func (NotificationUpdateOptions) Params

type SimpleQueryOptions

type SimpleQueryOptions struct {
	Id         string   `json:"id"`
	Database   string   `json:"database"`
	MetricName string   `json:"metric_name"`
	StartTime  string   `json:"start_time"`
	EndTime    string   `json:"end_time"`
	Tags       []string `json:"tags"`
}

func (*SimpleQueryOptions) GetId

func (o *SimpleQueryOptions) GetId() string

func (*SimpleQueryOptions) Params

Jump to

Keyboard shortcuts

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