notify

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERVICE_TYPE    = apis.SERVICE_TYPE_NOTIFY
	SERVICE_VERSION = ""

	EMAIL          = "email"
	MOBILE         = "mobile"
	DINGTALK       = "dingtalk"
	FEISHU         = "feishu"
	WEBCONSOLE     = "webconsole"
	WORKWX         = "workwx"
	FEISHU_ROBOT   = "feishu-robot"
	DINGTALK_ROBOT = "dingtalk-robot"
	WORKWX_ROBOT   = "workwx-robot"
	WEBHOOK        = "webhook"
	WEBHOOK_ROBOT  = "webhook-robot"
	WEBSOCKET      = "websocket"

	ROBOT = "robot"

	RECEIVER_NOTIFICATION_RECEIVED = "received"  // Received a task about sending a notification
	RECEIVER_NOTIFICATION_SENT     = "sending"   // Nofity module has sent notification, but result unkown
	RECEIVER_NOTIFICATION_OK       = "sent_ok"   // Notification was sent successfully
	RECEIVER_NOTIFICATION_FAIL     = "sent_fail" // That sent a notification is failed

	VERIFICATION_SENT          = "sent"      // Verification was sent
	VERIFICATION_SENT_FAIL     = "sent_fail" // Verification was sent failed
	VERIFICATION_VERIFIED      = "verified"  // Verification was verified
	VERIFICATION_TOKEN_EXPIRED = "Verification code expired"
	VERIFICATION_TOKEN_INVALID = "Incorrect verification code"

	RECEIVER_STATUS_READY       = "ready"
	RECEIVER_STATUS_PULLING     = "pulling"
	RECEIVER_STATUS_PULL_FAILED = "pull_failed"

	NOTIFICATION_PRIORITY_IMPORTANT = "important"
	NOTIFICATION_PRIORITY_CRITICAL  = "fatal"
	NOTIFICATION_PRIORITY_NORMAL    = "normal"

	NOTIFICATION_STATUS_RECEIVED = "received"
	NOTIFICATION_STATUS_SENDING  = "sending"
	NOTIFICATION_STATUS_FAILED   = "failed"
	NOTIFICATION_STATUS_OK       = "ok"
	NOTIFICATION_STATUS_PART_OK  = "part_ok"

	NOTIFICATION_TAG_ALERT = "alert"

	TEMPLATE_TYPE_TITLE   = "title"
	TEMPLATE_TYPE_CONTENT = "content"
	TEMPLATE_TYPE_REMOTE  = "remote"

	TEMPLATE_LANG_EN = "en"
	TEMPLATE_LANG_CN = "cn"

	CTYPE_ROBOT_YES  = "yes"
	CTYPE_ROBOT_ONLY = "only"

	CONFIG_ATTRIBUTION_SYSTEM = "system"
	CONFIG_ATTRIBUTION_DOMAIN = "domain"

	ROBOT_TYPE_FEISHU   = "feishu"
	ROBOT_TYPE_DINGTALK = "dingtalk"
	ROBOT_TYPE_WORKWX   = "workwx"
	ROBOT_TYPE_WEBHOOK  = "webhook"

	ROBOT_STATUS_READY = "ready"

	RECEIVER_TYPE_USER    = "user"
	RECEIVER_TYPE_CONTACT = "contact"
	RECEIVER_TYPE_ROBOT   = "robot"

	TOPIC_TYPE_RESOURCE          = "resource"
	TOPIC_TYPE_AUTOMATED_PROCESS = "automated_process"
	TOPIC_TYPE_SECURITY          = "security"

	TOPIC_RESOURCE_SERVER                   = "server"
	TOPIC_RESOURCE_SCALINGGROUP             = "scalinggroup"
	TOPIC_RESOURCE_SCALINGPOLICY            = "scalingpolicy"
	TOPIC_RESOURCE_IMAGE                    = "image"
	TOPIC_RESOURCE_DISK                     = "disk"
	TOPIC_RESOURCE_SNAPSHOT                 = "snapshot"
	TOPIC_RESOURCE_INSTANCESNAPSHOT         = "instance_snapshot"
	TOPIC_RESOURCE_SNAPSHOTPOLICY           = "snapshotpolicy"
	TOPIC_RESOURCE_NETWORK                  = "network"
	TOPIC_RESOURCE_EIP                      = "eip"
	TOPIC_RESOURCE_SECGROUP                 = "secgroup"
	TOPIC_RESOURCE_LOADBALANCER             = "loadbalancer"
	TOPIC_RESOURCE_LOADBALANCERACL          = "loadbalanceracl"
	TOPIC_RESOURCE_LOADBALANCERCERTIFICATE  = "loadbalancercertificate"
	TOPIC_RESOURCE_BUCKET                   = "bucket"
	TOPIC_RESOURCE_DBINSTANCE               = "dbinstance"
	TOPIC_RESOURCE_ELASTICCACHE             = "elasticcache"
	TOPIC_RESOURCE_SCHEDULEDTASK            = "scheduledtask"
	TOPIC_RESOURCE_BAREMETAL                = "baremetal"
	TOPIC_RESOURCE_VPC                      = "vpc"
	TOPIC_RESOURCE_DNSZONE                  = "dns_zone"
	TOPIC_RESOURCE_NATGATEWAY               = "natgateway"
	TOPIC_RESOURCE_WEBAPP                   = "webapp"
	TOPIC_RESOURCE_CDNDOMAIN                = "cdn_domain"
	TOPIC_RESOURCE_FILESYSTEM               = "file_system"
	TOPIC_RESOURCE_WAF                      = "waf_instance"
	TOPIC_RESOURCE_KAFKA                    = "kafka"
	TOPIC_RESOURCE_ELASTICSEARCH            = "elastic_search"
	TOPIC_RESOURCE_MONGODB                  = "mongodb"
	TOPIC_RESOURCE_DNSRECORDSET             = "dns_recordset"
	TOPIC_RESOURCE_LOADBALANCERLISTENER     = "loadbalancerlistener"
	TOPIC_RESOURCE_LOADBALANCERBACKEDNGROUP = "loadbalancerbackendgroup"
	TOPIC_RESOURCE_HOST                     = "host"
	TOPIC_RESOURCE_TASK                     = "task"
	TOPIC_RESOURCE_DB_TABLE_RECORD          = "db_table_record"
	TOPIC_RESOURCE_CLOUDPODS_COMPONENT      = "cloudpods_component"
	TOPIC_RESOURCE_USER                     = "user"
	TOPIC_RESOURCE_ACTION_LOG               = "action_log"
	TOPIC_RESOURCE_ACCOUNT_STATUS           = "account"
	TOPIC_RESOURCE_WORKER                   = "worker"
	TOPIC_RESOURCE_NET                      = "net"
	TOPIC_RESOURCE_SERVICE                  = "service"
	TOPIC_RESOURCE_VM_INTEGRITY_CHECK       = "vm_integrity"
	TOPIC_RESOURCE_PROJECT                  = "project"
	TOPIC_RESOURCE_CLOUDPHONE               = "cloudphone"

	SUBSCRIBER_TYPE_ROLE     = "role"
	SUBSCRIBER_TYPE_ROBOT    = "robot"
	SUBSCRIBER_TYPE_RECEIVER = "receiver"

	SUBSCRIBER_SCOPE_SYSTEM  = "system"
	SUBSCRIBER_SCOPE_DOMAIN  = "domain"
	SUBSCRIBER_SCOPE_PROJECT = "project"
)
View Source
const (
	EmailQueued  = "queued"
	EmailSending = "sending"
	EmailSuccess = "success"
	EmailFail    = "fail"
)
View Source
const (
	PWD_EXPIRE_SOON_TITLE_CN = `{{- $d := .resource_details -}}
	{{ $d.account }}:您的密码有效期将过`
	PWD_EXPIRE_SOON_TITLE_EN = `{{- $d := .resource_details -}}
	{{ $d.account }}:Your password is valid and will expire soon`
	PWD_EXPIRE_SOON_CONTENT_CN = `` /* 139-byte string literal not displayed */

	PWD_EXPIRE_SOON_CONTENT_EN = `` /* 167-byte string literal not displayed */

)

密码即将失效通知

View Source
const (
	EXPIRED_RELEASE_TITLE_CN = `{{- $d := .resource_details -}}
	{{ $d.project }}项目的
	{{ .resource_type_display }}{{ $d.name }}即将到期`
	EXPIRED_RELEASE_TITLE_EN = `` /* 138-byte string literal not displayed */

	EXPIRED_RELEASE_CONTENT_CN = `` /* 545-byte string literal not displayed */

	EXPIRED_RELEASE_CONTENT_EN = `` /* 481-byte string literal not displayed */

)

资源即将到期通知

View Source
const (
	PANIC_TITLE_CN = `{{- $d := .resource_details -}}
	{{ .resource_type }} {{ $d.task_name }} 崩溃了`
	PANIC_TITLE_EN = `{{- $d := .resource_details -}}
	{{ .resource_type }} {{ $d.task_name }} PANIC`
	PANIC_CONTENT_CN = `` /* 165-byte string literal not displayed */

	PANIC_CONTENT_EN = `` /* 162-byte string literal not displayed */

)

服务崩溃通知

View Source
const (
	ACTION_LOG_EXCEED_COUNT_TITLE_CN = `{{- $d := .resource_details -}}
	操作日志超出设置数量{{ $d.exceed_count }}条,当前{{ $d.current_count }}条`
	ACTION_LOG_EXCEED_COUNT_TITLE_EN = `` /* 129-byte string literal not displayed */

	ACTION_LOG_EXCEED_COUNT_CONTENT_CN = `{{- $d := .resource_details.action -}}
	当前日志 ID: {{ $d.id }}`
	ACTION_LOG_EXCEED_COUNT_CONTENT_EN = `{{- $d := .resource_details.action -}}
	Current log ID: {{ $d.id }}`
)

日志容量超限通知

View Source
const (
	CHECKSUM_TEST_FAILED_TITLE_CN = `` /* 176-byte string literal not displayed */

	CHECKSUM_TEST_FAILED_TITLE_EN = `` /* 183-byte string literal not displayed */

	CHECKSUM_TEST_FAILED_CONTENT_CN = `` /* 648-byte string literal not displayed */

	CHECKSUM_TEST_FAILED_CONTENT_EN = `` /* 650-byte string literal not displayed */

)

完整性校验失败通知

View Source
const (
	COMMON_TITLE_CN = `` /* 179-byte string literal not displayed */

	COMMON_TITLE_EN = `` /* 179-byte string literal not displayed */

	COMMON_CONTENT_CN = `` /* 327-byte string literal not displayed */

	COMMON_CONTENT_EN = `` /* 348-byte string literal not displayed */

)

通用通知

View Source
const (
	EXCEPTION_TITLE_CN = `{{- $d := .resource_details -}}
	{{ .resource_type }} {{ $d.name }} 发生异常: {{ $d.message }}`
	EXCEPTION_TITLE_EN = `{{- $d := .resource_details -}}
	{{ .resource_type }} {{ $d.name }} exception occurs: {{ $d.message }}`
	EXCEPTION_CONTENT_CN = `{{- $d := .resource_details -}}
	{{ .resource_type }} {{ $d.name }} 发生异常: {{ $d.message }}`
	EXCEPTION_CONTENT_EN = `{{- $d := .resource_details -}}
	{{ .resource_type }} {{ $d.name }} exception occurs: {{ $d.message }}`
)

服务组件异常通知

View Source
const (
	MYSQL_OUT_OF_SYNC_TITLE_CN = `{{- $d := .resource_details -}}
	数据库 {{$d.ip}} 的主从同步不一致,请及时检查。`
	MYSQL_OUT_OF_SYNC_TITLE_EN = `` /* 143-byte string literal not displayed */

	MYSQL_OUT_OF_SYNC_CONTENT_CN = `` /* 570-byte string literal not displayed */

	MYSQL_OUT_OF_SYNC_CONTENT_EN = `` /* 614-byte string literal not displayed */

)

数据库主从同步不一致通知

View Source
const (
	NET_OUT_OF_SYNC_TITLE_CN = `{{- $d := .resource_details -}}
	{{ $d.service_name }}服务的网络拓扑信息同步不一致,请及时检查。	`
	NET_OUT_OF_SYNC_TITLE_EN = `` /* 142-byte string literal not displayed */

	NET_OUT_OF_SYNC_CONTENT_CN = `{{- $d := .resource_details -}}
	{{ $d.service_name }}服务的网络拓扑信息同步不一致,请及时检查。	`
	NET_OUT_OF_SYNC_CONTENT_EN = `` /* 142-byte string literal not displayed */

)

网络拓扑不一致通知

View Source
const (
	OFFLINE_TITLE_CN = `{{- $d := .resource_details -}}
	{{ .resource_type }} {{ $d.name }} 离线`
	OFFLINE_TITLE_EN = `{{- $d := .resource_details -}}
	The {{ .resource_type }} {{ $d.name }} Offline `
	OFFLINE_CONTENT_CN = `` /* 131-byte string literal not displayed */

	OFFLINE_CONTENT_EN = `` /* 139-byte string literal not displayed */

)

离线通知

View Source
const (
	PENDING_DELETE_TITLE_CN = `` /* 158-byte string literal not displayed */

	PENDING_DELETE_TITLE_EN = `` /* 178-byte string literal not displayed */

	PENDING_DELETE_CONTENT_CN = `` /* 316-byte string literal not displayed */

	PENDING_DELETE_CONTENT_EN = `` /* 731-byte string literal not displayed */

)

资源加入回收站通知

View Source
const (
	SERVER_PANICKED_TITLE_CN = `{{- $d := .resource_details -}}
	您在{{ $d.project }}项目的虚拟机{{ $d.name }}崩溃了`
	SERVER_PANICKED_TITLE_EN = `{{- $d := .resource_details -}}
	{{ .resource_type }} {{ $d.task_name }} PANIC`
	SERVER_PANICKED_CONTENT_CN = `{{- $d := .resource_details -}}
	您在{{ $d.project }}项目的虚拟机{{ $d.name }}崩溃了`
	SERVER_PANICKED_CONTENT_EN = `{{- $d := .resource_details -}}
	The server {{ $d.name }} in project {{ $d.project }} panicked.`
)

虚拟机崩溃通知

View Source
const (
	SCHEDULEDTASK_EXECUTE_TITLE_CN = `{{- $d := .resource_details -}}
	您在{{ $d.project }}项目的定时任务执行成功`
	SCHEDULEDTASK_EXECUTE_TITLE_EN = `{{- $d := .resource_details -}}
	The scheduled task in {{ $d.project }} execute successfully`
	SCHEDULEDTASK_EXECUTE_CONTENT_CN = `{{- $d := .resource_details -}}
	您在{{ $d.project }}项目的定时任务执行成功`
	SCHEDULEDTASK_EXECUTE_CONTENT_EN = `` /* 169-byte string literal not displayed */

)

资源定时调度任务通知

View Source
const (
	SERVICE_ABNORMAL_TITLE_CN = `{{- $d := .resource_details -}}
	服务{{ $d.service_name }}异常`
	SERVICE_ABNORMAL_TITLE_EN = `{{- $d := .resource_details -}}
	Server {{ $d.service_name }} abnormal`
	SERVICE_ABNORMAL_CONTENT_CN = `` /* 199-byte string literal not displayed */

	SERVICE_ABNORMAL_CONTENT_EN = `` /* 194-byte string literal not displayed */

)

服务异常通知

View Source
const (
	SCALINGPOLICY_EXECUTE_TITLE_CN = `` /* 144-byte string literal not displayed */

	SCALINGPOLICY_EXECUTE_TITLE_EN = `{{- $d := .resource_details -}}
	The scaling policy {{ $d.name }} in the scaling group {{ $d.scaling_group }} triggered`
	SCALINGPOLICY_EXECUTE_CONTENT_CN = `` /* 259-byte string literal not displayed */

	SCALINGPOLICY_EXECUTE_CONTENT_EN = `` /* 298-byte string literal not displayed */

)

弹性伸缩组策略生效通知

View Source
const (
	SNAPSHOTPOLICY_EXECUTE_TITLE_CN = `{{- $d := .resource_details -}}
	{{ $d.project }}项目的自动快照策略{{ $d.name }}生效`
	SNAPSHOTPOLICY_EXECUTE_TITLE_EN = `{{- $d := .resource_details -}}
	The snapshot policy {{ $d.name }} in the {{ $d.project }} project executed`
	SNAPSHOTPOLICY_EXECUTE_CONTENT_CN = `` /* 135-byte string literal not displayed */

	SNAPSHOTPOLICY_EXECUTE_CONTENT_EN = `` /* 157-byte string literal not displayed */

)

自动快照策略生效通知

View Source
const (
	UPDATE_TITLE_CN = `` /* 165-byte string literal not displayed */

	UPDATE_TITLE_EN = `` /* 166-byte string literal not displayed */

	UPDATE_CONTENT_CN = `` /* 412-byte string literal not displayed */

	UPDATE_CONTENT_EN = `` /* 424-byte string literal not displayed */

)

资源变更通知

View Source
const (
	USER_LOCK_TITLE_CN = `{{- $d := .resource_details -}}
	账号{{ $d.name }}已被锁定`
	USER_LOCK_TITLE_EN = `{{- $d := .resource_details -}}
	Account {{ $d.name }} has been locked`
	USER_LOCK_CONTENT_CN = `` /* 169-byte string literal not displayed */

	USER_LOCK_CONTENT_EN = `` /* 205-byte string literal not displayed */

)

用户锁定通知

View Source
const (
	SYNC_ACCOUNT_STATUS_TITLE_CN = `{{- $d := .resource_details -}}
	云账号{{ $d.name}}状态异常`
	SYNC_ACCOUNT_STATUS_TITLE_EN = `{{- $d := .resource_details -}}
	The account {{ $d.name }} status is abnormal`
	SYNC_ACCOUNT_STATUS_CONTENT_CN = `{{- $d := .resource_details -}}
	云账号{{ $d.name }}状态异常,请及时检查。`
	SYNC_ACCOUNT_STATUS_CONTENT_EN = `{{- $d := .resource_details -}}
	The account {{ $d.name }} status is abnormal. Please check in time.`
)

云账号状态异常通知

View Source
const (
	WORK_BLOCK_TITLE_CN = `{{- $d := .resource_details -}}
	服务{{ d.service_name}} worker阻塞半小时,请及时检查。`
	WORK_BLOCK_TITLE_EN = `` /* 133-byte string literal not displayed */

	WORK_BLOCK_CONTENT_CN = `{{- $d := .resource_details -}}
	服务{{ d.service_name}} worker阻塞半小时,请及时检查。`
	WORK_BLOCK_CONTENT_EN = `` /* 133-byte string literal not displayed */

)

work阻塞通知

View Source
const (
	STATUS_CHANGED_TITLE_CN = `{{- $d := .resource_details -}}
		{{ $d.project }}项目的
		{{ .resource_type_display }}{{ $d.name }}状态发生变更`
	STATUS_CHANGED_TITLE_EN = `` /* 143-byte string literal not displayed */

	STATUS_CHANGED_CONTENT_CN = `` /* 256-byte string literal not displayed */

	STATUS_CHANGED_CONTENT_EN = `` /* 260-byte string literal not displayed */

)
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"
	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"
)
View Source
const (
	DelimiterInEvent = "/"
)

Variables

View Source
var (
	ErrNoSuchMobile     = errors.Error("no such mobile")
	ErrIncompleteConfig = errors.Error("incomplete config")
)
View Source
var (
	Event SNotifyEvent

	ActionCreate         SAction = "create"
	ActionDelete         SAction = "delete"
	ActionPendingDelete  SAction = "pending_delete"
	ActionUpdate         SAction = "update"
	ActionRebuildRoot    SAction = "rebuild_root"
	ActionResetPassword  SAction = "reset_password"
	ActionChangeConfig   SAction = "change_config"
	ActionResize         SAction = "resize"
	ActionExpiredRelease SAction = "expired_release"
	ActionExecute        SAction = "execute"
	ActionChangeIpaddr   SAction = "change_ipaddr"
	ActionSyncStatus     SAction = "sync_status"
	ActionCleanData      SAction = "clean_data"
	ActionMigrate        SAction = "migrate"

	ActionCreateBackupServer SAction = "add_backup_server"
	ActionDelBackupServer    SAction = "delete_backup_server"

	ActionSyncCreate        SAction = "sync_create"
	ActionSyncUpdate        SAction = "sync_update"
	ActionSyncDelete        SAction = "sync_delete"
	ActionSyncAccountStatus SAction = "sync_account_status"

	ActionOffline         SAction = "offline"
	ActionSystemPanic     SAction = "panic"
	ActionSystemException SAction = "exception"

	ActionChecksumTest SAction = "checksum_test"

	ActionLock SAction = "lock"

	ActionExceedCount          SAction = "exceed_count"
	ActionPasswordExpireSoon   SAction = "password_expire_soon"
	ActionWorkerBlock          SAction = "woker_block"
	ActionNetOutOfSync         SAction = "net_out_of_sync"
	ActionMysqlOutOfSync       SAction = "mysql_out_of_sync"
	ActionServiceAbnormal      SAction = "service_abnormal"
	ActionServerPanicked       SAction = "server_panicked"
	ActionAttach               SAction = "attach"
	ActionDetach               SAction = "detach"
	ActionIsolatedDeviceCreate SAction = "isolated_device_create"
	ActionIsolatedDeviceUpdate SAction = "isolated_device_update"
	ActionIsolatedDeviceDelete SAction = "isolated_device_delete"
	ActionStatusChanged        SAction = "status_changed"
	ActionStart                SAction = "start"
	ActionStop                 SAction = "stop"
	ActionReset                SAction = "reset"
	ActionRestart              SAction = "restart"

	ResultFailed  SResult = "failed"
	ResultSucceed SResult = "succeed"
)

Functions

This section is empty.

Types

type ConfigCreateInput

type ConfigCreateInput struct {
	apis.DomainLevelResourceCreateInput

	// description: config type
	// required: true
	// example: feishu
	Type string `json:"type"`

	// description: config content
	// required: true
	// example: {"app_id": "123456", "app_secret": "feishu_nihao"}
	Content *SNotifyConfigContent `json:"content"`

	// description: attribution
	// required: true
	// enum: system,domain
	// example: system
	Attribution string `json:"attribution"`
}

type ConfigDetails

type ConfigDetails struct {
	apis.DomainLevelResourceDetails

	SConfig
}

type ConfigListInput

type ConfigListInput struct {
	apis.DomainLevelResourceListInput
	Type        string `json:"type"`
	Attribution string `json:"attribution"`
}

type ConfigManagerGetTypesInput

type ConfigManagerGetTypesInput struct {
	// description: View the available notification channels for the receivers
	// required: false
	Receivers []string `json:"receivers"`
	// description: View the available notification channels for the domains with these DomainIds
	// required: false
	DomainIds []string `json:"domain_ids"`
	// description: Operation of reduce
	// required: false
	// enum: union,merge
	Operation string `json:"operation"`
}

type ConfigManagerGetTypesOutput

type ConfigManagerGetTypesOutput struct {
	Types []string `json:"types"`
}

type ConfigUpdateInput

type ConfigUpdateInput struct {
	// description: config content
	// required: true
	// example: {"app_id": "123456", "app_secret": "feishu_nihao"}
	Content *SNotifyConfigContent `json:"content"`
}

type ConfigValidateInput

type ConfigValidateInput struct {
	// description: config type
	// required: true
	// example: feishu
	Type string `json:"type"`

	// description: config content
	// required: true
	// example: {"app_id": "123456", "app_secret": "feishu_nihao"}
	Content *SNotifyConfigContent `json:"content"`
}

type ConfigValidateOutput

type ConfigValidateOutput struct {
	IsValid bool   `json:"is_valid"`
	Message string `json:"message"`
}

type EmailQueueCreateInput

type EmailQueueCreateInput struct {
	SEmailMessage

	// swagger: ignore
	Dest string `json:"dest"`
	// swagger: ignore
	DestCc string `json:"dest_cc"`
	// swagger: ignore
	DestBcc string `json:"dest_bcc"`
	// swagger: ignore
	Content jsonutils.JSONObject `json:"content"`

	// swagger: ignore
	ProjectId string `json:"project_id"`
	// swagger: ignore
	Project string `json:"project"`
	// swagger: ignore
	ProjectDomainId string `json:"project_domain_id"`
	// swagger: ignore
	ProjectDomain string `json:"project_domain"`
	// swagger: ignore
	UserId string `json:"user_id"`
	// swagger: ignore
	User string `json:"user"`
	// swagger: ignore
	DomainId string `json:"domain_id"`
	// swagger: ignore
	Domain string `json:"domain"`
	// swagger: ignore
	Roles string `json:"roles"`

	MoreDetails map[string]string `json:"more_datails"`

	SessionId string `json:"session_id"`
}

type EmailQueueDetails

type EmailQueueDetails struct {
	apis.ModelBaseDetails

	SEmailQueue

	SentAt time.Time `json:"sent_at"`

	Status string `json:"status"`

	Results string `json:"results"`
}

type EmailQueueListInput

type EmailQueueListInput struct {
	apis.ModelBaseListInput

	Id        []int    `json:"id"`
	To        []string `json:"to"`
	Subject   string   `json:"subject"`
	SessionId []string `json:"session_id"`
}

type EmailQueueSendInput

type EmailQueueSendInput struct {
	Sync bool `json:"sync"`
}

type FailedElem

type FailedElem struct {
	ContactType string
	Reason      string
}

type Identification

type Identification struct {
	// example: 036fed49483b412888a760c2bc995caa
	ID string `json:"id"`
	// example: test
	Name string `json:"name"`
}

type NotificationCreateInput

type NotificationCreateInput struct {
	apis.StatusStandaloneResourceCreateInput

	// description: ids or names of receiver
	// required: false
	// example: {"adfb720ccdd34c638346ea4fa7a713a8", "zhangsan"}
	Receivers []string `json:"receivers"`
	// description: direct contact, admin privileges required
	// required: false
	Contacts []string `json:"contacts"`
	// description: robots
	// example: feishu robot
	Robots []string `json:"robots"`
	// description: contact type
	// required: ture
	// example: email
	ContactType string `json:"contact_type"`
	// description: notification topic
	// required: true
	// example: IMAGE_ACTIVE
	Topic string `json:"topic"`
	// description: notification priority
	// required: false
	// enum: fatal,important,nomal
	// example: normal
	Priority string `json:"priority"`
	// description: message content or jsonobject
	// required: ture
	Message string `json:"message"`
	// description: notification tag
	// required: false
	// example: alert
	Tag                       string `json:"tag"`
	IgnoreNonexistentReceiver bool   `json:"ignore_nonexistent_receiver"`
}

type NotificationDetails

type NotificationDetails struct {
	apis.StatusStandaloneResourceDetails

	SNotification

	Title          string          `json:"title"`
	Content        string          `json:"content"`
	ReceiveDetails []ReceiveDetail `json:"receive_details"`
	TopicType      string          `json:"topic_type"`
}

type NotificationListInput

type NotificationListInput struct {
	apis.StatusStandaloneResourceListInput

	ContactType string
	ReceiverId  string
	Tag         string
	TopicType   string
}

type NotificationManagerContactNotifyInput

type NotificationManagerContactNotifyInput struct {
	// description: ids or names of receiver
	// required: false
	// example: {"adfb720ccdd34c638346ea4fa7a713a8"}
	ReceiverIds []string `json:"receiver_ids"`
	// description: contact types
	// required: false
	// example: email
	ContactTypes []string `json:"contact_type"`

	// description: ids  of robot
	// required: false
	// example: {"adfb720ccdd34c638346ea4fa7a713a8"}
	RobotIds []string `json:"robot_ids"`
	RoleIds  []string `json:"role_ids"`
	Subject  string
	Body     string
}

type NotificationManagerEventNotifyInput

type NotificationManagerEventNotifyInput struct {
	// description: ids or names of receiver
	// required: false
	// example: {"adfb720ccdd34c638346ea4fa7a713a8"}
	ReceiverIds []string `json:"receiver_ids"`
	// description: direct contact, admin privileges required
	// required: false
	Contacts []SContact `json:"contacts"`
	// description: contact types
	// required: false
	// example: email
	ContactTypes []string `json:"contact_type"`
	// description: notification priority
	// required: false
	// enum: fatal,important,nomal
	// example: normal
	Priority string `json:"priority"`
	// description: resource details
	// required: ture
	ResourceDetails *jsonutils.JSONDict `json:"resource_details"`
	// description: event trigger sending notification
	// required: true
	// example: SERVER_DELETE
	Event        string
	ResourceType string

	CloudAccountName string
	Action           SAction
	// failed,succeed
	Result SResult
	// description: day left before the event
	// required: false
	// example: 0
	AdvanceDays int `json:"advance_days"`
	// description: domainId of the resource that triggered the event notification
	// required: false
	// example: default
	ProjectDomainId string
	// description: projectId of the resource that triggered the event notification
	// required: false
	// example: f627e09f038645f08ce6880c8d9cb8fd
	ProjectId string `json:"project_id"`
	IsFailed  SResult
}

type NotificationManagerEventNotifyOutput

type NotificationManagerEventNotifyOutput struct {
	FailedList []FailedElem
}

type NotifyConfig

type NotifyConfig struct {
	SNotifyConfigContent
	Attribution string
	DomainId    string
}

func (*NotifyConfig) GetDomainId

func (self *NotifyConfig) GetDomainId() string

type PerformDisableInput

type PerformDisableInput struct {
}

type PerformEnableInput

type PerformEnableInput struct {
}

type ReceiveDetail

type ReceiveDetail struct {
	ReceiverId   string    `json:"receiver_id"`
	ReceiverName string    `json:"receiver_name"`
	Contact      string    `json:"contact"`
	ReceiverType string    `json:"receiver_type"`
	SendAt       time.Time `json:"sendAt"`
	SendBy       string    `json:"send_by"`
	Status       string    `json:"status"`
	FailedReason string    `json:"failed_reason"`
}

type ReceiverCreateInput

type ReceiverCreateInput struct {
	apis.VirtualResourceCreateInput
	apis.EnabledBaseResourceCreateInput

	// description: user id in keystone
	// example: adfb720ccdd34c638346ea4fa7a713a8
	UID string `json:"uid"`

	// description: user name in keystone
	// example: hello
	UName string `json:"uname"`

	// description: user email
	// example: example@gmail.com
	Email string `json:"email"`

	InternationalMobile SInternationalMobile `json:"international_mobile"`

	// description: enabled contact types for user
	// example: {"email", "mobile", "feishu", "dingtalk", "workwx"}
	EnabledContactTypes []string `json:"enabled_contact_types"`

	// force verified if admin create the records
	ForceVerified bool `json:"force_verified"`
}

type ReceiverDetails

type ReceiverDetails struct {
	apis.VirtualResourceDetails

	SReceiver
	InternationalMobile SInternationalMobile `json:"international_mobile"`

	// description: enabled contact types for user
	// example: eamil, mobile, feishu, dingtalk, workwx
	EnabledContactTypes []string `json:"enabled_contact_types"`

	// description: verified info
	VerifiedInfos []VerifiedInfo `json:"verified_infos"`
}

type ReceiverEnableContactTypeInput

type ReceiverEnableContactTypeInput struct {
	EnabledContactTypes []string `json:"enabled_contact_types"`
}

type ReceiverGetSubscriptionOptions

type ReceiverGetSubscriptionOptions struct {
	Id           string
	ShowDisabled bool
}

type ReceiverIntellijGetInput

type ReceiverIntellijGetInput struct {
	// description: user id in keystone
	// required: true
	UserId string `json:"user_id"`
	// description: create if receiver with UserId does not exist
	// required: false
	CreateIfNo *bool `json:"create_if_no"`
	// description: scope
	// required: true
	Scope string `json:"scope"`
}

type ReceiverListInput

type ReceiverListInput struct {
	apis.VirtualResourceListInput
	apis.EnabledResourceBaseListInput

	UID string `json:"uid"`

	UName string `json:"uname"`

	EnabledContactType string `json:"enabled_contact_type"`

	VerifiedContactType string `json:"verified_contact_type"`

	ProjectDomainFilter bool `json:"project_domain_filter"`
}

type ReceiverTriggerVerifyInput

type ReceiverTriggerVerifyInput struct {
	// description: contact type
	// required: true
	// example: email
	// enum: email,mobile
	ContactType string `json:"contact_type"`
}

type ReceiverUpdateInput

type ReceiverUpdateInput struct {
	apis.VirtualResourceBaseUpdateInput

	// description: user email
	// example: example@gmail.com
	Email string `json:"email"`

	InternationalMobile SInternationalMobile `json:"international_mobile"`

	// description: enabled contacts for user
	// example: {"email", "mobile", "feishu", "dingtalk", "workwx"}
	EnabledContactTypes []string `json:"enabled_contact_types"`

	ForceVerified bool `json:"force_verified"`
}

type ReceiverVerifyInput

type ReceiverVerifyInput struct {
	// description: Contact type
	// required: true
	// example: email
	// enum: email,mobile
	ContactType string `json:"contact_type"`
	// description: token user input
	// required: true
	// example: 123456
	Token string `json:"token"`
}

type RobotCreateInput

type RobotCreateInput struct {
	apis.SharableVirtualResourceCreateInput
	apis.EnabledBaseResourceCreateInput
	// description: robot type
	// enum: feishu,dingtalk,workwx,webhook
	// example: webhook
	Type string `json:"type"`
	// description: address
	// example: http://helloworld.io/test/webhook
	Address string `json:"address"`
	// description: Language preference
	// example: zh_CN
	Lang        string               `json:"lang"`
	Header      jsonutils.JSONObject `json:"header"`
	Body        jsonutils.JSONObject `json:"body"`
	MsgKey      string               `json:"msg_key"`
	UseTemplate tristate.TriState    `json:"use_template"`
}

type RobotDetails

type RobotDetails struct {
	apis.SharableVirtualResourceDetails
}

type RobotListInput

type RobotListInput struct {
	apis.SharableVirtualResourceListInput
	apis.EnabledResourceBaseListInput
	// description: robot type
	// enum: feishu,dingtalk,workwx,webhook
	// example: webhook
	Type string `json:"type"`
	// description: Language preference
	// example: en
	Lang string `json:"lang"`
}

type RobotUpdateInput

type RobotUpdateInput struct {
	apis.SharableVirtualResourceBaseUpdateInput
	// description: address
	// example: http://helloworld.io/test/webhook
	Address string `json:"address"`
	// description: Language preference
	// example: en
	Lang   string               `json:"lang"`
	Header jsonutils.JSONObject `json:"header"`
	Body   jsonutils.JSONObject `json:"body"`
	MsgKey string               `json:"msg_key"`
}

type SAction

type SAction string

type SBatchSendParams

type SBatchSendParams struct {
	ContactType string
	Contacts    []string
	Topic       string
	Message     string
	Priority    string
	Lang        string
}

type SConfig

type SConfig struct {
	apis.SDomainLevelResourceBase
	Type        string                `json:"type"`
	Content     *SNotifyConfigContent `json:"content"`
	Attribution string                `json:"attribution"`
}

SConfig is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SConfig.

type SContact

type SContact struct {
	Contact     string `json:"contact"`
	ContactType string `json:"contact_type"`
}

type SEmailAttachment

type SEmailAttachment struct {
	Filename string `json:"filename"`
	Mime     string `json:"mime"`

	Base64Content string `json:"content"`
}

type SEmailConfig

type SEmailConfig struct {
	Hostname      string `json:"hostname"`
	Hostport      int    `json:"hostport"`
	Username      string `json:"username"`
	Password      string `json:"password"`
	SenderAddress string `json:"sender_address"`
	SslGlobal     bool   `json:"ssl_global"`
}

type SEmailMessage

type SEmailMessage struct {
	To      []string `json:"to"`
	Cc      []string `json:"cc"`
	Bcc     []string `json:"bcc"`
	Subject string   `json:"subject"`
	Body    string   `json:"body"`

	Attachments []SEmailAttachment `json:"attachments"`
}

type SEmailQueue

type SEmailQueue struct {
	apis.SLogBase
	RecvAt          time.Time            `json:"recv_at"`
	Dest            string               `json:"dest"`
	Subject         string               `json:"subject"`
	DestCc          string               `json:"dest_cc"`
	DestBcc         string               `json:"dest_bcc"`
	SessionId       string               `json:"session_id"`
	Content         jsonutils.JSONObject `json:"content"`
	MoreDetails     jsonutils.JSONObject `json:"more_details"`
	ProjectId       string               `json:"project_id"`
	Project         string               `json:"project"`
	ProjectDomainId string               `json:"project_domain_id"`
	ProjectDomain   string               `json:"project_domain"`
	UserId          string               `json:"user_id"`
	User            string               `json:"user"`
	DomainId        string               `json:"domain_id"`
	Domain          string               `json:"domain"`
	Roles           string               `json:"roles"`
}

SEmailQueue is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SEmailQueue.

type SEmailQueueStatus

type SEmailQueueStatus struct {
	Id      int64     `json:"id"`
	SentAt  time.Time `json:"sent_at"`
	Status  string    `json:"status"`
	Results string    `json:"results"`
}

SEmailQueueStatus is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SEmailQueueStatus.

type SEvent

type SEvent struct {
	apis.SLogBase
	// 资源创建时间
	CreatedAt    time.Time `json:"created_at"`
	Message      string    `json:"message"`
	Event        string    `json:"event"`
	ResourceType string    `json:"resource_type"`
	Action       string    `json:"action"`
	AdvanceDays  int       `json:"advance_days"`
	TopicId      string    `json:"topic_id"`
}

SEvent is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SEvent.

type SInternationalMobile

type SInternationalMobile struct {
	// description: user mobile
	// example: 17812345678
	Mobile string `json:"mobile"`
	// description: area code of mobile
	// example: 86
	AreaCode string `json:"area_code"`
}

func ParseInternationalMobile

func ParseInternationalMobile(mobile string) SInternationalMobile

func (*SInternationalMobile) AcceptExtMobile

func (im *SInternationalMobile) AcceptExtMobile()

支持接受分机号(仅保留数字)

func (SInternationalMobile) String

func (im SInternationalMobile) String() string

type SNotification

type SNotification struct {
	apis.SStatusStandaloneResourceBase
	ContactType string `json:"contact_type"`
	// swagger:ignore
	Topic    string `json:"topic"`
	Priority string `json:"priority"`
	// swagger:ignore
	Message string `json:"message"`
	// swagger:ignore
	TopicType string `json:"topic_type"`
	// swagger:ignore
	TopicId    string    `json:"topic_id"`
	ReceivedAt time.Time `json:"received_at"`
	EventId    string    `json:"event_id"`
	SendTimes  int       `json:"send_times"`
}

SNotification is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotification.

type SNotificationGroup

type SNotificationGroup struct {
	Id       string `json:"id"`
	GroupKey string `json:"group_key"`
	Title    string `json:"title"`
	// swagger:ignore
	Message     string               `json:"message"`
	ReceiverId  string               `json:"receiver_id"`
	Body        jsonutils.JSONObject `json:"body"`
	Header      jsonutils.JSONObject `json:"header"`
	MsgKey      string               `json:"msg_key"`
	ContactType string               `json:"contact_type"`
	Contact     string               `json:"contact"`
	DomainId    string               `json:"domain_id"`
}

SNotificationGroup is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotificationGroup.

type SNotificationGroupSearchInput

type SNotificationGroupSearchInput struct {
	StartTime   time.Time
	EndTime     time.Time
	GroupKey    string
	ReceiverId  string
	ContactType string
}

type SNotificationLog

type SNotificationLog struct {
	apis.SLogBase
	ContactType string `json:"contact_type"`
	// swagger:ignore
	Topic    string `json:"topic"`
	Priority string `json:"priority"`
	// swagger:ignore
	Message string `json:"message"`
	// swagger:ignore
	TopicType  string    `json:"topic_type"`
	ReceivedAt time.Time `json:"received_at"`
	EventId    string    `json:"event_id"`
	SendTimes  int       `json:"send_times"`
}

SNotificationLog is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotificationLog.

type SNotifyAction

type SNotifyAction struct {
	apis.SEnabledStatusStandaloneResourceBase
}

SNotifyAction is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotifyAction.

type SNotifyConfigContent

type SNotifyConfigContent struct {
	// Email
	Hostname      string
	Hostport      int
	Password      string
	SslGlobal     bool
	Username      string
	SenderAddress string
	//Lark
	AppId       string
	AppSecret   string
	AccessToken string
	// workwx
	AgentId string
	CorpId  string
	Secret  string
	// dingtalk
	//AgentId string
	//AppSecret string
	AppKey string
	// sms
	VerifiyCode     string
	AlertsCode      string
	ErrorCode       string
	PhoneNumber     string
	AccessKeyId     string
	AccessKeySecret string
	ServiceUrl      string
	Signature       string
	SmsDriver       string
}

func (SNotifyConfigContent) IsZero

func (self SNotifyConfigContent) IsZero() bool

func (SNotifyConfigContent) String

func (self SNotifyConfigContent) String() string

type SNotifyElementCreateInput

type SNotifyElementCreateInput struct {
	apis.EnabledStatusStandaloneResourceCreateInput
	Name string
}

type SNotifyEvent

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

func (SNotifyEvent) Action

func (se SNotifyEvent) Action() SAction

func (SNotifyEvent) ActionWithResult

func (se SNotifyEvent) ActionWithResult(delimiter string) string

func (SNotifyEvent) ResourceType

func (se SNotifyEvent) ResourceType() string

func (SNotifyEvent) Result

func (se SNotifyEvent) Result() SResult

func (SNotifyEvent) String

func (se SNotifyEvent) String() string

func (SNotifyEvent) StringWithDeli

func (se SNotifyEvent) StringWithDeli(delimiter string) string

func (SNotifyEvent) WithAction

func (se SNotifyEvent) WithAction(a SAction) SNotifyEvent

func (SNotifyEvent) WithResourceType

func (se SNotifyEvent) WithResourceType(rt string) SNotifyEvent

func (SNotifyEvent) WithResult

func (se SNotifyEvent) WithResult(r SResult) SNotifyEvent

type SNotifyReceiver

type SNotifyReceiver struct {
	Contact  string
	DomainId string
	Enabled  bool
	Lang     string
	// contains filtered or unexported fields
}

func (*SNotifyReceiver) Callback

func (self *SNotifyReceiver) Callback(err error)

type SNotifyResource

type SNotifyResource struct {
	apis.SEnabledStatusStandaloneResourceBase
}

SNotifyResource is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SNotifyResource.

type SReceiver

type SReceiver struct {
	apis.SVirtualResourceBase
	apis.SEnabledResourceBase
	Email string `json:"email"`
	// swagger:ignore
	Mobile string `json:"mobile"`
	Lang   string `json:"lang"`
	// swagger:ignore
	EnabledEmail *bool `json:"enabled_email,omitempty"`
	// swagger:ignore
	VerifiedEmail *bool `json:"verified_email,omitempty"`
	// swagger:ignore
	EnabledMobile *bool `json:"enabled_mobile,omitempty"`
	// swagger:ignore
	VerifiedMobile *bool `json:"verified_mobile,omitempty"`
}

SReceiver is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SReceiver.

type SRemoteTemplateParam

type SRemoteTemplateParam struct {
	Code      string `json:"code"`
	Domain    string `json:"domain"`
	User      string `json:"user"`
	Type      string `json:"type"`
	AlertName string `json:"alert_name"`
}

type SResult

type SResult string

type SRobot

type SRobot struct {
	apis.SSharableVirtualResourceBase
	apis.SEnabledResourceBase
	Type        string               `json:"type"`
	Address     string               `json:"address"`
	Lang        string               `json:"lang"`
	Header      jsonutils.JSONObject `json:"header"`
	Body        jsonutils.JSONObject `json:"body"`
	MsgKey      string               `json:"msg_key"`
	UseTemplate *bool                `json:"use_template,omitempty"`
}

SRobot is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SRobot.

type SRoleContactInput

type SRoleContactInput struct {
	RoleIds         []string
	Scope           string
	ProjectDomainId string
	ProjectId       string `json:"project_id"`
}

type SRoleContactOutput

type SRoleContactOutput struct {
	ContactType []string
}

type SSMSSendParams

type SSMSSendParams struct {
	RemoteTemplate      string
	RemoteTemplateParam SRemoteTemplateParam

	AppKey        string
	AppSecret     string
	From          string
	To            string
	TemplateId    string
	TemplateParas string
	Signature     string
}

type SSendParams

type SSendParams struct {
	ContactType    string
	Contact        string
	Topic          string
	Message        string
	Priority       string
	Title          string
	RemoteTemplate string
	Lang           string
	Receiver       SNotifyReceiver
}

type SSubscriber

type SSubscriber struct {
	apis.SStandaloneAnonResourceBase
	apis.SEnabledResourceBase
	TopicId                 string `json:"topic_id"`
	Type                    string `json:"type"`
	Identification          string `json:"identification"`
	RoleScope               string `json:"role_scope"`
	ResourceScope           string `json:"resource_scope"`
	ResourceAttributionId   string `json:"resource_attribution_id"`
	ResourceAttributionName string `json:"resource_attribution_name"`
	Scope                   string `json:"scope"`
	DomainId                string `json:"domain_id"`
	// minutes
	GroupTimes uint32 `json:"group_times"`
}

SSubscriber is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SSubscriber.

type SSubscriberReceiver

type SSubscriberReceiver struct {
	apis.SJointResourceBase
	SubscriberId string `json:"subscriber_id"`
	ReceiverId   string `json:"receiver_id"`
}

SSubscriberReceiver is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.SSubscriberReceiver.

type STemplate

type STemplate struct {
	apis.SStandaloneAnonResourceBase
	ContactType string `json:"contact_type"`
	Topic       string `json:"topic"`
	// title | content | remote
	TemplateType string `json:"template_type"`
	Content      string `json:"content"`
	Lang         string `json:"lang"`
	Example      string `json:"example"`
}

STemplate is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.STemplate.

type STopic

type STopic struct {
	apis.SEnabledStatusStandaloneResourceBase
	Type              string           `json:"type"`
	Results           *bool            `json:"results,omitempty"`
	TitleCn           string           `json:"title_cn"`
	TitleEn           string           `json:"title_en"`
	ContentCn         string           `json:"content_cn"`
	ContentEn         string           `json:"content_en"`
	GroupKeys         *STopicGroupKeys `json:"group_keys"`
	AdvanceDays       []int            `json:"advance_days"`
	WebconsoleDisable *bool            `json:"webconsole_disable,omitempty"`
}

STopic is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.STopic.

type STopicAction

type STopicAction struct {
	apis.SJointResourceBase
	ActionId string `json:"action_id"`
	TopicId  string `json:"topic_id"`
}

STopicAction is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.STopicAction.

type STopicActionInput

type STopicActionInput struct {
	ActionId string
}

type STopicGroupKeys

type STopicGroupKeys []string

type STopicResource

type STopicResource struct {
	apis.SJointResourceBase
	ResourceId string `json:"resource_id"`
	TopicId    string `json:"topic_id"`
}

STopicResource is an autogenerated struct via yunion.io/x/onecloud/pkg/notify/models.STopicResource.

type STopicResourceInput

type STopicResourceInput struct {
	ResourceId string
}

type SWorkwxSendMessageResp

type SWorkwxSendMessageResp struct {
	ErrCode        int    `json:"errcode"`
	ErrMsg         string `json:"errmsg"`
	InvalidUser    string `json:"invaliduser"`
	InvalidParty   string `json:"invalidparty" `
	InvalidTag     string `json:"invalidtag"`
	UnlicensedUser string `json:"unlicenseduser" `
	MsgId          string `json:"msgid"`
	ResponseCode   string `json:"response_code"`
}

type SendParams

type SendParams struct {
	Title               string
	Message             string
	Priority            string
	RemoteTemplate      string
	Topic               string
	Event               string
	Receivers           SNotifyReceiver
	EmailMsg            SEmailMessage
	Header              jsonutils.JSONObject
	Body                jsonutils.JSONObject
	MsgKey              string
	DomainId            string
	RemoteTemplateParam SRemoteTemplateParam
	GroupKey            string
	// minutes
	GroupTimes uint
	ReceiverId string
	SendTime   time.Time
}

type SsNotification

type SsNotification struct {
	ContactType      string
	Topic            string
	Message          string
	Event            SNotifyEvent
	AdvanceDays      int
	RobotUseTemplate bool
}

type SubscriberChangeInput

type SubscriberChangeInput struct {
	// description: receivers which is required when the type is 'receiver' will Subscribe TopicID
	Receivers []string

	// description: Role(Id or Name) which is required when the type is 'role' will Subscribe TopicID
	Role string

	// description: The scope of role subscribers
	// enum: system,domain,project
	RoleScope string

	// description: Robot(Id or Name) which is required when the type is 'robot' will Subscribe TopicID
	Robot string
	// minutes
	GroupTimes *uint32
}

type SubscriberCreateInput

type SubscriberCreateInput struct {
	apis.StandaloneAnonResourceCreateInput

	// description: Id of Topic
	// required
	TopicID string

	// description: scope of resource
	// enum: system,domain,project
	ResourceScope string

	// description: project id or domain id of resource
	// example: 1e3824756bac4ac084e784ed297ec652
	ResourceAttributionId string

	ResourceAttributionName string

	// description: domain id of resource
	// example: 1e3824756bac4ac084e784ed297ec652
	DomainId string

	// description: Type of subscriber
	// enum: receiver,robot,role
	Type string

	// description: receivers which is required when the type is 'receiver' will Subscribe TopicID
	Receivers []string

	// description: Role(Id or Name) which is required when the type is 'role' will Subscribe TopicID
	Role string

	// description: The scope of role subscribers
	// enum: system,domain,project
	RoleScope string

	// description: Robot(Id or Name) which is required when the type is 'robot' will Subscribe TopicID
	Robot string

	// description: scope
	// enum: system,domain
	Scope string
	// minutes
	GroupTimes *uint32
}

type SubscriberDetails

type SubscriberDetails struct {
	apis.StandaloneAnonResourceDetails
	SSubscriber

	// description: receivers
	Receivers []Identification

	// description: role
	Role Identification

	// description: robot
	Robot Identification
}

type SubscriberListInput

type SubscriberListInput struct {
	apis.StandaloneAnonResourceListInput
	apis.EnabledResourceBaseListInput

	// description: topic id
	TopicID string

	// description: scope of resource
	// enum: system,domain,project
	ResourceScope string

	// description: type
	// enum: receiver,robot,role
	Type string

	// description: scope
	// enum: system,domain
	Scope string
}

type SubscriberSetReceiverInput

type SubscriberSetReceiverInput struct {
	Receivers []string
}

type TemplateCreateInput

type TemplateCreateInput struct {
	apis.StandaloneAnonResourceCreateInput

	// description: Contact type, specifically, setting it to all means all contact type
	// require: true
	// example: email
	ContactType string `json:"contact_type"`
	// description: Template type
	// enum: title,content,remote
	// example: title
	TemplateType string `json:"template_type"`

	// description: Template topic
	// required: true
	// example: IMAGE_ACTIVE
	Topic string `json:"topic"`

	// description: Template content
	// required: true
	// example: 镜像 {{.name}} 上传完成
	Content string `json:"content"`
	// description: Example for using this template
	// required: true
	// example: {"name": "centos7.6"}
	Example string `json:"example"`
	// description: Language
	// enum: cn,en
	Lang string `json:"lang"`
}

type TemplateDetails

type TemplateDetails struct {
	apis.StandaloneResourceDetails

	STemplate
}

type TemplateListInput

type TemplateListInput struct {
	apis.StandaloneAnonResourceListInput

	// description: Contact type, specifically, setting it to all means all contact type
	// require: true
	// example: email
	ContactType string `json:"contact_type"`

	// description: Template type
	// enum: title,content,remote
	// example: title
	TemplateType string `json:"template_type"`

	// description: template topic
	// required: true
	// example: IMAGE_ACTIVE
	Topic string `json:"topic"`

	// description: Language
	// enum: cn,en
	Lang string `json:"lang"`
}

type TemplateManagerSaveInput

type TemplateManagerSaveInput struct {
	ContactType string
	Templates   []TemplateCreateInput
	Force       bool
}

type TemplateUpdateInput

type TemplateUpdateInput struct {
	apis.StandaloneAnonResourceBaseUpdateInput

	// description: template content
	// required: true
	// example: 镜像 {{.name}} 上传完成
	Content string `json:"content"`
	// description: all example for using this template
	// required: true
	// example: {"name": "centos7.6"}
	Example string `json:"example"`
}

type TopicAdvanceDays

type TopicAdvanceDays []int

type TopicDetails

type TopicDetails struct {
	apis.StandaloneResourceDetails
	STopic

	// description: resources managed
	// example: ["server", "eip", "disk"]
	Resources   []string `json:"resource_types"`
	AdvanceDays []int    `json:"advance_days"`
}

type TopicUpdateInput

type TopicUpdateInput struct {
	TitleCn     string
	TitleEn     string
	ContentCn   string
	ContentEn   string
	AdvanceDays []int `json:"advance_days"`
}

type VerifiedInfo

type VerifiedInfo struct {
	ContactType string
	Verified    bool
	Note        string
}

Jump to

Keyboard shortcuts

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