models

package
v0.0.0-...-6410feb Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AlertNotificationUsedByMeterAlert     = monitor.AlertNotificationUsedByMeterAlert
	AlertNotificationUsedByNodeAlert      = monitor.AlertNotificationUsedByNodeAlert
	AlertNotificationUsedByCommonAlert    = monitor.AlertNotificationUsedByCommonAlert
	AlertNotificationUsedByMigrationAlert = monitor.AlertNotificationUsedByMigrationAlert
)
View Source
const (
	ErrAlertResourceDriverNotFound       = errors.Error("Alert resource driver not found")
	ErrAlertResourceDriverDuplicateMatch = errors.Error("Alert resource driver duplicate match")
)
View Source
const (
	CommonAlertMetadataAlertType = "alert_type"
	CommonAlertMetadataFieldOpt  = "field_opt"
	CommonAlertMetadataPointStr  = "point_str"
	CommonAlertMetadataName      = "meta_name"

	COMPANY_COPYRIGHT_ONECLOUD = "云联"
	BRAND_ONECLOUD_NAME_CN     = "云联壹云"
	BRAND_ONECLOUD_NAME_EN     = "YunionCloud"
)
View Source
const (
	VICTORIA_METRICS_DB_TAG_KEY          = "db"
	VICTORIA_METRICS_DB_TAG_VAL_TELEGRAF = "telegraf"
)
View Source
const (
	MeterAlertMetadataType      = "type"
	MeterAlertMetadataProjectId = "project_id"
	MeterAlertMetadataAccountId = "account_id"
	MeterAlertMetadataProvider  = "provider"
)
View Source
const (
	NodeAlertMetadataType     = "type"
	NodeAlertMetadataNodeId   = "node_id"
	NodeAlertMetadataNodeName = "node_name"
)
View Source
const (
	V1AlertDisabledStatus = "Disabled"
	V1AlertEnabledStatus  = "Enabled"
)
View Source
const (
	AlertMetadataTitle = "alert_title"
)
View Source
const (
	DEFAULT_SHEILD_TIME = 100 // year
)
View Source
const (
	ErrAlertChannotChangeStateOnPaused = errors.Error("Cannot change state on pause alert")
)
View Source
const (
	INTERNAL_ID = "internal"
)
View Source
const (
	TELEGRAF_DATABASE = "telegraf"
)

Variables

This section is empty.

Functions

func FetchAllRemoteDomainProjects

func FetchAllRemoteDomainProjects(ctx context.Context) ([]*db.STenant, []*db.STenant, error)

func FormatFileSize

func FormatFileSize(fileSize float64, unit string, unitsize float64) (size string)

单位转换 保留2位小数

func GetGlobalSettingsDictionary

func GetGlobalSettingsDictionary(ctx context.Context, param string) (val string)

func GetMeasurementField

func GetMeasurementField(metric string) (string, string, error)

func GetMeterAlertQuery

func GetMeterAlertQuery(
	input monitor.MeterAlertCreateInput,
	measurement string,
	db string,
	allAccountIds []string,
	groupByStr string,
) (
	monitor.MetricQuery,
	monitor.Condition,
	monitor.Condition)

func GetMeterAlertSetting

func GetMeterAlertSetting(
	input monitor.MeterAlertCreateInput,
	measurement string,
	db string,
	accountIds []string,
	groupByStr string,
) monitor.AlertSetting

func GetModelTaskManager

func GetModelTaskManager() *appsrv.SWorkerManager

func GetOnecloudResources

func GetOnecloudResources(resTyep string) ([]jsonutils.JSONObject, error)

func GetResourceSyncMap

func GetResourceSyncMap() map[string]IResourceSync

func InitDB

func InitDB() error

func IsQuerySelectHasField

func IsQuerySelectHasField(selects monitor.MetricQuerySelect, field string) bool

func ListAllResources

func ListAllResources(manager modulebase.Manager, params *jsonutils.JSONDict) ([]jsonutils.JSONObject, error)

func PerformConfigLog

func PerformConfigLog(model db.IModel, userCred mcclient.TokenCredential)

func RationalizeValueFromUnit

func RationalizeValueFromUnit(value float64, unit string, opt string) string

func RegisterAlertResourceDriverFactory

func RegisterAlertResourceDriverFactory(drvs ...IAlertResourceDriverFactory)

func RegistryResourceSync

func RegistryResourceSync(sync IResourceSync) error

func RunModelTask

func RunModelTask(name string, obj db.IStandaloneModel, f func() error)

func SetQueryHostType

func SetQueryHostType(q *jsonutils.JSONDict)

func ValidateQuerySignature

func ValidateQuerySignature(input jsonutils.JSONObject) error

Types

type AccountResourceSync

type AccountResourceSync struct {
	SyncObject
}

func (*AccountResourceSync) SyncType

func (g *AccountResourceSync) SyncType() string

type Accounts

type Accounts map[string]*SAccount

+onecloud:swagger-gen-ignore

func (Accounts) AddModel

func (a Accounts) AddModel(i db.IModel)

func (Accounts) Copy

func (a Accounts) Copy() apihelper.IModelSet

func (Accounts) GetResType

func (a Accounts) GetResType() string

func (Accounts) ModelManager

func (a Accounts) ModelManager() modulebase.IBaseManager

func (Accounts) NeedSync

func (s Accounts) NeedSync() bool

func (Accounts) NewModel

func (a Accounts) NewModel() db.IModel

type AlertResourceUniqCond

type AlertResourceUniqCond struct {
	Type monitor.AlertResourceType
	Name string
}

type AlertRuleTag

type AlertRuleTag struct {
	Key   string
	Value string
}

type AlertRuleTags

type AlertRuleTags map[string]AlertRuleTag

type AlertSetStateInput

type AlertSetStateInput struct {
	State           monitor.AlertStateType
	EvalData        jsonutils.JSONObject
	UpdateStateTime time.Time
	ExecutionError  string
}

type AlertStatusCount

type AlertStatusCount struct {
	CountId    int64
	AlertState string
}

type AlertTestRunner

type AlertTestRunner interface {
	DoTest(ruleDef *SAlert, userCred mcclient.TokenCredential, input monitor.AlertTestRunInput) (*monitor.AlertTestRunOutput, error)
}

type Domains

type Domains map[string]*SDomain

+onecloud:swagger-gen-ignore

func (Domains) AddModel

func (d Domains) AddModel(i db.IModel)

func (Domains) Copy

func (d Domains) Copy() apihelper.IModelSet

func (Domains) GetResType

func (d Domains) GetResType() string

func (Domains) ModelManager

func (d Domains) ModelManager() modulebase.IBaseManager

func (Domains) NeedSync

func (d Domains) NeedSync() bool

func (Domains) NewModel

func (d Domains) NewModel() db.IModel

type Guest

type Guest struct {
	db.SModelBase
	compute_api.ServerDetails
}

+onecloud:swagger-gen-ignore

type GuestResourceSync

type GuestResourceSync struct {
	SyncObject
}

func (*GuestResourceSync) SyncType

func (g *GuestResourceSync) SyncType() string

type Host

type Host struct {
	db.SModelBase
	compute_api.HostDetails
}

+onecloud:swagger-gen-ignore

type HostResourceSync

type HostResourceSync struct {
	SyncObject
}

func (*HostResourceSync) SyncType

func (self *HostResourceSync) SyncType() string

type Hosts

type Hosts map[string]*Host

+onecloud:swagger-gen-ignore

func (Hosts) AddModel

func (h Hosts) AddModel(i db.IModel)

func (Hosts) Copy

func (h Hosts) Copy() apihelper.IModelSet

func (Hosts) GetResType

func (h Hosts) GetResType() string

func (Hosts) ModelManager

func (h Hosts) ModelManager() modulebase.IBaseManager

func (Hosts) ModelParamFilter

func (s Hosts) ModelParamFilter() jsonutils.JSONObject

func (Hosts) NeedSync

func (s Hosts) NeedSync() bool

func (Hosts) NewModel

func (h Hosts) NewModel() db.IModel

type IAlertResourceDriver

type IAlertResourceDriver interface {
	// GetType return the driver type
	GetType() monitor.AlertResourceType
	// GetUniqCond get uniq match conditions from eval match to find AlertResource
	GetUniqCond() *AlertResourceUniqCond
}

func GetAlertResourceDriver

func GetAlertResourceDriver(match monitor.EvalMatch) (IAlertResourceDriver, error)

type IAlertResourceDriverFactory

type IAlertResourceDriverFactory interface {
	// GetType return the driver type
	GetType() monitor.AlertResourceType

	// IsEvalMatched match driver by monitor.EvalMatch
	IsEvalMatched(input monitor.EvalMatch) bool

	GetDriver(input monitor.EvalMatch) IAlertResourceDriver
}

type IAlertResourceJointModel

type IAlertResourceJointModel interface {
	db.IJointModel

	GetAlertResource() (*SAlertResource, error)
	GetDetails(base monitor.AlertResourceJointBaseDetails, isList bool) interface{}
}

type ICommonAlert

type ICommonAlert interface {
	db.IModel

	RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error
	DeleteAttachAlertRecords(ctx context.Context, userCred mcclient.TokenCredential) []error
	DetachAlertResourceOnDisable(ctx context.Context, userCred mcclient.TokenCredential) []error
	DetachMonitorResourceJoint(ctx context.Context, userCred mcclient.TokenCredential) error
	UpdateMonitorResourceJoint(ctx context.Context, userCred mcclient.TokenCredential) error
	GetMoreDetails(ctx context.Context, out monitor.CommonAlertDetails) (monitor.CommonAlertDetails, error)
}

type IMeterAlertDriver

type IMeterAlertDriver interface {
	GetType() string
	GetName() string
	GetFor() time.Duration
	ToAlertCreateInput(input monitor.MeterAlertCreateInput, allAccountIds []string, level string) monitor.AlertCreateInput
}

type IMetricMeasurementCache

type IMetricMeasurementCache interface {
	Get(measurementName string) (*SMetricMeasurement, bool)
}

type IMonitorResModelSet

type IMonitorResModelSet interface {
	apihelper.IModelSet
	GetResType() string
	NeedSync() bool
}

type IMonitorResourceCache

type IMonitorResourceCache interface {
	Get(resId string) (jsonutils.JSONObject, bool)
}

type IResourceSync

type IResourceSync interface {
	SyncResources(ctx context.Context, userCred mcclient.TokenCredential, param jsonutils.JSONObject) error
	SyncType() string
}

func GetResourceSyncByType

func GetResourceSyncByType(syncType string) IResourceSync

func NewAccountResourceSync

func NewAccountResourceSync() IResourceSync

func NewGuestResourceSync

func NewGuestResourceSync() IResourceSync

func NewHostResourceSync

func NewHostResourceSync() IResourceSync

func NewOssResourceSync

func NewOssResourceSync() IResourceSync

func NewRdsResourceSync

func NewRdsResourceSync() IResourceSync

func NewRedisResourceSync

func NewRedisResourceSync() IResourceSync

func NewStorageResourceSync

func NewStorageResourceSync() IResourceSync

type ISubscriptionManager

type ISubscriptionManager interface {
	SetAlert(alert *SCommonAlert)
	DeleteAlert(alert *SCommonAlert)
}

type InfluxdbSubscription

type InfluxdbSubscription struct {
	SubName  string
	DataBase string
	//retention policy
	Rc  string
	Url string
}

type MigrateNote

type MigrateNote struct {
	Guest  *MigrateNoteGuest  `json:"guest"`
	Target *MigrateNoteTarget `json:"target_host"`
	Error  string             `json:"error"`
}

type MigrateNoteGuest

type MigrateNoteGuest struct {
	Id        string  `json:"id"`
	Name      string  `json:"name"`
	HostId    string  `json:"host_id"`
	Host      string  `json:"host"`
	VCPUCount int     `json:"vcpu_count"`
	VMemSize  int     `json:"vmem_size"`
	Score     float64 `json:"score"`
}

type MigrateNoteTarget

type MigrateNoteTarget struct {
	Id    string  `json:"id"`
	Name  string  `json:"name"`
	Score float64 `json:"score"`
}

type MonitorResModelSets

type MonitorResModelSets struct {
	Servers  Servers
	Hosts    Hosts
	Rds      Rds
	Redis    Redis
	Oss      Oss
	Accounts Accounts
	Storages Storages
	Domains  Domains
	Projects Projects
}

func NewModelSets

func NewModelSets() *MonitorResModelSets

func (*MonitorResModelSets) ApplyUpdates

func (*MonitorResModelSets) Copy

func (*MonitorResModelSets) CopyJoined

func (m *MonitorResModelSets) CopyJoined() apihelper.IModelSets

func (*MonitorResModelSets) ModelSetList

func (m *MonitorResModelSets) ModelSetList() []apihelper.IModelSet

func (*MonitorResModelSets) NewEmpty

type Oss

type Oss map[string]*SOss

+onecloud:swagger-gen-ignore

func (Oss) AddModel

func (o Oss) AddModel(i db.IModel)

func (Oss) Copy

func (o Oss) Copy() apihelper.IModelSet

func (Oss) GetResType

func (o Oss) GetResType() string

func (Oss) ModelManager

func (o Oss) ModelManager() modulebase.IBaseManager

func (Oss) NeedSync

func (s Oss) NeedSync() bool

func (Oss) NewModel

func (o Oss) NewModel() db.IModel

type OssResourceSync

type OssResourceSync struct {
	SyncObject
}

func (*OssResourceSync) SyncType

func (g *OssResourceSync) SyncType() string

type Projects

type Projects map[string]*SProject

+onecloud:swagger-gen-ignore

func (Projects) AddModel

func (p Projects) AddModel(i db.IModel)

func (Projects) Copy

func (p Projects) Copy() apihelper.IModelSet

func (Projects) GetResType

func (p Projects) GetResType() string

func (Projects) ModelManager

func (p Projects) ModelManager() modulebase.IBaseManager

func (Projects) NeedSync

func (p Projects) NeedSync() bool

func (Projects) NewModel

func (p Projects) NewModel() db.IModel

type Rds

type Rds map[string]*SRds

+onecloud:swagger-gen-ignore

func (Rds) AddModel

func (r Rds) AddModel(i db.IModel)

func (Rds) Copy

func (r Rds) Copy() apihelper.IModelSet

func (Rds) GetResType

func (r Rds) GetResType() string

func (Rds) ModelManager

func (r Rds) ModelManager() modulebase.IBaseManager

func (Rds) NeedSync

func (s Rds) NeedSync() bool

func (Rds) NewModel

func (r Rds) NewModel() db.IModel

type RdsResourceSync

type RdsResourceSync struct {
	SyncObject
}

func (*RdsResourceSync) SyncType

func (g *RdsResourceSync) SyncType() string

type Redis

type Redis map[string]*SRedis

+onecloud:swagger-gen-ignore

func (Redis) AddModel

func (r Redis) AddModel(i db.IModel)

func (Redis) Copy

func (r Redis) Copy() apihelper.IModelSet

func (Redis) GetResType

func (r Redis) GetResType() string

func (Redis) ModelManager

func (r Redis) ModelManager() modulebase.IBaseManager

func (Redis) NeedSync

func (s Redis) NeedSync() bool

func (Redis) NewModel

func (r Redis) NewModel() db.IModel

type RedisResourceSync

type RedisResourceSync struct {
	SyncObject
}

func (*RedisResourceSync) SyncType

func (g *RedisResourceSync) SyncType() string

type SAccount

type SAccount struct {
	db.SModelBase
	compute_api.CloudaccountDetail
}

+onecloud:swagger-gen-ignore

type SAlert

type SAlert struct {
	//db.SVirtualResourceBase
	db.SEnabledResourceBase
	db.SStatusStandaloneResourceBase
	SMonitorScopedResource

	// Frequency is evaluate period
	Frequency int64                `nullable:"false" list:"user" create:"required" update:"user"`
	Settings  jsonutils.JSONObject `nullable:"false" list:"user" create:"required" update:"user" length:"medium"`
	Level     string               `charset:"ascii" width:"36" nullable:"false" default:"normal" list:"user" update:"user"`
	Message   string               `charset:"utf8" list:"user" create:"optional" update:"user"`
	UsedBy    string               `charset:"ascii" create:"optional" list:"user"`

	// Silenced       bool
	ExecutionError string `charset:"utf8" list:"user"`

	// If an alert rule has a configured `For` and the query violates the configured threshold
	// it will first go from `OK` to `Pending`. Going from `OK` to `Pending` will not send any
	// notifications. Once the alert rule has been firing for more than `For` duration, it will
	// change to `Alerting` and send alert notifications.
	For int64 `nullable:"false" list:"user" update:"user"`

	EvalData            jsonutils.JSONObject `list:"user" length:"medium"`
	State               string               `width:"36" charset:"ascii" nullable:"false" default:"unknown" list:"user" update:"user"`
	NoDataState         string               `width:"36" charset:"ascii" nullable:"false" default:"no_data" create:"optional"  list:"user" update:"user"`
	ExecutionErrorState string               `width:"36" charset:"ascii" nullable:"false" default:"alerting" create:"optional" list:"user" update:"user"`
	LastStateChange     time.Time            `list:"user"`
	StateChanges        int                  `default:"0" nullable:"false" list:"user"`
	CustomizeConfig     jsonutils.JSONObject `list:"user" create:"optional" update:"user" length:"medium"`
	ResType             string               `width:"32" list:"user" update:"user"`
}

func (*SAlert) AttachNotification

func (alert *SAlert) AttachNotification(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	noti *SNotification,
	state monitor.AlertNotificationStateType,
	usedBy string) (*SAlertnotification, error)

func (*SAlert) CustomizeCreate

func (alert *SAlert) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SAlert) CustomizeDelete

func (alert *SAlert) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject,
) error

func (*SAlert) GetAlertResources

func (alert *SAlert) GetAlertResources() ([]*SAlertResource, error)

func (*SAlert) GetExecutionErrorState

func (alert *SAlert) GetExecutionErrorState() monitor.ExecutionErrorOption

func (*SAlert) GetNoDataState

func (alert *SAlert) GetNoDataState() monitor.NoDataOption

func (*SAlert) GetNotifications

func (alert *SAlert) GetNotifications() ([]SAlertnotification, error)

func (*SAlert) GetNotificationsQuery

func (alert *SAlert) GetNotificationsQuery() *sqlchemy.SQuery

func (*SAlert) GetSettings

func (alert *SAlert) GetSettings() (*monitor.AlertSetting, error)

func (*SAlert) GetState

func (alert *SAlert) GetState() monitor.AlertStateType

func (*SAlert) GetTitle

func (alert *SAlert) GetTitle() string

func (*SAlert) IsAttachNotification

func (alert *SAlert) IsAttachNotification(noti *SNotification) (bool, error)

func (*SAlert) IsEnable

func (alert *SAlert) IsEnable() bool

func (*SAlert) PerformDisable

func (alert *SAlert) PerformDisable(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformDisableInput) (jsonutils.JSONObject, error)

func (*SAlert) PerformEnable

func (alert *SAlert) PerformEnable(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformEnableInput) (jsonutils.JSONObject, error)

func (*SAlert) PerformPause

func (alert *SAlert) PerformPause(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	input monitor.AlertPauseInput,
) (jsonutils.JSONObject, error)

func (*SAlert) PerformTestRun

func (alert *SAlert) PerformTestRun(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	input monitor.AlertTestRunInput,
) (*monitor.AlertTestRunOutput, error)

func (*SAlert) PostCreate

func (alert *SAlert) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SAlert) SetDisable

func (alert *SAlert) SetDisable() error

func (*SAlert) SetEnable

func (alert *SAlert) SetEnable() error

func (*SAlert) SetFor

func (alert *SAlert) SetFor(forTime time.Duration) error

func (*SAlert) SetState

func (alert *SAlert) SetState(input AlertSetStateInput) error

func (*SAlert) SetTitle

func (alert *SAlert) SetTitle(ctx context.Context, t string) error

func (*SAlert) SetUsedBy

func (alert *SAlert) SetUsedBy(usedBy string) error

func (*SAlert) ShouldUpdateState

func (alert *SAlert) ShouldUpdateState(newState monitor.AlertStateType) bool

func (*SAlert) TestRunAlert

func (alert *SAlert) TestRunAlert(userCred mcclient.TokenCredential, input monitor.AlertTestRunInput) (*monitor.AlertTestRunOutput, error)

func (*SAlert) ValidateUpdateData

func (alert *SAlert) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input monitor.AlertUpdateInput) (monitor.AlertUpdateInput, error)

type SAlertDashBoard

type SAlertDashBoard struct {
	//db.SVirtualResourceBase
	db.SEnabledResourceBase
	db.SStatusStandaloneResourceBase
	db.SScopedResourceBase

	Refresh string `nullable:"false" list:"user" create:"required" update:"user"`
}

func (*SAlertDashBoard) CustomizeCreate

func (dash *SAlertDashBoard) CustomizeCreate(
	ctx context.Context, userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider,
	query jsonutils.JSONObject,
	data jsonutils.JSONObject,
) error

func (*SAlertDashBoard) CustomizeDelete

func (dash *SAlertDashBoard) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SAlertDashBoard) GetMoreDetails

func (*SAlertDashBoard) PerformCloneDashboard

func (*SAlertDashBoard) PerformClonePanel

func (*SAlertDashBoard) PerformSetScope

func (*SAlertDashBoard) PostCreate

func (*SAlertDashBoard) ValidateUpdateData

func (dash *SAlertDashBoard) ValidateUpdateData(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	data *jsonutils.JSONDict,
) (*jsonutils.JSONDict, error)

type SAlertDashBoardManager

var AlertDashBoardManager *SAlertDashBoardManager

func (*SAlertDashBoardManager) FetchCustomizeColumns

func (man *SAlertDashBoardManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.AlertDashBoardDetails

func (*SAlertDashBoardManager) ListItemExportKeys

func (*SAlertDashBoardManager) ListItemFilter

func (*SAlertDashBoardManager) NamespaceScope

func (manager *SAlertDashBoardManager) NamespaceScope() rbacscope.TRbacScope

func (*SAlertDashBoardManager) OrderByExtraFields

type SAlertDashboardPanel

type SAlertDashboardPanel struct {
	db.SVirtualJointResourceBase

	DashboardId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
	PanelId     string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
}

func (*SAlertDashboardPanel) Detach

func (joint *SAlertDashboardPanel) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

type SAlertDashboardPanelManager

type SAlertDashboardPanelManager struct {
	db.SJointResourceBaseManager
}
var (
	AlertDashBoardPanelManager *SAlertDashboardPanelManager
)

func (*SAlertDashboardPanelManager) GetMasterFieldName

func (man *SAlertDashboardPanelManager) GetMasterFieldName() string

func (*SAlertDashboardPanelManager) GetSlaveFieldName

func (man *SAlertDashboardPanelManager) GetSlaveFieldName() string

type SAlertJointsBase

type SAlertJointsBase struct {
	db.SVirtualJointResourceBase

	AlertId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
}

+onecloud:swagger-gen-ignore

type SAlertJointsManager

type SAlertJointsManager struct {
	db.SJointResourceBaseManager
}

+onecloud:swagger-gen-ignore

func NewAlertJointsManager

func NewAlertJointsManager(
	dt interface{}, tableName string,
	keyword string, keywordPlural string,
	slave db.IStandaloneModelManager) SAlertJointsManager

func (*SAlertJointsManager) FetchCustomizeColumns

func (man *SAlertJointsManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.AlertJointResourceBaseDetails

func (*SAlertJointsManager) GetMasterFieldName

func (man *SAlertJointsManager) GetMasterFieldName() string

type SAlertManager

type SAlertManager struct {
	//db.SVirtualResourceBaseManager
	db.SEnabledResourceBaseManager
	db.SStatusStandaloneResourceBaseManager
	SMonitorScopedResourceManager
	// contains filtered or unexported fields
}
var (
	AlertManager *SAlertManager
)

func NewAlertManager

func NewAlertManager(dt interface{}, keyword, keywordPlural string) *SAlertManager

func (*SAlertManager) CustomizeFilterList

func (man *SAlertManager) CustomizeFilterList(
	ctx context.Context, q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential, query jsonutils.JSONObject) (
	*db.CustomizeListFilters, error)

func (*SAlertManager) FetchAllAlerts

func (man *SAlertManager) FetchAllAlerts() ([]SAlert, error)

func (*SAlertManager) FetchCustomizeColumns

func (man *SAlertManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.AlertDetails

func (*SAlertManager) GetAlert

func (man *SAlertManager) GetAlert(id string) (*SAlert, error)

func (*SAlertManager) GetTester

func (man *SAlertManager) GetTester() AlertTestRunner

func (*SAlertManager) ListItemExportKeys

func (manager *SAlertManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, keys stringutils2.SSortedStrings) (*sqlchemy.SQuery, error)

func (*SAlertManager) ListItemFilter

func (man *SAlertManager) ListItemFilter(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	input monitor.AlertListInput,
) (*sqlchemy.SQuery, error)

func (*SAlertManager) NamespaceScope

func (manager *SAlertManager) NamespaceScope() rbacscope.TRbacScope

func (*SAlertManager) OrderByExtraFields

func (man *SAlertManager) OrderByExtraFields(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	input monitor.AlertListInput,
) (*sqlchemy.SQuery, error)

func (*SAlertManager) QueryDistinctExtraField

func (man *SAlertManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)

func (*SAlertManager) SetTester

func (man *SAlertManager) SetTester(tester AlertTestRunner)

type SAlertNotificationManager

type SAlertNotificationManager struct {
	SAlertJointsManager
}

+onecloud:swagger-gen-ignore

var AlertNotificationManager *SAlertNotificationManager

func (*SAlertNotificationManager) FetchCustomizeColumns

func (man *SAlertNotificationManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.AlertnotificationDetails

func (*SAlertNotificationManager) Get

func (man *SAlertNotificationManager) Get(alertId string, notiId string) (*SAlertnotification, error)

func (*SAlertNotificationManager) GetSlaveFieldName

func (man *SAlertNotificationManager) GetSlaveFieldName() string

func (*SAlertNotificationManager) ValidateCreateData

type SAlertNotificationStateManager

type SAlertNotificationStateManager struct {
	db.SStandaloneResourceBaseManager
}

type SAlertPanel

type SAlertPanel struct {
	db.SStatusStandaloneResourceBase
	db.SScopedResourceBase

	Settings jsonutils.JSONObject `nullable:"false" list:"user" create:"required" update:"user"`
	Message  string               `charset:"utf8" list:"user" create:"optional" update:"user"`
}

func (*SAlertPanel) ClonePanel

func (panel *SAlertPanel) ClonePanel(ctx context.Context, dashboardId string,
	input monitor.AlertClonePanelInput) (*SAlertPanel, error)

func (*SAlertPanel) CustomizeCreate

func (panel *SAlertPanel) CustomizeCreate(
	ctx context.Context, userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider,
	query jsonutils.JSONObject,
	data jsonutils.JSONObject,
) error

func (*SAlertPanel) CustomizeDelete

func (panel *SAlertPanel) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SAlertPanel) GetCommonAlertMetricDetailsFromAlertCondition

func (dash *SAlertPanel) GetCommonAlertMetricDetailsFromAlertCondition(index int,
	cond *monitor.AlertCondition) *monitor.
	CommonAlertMetricDetails

func (*SAlertPanel) GetMoreDetails

func (panel *SAlertPanel) GetMoreDetails(out monitor.PanelDetails) (monitor.PanelDetails, error)

func (*SAlertPanel) GetSettings

func (dash *SAlertPanel) GetSettings() (*monitor.AlertSetting, error)

func (*SAlertPanel) ValidateUpdateData

func (dash *SAlertPanel) ValidateUpdateData(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	data *jsonutils.JSONDict,
) (*jsonutils.JSONDict, error)

type SAlertPanelManager

var (
	AlertPanelManager *SAlertPanelManager
)

func (*SAlertPanelManager) FetchCustomizeColumns

func (man *SAlertPanelManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.PanelDetails

func (*SAlertPanelManager) HasName

func (man *SAlertPanelManager) HasName() bool

func (*SAlertPanelManager) ListItemExportKeys

func (manager *SAlertPanelManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential,
	keys stringutils2.SSortedStrings) (*sqlchemy.SQuery, error)

func (*SAlertPanelManager) ListItemFilter

func (*SAlertPanelManager) NamespaceScope

func (manager *SAlertPanelManager) NamespaceScope() rbacscope.TRbacScope

func (*SAlertPanelManager) OrderByExtraFields

func (man *SAlertPanelManager) OrderByExtraFields(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	input monitor.AlertPanelListInput,
) (*sqlchemy.SQuery, error)

type SAlertRecord

type SAlertRecord struct {
	//db.SVirtualResourceBase
	db.SEnabledResourceBase
	db.SStatusStandaloneResourceBase
	SMonitorScopedResource

	AlertId   string               `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required"`
	Level     string               `charset:"ascii" width:"36" nullable:"false" default:"normal" list:"user" update:"user"`
	State     string               `width:"36" charset:"ascii" nullable:"false" default:"unknown" list:"user" update:"user"`
	SendState string               `width:"36" charset:"ascii" default:"ok" list:"user" update:"user"`
	EvalData  jsonutils.JSONObject `list:"user" update:"user" length:"medium"`
	AlertRule jsonutils.JSONObject `list:"user" update:"user" length:"medium"`
	ResType   string               `width:"36" list:"user" update:"user"`
}

func (*SAlertRecord) CustomizeCreate

func (record *SAlertRecord) CustomizeCreate(
	ctx context.Context, userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider,
	query jsonutils.JSONObject,
	data jsonutils.JSONObject,
) error

func (*SAlertRecord) GetEvalData

func (record *SAlertRecord) GetEvalData() ([]monitor.EvalMatch, error)

func (*SAlertRecord) GetMoreDetails

func (record *SAlertRecord) GetMoreDetails(out monitor.AlertRecordDetails) (monitor.AlertRecordDetails, error)

func (*SAlertRecord) GetState

func (record *SAlertRecord) GetState() monitor.AlertStateType

func (*SAlertRecord) PostCreate

func (record *SAlertRecord) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)

type SAlertRecordManager

var (
	AlertRecordManager *SAlertRecordManager
)

func (*SAlertRecordManager) DeleteRecordsOfThirtyDaysAgo

func (manager *SAlertRecordManager) DeleteRecordsOfThirtyDaysAgo(ctx context.Context, userCred mcclient.TokenCredential,
	isStart bool)

func (*SAlertRecordManager) FetchCustomizeColumns

func (man *SAlertRecordManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.AlertRecordDetails

func (*SAlertRecordManager) GetAlertRecord

func (man *SAlertRecordManager) GetAlertRecord(id string) (*SAlertRecord, error)

func (*SAlertRecordManager) GetAlertRecordsByAlertId

func (man *SAlertRecordManager) GetAlertRecordsByAlertId(id string) ([]SAlertRecord, error)

func (*SAlertRecordManager) GetPropertyTotalAlert

func (manager *SAlertRecordManager) GetPropertyTotalAlert(ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SAlertRecordManager) ListItemExportKeys

func (manager *SAlertRecordManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, keys stringutils2.SSortedStrings) (*sqlchemy.SQuery, error)

func (*SAlertRecordManager) ListItemFilter

func (*SAlertRecordManager) NamespaceScope

func (manager *SAlertRecordManager) NamespaceScope() rbacscope.TRbacScope

func (*SAlertRecordManager) OrderByExtraFields

func (*SAlertRecordManager) QueryDistinctExtraField

func (manager *SAlertRecordManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)

type SAlertRecordShield

type SAlertRecordShield struct {
	//db.SVirtualResourceBase
	db.SEnabledResourceBase
	db.SStatusStandaloneResourceBase
	SMonitorScopedResource

	AlertId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" json:"alert_id"`
	ResId   string `width:"36" nullable:"false"  create:"optional" list:"user" update:"user" json:"res_id"`
	ResType string `width:"36" nullable:"false"  create:"optional" list:"user" update:"user" json:"res_type"`

	StartTime time.Time `required:"optional" list:"user" update:"user" json:"start_time"`
	EndTime   time.Time `required:"optional" list:"user" update:"user" json:"end_time"`
}

func (*SAlertRecordShield) GetMoreDetails

func (*SAlertRecordShield) PostCreate

type SAlertRecordShieldManager

var (
	AlertRecordShieldManager *SAlertRecordShieldManager
)

func (*SAlertRecordShieldManager) FetchCustomizeColumns

func (man *SAlertRecordShieldManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.AlertRecordShieldDetails

func (*SAlertRecordShieldManager) GetRecordShields

func (*SAlertRecordShieldManager) HasName

func (man *SAlertRecordShieldManager) HasName() bool

func (*SAlertRecordShieldManager) ListItemExportKeys

func (*SAlertRecordShieldManager) ListItemFilter

func (*SAlertRecordShieldManager) OrderByExtraFields

type SAlertResource

type SAlertResource struct {
	db.SStandaloneResourceBase
	Type string `charset:"ascii" width:"36" nullable:"false" create:"required" list:"user"`
}

SAlertResource records alerting single resource, one resource has multi alerts

func (*SAlertResource) CustomizeDelete

func (res *SAlertResource) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SAlertResource) DetachAlert

func (res *SAlertResource) DetachAlert(ctx context.Context, userCred mcclient.TokenCredential, alertId string) error

func (*SAlertResource) GetJointAlert

func (res *SAlertResource) GetJointAlert(alertId string) (*SAlertResourceAlert, error)

func (*SAlertResource) GetType

func (res *SAlertResource) GetType() monitor.AlertResourceType

func (*SAlertResource) LogPrefix

func (res *SAlertResource) LogPrefix() string

type SAlertResourceAlert

type SAlertResourceAlert struct {
	SAlertResourceJointsBase

	AlertId       string               `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
	AlertRecordId string               `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
	TriggerTime   time.Time            `nullable:"false" index:"true" get:"user" list:"user" json:"trigger_time"`
	Data          jsonutils.JSONObject `create:"required" list:"user"`
}

+onecloud:swagger-gen-ignore

func (*SAlertResourceAlert) Detach

func (obj *SAlertResourceAlert) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SAlertResourceAlert) GetAlert

func (obj *SAlertResourceAlert) GetAlert() (*SCommonAlert, error)

func (*SAlertResourceAlert) GetData

func (obj *SAlertResourceAlert) GetData() (*monitor.EvalMatch, error)

func (*SAlertResourceAlert) GetDetails

func (obj *SAlertResourceAlert) GetDetails(base monitor.AlertResourceJointBaseDetails, isList bool) interface{}

func (*SAlertResourceAlert) UpdateData

func (obj *SAlertResourceAlert) UpdateData(record *SAlertRecord, match *monitor.EvalMatch) error

type SAlertResourceAlertManager

type SAlertResourceAlertManager struct {
	SAlertResourceJointsManager
}

+onecloud:swagger-gen-ignore

func GetAlertResourceAlertManager

func GetAlertResourceAlertManager() *SAlertResourceAlertManager

func (*SAlertResourceAlertManager) GetJointAlert

func (m *SAlertResourceAlertManager) GetJointAlert(res *SAlertResource, alertId string) (*SAlertResourceAlert, error)

func (*SAlertResourceAlertManager) GetSlaveFieldName

func (m *SAlertResourceAlertManager) GetSlaveFieldName() string

func (*SAlertResourceAlertManager) ListItemFilter

type SAlertResourceJointsBase

type SAlertResourceJointsBase struct {
	db.SJointResourceBase

	AlertResourceId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true"`
}

+onecloud:swagger-gen-ignore

func (*SAlertResourceJointsBase) GetAlertResource

func (obj *SAlertResourceJointsBase) GetAlertResource() (*SAlertResource, error)

type SAlertResourceJointsManager

type SAlertResourceJointsManager struct {
	db.SJointResourceBaseManager
}

+onecloud:swagger-gen-ignore

func NewAlertResourceJointManager

func NewAlertResourceJointManager(dt interface{}, tableName string, keyword string, keywordPlural string, slave db.IStandaloneModelManager) *SAlertResourceJointsManager

func (*SAlertResourceJointsManager) FetchCustomizeColumns

func (m *SAlertResourceJointsManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool) []interface{}

func (SAlertResourceJointsManager) GetMasterFieldName

func (m SAlertResourceJointsManager) GetMasterFieldName() string

type SAlertResourceManager

type SAlertResourceManager struct {
	db.SStandaloneResourceBaseManager
}

func GetAlertResourceManager

func GetAlertResourceManager() *SAlertResourceManager

func (*SAlertResourceManager) FetchCustomizeColumns

func (man *SAlertResourceManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.AlertResourceDetails

func (*SAlertResourceManager) GetAdminRoleUsers

func (manager *SAlertResourceManager) GetAdminRoleUsers(ctx context.Context, userCred mcclient.TokenCredential,
	isStart bool)

func (*SAlertResourceManager) ListItemFilter

func (*SAlertResourceManager) ReconcileFromRecord

func (m *SAlertResourceManager) ReconcileFromRecord(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, record *SAlertRecord) error

type SAlertnotification

type SAlertnotification struct {
	SAlertJointsBase
	NotificationId string               `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required"`
	State          string               `nullable:"false" list:"user" create:"required"`
	Index          int8                 `nullable:"false" default:"0" list:"user" list:"user" update:"user"`
	UsedBy         string               `width:"36" charset:"ascii" nullable:"true" list:"user"`
	Params         jsonutils.JSONObject `nullable:"true" list:"user" update:"user"`
}

+onecloud:swagger-gen-ignore

func (*SAlertnotification) Delete

func (joint *SAlertnotification) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SAlertnotification) Detach

func (joint *SAlertnotification) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SAlertnotification) DoSave

func (joint *SAlertnotification) DoSave(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SAlertnotification) GetNotification

func (joint *SAlertnotification) GetNotification() (*SNotification, error)

func (*SAlertnotification) GetParams

func (state *SAlertnotification) GetParams() jsonutils.JSONObject

func (*SAlertnotification) GetState

func (*SAlertnotification) GetUsedBy

func (joint *SAlertnotification) GetUsedBy() string

func (*SAlertnotification) SetToCompleted

func (state *SAlertnotification) SetToCompleted() error

func (*SAlertnotification) SetToPending

func (state *SAlertnotification) SetToPending() error

func (*SAlertnotification) ShouldSendNotification

func (join *SAlertnotification) ShouldSendNotification() (bool, error)

func (*SAlertnotification) UpdateSendTime

func (joint *SAlertnotification) UpdateSendTime() error

type SBalanceRule

type SBalanceRule struct {
}

type SCommonAlert

type SCommonAlert struct {
	SAlert
}

func (*SCommonAlert) AllowDeleteItem

func (alert *SCommonAlert) AllowDeleteItem(ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) bool

func (*SCommonAlert) CustomizeCreate

func (alert *SCommonAlert) CustomizeCreate(
	ctx context.Context, userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider,
	query jsonutils.JSONObject,
	data jsonutils.JSONObject,
) error

func (*SCommonAlert) CustomizeDelete

func (alert *SCommonAlert) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SCommonAlert) Delete

func (alert *SCommonAlert) Delete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SCommonAlert) DeleteAttachAlertRecords

func (self *SCommonAlert) DeleteAttachAlertRecords(ctx context.Context, userCred mcclient.TokenCredential) (errs []error)

func (*SCommonAlert) DetachAlertResourceOnDisable

func (alert *SCommonAlert) DetachAlertResourceOnDisable(ctx context.Context,
	userCred mcclient.TokenCredential) (errs []error)

func (*SCommonAlert) DetachMonitorResourceJoint

func (alert *SCommonAlert) DetachMonitorResourceJoint(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SCommonAlert) GetAlertRule

func (alert *SCommonAlert) GetAlertRule(settings *monitor.AlertSetting, index int, silentPeriod int64) *monitor.AlertRecordRule

func (*SCommonAlert) GetAlertRules

func (alert *SCommonAlert) GetAlertRules(silentPeriod int64) ([]*monitor.AlertRecordRule, error)

func (*SCommonAlert) GetCommonAlertMetricDetails

func (alert *SCommonAlert) GetCommonAlertMetricDetails() ([]*monitor.CommonAlertMetricDetails, error)

func (*SCommonAlert) GetCommonAlertMetricDetailsFromAlertCondition

func (alert *SCommonAlert) GetCommonAlertMetricDetailsFromAlertCondition(index int, cond *monitor.AlertCondition) *monitor.CommonAlertMetricDetails

func (*SCommonAlert) GetMoreDetails

func (*SCommonAlert) GetSilentPeriod

func (alert *SCommonAlert) GetSilentPeriod() (int64, error)

func (*SCommonAlert) PerformConfig

func (*SCommonAlert) PerformDisable

func (*SCommonAlert) PerformEnable

func (*SCommonAlert) PerformSetScope

func (alert *SCommonAlert) PerformSetScope(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SCommonAlert) PostCreate

func (*SCommonAlert) PostUpdate

func (alert *SCommonAlert) PostUpdate(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SCommonAlert) RealDelete

func (alert *SCommonAlert) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SCommonAlert) StartDeleteTask

func (self *SCommonAlert) StartDeleteTask(ctx context.Context, userCred mcclient.TokenCredential)

func (*SCommonAlert) StartDetachMonitorAlertJointTask

func (alert *SCommonAlert) StartDetachMonitorAlertJointTask(ctx context.Context, userCred mcclient.TokenCredential)

func (*SCommonAlert) StartDetachTask

func (alert *SCommonAlert) StartDetachTask(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SCommonAlert) StartUpdateMonitorAlertJointTask

func (alert *SCommonAlert) StartUpdateMonitorAlertJointTask(ctx context.Context, userCred mcclient.TokenCredential)

func (*SCommonAlert) UpdateMonitorResourceJoint

func (alert *SCommonAlert) UpdateMonitorResourceJoint(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SCommonAlert) UpdateNotification

func (alert *SCommonAlert) UpdateNotification(ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SCommonAlert) UpdateResType

func (alert *SCommonAlert) UpdateResType() error

func (*SCommonAlert) ValidateUpdateData

func (alert *SCommonAlert) ValidateUpdateData(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	data *jsonutils.JSONDict,
) (*jsonutils.JSONDict, error)

type SCommonAlertManager

type SCommonAlertManager struct {
	SAlertManager
	// contains filtered or unexported fields
}
var (
	CommonAlertManager *SCommonAlertManager
)

func GetCommonAlertManager

func GetCommonAlertManager() *SCommonAlertManager

func (*SCommonAlertManager) CustomizeFilterList

func (*SCommonAlertManager) DeleteSubscriptionAlert

func (man *SCommonAlertManager) DeleteSubscriptionAlert(alert *SCommonAlert)

func (*SCommonAlertManager) DetachAlertResourceByAlertId

func (manager *SCommonAlertManager) DetachAlertResourceByAlertId(ctx context.Context,
	userCred mcclient.TokenCredential, alertId string) (errs []error)

func (*SCommonAlertManager) FetchCustomizeColumns

func (man *SCommonAlertManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.CommonAlertDetails

func (*SCommonAlertManager) FieldListFilter

func (man *SCommonAlertManager) FieldListFilter(q *sqlchemy.SQuery, input monitor.CommonAlertListInput)

func (*SCommonAlertManager) GetAlert

func (man *SCommonAlertManager) GetAlert(id string) (*SCommonAlert, error)

func (*SCommonAlertManager) GetAlerts

func (manager *SCommonAlertManager) GetAlerts(input monitor.CommonAlertListInput) ([]SCommonAlert, error)

func (*SCommonAlertManager) GetExportExtraKeys

func (manager *SCommonAlertManager) GetExportExtraKeys(ctx context.Context, keys stringutils2.SSortedStrings, rowMap map[string]string) *jsonutils.JSONDict

func (*SCommonAlertManager) GetOwnerId

func (*SCommonAlertManager) GetSystemAlerts

func (self *SCommonAlertManager) GetSystemAlerts() ([]SCommonAlert, error)

func (*SCommonAlertManager) Init

func (manager *SCommonAlertManager) Init() error

func (*SCommonAlertManager) ListItemFilter

func (*SCommonAlertManager) NamespaceScope

func (man *SCommonAlertManager) NamespaceScope() rbacscope.TRbacScope

func (*SCommonAlertManager) QueryDistinctExtraField

func (manager *SCommonAlertManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)

func (*SCommonAlertManager) Run

func (man *SCommonAlertManager) Run(ctx context.Context) error

func (*SCommonAlertManager) SetSubscriptionAlert

func (man *SCommonAlertManager) SetSubscriptionAlert(alert *SCommonAlert)

func (*SCommonAlertManager) SetSubscriptionManager

func (man *SCommonAlertManager) SetSubscriptionManager(sman ISubscriptionManager)

func (*SCommonAlertManager) UpdateAlertsResType

func (man *SCommonAlertManager) UpdateAlertsResType(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SCommonAlertManager) ValidateMetricQuery

func (man *SCommonAlertManager) ValidateMetricQuery(metricRequest *monitor.CommonMetricInputQuery, scope string, ownerId mcclient.IIdentityProvider) error

type SCompanyInfo

type SCompanyInfo struct {
	Copyright string `json:"copyright"`
	Name      string `json:"name"`
}

func GetCompanyInfo

func GetCompanyInfo(ctx context.Context) (SCompanyInfo, error)

type SDataSource

type SDataSource struct {
	db.SStandaloneResourceBase

	Type      string            `nullable:"false" list:"user"`
	Url       string            `nullable:"false" list:"user"`
	User      string            `width:"64" charset:"utf8" nullable:"true"`
	Password  string            `width:"64" charset:"utf8" nullable:"true"`
	Database  string            `width:"64" charset:"utf8" nullable:"true"`
	IsDefault tristate.TriState `default:"false" create:"optional"`
}

type SDataSourceManager

type SDataSourceManager struct {
	db.SStandaloneResourceBaseManager
}
var (
	DataSourceManager *SDataSourceManager
)

func (*SDataSourceManager) AddSubscription

func (self *SDataSourceManager) AddSubscription(subscription InfluxdbSubscription) error

func (*SDataSourceManager) DropSubscription

func (self *SDataSourceManager) DropSubscription(subscription InfluxdbSubscription) error

func (*SDataSourceManager) GetDatabases

func (self *SDataSourceManager) GetDatabases() (jsonutils.JSONObject, error)

func (*SDataSourceManager) GetMeasurements

func (self *SDataSourceManager) GetMeasurements(query jsonutils.JSONObject,
	measurementFilter, tagFilter string) (jsonutils.JSONObject,
	error)

func (*SDataSourceManager) GetMeasurementsWithDescriptionInfos

func (self *SDataSourceManager) GetMeasurementsWithDescriptionInfos(query jsonutils.JSONObject, tagFilter *monitor.MetricQueryTag) (jsonutils.JSONObject, error)

func (*SDataSourceManager) GetMeasurementsWithOutTimeFilter

func (self *SDataSourceManager) GetMeasurementsWithOutTimeFilter(query jsonutils.JSONObject,
	measurementFilter, tagFilter string) (jsonutils.JSONObject,
	error)

func (*SDataSourceManager) GetMetricMeasurement

func (self *SDataSourceManager) GetMetricMeasurement(userCred mcclient.TokenCredential, query jsonutils.JSONObject, tagFilter *monitor.MetricQueryTag) (jsonutils.JSONObject, error)

func (*SDataSourceManager) GetSource

func (m *SDataSourceManager) GetSource(id string) (*SDataSource, error)

type SDomain

type SDomain struct {
	db.SModelBase
	keystone_api.DomainDetails
}

+onecloud:swagger-gen-ignore

type SMeterAlert

type SMeterAlert struct {
	SV1Alert
}

func (*SMeterAlert) CustomizeCreate

func (alert *SMeterAlert) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SMeterAlert) CustomizeDelete

func (alert *SMeterAlert) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SMeterAlert) PostCreate

func (alert *SMeterAlert) PostCreate(ctx context.Context,
	userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider,
	query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SMeterAlert) PostUpdate

func (alert *SMeterAlert) PostUpdate(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SMeterAlert) ValidateUpdateData

type SMeterAlertManager

type SMeterAlertManager struct {
	SV1AlertManager
	// contains filtered or unexported fields
}
var MeterAlertManager *SMeterAlertManager

func NewMeterAlertManager

func NewMeterAlertManager() *SMeterAlertManager

func (*SMeterAlertManager) CustomizeFilterList

func (man *SMeterAlertManager) CustomizeFilterList(
	ctx context.Context, q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential, query jsonutils.JSONObject) (
	*db.CustomizeListFilters, error)

func (*SMeterAlertManager) FetchCustomizeColumns

func (man *SMeterAlertManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.MeterAlertDetails

func (*SMeterAlertManager) GetAlert

func (man *SMeterAlertManager) GetAlert(id string) (*SMeterAlert, error)

func (*SMeterAlertManager) GetDriver

func (man *SMeterAlertManager) GetDriver(typ string) IMeterAlertDriver

func (*SMeterAlertManager) ListItemFilter

func (*SMeterAlertManager) OrderByExtraFields

func (man *SMeterAlertManager) OrderByExtraFields(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	query monitor.MeterAlertListInput,
) (*sqlchemy.SQuery, error)

func (*SMeterAlertManager) QueryDistinctExtraField

func (man *SMeterAlertManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)

type SMetric

type SMetric struct {
	db.SVirtualJointResourceBase
	MeasurementId string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required"`
	FieldId       string `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required"`
}

func (*SMetric) Detach

func (joint *SMetric) Detach(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SMetric) DoSave

func (metric *SMetric) DoSave(ctx context.Context) error

func (*SMetric) GetMetricField

func (self *SMetric) GetMetricField(ctx context.Context) (*SMetricField, error)

type SMetricField

type SMetricField struct {
	//db.SVirtualResourceBase
	db.SEnabledResourceBase
	db.SStatusStandaloneResourceBase
	db.SScopedResourceBase

	DisplayName string `width:"256" list:"user" update:"user"`
	Unit        string `width:"32" list:"user" update:"user"`
	ValueType   string `width:"32" list:"user" update:"user"`
	Score       int    `width:"32" list:"user" update:"user" default:"99"`
}

func (*SMetricField) CustomizeDelete

func (self *SMetricField) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SMetricField) ValidateUpdateData

type SMetricFieldManager

var MetricFieldManager *SMetricFieldManager

func (*SMetricFieldManager) FetchCustomizeColumns

func (man *SMetricFieldManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.MetricFieldDetail

func (*SMetricFieldManager) GetFieldByIdOrName

func (man *SMetricFieldManager) GetFieldByIdOrName(ctx context.Context, id string, userCred mcclient.TokenCredential) (*SMetricField, error)

func (*SMetricFieldManager) ListItemExportKeys

func (manager *SMetricFieldManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential, keys stringutils2.SSortedStrings) (*sqlchemy.SQuery, error)

func (*SMetricFieldManager) ListItemFilter

func (*SMetricFieldManager) NamespaceScope

func (manager *SMetricFieldManager) NamespaceScope() rbacscope.TRbacScope

func (*SMetricFieldManager) OrderByExtraFields

func (man *SMetricFieldManager) OrderByExtraFields(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	input monitor.AlertListInput,
) (*sqlchemy.SQuery, error)

func (*SMetricFieldManager) SaveMetricField

type SMetricManager

type SMetricManager struct {
	db.SJointResourceBaseManager
}
var MetricManager *SMetricManager

func (*SMetricManager) GetMasterFieldName

func (man *SMetricManager) GetMasterFieldName() string

func (*SMetricManager) GetSlaveFieldName

func (man *SMetricManager) GetSlaveFieldName() string

type SMetricMeasurement

type SMetricMeasurement struct {
	//db.SVirtualResourceBase
	db.SEnabledResourceBase
	db.SStatusStandaloneResourceBase
	db.SScopedResourceBase

	ResType     string `width:"32" list:"user" update:"user"`
	Database    string `width:"32" list:"user" update:"user"`
	DisplayName string `width:"256" list:"user" update:"user"`
	Score       int    `width:"32" list:"user" update:"user" default:"99"`
}

func (*SMetricMeasurement) CustomizeCreate

func (measurement *SMetricMeasurement) CustomizeCreate(
	ctx context.Context, userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider,
	query jsonutils.JSONObject,
	data jsonutils.JSONObject,
) error

func (*SMetricMeasurement) CustomizeDelete

func (self *SMetricMeasurement) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SMetricMeasurement) GetMoreDetails

func (measurement *SMetricMeasurement) GetMoreDetails(out monitor.MetricDetails) (monitor.MetricDetails, error)

func (*SMetricMeasurement) PreUpdate

func (measurement *SMetricMeasurement) PreUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject,
	data jsonutils.JSONObject)

func (*SMetricMeasurement) SaveMetricField

func (measurement *SMetricMeasurement) SaveMetricField(ctx context.Context, userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider, fieldInput monitor.MetricFieldCreateInput) (*SMetricField, error)

func (*SMetricMeasurement) ValidateUpdateData

type SMetricMeasurementManager

type SMetricMeasurementManager struct {
	db.SEnabledResourceBaseManager
	db.SStatusStandaloneResourceBaseManager
	db.SScopedResourceBaseManager
	// contains filtered or unexported fields
}
var MetricMeasurementManager *SMetricMeasurementManager

func (*SMetricMeasurementManager) FetchCustomizeColumns

func (man *SMetricMeasurementManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.MetricDetails

func (*SMetricMeasurementManager) GetCache

func (*SMetricMeasurementManager) Init

func (manager *SMetricMeasurementManager) Init() error

func (*SMetricMeasurementManager) ListItemExportKeys

func (*SMetricMeasurementManager) ListItemFilter

func (*SMetricMeasurementManager) NamespaceScope

func (manager *SMetricMeasurementManager) NamespaceScope() rbacscope.TRbacScope

func (*SMetricMeasurementManager) OrderByExtraFields

func (*SMetricMeasurementManager) Run

type SMigrationAlert

type SMigrationAlert struct {
	SAlert

	MetricType   string               `create:"admin_required" list:"admin" get:"admin"`
	MigrateNotes jsonutils.JSONObject `nullable:"true" list:"admin" get:"admin" update:"admin" create:"admin_optional"`
}

func (*SMigrationAlert) CreateNotification

func (alert *SMigrationAlert) CreateNotification(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SMigrationAlert) CustomizeCreate

func (alert *SMigrationAlert) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SMigrationAlert) CustomizeDelete

func (alert *SMigrationAlert) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SMigrationAlert) GetMetricType

func (alert *SMigrationAlert) GetMetricType() monitor.MigrationAlertMetricType

func (*SMigrationAlert) GetMigrateNotes

func (alert *SMigrationAlert) GetMigrateNotes() (map[string]MigrateNote, error)

func (*SMigrationAlert) GetMigrationSettings

func (alert *SMigrationAlert) GetMigrationSettings() (*monitor.MigrationAlertSettings, error)

func (*SMigrationAlert) IsInMigrationProcess

func (alert *SMigrationAlert) IsInMigrationProcess() (bool, map[string]MigrateNote, error)

func (*SMigrationAlert) SetMigrateNote

func (alert *SMigrationAlert) SetMigrateNote(ctx context.Context, ns *MigrateNote, isDelete bool) error

type SMigrationAlertManager

type SMigrationAlertManager struct {
	SAlertManager
}

func GetMigrationAlertManager

func GetMigrationAlertManager() *SMigrationAlertManager

func (*SMigrationAlertManager) FetchAllMigrationAlerts

func (m *SMigrationAlertManager) FetchAllMigrationAlerts() ([]SMigrationAlert, error)

func (*SMigrationAlertManager) GetGuestByIdOrName

func (m *SMigrationAlertManager) GetGuestByIdOrName(id string) (jsonutils.JSONObject, error)

func (*SMigrationAlertManager) GetHostByIdOrName

func (m *SMigrationAlertManager) GetHostByIdOrName(id string) (jsonutils.JSONObject, error)

func (*SMigrationAlertManager) GetInMigrationAlerts

func (m *SMigrationAlertManager) GetInMigrationAlerts() ([]*SMigrationAlert, error)

func (*SMigrationAlertManager) GetResourceByIdOrName

func (m *SMigrationAlertManager) GetResourceByIdOrName(rType string, id string) (jsonutils.JSONObject, error)

func (*SMigrationAlertManager) ListItemFilter

func (*SMigrationAlertManager) ValidateMigrationSettings

func (m *SMigrationAlertManager) ValidateMigrationSettings(s *monitor.MigrationAlertSettings) error

func (*SMigrationAlertManager) ValidateMigrationSettingsSource

func (m *SMigrationAlertManager) ValidateMigrationSettingsSource(input *monitor.MigrationAlertSettingsSource) error

func (*SMigrationAlertManager) ValidateMigrationSettingsTarget

func (m *SMigrationAlertManager) ValidateMigrationSettingsTarget(input *monitor.MigrationAlertSettingsTarget) error

type SMonitorResource

type SMonitorResource struct {
	db.SVirtualResourceBase
	db.SEnabledResourceBase

	AlertState string `width:"36" charset:"ascii" list:"user" default:"init" update:"user" json:"alert_state"`
	ResId      string `width:"256" charset:"ascii"  index:"true" list:"user" update:"user" json:"res_id"`
	ResType    string `width:"36" charset:"ascii" list:"user" update:"user" json:"res_type"`
}

func (*SMonitorResource) AttachAlert

func (self *SMonitorResource) AttachAlert(ctx context.Context, userCred mcclient.TokenCredential, alertId string, metric string, match monitor.EvalMatch) (*SMonitorResourceAlert, error)

func (*SMonitorResource) CustomizeCreate

func (*SMonitorResource) DetachJoint

func (self *SMonitorResource) DetachJoint(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SMonitorResource) RealDelete

func (self *SMonitorResource) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error

func (*SMonitorResource) UpdateAlertState

func (self *SMonitorResource) UpdateAlertState() error

func (*SMonitorResource) UpdateAttachJoint

func (self *SMonitorResource) UpdateAttachJoint(ctx context.Context, userCred mcclient.TokenCredential, input *UpdateMonitorResourceAlertInput, match monitor.EvalMatch) error

type SMonitorResourceAlert

type SMonitorResourceAlert struct {
	db.SJointResourceBase

	MonitorResourceId string               `width:"36" charset:"ascii" nullable:"false" list:"user" create:"required" index:"true" json:"monitor_resource_id"`
	AlertId           string               `width:"36" charset:"ascii" list:"user" create:"required" index:"true"`
	AlertRecordId     string               `width:"36" charset:"ascii" list:"user" update:"user"`
	ResType           string               `width:"36" charset:"ascii" list:"user" update:"user" json:"res_type"`
	Metric            string               `width:"36" charset:"ascii" list:"user" create:"required" json:"metric"`
	AlertState        string               `width:"18" charset:"ascii" default:"init" list:"user" update:"user"`
	SendState         string               `width:"18" charset:"ascii" default:"ok" list:"user" update:"user"`
	TriggerTime       time.Time            `list:"user"  update:"user" json:"trigger_time"`
	Data              jsonutils.JSONObject `list:"user"  update:"user"`
}

func (*SMonitorResourceAlert) Detach

func (*SMonitorResourceAlert) GetAlert

func (obj *SMonitorResourceAlert) GetAlert() (*SCommonAlert, error)

func (*SMonitorResourceAlert) GetData

func (obj *SMonitorResourceAlert) GetData() (*monitor.EvalMatch, error)

func (*SMonitorResourceAlert) UpdateAlertRecordData

func (obj *SMonitorResourceAlert) UpdateAlertRecordData(input *UpdateMonitorResourceAlertInput, match *monitor.EvalMatch) error

type SMonitorResourceAlertManager

type SMonitorResourceAlertManager struct {
	db.SJointResourceBaseManager
	SMonitorScopedResourceManager
}
var (
	MonitorResourceAlertManager *SMonitorResourceAlertManager
)

func (*SMonitorResourceAlertManager) CustomizeFilterList

func (*SMonitorResourceAlertManager) DetachJoint

func (*SMonitorResourceAlertManager) FetchCustomizeColumns

func (man *SMonitorResourceAlertManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.MonitorResourceJointDetails

func (*SMonitorResourceAlertManager) FilterByOwner

func (*SMonitorResourceAlertManager) GetJoinsByListInput

func (*SMonitorResourceAlertManager) GetMasterFieldName

func (manager *SMonitorResourceAlertManager) GetMasterFieldName() string

func (*SMonitorResourceAlertManager) GetSlaveFieldName

func (manager *SMonitorResourceAlertManager) GetSlaveFieldName() string

func (*SMonitorResourceAlertManager) ListItemExportKeys

func (*SMonitorResourceAlertManager) ListItemFilter

func (*SMonitorResourceAlertManager) ResourceScope

func (manager *SMonitorResourceAlertManager) ResourceScope() rbacscope.TRbacScope

type SMonitorResourceManager

type SMonitorResourceManager struct {
	db.SVirtualResourceBaseManager
	db.SEnabledResourceBaseManager
	// contains filtered or unexported fields
}
var (
	MonitorResourceManager *SMonitorResourceManager
)

func (*SMonitorResourceManager) DeleteMonitorResources

func (manager *SMonitorResourceManager) DeleteMonitorResources(ctx context.Context, userCred mcclient.TokenCredential, input SdeleteRes) error

func (*SMonitorResourceManager) FetchCustomizeColumns

func (man *SMonitorResourceManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.MonitorResourceDetails

func (*SMonitorResourceManager) FieldListFilter

func (*SMonitorResourceManager) GetModelSets

func (manager *SMonitorResourceManager) GetModelSets() *MonitorResModelSets

func (*SMonitorResourceManager) GetMonitorResourceById

func (manager *SMonitorResourceManager) GetMonitorResourceById(id string) (*SMonitorResource, error)

func (*SMonitorResourceManager) GetMonitorResources

func (manager *SMonitorResourceManager) GetMonitorResources(input monitor.MonitorResourceListInput) ([]SMonitorResource, error)

func (*SMonitorResourceManager) GetPropertyAlert

func (*SMonitorResourceManager) GetResourceObj

func (manager *SMonitorResourceManager) GetResourceObj(id string) (bool, jsonutils.JSONObject)

func (*SMonitorResourceManager) GetResourceObjByResType

func (manager *SMonitorResourceManager) GetResourceObjByResType(typ string) (bool, []jsonutils.JSONObject)

func (*SMonitorResourceManager) GetSetType

func (manager *SMonitorResourceManager) GetSetType(set apihelper.IModelSet) (bool, string)

func (*SMonitorResourceManager) HasName

func (man *SMonitorResourceManager) HasName() bool

func (*SMonitorResourceManager) ListItemFilter

func (*SMonitorResourceManager) OrderByExtraFields

func (*SMonitorResourceManager) SetAPIHelper

func (manager *SMonitorResourceManager) SetAPIHelper(h *apihelper.APIHelper)

func (*SMonitorResourceManager) SyncManually

func (manager *SMonitorResourceManager) SyncManually(ctx context.Context)

func (*SMonitorResourceManager) SyncResources

func (manager *SMonitorResourceManager) SyncResources(ctx context.Context, mss *MonitorResModelSets) error

func (*SMonitorResourceManager) UpdateMonitorResourceAttachJoint

func (manager *SMonitorResourceManager) UpdateMonitorResourceAttachJoint(ctx context.Context, userCred mcclient.TokenCredential, input *UpdateMonitorResourceAlertInput) error

func (*SMonitorResourceManager) UpdateMonitorResourceAttachJointByRecord

func (manager *SMonitorResourceManager) UpdateMonitorResourceAttachJointByRecord(ctx context.Context, userCred mcclient.TokenCredential, record *SAlertRecord) error

type SMonitorScopedResource

type SMonitorScopedResource struct {
	db.SScopedResourceBase
}

func (*SMonitorScopedResource) CustomizeCreate

func (*SMonitorScopedResource) GetOwnerId

type SMonitorScopedResourceManager

type SMonitorScopedResourceManager struct {
	db.SScopedResourceBaseManager
}

func (*SMonitorScopedResourceManager) FetchOwnerId

func (*SMonitorScopedResourceManager) FilterByOwner

func (*SMonitorScopedResourceManager) ResourceScope

func (manager *SMonitorScopedResourceManager) ResourceScope() rbacscope.TRbacScope

type SNodeAlert

type SNodeAlert struct {
	SCommonAlert
}

func (*SNodeAlert) CustomizeCreate

func (alert *SNodeAlert) CustomizeCreate(
	ctx context.Context, userCred mcclient.TokenCredential,
	ownerId mcclient.IIdentityProvider,
	query jsonutils.JSONObject,
	data jsonutils.JSONObject,
) error

func (*SNodeAlert) CustomizeDelete

func (alert *SNodeAlert) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SNodeAlert) GetCommonAlertUpdateData

func (alert *SNodeAlert) GetCommonAlertUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input *monitor.NodeAlertUpdateInput) (jsonutils.JSONObject, error)

func (*SNodeAlert) PostCreate

func (alert *SNodeAlert) PostCreate(ctx context.Context,
	userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider,
	query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SNodeAlert) PostUpdate

func (alert *SNodeAlert) PostUpdate(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SNodeAlert) ValidateUpdateData

func (alert *SNodeAlert) ValidateUpdateData(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	input monitor.NodeAlertUpdateInput,
) (jsonutils.JSONObject, error)

type SNodeAlertManager

type SNodeAlertManager struct {
	SCommonAlertManager
}
var NodeAlertManager *SNodeAlertManager

func NewNodeAlertManager

func NewNodeAlertManager() *SNodeAlertManager

func (*SNodeAlertManager) CustomizeFilterList

func (man *SNodeAlertManager) CustomizeFilterList(
	ctx context.Context, q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential, query jsonutils.JSONObject) (
	*db.CustomizeListFilters, error)

func (*SNodeAlertManager) FetchCustomizeColumns

func (man *SNodeAlertManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.NodeAlertDetails

func (*SNodeAlertManager) GetAlert

func (man *SNodeAlertManager) GetAlert(id string) (*SNodeAlert, error)

func (*SNodeAlertManager) ListItemFilter

func (*SNodeAlertManager) OrderByExtraFields

func (man *SNodeAlertManager) OrderByExtraFields(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	query monitor.NodeAlertListInput,
) (*sqlchemy.SQuery, error)

func (*SNodeAlertManager) QueryDistinctExtraField

func (man *SNodeAlertManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)

func (*SNodeAlertManager) ValidateListConditions

func (man *SNodeAlertManager) ValidateListConditions(ctx context.Context, userCred mcclient.TokenCredential, query *jsonutils.JSONDict) (*jsonutils.JSONDict, error)

type SNotification

type SNotification struct {
	db.SVirtualResourceBase

	Type                  string `nullable:"false" list:"user" create:"required"`
	IsDefault             bool   `nullable:"false" default:"false" list:"user" create:"optional" update:"user"`
	SendReminder          bool   `nullable:"false" default:"false" list:"user" create:"optional" update:"user"`
	DisableResolveMessage bool   `nullable:"false" default:"false" list:"user" create:"optional" update:"user"`
	// unit is second
	Frequency            int64                `nullable:"false" default:"0" list:"user" create:"optional" update:"user"`
	Settings             jsonutils.JSONObject `nullable:"false" list:"user" create:"required" update:"user"`
	LastSendNotification time.Time            `list:"user" create:"optional" update:"user"`
}

func (*SNotification) AttachToAlert

func (n *SNotification) AttachToAlert(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	alertId string) (*SAlertnotification, error)

func (*SNotification) GetAlertNotificationCount

func (n *SNotification) GetAlertNotificationCount() (int, error)

func (*SNotification) IsAttached

func (n *SNotification) IsAttached() (bool, error)

func (*SNotification) ShouldSendNotification

func (n *SNotification) ShouldSendNotification() bool

func (*SNotification) UpdateSendTime

func (n *SNotification) UpdateSendTime() error

func (*SNotification) ValidateDeleteCondition

func (n *SNotification) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error

type SNotificationManager

type SNotificationManager struct {
	db.SVirtualResourceBaseManager
}

+onecloud:swagger-gen-model-singular=alert_notification +onecloud:swagger-gen-model-plural=alert_notifications

var (
	NotificationManager *SNotificationManager
)

func NewNotificationManager

func NewNotificationManager() *SNotificationManager

func (*SNotificationManager) CreateAutoMigrationNotification

func (man *SNotificationManager) CreateAutoMigrationNotification(ctx context.Context, userCred mcclient.TokenCredential, alert *SMigrationAlert) (*SNotification, error)

func (*SNotificationManager) CreateOneCloudNotification

func (man *SNotificationManager) CreateOneCloudNotification(ctx context.Context, userCred mcclient.TokenCredential, alertName string, settings *monitor.NotificationSettingOneCloud, silentPeriod string) (*SNotification, error)

func (*SNotificationManager) GetNotification

func (man *SNotificationManager) GetNotification(id string) (*SNotification, error)

func (*SNotificationManager) GetNotifications

func (man *SNotificationManager) GetNotifications(ids []string) ([]SNotification, error)

func (*SNotificationManager) GetNotificationsWithDefault

func (man *SNotificationManager) GetNotificationsWithDefault(ids []string) ([]SNotification, error)

func (*SNotificationManager) GetPlugin

func (*SNotificationManager) ListItemFilter

type SOss

type SOss struct {
	db.SModelBase
	compute_api.BucketDetails
}

+onecloud:swagger-gen-ignore

type SProject

type SProject struct {
	db.SModelBase
	keystone_api.ProjectDetails
}

+onecloud:swagger-gen-ignore

type SRds

+onecloud:swagger-gen-ignore

type SRedis

type SRedis struct {
	db.SModelBase
	compute_api.ElasticcacheDetails
}

+onecloud:swagger-gen-ignore

type SStorage

type SStorage struct {
	db.SModelBase
	compute_api.StorageDetails
}

+onecloud:swagger-gen-ignore

type SUnifiedMonitorManager

type SUnifiedMonitorManager struct {
	db.SVirtualResourceBaseManager
}
var (
	UnifiedMonitorManager *SUnifiedMonitorManager
)

func (*SUnifiedMonitorManager) GetPropertyDatabases

func (self *SUnifiedMonitorManager) GetPropertyDatabases(ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SUnifiedMonitorManager) GetPropertyMeasurements

func (self *SUnifiedMonitorManager) GetPropertyMeasurements(ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SUnifiedMonitorManager) GetPropertyMetricMeasurement

func (self *SUnifiedMonitorManager) GetPropertyMetricMeasurement(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*SUnifiedMonitorManager) GetPropertySimpleQuery

func (self *SUnifiedMonitorManager) GetPropertySimpleQuery(ctx context.Context, userCred mcclient.TokenCredential, input *monitor.SimpleQueryInput) (jsonutils.JSONObject, error)

func (*SUnifiedMonitorManager) PerformQuery

func (*SUnifiedMonitorManager) SetHandlerProcessTimeout

func (self *SUnifiedMonitorManager) SetHandlerProcessTimeout(info *appsrv.SHandlerInfo, r *http.Request) time.Duration

func (*SUnifiedMonitorManager) ValidateInputQuery

func (self *SUnifiedMonitorManager) ValidateInputQuery(query *monitor.AlertQuery, input *monitor.MetricQueryInput) error

type SUnifiedMonitorModel

type SUnifiedMonitorModel struct {
}

type SV1Alert

type SV1Alert struct {
	SAlert
}

func (*SV1Alert) CustomizeCreate

func (alert *SV1Alert) CustomizeCreate(
	ctx context.Context, userCred mcclient.TokenCredential,
	notiName, channel, recipients, usedBy string) error

func (*SV1Alert) CustomizeDelete

func (alert *SV1Alert) CustomizeDelete(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject) error

func (*SV1Alert) GetNotification

func (alert *SV1Alert) GetNotification(usedby string) (*SNotification, error)

func (*SV1Alert) GetStatus

func (alert *SV1Alert) GetStatus() string

func (*SV1Alert) PostUpdate

func (alert *SV1Alert) PostUpdate(
	ctx context.Context, userCred mcclient.TokenCredential,
	query jsonutils.JSONObject, data jsonutils.JSONObject)

func (*SV1Alert) UpdateIsEnabledStatus

func (alert *SV1Alert) UpdateIsEnabledStatus(ctx context.Context, userCred mcclient.TokenCredential, status *string) error

func (*SV1Alert) UpdateNotification

func (alert *SV1Alert) UpdateNotification(usedBy string, channel, recipients *string) error

func (*SV1Alert) ValidateUpdateData

func (alertV1 *SV1Alert) ValidateUpdateData(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	input monitor.V1AlertUpdateInput,
) (monitor.V1AlertUpdateInput, error)

type SV1AlertManager

type SV1AlertManager struct {
	SAlertManager
}

func (*SV1AlertManager) CreateNotification

func (v1man *SV1AlertManager) CreateNotification(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	alertName string,
	channel string,
	recipients string) (*SNotification, error)

func (*SV1AlertManager) FetchCustomizeColumns

func (man *SV1AlertManager) FetchCustomizeColumns(
	ctx context.Context,
	userCred mcclient.TokenCredential,
	query jsonutils.JSONObject,
	objs []interface{},
	fields stringutils2.SSortedStrings,
	isList bool,
) []monitor.AlertV1Details

func (*SV1AlertManager) ListItemFilter

func (man *SV1AlertManager) ListItemFilter(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	query monitor.V1AlertListInput,
) (*sqlchemy.SQuery, error)

func (*SV1AlertManager) OrderByExtraFields

func (man *SV1AlertManager) OrderByExtraFields(
	ctx context.Context,
	q *sqlchemy.SQuery,
	userCred mcclient.TokenCredential,
	query monitor.V1AlertListInput,
) (*sqlchemy.SQuery, error)

func (*SV1AlertManager) QueryDistinctExtraField

func (man *SV1AlertManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)

type SdeleteRes

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

type Servers

type Servers map[string]*Guest

+onecloud:swagger-gen-ignore

func (Servers) AddModel

func (s Servers) AddModel(i db.IModel)

func (Servers) Copy

func (s Servers) Copy() apihelper.IModelSet

func (Servers) GetResType

func (s Servers) GetResType() string

func (Servers) ModelFilter

func (s Servers) ModelFilter() []string

func (Servers) ModelManager

func (s Servers) ModelManager() modulebase.IBaseManager

func (Servers) NeedSync

func (s Servers) NeedSync() bool

func (Servers) NewModel

func (s Servers) NewModel() db.IModel

type StorageResourceSync

type StorageResourceSync struct {
	SyncObject
}

func (*StorageResourceSync) SyncType

func (g *StorageResourceSync) SyncType() string

type Storages

type Storages map[string]*SStorage

+onecloud:swagger-gen-ignore

func (Storages) AddModel

func (s Storages) AddModel(i db.IModel)

func (Storages) Copy

func (s Storages) Copy() apihelper.IModelSet

func (Storages) GetResType

func (s Storages) GetResType() string

func (Storages) ModelManager

func (s Storages) ModelManager() modulebase.IBaseManager

func (Storages) NeedSync

func (s Storages) NeedSync() bool

func (Storages) NewModel

func (s Storages) NewModel() db.IModel

func (Storages) SetModelListParams

func (s Storages) SetModelListParams(params *jsonutils.JSONDict) *jsonutils.JSONDict

type SyncObject

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

func (*SyncObject) SyncResources

func (self *SyncObject) SyncResources(ctx context.Context, userCred mcclient.TokenCredential,
	param jsonutils.JSONObject) error

type UpdateMonitorResourceAlertInput

type UpdateMonitorResourceAlertInput struct {
	AlertId       string
	Matches       []monitor.EvalMatch
	ResType       string
	AlertState    string
	SendState     string
	TriggerTime   time.Time
	AlertRecordId string
}

Jump to

Keyboard shortcuts

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