Documentation ¶
Index ¶
- Constants
- Variables
- func AddNotifyDBHookResources(keywordPlurals ...string)
- func EventNotify(ctx context.Context, userCred mcclient.TokenCredential, ep SEventNotifyParam)
- func EventNotifyServiceAbnormal(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func FetchNotifyAdminRecipients(ctx context.Context, region string, users []string, groups []string)
- func IntelliNotify(ctx context.Context, recipientId []string, isGroup bool, ...)
- func Notify(recipientId []string, isGroup bool, priority npk.TNotifyPriority, event string, ...)
- func NotifyAllWithoutRobot(recipientId []string, isGroup bool, priority npk.TNotifyPriority, event string, ...) error
- func NotifyAllWithoutRobotWithCtx(ctx context.Context, recipientId []string, isGroup bool, ...) error
- func NotifyCritical(recipientId []string, isGroup bool, event string, data jsonutils.JSONObject)
- func NotifyCriticalWithCtx(ctx context.Context, recipientId []string, isGroup bool, event string, ...)
- func NotifyError(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func NotifyGeneralSystemError(data jsonutils.JSONObject)
- func NotifyGeneralSystemErrorWithCtx(ctx context.Context, data jsonutils.JSONObject)
- func NotifyImportant(recipientId []string, isGroup bool, event string, data jsonutils.JSONObject)
- func NotifyImportantWithCtx(ctx context.Context, recipientId []string, isGroup bool, event string, ...)
- func NotifyNormal(recipientId []string, isGroup bool, event string, data jsonutils.JSONObject)
- func NotifyNormalWithCtx(ctx context.Context, recipientId []string, isGroup bool, event string, ...)
- func NotifyRobot(robotIds []string, priority npk.TNotifyPriority, event string, ...) error
- func NotifyRobotWithCtx(ctx context.Context, robotIds []string, priority npk.TNotifyPriority, ...) error
- func NotifySystemError(idstr string, name string, event string, reason string)
- func NotifySystemErrorWithCtx(ctx context.Context, idstr string, name string, event string, reason string)
- func NotifySystemWarning(idstr string, name string, event string, reason string)
- func NotifySystemWarningWithCtx(ctx context.Context, idstr string, name string, event string, reason string)
- func NotifyVmIntegrity(ctx context.Context, name string)
- func NotifyWebhook(ctx context.Context, userCred mcclient.TokenCredential, obj db.IModel, ...)
- func NotifyWithContact(ctx context.Context, contacts []string, channel npk.TNotifyChannel, ...)
- func NotifyWithCtx(ctx context.Context, recipientId []string, isGroup bool, ...)
- func NotifyWithTag(ctx context.Context, params SNotifyParams)
- func RawNotify(recipientId []string, isGroup bool, channel npk.TNotifyChannel, ...)
- func RawNotifyWithCtx(ctx context.Context, recipientId []string, isGroup bool, ...)
- func SystemEventNotify(ctx context.Context, action api.SAction, resType string, ...)
- func SystemExceptionNotify(ctx context.Context, action api.SAction, resType string, ...)
- func SystemExceptionNotifyWithResult(ctx context.Context, action api.SAction, resType string, result api.SResult, ...)
- func SystemNotify(priority npk.TNotifyPriority, event string, data jsonutils.JSONObject)
- func SystemNotifyWithCtx(ctx context.Context, priority npk.TNotifyPriority, event string, ...)
- type SAdminSessionGenerator
- type SEvent
- type SEventMessage
- type SEventNotifyParam
- type SNotifyParams
- type SSystemEventMsg
- type SUserLangFetcher
Constants ¶
View Source
const ( SYSTEM_ERROR = "SYSTEM_ERROR" SYSTEM_WARNING = "SYSTEM_WARNING" SERVER_CREATED = "SERVER_CREATED" SERVER_CREATED_ADMIN = "SERVER_CREATED_ADMIN" SERVER_DELETED = "SERVER_DELETED" SERVER_DELETED_ADMIN = "SERVER_DELETED_ADMIN" SERVER_REBUILD_ROOT = "SERVER_REBUILD_ROOT" SERVER_CHANGE_FLAVOR = "SERVER_CHANGE_FLAVOR" SERVER_PANICKED = "SERVER_PANICKED" IMAGE_ACTIVED = "IMAGE_ACTIVED" USER_LOGIN_EXCEPTION = "USER_LOGIN_EXCEPTION" )
Variables ¶
View Source
var ( Event SEvent ActionCreate = api.ActionCreate ActionDelete = api.ActionDelete ActionUpdate = api.ActionUpdate ActionRebuildRoot = api.ActionRebuildRoot ActionResetPassword = api.ActionResetPassword ActionChangeConfig = api.ActionChangeConfig ActionResize = api.ActionResize ActionExpiredRelease = api.ActionExpiredRelease ActionExecute = api.ActionExecute ActionMigrate = api.ActionMigrate ActionCreateBackupServer = api.ActionCreateBackupServer ActionDelBackupServer = api.ActionDelBackupServer ActionSyncStatus = api.ActionSyncStatus ActionNetOutOfSync = api.ActionNetOutOfSync ActionMysqlOutOfSync = api.ActionMysqlOutOfSync ActionServiceAbnormal = api.ActionServiceAbnormal ActionServerPanicked = api.ActionServerPanicked ActionPendingDelete = api.ActionPendingDelete ActionSyncCreate = api.ActionSyncCreate ActionSyncUpdate = api.ActionSyncUpdate ActionSyncDelete = api.ActionSyncDelete ActionSyncAccountStatus = api.ActionSyncAccountStatus ActionIsolatedDeviceCreate = api.ActionIsolatedDeviceCreate ActionIsolatedDeviceUpdate = api.ActionIsolatedDeviceUpdate ActionIsolatedDeviceDelete = api.ActionIsolatedDeviceDelete )
View Source
var ( AdminSessionGenerator SAdminSessionGenerator = getAdminSesion UserLangFetcher SUserLangFetcher = getUserLang )
Functions ¶
func AddNotifyDBHookResources ¶
func AddNotifyDBHookResources(keywordPlurals ...string)
func EventNotify ¶
func EventNotify(ctx context.Context, userCred mcclient.TokenCredential, ep SEventNotifyParam)
func EventNotifyServiceAbnormal ¶
func EventNotifyServiceAbnormal(ctx context.Context, userCred mcclient.TokenCredential, service, method, path string, body jsonutils.JSONObject, err error)
func IntelliNotify ¶
func IntelliNotify(ctx context.Context, recipientId []string, isGroup bool, channel npk.TNotifyChannel, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject, createReceiver bool)
IntelliNotify try to create receiver nonexistent if createReceiver is set to true
func Notify ¶
func Notify(recipientId []string, isGroup bool, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject)
func NotifyAllWithoutRobot ¶
func NotifyAllWithoutRobot(recipientId []string, isGroup bool, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject) error
NotifyAllWithoutRobot will send messages via all contacnt type from exclude robot contact type such as dingtalk-robot.
func NotifyAllWithoutRobotWithCtx ¶
func NotifyAllWithoutRobotWithCtx(ctx context.Context, recipientId []string, isGroup bool, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject) error
NotifyAllWithoutRobot will send messages via all contacnt type from exclude robot contact type such as dingtalk-robot.
func NotifyCritical ¶
func NotifyCritical(recipientId []string, isGroup bool, event string, data jsonutils.JSONObject)
func NotifyCriticalWithCtx ¶
func NotifyError ¶
func NotifyError(ctx context.Context, userCred mcclient.TokenCredential, idstr, name, event, reason string)
func NotifyGeneralSystemError ¶
func NotifyGeneralSystemError(data jsonutils.JSONObject)
func NotifyGeneralSystemErrorWithCtx ¶
func NotifyGeneralSystemErrorWithCtx(ctx context.Context, data jsonutils.JSONObject)
func NotifyImportant ¶
func NotifyImportant(recipientId []string, isGroup bool, event string, data jsonutils.JSONObject)
func NotifyImportantWithCtx ¶
func NotifyNormal ¶
func NotifyNormal(recipientId []string, isGroup bool, event string, data jsonutils.JSONObject)
func NotifyNormalWithCtx ¶
func NotifyRobot ¶
func NotifyRobot(robotIds []string, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject) error
NotifyRobot will send messages via all robot contact type such as dingtalk-robot.
func NotifyRobotWithCtx ¶
func NotifyRobotWithCtx(ctx context.Context, robotIds []string, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject) error
NotifyRobot will send messages via all robot contact type such as dingtalk-robot.
func NotifySystemError ¶
func NotifySystemWarning ¶
func NotifyVmIntegrity ¶
func NotifyWebhook ¶
func NotifyWithContact ¶
func NotifyWithContact(ctx context.Context, contacts []string, channel npk.TNotifyChannel, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject)
func NotifyWithCtx ¶
func NotifyWithCtx(ctx context.Context, recipientId []string, isGroup bool, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject)
func NotifyWithTag ¶
func NotifyWithTag(ctx context.Context, params SNotifyParams)
func RawNotify ¶
func RawNotify(recipientId []string, isGroup bool, channel npk.TNotifyChannel, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject)
func RawNotifyWithCtx ¶
func RawNotifyWithCtx(ctx context.Context, recipientId []string, isGroup bool, channel npk.TNotifyChannel, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject)
func SystemEventNotify ¶
func SystemExceptionNotify ¶
func SystemNotify ¶
func SystemNotify(priority npk.TNotifyPriority, event string, data jsonutils.JSONObject)
func SystemNotifyWithCtx ¶
func SystemNotifyWithCtx(ctx context.Context, priority npk.TNotifyPriority, event string, data jsonutils.JSONObject)
Types ¶
type SAdminSessionGenerator ¶
type SEvent ¶
type SEvent struct {
// contains filtered or unexported fields
}
func (SEvent) ResourceType ¶
func (SEvent) WithResourceType ¶
func (se SEvent) WithResourceType(manager db.IModelManager) SEvent
type SEventMessage ¶
type SEventNotifyParam ¶
type SNotifyParams ¶
type SNotifyParams struct { RecipientId []string IsGroup bool Priority npk.TNotifyPriority Event string Data jsonutils.JSONObject Tag string Metadata map[string]interface{} IgnoreNonexistentReceiver bool }
type SSystemEventMsg ¶
Click to show internal directories.
Click to hide internal directories.