Documentation ¶
Index ¶
- Constants
- Variables
- func GetRobotTypeById(id string) (string, error)
- func GetRobotTypes() []string
- func GetSenderTypes() []string
- func GetValidPersonalSenderTypes() []string
- func InitDB() error
- func InitEmailQueue()
- func InitEventLog()
- func InitNotificationLog()
- func InitReceiverProject(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func Register(driver ISenderDriver)
- func SMSRegister(driver ISmsDriver)
- type IReceiver
- type ISenderDriver
- type ISmsDriver
- type SCompanyInfo
- type SConfig
- func (c *SConfig) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (c *SConfig) Delete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (c *SConfig) GetNotifyConfig() api.NotifyConfig
- func (self *SConfig) GetReceivers() ([]SReceiver, error)
- func (c *SConfig) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (c *SConfig) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (c *SConfig) PreDelete(ctx context.Context, userCred mcclient.TokenCredential)
- func (c *SConfig) RealDelete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (c *SConfig) StartRepullSubcontactTask(ctx context.Context, userCred mcclient.TokenCredential, del bool) error
- func (c *SConfig) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ConfigUpdateInput, error)
- type SConfigManager
- func (self *SConfigManager) Config(contactType, domainId string, attribution string) (*SConfig, error)
- func (self *SConfigManager) Configs(contactType string) ([]SConfig, error)
- func (cm *SConfigManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.ConfigDetails
- func (cm *SConfigManager) FilterByOwner(ctx context.Context, q *sqlchemy.SQuery, man db.FilterByOwnerProvider, ...) *sqlchemy.SQuery
- func (manager *SConfigManager) GetPropertyCapability(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (self *SConfigManager) HasSystemConfig(contactType string) (bool, error)
- func (confManager *SConfigManager) InitializeData() error
- func (manager *SConfigManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (self *SConfigManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (cm *SConfigManager) OrderByExtraFields(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (cm *SConfigManager) PerformValidate(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ConfigValidateOutput, error)
- func (cm *SConfigManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)
- func (cm *SConfigManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ConfigCreateInput, error)
- type SContact
- type SEmailQueue
- func (eq *SEmailQueue) Dump() string
- func (e *SEmailQueue) GetRecordTime() time.Time
- func (eq *SEmailQueue) PerformSend(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (eq *SEmailQueue) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (eq *SEmailQueue) Run()
- type SEmailQueueManager
- func (manager *SEmailQueueManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.EmailQueueDetails
- func (manager *SEmailQueueManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (manager *SEmailQueueManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.EmailQueueCreateInput, error)
- type SEmailQueueStatus
- type SEmailQueueStatusManager
- type SEvent
- type SEventDisplay
- type SEventManager
- type SNotification
- func (n *SNotification) AddOne() error
- func (n *SNotification) Create(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (n *SNotification) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (n *SNotification) GetNotOKReceivers() ([]SReceiver, error)
- func (n *SNotification) GetTemplate(ctx context.Context, topicId, lang string, no api.SsNotification) (api.SendParams, error)
- func (n *SNotification) Notification(robotUseTemplate bool) (api.SsNotification, error)
- func (n *SNotification) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (n *SNotification) ReceiverNotificationsNotOK() ([]SReceiverNotification, error)
- func (n *SNotification) TaskInsert() error
- type SNotificationGroup
- type SNotificationGroupManager
- type SNotificationLog
- type SNotificationLogManager
- type SNotificationManager
- func (nm *SNotificationManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.NotificationDetails
- func (nm *SNotificationManager) FetchOwnerId(ctx context.Context, data jsonutils.JSONObject) (mcclient.IIdentityProvider, error)
- func (nm *SNotificationManager) FilterByOwner(ctx context.Context, q *sqlchemy.SQuery, man db.FilterByOwnerProvider, ...) *sqlchemy.SQuery
- func (nm *SNotificationManager) InitializeData() error
- func (nm *SNotificationManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (nm *SNotificationManager) NamespaceScope() rbacscope.TRbacScope
- func (nm *SNotificationManager) PerformContactNotify(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.NotificationManagerEventNotifyOutput, error)
- func (nm *SNotificationManager) PerformEventNotify(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.NotificationManagerEventNotifyOutput, error)
- func (nm *SNotificationManager) ReSend(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func (nm *SNotificationManager) ResourceScope() rbacscope.TRbacScope
- func (nm *SNotificationManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.NotificationCreateInput, error)
- type SReceiver
- func (r *SReceiver) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (r *SReceiver) Delete(ctx context.Context, userCred mcclient.TokenCredential) error
- func (r *SReceiver) GetContact(cType string) (string, error)
- func (r *SReceiver) GetDomainId() string
- func (r *SReceiver) GetEnabledContactTypes() ([]string, error)
- func (r *SReceiver) GetName() string
- func (self *SReceiver) GetNotifyReceiver() api.SNotifyReceiver
- func (self *SReceiver) GetSubContacts() ([]SSubContact, error)
- func (r *SReceiver) GetTemplateLang(ctx context.Context) (string, error)
- func (r *SReceiver) GetVerifiedContactTypes() ([]string, error)
- func (r *SReceiver) IsEnabled() bool
- func (r *SReceiver) IsEnabledContactType(ct string) (bool, error)
- func (r *SReceiver) IsOwner(userCred mcclient.TokenCredential) bool
- func (r *SReceiver) IsReceiver() bool
- func (r *SReceiver) IsRobot() bool
- func (r *SReceiver) IsVerifiedContactType(ct string) (bool, error)
- func (r *SReceiver) MarkContactTypeUnVerified(ctx context.Context, contactType string, note string) error
- func (r *SReceiver) MarkContactTypeVerified(ctx context.Context, contactType string) error
- func (r *SReceiver) PerformDisable(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (r *SReceiver) PerformEnable(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (r *SReceiver) PerformEnableContactType(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (r *SReceiver) PerformGetSubscription(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (r *SReceiver) PerformTriggerVerify(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (r *SReceiver) PerformVerify(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (r *SReceiver) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (r *SReceiver) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (r *SReceiver) PreUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (r *SReceiver) SetContact(cType string, contact string) error
- func (r *SReceiver) StartSubcontactPullTask(ctx context.Context, userCred mcclient.TokenCredential, contactTypes []string, ...) error
- func (r *SReceiver) Sync(ctx context.Context) error
- func (r *SReceiver) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ReceiverUpdateInput, error)
- type SReceiverBase
- type SReceiverManager
- func (rm *SReceiverManager) CreateByInsertOrUpdate() bool
- func (rm *SReceiverManager) FetchByIDs(ctx context.Context, ids ...string) ([]SReceiver, error)
- func (rm *SReceiverManager) FetchByIdOrNames(ctx context.Context, idOrNames ...string) ([]SReceiver, error)
- func (rm *SReceiverManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.ReceiverDetails
- func (rm *SReceiverManager) FetchEnableReceiversByIdOrNames(ctx context.Context, idOrNames ...string) ([]SReceiver, error)
- func (rm *SReceiverManager) FetchOwnerId(ctx context.Context, data jsonutils.JSONObject) (mcclient.IIdentityProvider, error)
- func (rm *SReceiverManager) FetchSubContacts(ids []string) (map[string][]SSubContact, error)
- func (rm *SReceiverManager) FilterByOwner(ctx context.Context, q *sqlchemy.SQuery, man db.FilterByOwnerProvider, ...) *sqlchemy.SQuery
- func (manager *SReceiverManager) GetPropertyRoleContactType(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (rm *SReceiverManager) InitializeData() error
- func (rm *SReceiverManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (rm *SReceiverManager) OnAdd(obj *jsonutils.JSONDict)
- func (rm *SReceiverManager) OnDelete(obj *jsonutils.JSONDict)
- func (rm *SReceiverManager) OnUpdate(oldObj, newObj *jsonutils.JSONDict)
- func (rm *SReceiverManager) OrderByExtraFields(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (rm *SReceiverManager) PerformGetTypes(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ConfigManagerGetTypesOutput, error)
- func (rm *SReceiverManager) PerformIntellijGet(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (rm *SReceiverManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)
- func (rm *SReceiverManager) ResourceScope() rbacscope.TRbacScope
- func (rm *SReceiverManager) StartWatchUserInKeystone() error
- func (manager *SReceiverManager) SyncUserFromKeystone(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
- func (rm *SReceiverManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.ReceiverCreateInput, error)
- type SReceiverNotification
- func (rn *SReceiverNotification) AfterSend(ctx context.Context, success bool, reason string) error
- func (rn *SReceiverNotification) BeforeSend(ctx context.Context, sendTime time.Time) error
- func (self *SReceiverNotification) GetReceiver() (*SReceiver, error)
- func (rn *SReceiverNotification) Receiver() (IReceiver, error)
- type SReceiverNotificationManager
- func (rnm *SReceiverNotificationManager) Create(ctx context.Context, userCred mcclient.TokenCredential, receiverID string, ...) (*SReceiverNotification, error)
- func (rnm *SReceiverNotificationManager) CreateContact(ctx context.Context, userCred mcclient.TokenCredential, ...) (*SReceiverNotification, error)
- func (rnm *SReceiverNotificationManager) CreateRobot(ctx context.Context, userCred mcclient.TokenCredential, RobotID string, ...) (*SReceiverNotification, error)
- func (rnm *SReceiverNotificationManager) GetMasterFieldName() string
- func (rnm *SReceiverNotificationManager) GetSlaveFieldName() string
- func (self *SReceiverNotificationManager) InitializeData() error
- func (rnm *SReceiverNotificationManager) SetHandlerProcessTimeout(info *appsrv.SHandlerInfo, r *http.Request) time.Duration
- type SRobot
- func (r *SRobot) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (r *SRobot) GetContact(ctype string) (string, error)
- func (r *SRobot) GetDomainId() string
- func (r *SRobot) GetName() string
- func (r *SRobot) GetTemplateLang(ctx context.Context) (string, error)
- func (r *SRobot) IsEnabled() bool
- func (r *SRobot) IsEnabledContactType(ctype string) (bool, error)
- func (r *SRobot) IsReceiver() bool
- func (r *SRobot) IsRobot() bool
- func (r *SRobot) IsVerifiedContactType(ctype string) (bool, error)
- func (r *SRobot) PerformDisable(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (r *SRobot) PerformEnable(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (r *SRobot) PostDelete(ctx context.Context, userCred mcclient.TokenCredential)
- func (r *SRobot) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (r *SRobot) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.RobotUpdateInput, error)
- type SRobotManager
- func (rm *SRobotManager) FetchByIdOrNames(ctx context.Context, idOrNames ...string) ([]SRobot, error)
- func (rm *SRobotManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.RobotDetails
- func (rm *SRobotManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (rm *SRobotManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.RobotCreateInput, error)
- type SSubContact
- type SSubContactManager
- type SSubscriber
- func (s *SSubscriber) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (s *SSubscriber) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, ...) error
- func (self *SSubscriber) GetEnabledReceivers() ([]SReceiver, error)
- func (self *SSubscriber) GetRobot() (*SRobot, error)
- func (s *SSubscriber) PerformChange(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (s *SSubscriber) PerformDisable(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (s *SSubscriber) PerformEnable(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (s *SSubscriber) PerformSetReceiver(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (s *SSubscriber) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ...)
- func (sr *SSubscriber) SetReceivers(ctx context.Context, receiverIds []string) error
- type SSubscriberDis
- type SSubscriberManager
- func (sm *SSubscriberManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []api.SubscriberDetails
- func (sm *SSubscriberManager) InitializeData() error
- func (sm *SSubscriberManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (sm *SSubscriberManager) QueryDistinctExtraField(q *sqlchemy.SQuery, field string) (*sqlchemy.SQuery, error)
- func (sm *SSubscriberManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.SubscriberCreateInput, error)
- type SSubscriberReceiver
- type SSubscriberReceiverManager
- type STemplate
- type STemplateManager
- func (tm *STemplateManager) FillWithTemplate(ctx context.Context, lang string, no api.SsNotification) (params api.SendParams, err error)
- func (tm *STemplateManager) GetCompanyInfo(ctx context.Context) (SCompanyInfo, error)
- func (tm *STemplateManager) GetEmailUrl() string
- func (tm *STemplateManager) InitializeData() error
- func (tm *STemplateManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (tm *STemplateManager) PerformSave(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- func (tm *STemplateManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.TemplateCreateInput, error)
- type STopic
- func (self *STopic) CreateEvent(ctx context.Context, resType, action, message string) (*SEvent, error)
- func (self *STopic) GetEnabledSubscribers(domainId, projectId string) ([]SSubscriber, error)
- func (t *STopic) PreCheckPerformAction(ctx context.Context, userCred mcclient.TokenCredential, action string, ...) error
- func (ss *STopic) ValidateDeleteCondition(ctx context.Context, info jsonutils.JSONObject) error
- func (ss *STopic) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (api.TopicUpdateInput, error)
- type STopicManager
- func (sm *STopicManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, ...) []notify.TopicDetails
- func (sm *STopicManager) GetTopicByEvent(resourceType string, action notify.SAction, isFailed notify.SResult) (*STopic, error)
- func (sm *STopicManager) GetTopicsByEvent(resourceType string, action notify.SAction, isFailed notify.SResult) ([]STopic, error)
- func (sm *STopicManager) InitializeData() error
- func (sm *STopicManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, ...) (*sqlchemy.SQuery, error)
- func (sm *STopicManager) TopicByEvent(eventStr string) (*STopic, error)
- func (sm *STopicManager) TopicsByEvent(eventStr string) ([]STopic, error)
- func (sm *STopicManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ...) (jsonutils.JSONObject, error)
- type SVerification
- type SVerificationManager
Constants ¶
View Source
const ( DefaultResourceCreateDelete = "resource create or delete" DefaultResourceChangeConfig = "resource change config" DefaultResourceUpdate = "resource update" DefaultResourceReleaseDue1Day = "resource release due 1 day" DefaultResourceReleaseDue3Day = "resource release due 3 day" DefaultResourceReleaseDue30Day = "resource release due 30 day" DefaultResourceRelease = "resource release" DefaultScheduledTaskExecute = "scheduled task execute" DefaultScalingPolicyExecute = "scaling policy execute" DefaultSnapshotPolicyExecute = "snapshot policy execute" DefaultResourceOperationFailed = "resource operation failed" DefaultResourceOperationSuccessed = "resource operation successed" DefaultResourceSync = "resource sync" DefaultSystemExceptionEvent = "system exception event" DefaultChecksumTestFailed = "checksum test failed" DefaultUserLock = "user lock" DefaultActionLogExceedCount = "action log exceed count" DefaultSyncAccountStatus = "cloud account sync status" DefaultPasswordExpireDue1Day = "password expire due 1 day" DefaultPasswordExpireDue7Day = "password expire due 7 day" DefaultPasswordExpire = "password expire" DefaultNetOutOfSync = "net out of sync" DefaultMysqlOutOfSync = "mysql out of sync" DefaultServiceAbnormal = "service abnormal" DefaultServerPanicked = "server panicked" DefaultAttachOrDetach = "resource attach or detach" DefaultIsolatedDeviceChanged = "isolated device changed" DefaultStatusChanged = "resource status changed" )
View Source
const (
CONTACTTYPE_ALL = "all"
)
View Source
const (
ReceiverIdDefault = "default"
)
View Source
const (
SendByContact = "send_by_contact"
)
Variables ¶
View Source
var ( ErrContactNotFound = errors.New("Contact Not Found") ErrVeritying = errors.New("During the verification process, please do not try again") ErrDial = errors.New("Dial Failed") ErrGetConfig = errors.New("Get Config Failed") ErrUpdateConfig = errors.New("Update Config Failed") )
View Source
var ( PersonalConfigContactTypes = []string{ api.EMAIL, api.MOBILE, api.DINGTALK, api.FEISHU, api.WORKWX, } RobotContactTypes = []string{ api.FEISHU_ROBOT, api.DINGTALK_ROBOT, api.WORKWX_ROBOT, } SystemConfigContactTypes = append( RobotContactTypes, api.WEBCONSOLE, api.WEBHOOK, ) )
View Source
var ConfigMap map[string]SConfig
View Source
var ErrVerifyFrequently = errors.Wrap(httperrors.ErrTooManyRequests, "Send validation messages too frequently")
View Source
var LaxMobileRegexp = regexp.MustCompile(`[0-9]{6,14}`)
View Source
var RobotList = []string{api.FEISHU_ROBOT, api.DINGTALK_ROBOT, api.WORKWX_ROBOT, api.WEBHOOK, api.WEBHOOK_ROBOT}
View Source
var Worker *appsrv.SWorkerManager
Functions ¶
func GetRobotTypeById ¶
func GetRobotTypes ¶
func GetRobotTypes() []string
func GetSenderTypes ¶
func GetSenderTypes() []string
func GetValidPersonalSenderTypes ¶
func GetValidPersonalSenderTypes() []string
func InitEmailQueue ¶
func InitEmailQueue()
func InitEventLog ¶
func InitEventLog()
func InitNotificationLog ¶
func InitNotificationLog()
func InitReceiverProject ¶
func InitReceiverProject(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
func Register ¶
func Register(driver ISenderDriver)
func SMSRegister ¶
func SMSRegister(driver ISmsDriver)
Types ¶
type ISenderDriver ¶
type ISenderDriver interface { GetSenderType() string Send(ctx context.Context, args api.SendParams) error ValidateConfig(ctx context.Context, args api.NotifyConfig) (string, error) ContactByMobile(ctx context.Context, mobile, domainId string) (string, error) IsRobot() bool IsPersonal() bool IsSystemConfigContactType() bool IsValid() bool IsPullType() bool GetAccessToken(ctx context.Context, domainId string) error RegisterConfig(config SConfig) }
func GetDriver ¶
func GetDriver(sendType string) ISenderDriver
type ISmsDriver ¶
type ISmsDriver interface { Name() string Send(args api.SSMSSendParams, isVerify bool, config *api.NotifyConfig) error Verify(config *api.NotifyConfig) error }
func GetSMSDriver ¶
func GetSMSDriver(smsDriver string) ISmsDriver
type SCompanyInfo ¶
type SConfig ¶
type SConfig struct { db.SDomainLevelResourceBase Type string `width:"15" nullable:"false" create:"required" get:"domain" list:"domain" index:"true"` Content *api.SNotifyConfigContent `nullable:"false" create:"required" update:"domain" get:"domain" list:"domain"` Attribution string `width:"8" nullable:"false" default:"system" get:"domain" list:"domain" create:"optional"` }
func (*SConfig) CustomizeDelete ¶
func (c *SConfig) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SConfig) GetNotifyConfig ¶
func (c *SConfig) GetNotifyConfig() api.NotifyConfig
func (*SConfig) GetReceivers ¶
func (*SConfig) PostCreate ¶
func (c *SConfig) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SConfig) PostUpdate ¶
func (c *SConfig) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SConfig) PreDelete ¶
func (c *SConfig) PreDelete(ctx context.Context, userCred mcclient.TokenCredential)
func (*SConfig) RealDelete ¶
func (*SConfig) StartRepullSubcontactTask ¶
func (*SConfig) ValidateUpdateData ¶
func (c *SConfig) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ConfigUpdateInput) (api.ConfigUpdateInput, error)
type SConfigManager ¶
type SConfigManager struct {
db.SDomainLevelResourceBaseManager
}
var ConfigManager *SConfigManager
func (*SConfigManager) Config ¶
func (self *SConfigManager) Config(contactType, domainId string, attribution string) (*SConfig, error)
func (*SConfigManager) Configs ¶
func (self *SConfigManager) Configs(contactType string) ([]SConfig, error)
Fetch all SConfig struct which type is contactType.
func (*SConfigManager) FetchCustomizeColumns ¶
func (cm *SConfigManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool, ) []api.ConfigDetails
func (*SConfigManager) FilterByOwner ¶
func (cm *SConfigManager) FilterByOwner(ctx context.Context, q *sqlchemy.SQuery, man db.FilterByOwnerProvider, userCred mcclient.TokenCredential, owner mcclient.IIdentityProvider, scope rbacscope.TRbacScope) *sqlchemy.SQuery
func (*SConfigManager) GetPropertyCapability ¶
func (manager *SConfigManager) GetPropertyCapability(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SConfigManager) HasSystemConfig ¶
func (self *SConfigManager) HasSystemConfig(contactType string) (bool, error)
func (*SConfigManager) InitializeData ¶
func (confManager *SConfigManager) InitializeData() error
func (*SConfigManager) ListItemExportKeys ¶
func (manager *SConfigManager) ListItemExportKeys(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, keys stringutils2.SSortedStrings) (*sqlchemy.SQuery, error)
func (*SConfigManager) ListItemFilter ¶
func (self *SConfigManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input api.ConfigListInput) (*sqlchemy.SQuery, error)
func (*SConfigManager) OrderByExtraFields ¶
func (cm *SConfigManager) OrderByExtraFields(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query api.ConfigListInput) (*sqlchemy.SQuery, error)
func (*SConfigManager) PerformValidate ¶
func (cm *SConfigManager) PerformValidate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ConfigValidateInput) (api.ConfigValidateOutput, error)
func (*SConfigManager) QueryDistinctExtraField ¶
func (*SConfigManager) ValidateCreateData ¶
func (cm *SConfigManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.ConfigCreateInput) (api.ConfigCreateInput, error)
type SContact ¶
type SContact struct { SReceiverBase // contains filtered or unexported fields }
func (*SContact) IsReceiver ¶
type SEmailQueue ¶
type SEmailQueue struct { db.SLogBase RecvAt time.Time `nullable:"false" created_at:"true" index:"true" get:"user" list:"user" json:"recv_at"` Dest string `width:"256" charset:"ascii" nullable:"false" list:"user" create:"admin_required"` Subject string `width:"256" charset:"utf8" nullable:"false" list:"user" create:"admin_required"` DestCc string `width:"256" charset:"ascii" nullable:"false" list:"user" create:"admin_optional"` DestBcc string `width:"256" charset:"ascii" nullable:"false" list:"user" create:"admin_optional"` SessionId string `width:"256" charset:"utf8" nullable:"false" list:"user" create:"admin_optional"` Content jsonutils.JSONObject `length:"long" charset:"utf8" nullable:"false" list:"user" create:"admin_required"` MoreDetails jsonutils.JSONObject `length:"long" charset:"utf8" nullable:"true" list:"user" create:"admin_optional"` ProjectId string `width:"128" charset:"ascii" list:"user" create:"admin_optional" index:"true"` Project string `width:"128" charset:"utf8" list:"user" create:"admin_optional"` ProjectDomainId string `name:"project_domain_id" default:"default" width:"128" charset:"ascii" list:"user" create:"admin_optional"` ProjectDomain string `name:"project_domain" default:"Default" width:"128" charset:"utf8" list:"user" create:"admin_optional"` UserId string `width:"128" charset:"ascii" list:"user" create:"admin_required"` User string `width:"128" charset:"utf8" list:"user" create:"admin_required"` DomainId string `width:"128" charset:"ascii" list:"user" create:"admin_optional"` Domain string `width:"128" charset:"utf8" list:"user" create:"admin_optional"` Roles string `width:"64" charset:"utf8" list:"user" create:"admin_optional"` }
func (*SEmailQueue) Dump ¶
func (eq *SEmailQueue) Dump() string
func (*SEmailQueue) GetRecordTime ¶
func (e *SEmailQueue) GetRecordTime() time.Time
func (*SEmailQueue) PerformSend ¶
func (eq *SEmailQueue) PerformSend( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.EmailQueueSendInput, ) (jsonutils.JSONObject, error)
func (*SEmailQueue) PostCreate ¶
func (eq *SEmailQueue) PostCreate( ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject, )
func (*SEmailQueue) Run ¶
func (eq *SEmailQueue) Run()
type SEmailQueueManager ¶
type SEmailQueueManager struct {
db.SLogBaseManager
}
var EmailQueueManager *SEmailQueueManager
func (*SEmailQueueManager) FetchCustomizeColumns ¶
func (manager *SEmailQueueManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool, ) []api.EmailQueueDetails
func (*SEmailQueueManager) ListItemFilter ¶
func (manager *SEmailQueueManager) ListItemFilter( ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query api.EmailQueueListInput, ) (*sqlchemy.SQuery, error)
宿主机/物理机列表
func (*SEmailQueueManager) ValidateCreateData ¶
func (manager *SEmailQueueManager) ValidateCreateData( ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.EmailQueueCreateInput, ) (api.EmailQueueCreateInput, error)
type SEmailQueueStatus ¶
type SEmailQueueStatusManager ¶
type SEmailQueueStatusManager struct {
db.SModelBaseManager
}
var EmailQueueStatusManager *SEmailQueueStatusManager
type SEvent ¶
type SEvent struct { db.SLogBase // 资源创建时间 CreatedAt time.Time `nullable:"false" created_at:"true" index:"true" get:"user" list:"user" json:"created_at"` Message string `length:"medium"` Event string `width:"64" nullable:"true"` ResourceType string `width:"64" nullable:"true"` Action string `width:"64" nullable:"true"` AdvanceDays int TopicId string `width:"128" nullable:"true" index:"true"` }
func (*SEvent) GetRecordTime ¶
type SEventDisplay ¶
type SEventManager ¶
type SEventManager struct {
db.SLogBaseManager
}
var EventManager *SEventManager
func (*SEventManager) CreateEvent ¶
type SNotification ¶
type SNotification struct { db.SStatusStandaloneResourceBase ContactType string `width:"128" nullable:"true" create:"optional" list:"user" get:"user"` // swagger:ignore Topic string `width:"128" nullable:"true" create:"required" list:"user" get:"user"` Priority string `width:"16" nullable:"true" create:"optional" list:"user" get:"user"` // swagger:ignore Message string `create:"required"` // swagger:ignore TopicType string `json:"topic_type" width:"20" nullable:"true" update:"user" list:"user"` // swagger:ignore TopicId string `width:"128" nullable:"true" list:"user" get:"user"` ReceivedAt time.Time `nullable:"true" list:"user" get:"user"` EventId string `width:"128" nullable:"true"` SendTimes int }
站内信
func (*SNotification) AddOne ¶
func (n *SNotification) AddOne() error
func (*SNotification) Create ¶
func (n *SNotification) Create(ctx context.Context, userCred mcclient.TokenCredential, receiverIds map[string]uint32, contacts []string) error
func (*SNotification) CustomizeCreate ¶
func (n *SNotification) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SNotification) GetNotOKReceivers ¶
func (n *SNotification) GetNotOKReceivers() ([]SReceiver, error)
func (*SNotification) GetTemplate ¶
func (n *SNotification) GetTemplate(ctx context.Context, topicId, lang string, no api.SsNotification) (api.SendParams, error)
获取消息文案
func (*SNotification) Notification ¶
func (n *SNotification) Notification(robotUseTemplate bool) (api.SsNotification, error)
func (*SNotification) PostCreate ¶
func (n *SNotification) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SNotification) ReceiverNotificationsNotOK ¶
func (n *SNotification) ReceiverNotificationsNotOK() ([]SReceiverNotification, error)
func (*SNotification) TaskInsert ¶
func (n *SNotification) TaskInsert() error
type SNotificationGroup ¶
type SNotificationGroup struct { db.SModelBase Id string `width:"128" nullable:"false" create:"required" list:"user" index:"true" get:"user"` GroupKey string `width:"128" nullable:"false" create:"required" list:"user" get:"user"` Title string // swagger:ignore Message string `length:"medium"` ReceiverId string `width:"128" nullable:"false" create:"required" list:"user" get:"user"` Body jsonutils.JSONObject Header jsonutils.JSONObject MsgKey string ContactType string `width:"32" nullable:"false" create:"required" list:"user" get:"user"` Contact string `width:"128" nullable:"false" create:"required" list:"user" get:"user"` CreatedAt time.Time DomainId string `width:"128" nullable:"false" create:"required" list:"user" get:"user"` }
站内信
type SNotificationGroupManager ¶
type SNotificationGroupManager struct {
db.SModelBaseManager
}
var NotificationGroupManager *SNotificationGroupManager
func (*SNotificationGroupManager) TaskCreate ¶
func (ng *SNotificationGroupManager) TaskCreate(ctx context.Context, contactType string, args apis.SendParams) error
func (*SNotificationGroupManager) TaskSend ¶
func (ng *SNotificationGroupManager) TaskSend(ctx context.Context, input apis.SNotificationGroupSearchInput) (*apis.SendParams, error)
type SNotificationLog ¶
type SNotificationLog struct { db.SLogBase ContactType string `width:"128" nullable:"true" create:"optional" list:"user" get:"user"` // swagger:ignore Topic string `width:"128" nullable:"true" create:"required" list:"user" get:"user"` Priority string `width:"16" nullable:"true" create:"optional" list:"user" get:"user"` // swagger:ignore Message string `create:"required"` // swagger:ignore TopicType string `json:"topic_type" width:"20" nullable:"true" update:"user" list:"user"` ReceivedAt time.Time `nullable:"true" list:"user" get:"user"` EventId string `width:"128" nullable:"true"` SendTimes int }
站内信
type SNotificationLogManager ¶
type SNotificationLogManager struct {
db.SLogBaseManager
}
var NotificationLogManager *SNotificationLogManager
type SNotificationManager ¶
type SNotificationManager struct {
db.SStatusStandaloneResourceBaseManager
}
var NotificationManager *SNotificationManager
func (*SNotificationManager) FetchCustomizeColumns ¶
func (nm *SNotificationManager) FetchCustomizeColumns( ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool, ) []api.NotificationDetails
func (*SNotificationManager) FetchOwnerId ¶
func (nm *SNotificationManager) FetchOwnerId(ctx context.Context, data jsonutils.JSONObject) (mcclient.IIdentityProvider, error)
func (*SNotificationManager) FilterByOwner ¶
func (nm *SNotificationManager) FilterByOwner(ctx context.Context, q *sqlchemy.SQuery, man db.FilterByOwnerProvider, userCred mcclient.TokenCredential, owner mcclient.IIdentityProvider, scope rbacscope.TRbacScope) *sqlchemy.SQuery
func (*SNotificationManager) InitializeData ¶
func (nm *SNotificationManager) InitializeData() error
func (*SNotificationManager) ListItemFilter ¶
func (nm *SNotificationManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input api.NotificationListInput) (*sqlchemy.SQuery, error)
通知消息列表
func (*SNotificationManager) NamespaceScope ¶
func (nm *SNotificationManager) NamespaceScope() rbacscope.TRbacScope
func (*SNotificationManager) PerformContactNotify ¶
func (nm *SNotificationManager) PerformContactNotify(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.NotificationManagerContactNotifyInput) (api.NotificationManagerEventNotifyOutput, error)
func (*SNotificationManager) PerformEventNotify ¶
func (nm *SNotificationManager) PerformEventNotify(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.NotificationManagerEventNotifyInput) (api.NotificationManagerEventNotifyOutput, error)
TODO: support project and domain
func (*SNotificationManager) ReSend ¶
func (nm *SNotificationManager) ReSend(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
func (*SNotificationManager) ResourceScope ¶
func (nm *SNotificationManager) ResourceScope() rbacscope.TRbacScope
func (*SNotificationManager) ValidateCreateData ¶
func (nm *SNotificationManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.NotificationCreateInput) (api.NotificationCreateInput, error)
type SReceiver ¶
type SReceiver struct { db.SVirtualResourceBase db.SEnabledResourceBase Email string `width:"128" nullable:"false" create:"optional" update:"user" get:"user" list:"user"` // swagger:ignore Mobile string `width:"32" nullable:"false" create:"optional"` Lang string `width:"8" charset:"ascii" nullable:"false" list:"user" update:"user"` // swagger:ignore EnabledEmail tristate.TriState `default:"false" update:"user"` // swagger:ignore VerifiedEmail tristate.TriState `default:"false" update:"user"` // swagger:ignore EnabledMobile tristate.TriState `default:"false" update:"user"` // swagger:ignore VerifiedMobile tristate.TriState `default:"false" update:"user"` }
接收人
func (*SReceiver) CustomizeCreate ¶
func (r *SReceiver) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SReceiver) GetDomainId ¶
func (*SReceiver) GetEnabledContactTypes ¶
func (*SReceiver) GetNotifyReceiver ¶
func (self *SReceiver) GetNotifyReceiver() api.SNotifyReceiver
func (*SReceiver) GetSubContacts ¶
func (self *SReceiver) GetSubContacts() ([]SSubContact, error)
func (*SReceiver) GetTemplateLang ¶
func (*SReceiver) GetVerifiedContactTypes ¶
func (*SReceiver) IsEnabledContactType ¶
func (*SReceiver) IsReceiver ¶
func (*SReceiver) IsVerifiedContactType ¶
func (*SReceiver) MarkContactTypeUnVerified ¶
func (*SReceiver) MarkContactTypeVerified ¶
func (*SReceiver) PerformDisable ¶
func (r *SReceiver) PerformDisable(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformDisableInput) (jsonutils.JSONObject, error)
func (*SReceiver) PerformEnable ¶
func (r *SReceiver) PerformEnable(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformEnableInput) (jsonutils.JSONObject, error)
func (*SReceiver) PerformEnableContactType ¶
func (r *SReceiver) PerformEnableContactType(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ReceiverEnableContactTypeInput) (jsonutils.JSONObject, error)
func (*SReceiver) PerformGetSubscription ¶
func (r *SReceiver) PerformGetSubscription(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ReceiverGetSubscriptionOptions) (jsonutils.JSONObject, error)
获取用户订阅
func (*SReceiver) PerformTriggerVerify ¶
func (r *SReceiver) PerformTriggerVerify(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ReceiverTriggerVerifyInput) (jsonutils.JSONObject, error)
func (*SReceiver) PerformVerify ¶
func (r *SReceiver) PerformVerify(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ReceiverVerifyInput) (jsonutils.JSONObject, error)
func (*SReceiver) PostCreate ¶
func (r *SReceiver) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SReceiver) PostUpdate ¶
func (r *SReceiver) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SReceiver) PreUpdate ¶
func (r *SReceiver) PreUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SReceiver) StartSubcontactPullTask ¶
func (*SReceiver) ValidateUpdateData ¶
func (r *SReceiver) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ReceiverUpdateInput) (api.ReceiverUpdateInput, error)
type SReceiverBase ¶
type SReceiverBase struct { }
func (SReceiverBase) GetDomainId ¶
func (s SReceiverBase) GetDomainId() string
func (SReceiverBase) GetTemplateLang ¶
func (s SReceiverBase) GetTemplateLang(ctx context.Context) (string, error)
func (SReceiverBase) IsEnabled ¶
func (s SReceiverBase) IsEnabled() bool
func (SReceiverBase) IsEnabledContactType ¶
func (s SReceiverBase) IsEnabledContactType(_ string) (bool, error)
func (SReceiverBase) IsVerifiedContactType ¶
func (s SReceiverBase) IsVerifiedContactType(_ string) (bool, error)
type SReceiverManager ¶
type SReceiverManager struct { db.SVirtualResourceBaseManager db.SEnabledResourceBaseManager }
var ReceiverManager *SReceiverManager
func (*SReceiverManager) CreateByInsertOrUpdate ¶
func (rm *SReceiverManager) CreateByInsertOrUpdate() bool
func (*SReceiverManager) FetchByIDs ¶
func (*SReceiverManager) FetchByIdOrNames ¶
func (*SReceiverManager) FetchCustomizeColumns ¶
func (rm *SReceiverManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool) []api.ReceiverDetails
func (*SReceiverManager) FetchEnableReceiversByIdOrNames ¶
func (*SReceiverManager) FetchOwnerId ¶
func (rm *SReceiverManager) FetchOwnerId(ctx context.Context, data jsonutils.JSONObject) (mcclient.IIdentityProvider, error)
func (*SReceiverManager) FetchSubContacts ¶
func (rm *SReceiverManager) FetchSubContacts(ids []string) (map[string][]SSubContact, error)
func (*SReceiverManager) FilterByOwner ¶
func (rm *SReceiverManager) FilterByOwner(ctx context.Context, q *sqlchemy.SQuery, man db.FilterByOwnerProvider, userCred mcclient.TokenCredential, owner mcclient.IIdentityProvider, scope rbacscope.TRbacScope) *sqlchemy.SQuery
func (*SReceiverManager) GetPropertyRoleContactType ¶
func (manager *SReceiverManager) GetPropertyRoleContactType(ctx context.Context, userCred mcclient.TokenCredential, input api.SRoleContactInput) (jsonutils.JSONObject, error)
func (*SReceiverManager) InitializeData ¶
func (rm *SReceiverManager) InitializeData() error
func (*SReceiverManager) ListItemFilter ¶
func (rm *SReceiverManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input api.ReceiverListInput) (*sqlchemy.SQuery, error)
func (*SReceiverManager) OnAdd ¶
func (rm *SReceiverManager) OnAdd(obj *jsonutils.JSONDict)
Implemente interface EventHandler
func (*SReceiverManager) OnDelete ¶
func (rm *SReceiverManager) OnDelete(obj *jsonutils.JSONDict)
func (*SReceiverManager) OnUpdate ¶
func (rm *SReceiverManager) OnUpdate(oldObj, newObj *jsonutils.JSONDict)
func (*SReceiverManager) OrderByExtraFields ¶
func (rm *SReceiverManager) OrderByExtraFields(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, query api.ReceiverListInput) (*sqlchemy.SQuery, error)
func (*SReceiverManager) PerformGetTypes ¶
func (rm *SReceiverManager) PerformGetTypes(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ConfigManagerGetTypesInput) (api.ConfigManagerGetTypesOutput, error)
func (*SReceiverManager) PerformIntellijGet ¶
func (rm *SReceiverManager) PerformIntellijGet(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.ReceiverIntellijGetInput) (jsonutils.JSONObject, error)
func (*SReceiverManager) QueryDistinctExtraField ¶
func (*SReceiverManager) ResourceScope ¶
func (rm *SReceiverManager) ResourceScope() rbacscope.TRbacScope
func (*SReceiverManager) StartWatchUserInKeystone ¶
func (rm *SReceiverManager) StartWatchUserInKeystone() error
监听User变化
func (*SReceiverManager) SyncUserFromKeystone ¶
func (manager *SReceiverManager) SyncUserFromKeystone(ctx context.Context, userCred mcclient.TokenCredential, isStart bool)
func (*SReceiverManager) ValidateCreateData ¶
func (rm *SReceiverManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.ReceiverCreateInput) (api.ReceiverCreateInput, error)
type SReceiverNotification ¶
type SReceiverNotification struct { db.SJointResourceBase ReceiverID string `width:"128" charset:"ascii" nullable:"false" index:"true"` NotificationID string `width:"128" charset:"ascii" nullable:"false" index:"true"` // ignore if ReceiverID is not empty or default Contact string `width:"128" index:"true"` ReceiverType string `width:"16"` SendAt time.Time SendBy string `width:"128"` Status string `width:"36" charset:"ascii"` FailedReason string `width:"1024"` // minutes GroupTimes uint32 }
+onecloud:swagger-gen-ignore
func (*SReceiverNotification) BeforeSend ¶
func (*SReceiverNotification) GetReceiver ¶
func (self *SReceiverNotification) GetReceiver() (*SReceiver, error)
func (*SReceiverNotification) Receiver ¶
func (rn *SReceiverNotification) Receiver() (IReceiver, error)
type SReceiverNotificationManager ¶
type SReceiverNotificationManager struct {
db.SJointResourceBaseManager
}
var ReceiverNotificationManager *SReceiverNotificationManager
func (*SReceiverNotificationManager) Create ¶
func (rnm *SReceiverNotificationManager) Create(ctx context.Context, userCred mcclient.TokenCredential, receiverID string, groupTimes uint32, notificationID string) (*SReceiverNotification, error)
func (*SReceiverNotificationManager) CreateContact ¶
func (rnm *SReceiverNotificationManager) CreateContact(ctx context.Context, userCred mcclient.TokenCredential, contact, notificationID string) (*SReceiverNotification, error)
func (*SReceiverNotificationManager) CreateRobot ¶
func (rnm *SReceiverNotificationManager) CreateRobot(ctx context.Context, userCred mcclient.TokenCredential, RobotID string, groupTimes uint32, notificationID string) (*SReceiverNotification, error)
func (*SReceiverNotificationManager) GetMasterFieldName ¶
func (rnm *SReceiverNotificationManager) GetMasterFieldName() string
func (*SReceiverNotificationManager) GetSlaveFieldName ¶
func (rnm *SReceiverNotificationManager) GetSlaveFieldName() string
func (*SReceiverNotificationManager) InitializeData ¶
func (self *SReceiverNotificationManager) InitializeData() error
func (*SReceiverNotificationManager) SetHandlerProcessTimeout ¶
func (rnm *SReceiverNotificationManager) SetHandlerProcessTimeout(info *appsrv.SHandlerInfo, r *http.Request) time.Duration
type SRobot ¶
type SRobot struct { db.SSharableVirtualResourceBase db.SEnabledResourceBase Type string `width:"16" nullable:"false" create:"required" get:"user" list:"user" index:"true"` Address string `nullable:"false" create:"required" update:"user" get:"user" list:"user"` Lang string `width:"16" nullable:"false" create:"required" update:"user" get:"user" list:"user"` Header jsonutils.JSONObject `length:"long" charset:"utf8" nullable:"true" list:"user" create:"optional" update:"user"` Body jsonutils.JSONObject `length:"long" charset:"utf8" nullable:"true" list:"user" create:"optional" update:"user"` MsgKey string `width:"16" nullable:"true" update:"user" get:"user" list:"user"` UseTemplate tristate.TriState `default:"false" list:"domain" update:"user" create:"admin_optional"` }
func (*SRobot) CustomizeCreate ¶
func (r *SRobot) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SRobot) GetDomainId ¶
func (*SRobot) GetTemplateLang ¶
func (*SRobot) IsEnabledContactType ¶
func (*SRobot) IsReceiver ¶
func (*SRobot) IsVerifiedContactType ¶
func (*SRobot) PerformDisable ¶
func (r *SRobot) PerformDisable(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformDisableInput) (jsonutils.JSONObject, error)
func (*SRobot) PerformEnable ¶
func (r *SRobot) PerformEnable(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input apis.PerformEnableInput) (jsonutils.JSONObject, error)
func (*SRobot) PostDelete ¶
func (r *SRobot) PostDelete(ctx context.Context, userCred mcclient.TokenCredential)
func (*SRobot) PostUpdate ¶
func (r *SRobot) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SRobot) ValidateUpdateData ¶
func (r *SRobot) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.RobotUpdateInput) (api.RobotUpdateInput, error)
type SRobotManager ¶
type SRobotManager struct { db.SSharableVirtualResourceBaseManager db.SEnabledResourceBaseManager }
var RobotManager *SRobotManager
func (*SRobotManager) FetchByIdOrNames ¶
func (*SRobotManager) FetchCustomizeColumns ¶
func (rm *SRobotManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool) []api.RobotDetails
func (*SRobotManager) ListItemFilter ¶
func (rm *SRobotManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input api.RobotListInput) (*sqlchemy.SQuery, error)
func (*SRobotManager) ValidateCreateData ¶
func (rm *SRobotManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.RobotCreateInput) (api.RobotCreateInput, error)
type SSubContact ¶
type SSubContact struct { db.SStandaloneResourceBase // id of receiver user ReceiverID string `width:"128" nullable:"false" index:"true"` Type string `width:"16" nullable:"false" index:"true"` Contact string `width:"128" nullable:"false"` ParentContactType string `width:"16" nullable:"false"` Enabled tristate.TriState `default:"false"` Verified tristate.TriState `default:"false"` VerifiedNote string `width:"1024"` }
+onecloud:swagger-gen-ignore
func (*SSubContact) Disable ¶
func (sc *SSubContact) Disable() error
func (*SSubContact) Disverify ¶
func (sc *SSubContact) Disverify() error
func (*SSubContact) Enable ¶
func (sc *SSubContact) Enable() error
func (*SSubContact) Update ¶
func (sc *SSubContact) Update(contact *string, enabled *bool, verified *bool) error
func (*SSubContact) Verify ¶
func (sc *SSubContact) Verify() error
type SSubContactManager ¶
type SSubContactManager struct {
db.SStandaloneResourceBaseManager
}
var SubContactManager *SSubContactManager
type SSubscriber ¶
type SSubscriber struct { db.SStandaloneAnonResourceBase db.SEnabledResourceBase TopicId string `width:"128" charset:"ascii" nullable:"false" index:"true" get:"user" list:"user" create:"required"` Type string `width:"16" charset:"ascii" nullable:"false" index:"true" get:"user" list:"user" create:"required"` Identification string `width:"128" charset:"ascii" nullable:"false" index:"true"` RoleScope string `width:"8" charset:"ascii" nullable:"false" get:"user" list:"user" create:"optional"` ResourceScope string `width:"8" charset:"ascii" nullable:"false" get:"user" list:"user" create:"required"` ResourceAttributionId string `width:"128" charset:"ascii" nullable:"false" get:"user" list:"user" create:"optional"` ResourceAttributionName string `width:"128" charset:"utf8" list:"user" create:"optional"` Scope string `width:"128" charset:"ascii" nullable:"false" create:"required"` DomainId string `width:"128" charset:"ascii" nullable:"false" create:"optional"` // minutes GroupTimes uint32 `nullable:"true" list:"user" update:"user"` }
消息订阅接收人
func (*SSubscriber) CustomizeCreate ¶
func (s *SSubscriber) CustomizeCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SSubscriber) CustomizeDelete ¶
func (s *SSubscriber) CustomizeDelete(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) error
func (*SSubscriber) GetEnabledReceivers ¶
func (self *SSubscriber) GetEnabledReceivers() ([]SReceiver, error)
func (*SSubscriber) GetRobot ¶
func (self *SSubscriber) GetRobot() (*SRobot, error)
func (*SSubscriber) PerformChange ¶
func (s *SSubscriber) PerformChange(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.SubscriberChangeInput) (jsonutils.JSONObject, error)
func (*SSubscriber) PerformDisable ¶
func (s *SSubscriber) PerformDisable(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SSubscriber) PerformEnable ¶
func (s *SSubscriber) PerformEnable(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input jsonutils.JSONObject) (jsonutils.JSONObject, error)
func (*SSubscriber) PerformSetReceiver ¶
func (s *SSubscriber) PerformSetReceiver(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.SubscriberSetReceiverInput) (jsonutils.JSONObject, error)
func (*SSubscriber) PostCreate ¶
func (s *SSubscriber) PostCreate(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, data jsonutils.JSONObject)
func (*SSubscriber) SetReceivers ¶
func (sr *SSubscriber) SetReceivers(ctx context.Context, receiverIds []string) error
type SSubscriberDis ¶
type SSubscriberDis struct { SSubscriber ReceiverName string `json:"receiver_name"` RoleName string `json:"role_name"` }
type SSubscriberManager ¶
type SSubscriberManager struct { db.SStandaloneAnonResourceBaseManager db.SEnabledResourceBaseManager }
var SubscriberManager *SSubscriberManager
func (*SSubscriberManager) FetchCustomizeColumns ¶
func (sm *SSubscriberManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool) []api.SubscriberDetails
func (*SSubscriberManager) InitializeData ¶
func (sm *SSubscriberManager) InitializeData() error
func (*SSubscriberManager) ListItemFilter ¶
func (sm *SSubscriberManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input api.SubscriberListInput) (*sqlchemy.SQuery, error)
func (*SSubscriberManager) QueryDistinctExtraField ¶
func (*SSubscriberManager) ValidateCreateData ¶
func (sm *SSubscriberManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.SubscriberCreateInput) (api.SubscriberCreateInput, error)
type SSubscriberReceiver ¶
type SSubscriberReceiver struct { db.SJointResourceBase SubscriberId string `width:"36" charset:"ascii" nullable:"false" index:"true"` ReceiverId string `width:"128" charset:"ascii" nullable:"false" index:"true"` }
type SSubscriberReceiverManager ¶
type SSubscriberReceiverManager struct {
db.SJointResourceBaseManager
}
var SubscriberReceiverManager *SSubscriberReceiverManager
func (*SSubscriberReceiverManager) GetMasterFieldName ¶
func (srm *SSubscriberReceiverManager) GetMasterFieldName() string
func (*SSubscriberReceiverManager) GetSlaveFieldName ¶
func (srm *SSubscriberReceiverManager) GetSlaveFieldName() string
type STemplate ¶
type STemplate struct { db.SStandaloneAnonResourceBase ContactType string `width:"16" nullable:"false" create:"required" update:"user" list:"user"` Topic string `width:"128" nullable:"false" create:"required" update:"user" list:"user"` // title | content | remote TemplateType string `width:"10" nullable:"false" create:"required" update:"user" list:"user"` Content string `length:"text" nullable:"true" create:"required" get:"user" list:"user" update:"user"` Lang string `width:"8" charset:"ascii" nullable:"false" list:"user" update:"user" create:"optional"` Example string `nullable:"true" create:"optional" get:"user" list:"user" update:"user"` }
func (*STemplate) ValidateUpdateData ¶
func (t *STemplate) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.TemplateUpdateInput) (api.TemplateUpdateInput, error)
type STemplateManager ¶
type STemplateManager struct {
db.SStandaloneAnonResourceBaseManager
}
var TemplateManager *STemplateManager
func (*STemplateManager) FillWithTemplate ¶
func (tm *STemplateManager) FillWithTemplate(ctx context.Context, lang string, no api.SsNotification) (params api.SendParams, err error)
FillWithTemplate will return the title and content generated by corresponding template. Local cache about common template will be considered in case of performance issues.
func (*STemplateManager) GetCompanyInfo ¶
func (tm *STemplateManager) GetCompanyInfo(ctx context.Context) (SCompanyInfo, error)
func (*STemplateManager) GetEmailUrl ¶
func (tm *STemplateManager) GetEmailUrl() string
func (*STemplateManager) InitializeData ¶
func (tm *STemplateManager) InitializeData() error
func (*STemplateManager) ListItemFilter ¶
func (tm *STemplateManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input api.TemplateListInput) (*sqlchemy.SQuery, error)
func (*STemplateManager) PerformSave ¶
func (tm *STemplateManager) PerformSave(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.TemplateManagerSaveInput) (jsonutils.JSONObject, error)
func (*STemplateManager) ValidateCreateData ¶
func (tm *STemplateManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input api.TemplateCreateInput) (api.TemplateCreateInput, error)
type STopic ¶
type STopic struct { db.SEnabledStatusStandaloneResourceBase Type string `width:"20" nullable:"false" create:"required" update:"user" list:"user"` Resources uint64 `nullable:"false"` Actions uint64 `nullable:"false"` Results tristate.TriState `default:"true"` TitleCn string `length:"medium" nullable:"true" charset:"utf8" list:"user" update:"user" create:"optional"` TitleEn string `length:"medium" nullable:"true" charset:"utf8" list:"user" update:"user" create:"optional"` ContentCn string `length:"medium" nullable:"true" charset:"utf8" list:"user" update:"user" create:"optional"` ContentEn string `length:"medium" nullable:"true" charset:"utf8" list:"user" update:"user" create:"optional"` GroupKeys *api.STopicGroupKeys `nullable:"true" list:"user" update:"user"` AdvanceDays []int `nullable:"true" charset:"utf8" list:"user" update:"user" create:"optional"` WebconsoleDisable tristate.TriState }
消息订阅
func (*STopic) CreateEvent ¶
func (*STopic) GetEnabledSubscribers ¶
func (self *STopic) GetEnabledSubscribers(domainId, projectId string) ([]SSubscriber, error)
func (*STopic) PreCheckPerformAction ¶
func (t *STopic) PreCheckPerformAction( ctx context.Context, userCred mcclient.TokenCredential, action string, query jsonutils.JSONObject, data jsonutils.JSONObject, ) error
func (*STopic) ValidateDeleteCondition ¶
func (*STopic) ValidateUpdateData ¶
func (ss *STopic) ValidateUpdateData(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, input api.TopicUpdateInput) (api.TopicUpdateInput, error)
type STopicManager ¶
type STopicManager struct {
db.SEnabledStatusStandaloneResourceBaseManager
}
var TopicManager *STopicManager
func (*STopicManager) FetchCustomizeColumns ¶
func (sm *STopicManager) FetchCustomizeColumns(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, objs []interface{}, fields stringutils2.SSortedStrings, isList bool) []notify.TopicDetails
func (*STopicManager) GetTopicByEvent ¶
func (*STopicManager) GetTopicsByEvent ¶
func (*STopicManager) InitializeData ¶
func (sm *STopicManager) InitializeData() error
func (*STopicManager) ListItemFilter ¶
func (sm *STopicManager) ListItemFilter(ctx context.Context, q *sqlchemy.SQuery, userCred mcclient.TokenCredential, input notify.TopicListInput) (*sqlchemy.SQuery, error)
func (*STopicManager) TopicByEvent ¶
func (sm *STopicManager) TopicByEvent(eventStr string) (*STopic, error)
func (*STopicManager) TopicsByEvent ¶
func (sm *STopicManager) TopicsByEvent(eventStr string) ([]STopic, error)
func (*STopicManager) ValidateCreateData ¶
func (sm *STopicManager) ValidateCreateData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, query jsonutils.JSONObject, input jsonutils.JSONObject) (jsonutils.JSONObject, error)
type SVerification ¶
type SVerification struct { db.SStandaloneResourceBase ReceiverId string `width:"128" nullable:"false"` ContactType string `width:"16" nullable:"false"` Token string `width:"200" nullable:"false"` }
+onecloud:swagger-gen-ignore
type SVerificationManager ¶
type SVerificationManager struct {
db.SStandaloneResourceBaseManager
}
var VerificationManager *SVerificationManager
func (*SVerificationManager) Create ¶
func (vm *SVerificationManager) Create(ctx context.Context, receiverId, contactType string) (*SVerification, error)
func (*SVerificationManager) Get ¶
func (vm *SVerificationManager) Get(receiverId, contactType string) (*SVerification, error)
Source Files ¶
- config.go
- doc.go
- emailqueue.go
- emailqueuestatus.go
- errors.go
- event.go
- event_template.go
- initdb.go
- notification.go
- notification_group.go
- notification_logs.go
- plugindriver.go
- receiver.go
- receiver_notification.go
- robot.go
- smsdriver.go
- subcontact.go
- subscriber.go
- subscriber_receiver.go
- template.go
- topic.go
- verify.go
- worker.go
Click to show internal directories.
Click to hide internal directories.