notify

package
v0.3.9-5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 22

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"

	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"

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

Variables

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"

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

	ActionChecksumTest SAction = "checksum_test"

	ActionLock SAction = "lock"

	ActionExceedCount SAction = "exceed_count"

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

Functions

This section is empty.

Types

type ConfigCreateInput

type ConfigCreateInput struct {
	apis.StandaloneResourceCreateInput
	apis.DomainizedResourceInput

	// 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 jsonutils.JSONObject `json:"content"`

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

type ConfigListInput

type ConfigListInput struct {
	apis.StandaloneResourceListInput
	apis.DomainizedResourceListInput
	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 jsonutils.JSONObject `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 jsonutils.JSONObject `json:"content"`
}

type ConfigValidateOutput

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

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"`
	Metadata                  map[string]interface{} `json:"metadata"`
	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 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 `json:"event"`
	// 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"`
}

type NotificationManagerEventNotifyOutput

type NotificationManagerEventNotifyOutput struct {
	FailedList []FailedElem
}

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.StatusStandaloneResourceCreateInput
	apis.DomainizedResourceCreateInput
	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.StatusStandaloneResourceDetails
	apis.DomainizedResourceInfo

	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 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.StatusStandaloneResourceListInput
	apis.DomainizedResourceListInput
	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.StatusStandaloneResourceBaseUpdateInput

	// 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
	// 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"`
}

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"`
}

type SAction

type SAction string

type SConfig

type SConfig struct {
	apis.SStandaloneResourceBase
	apis.SDomainizedResourceBase
	Type        string               `json:"type"`
	Content     jsonutils.JSONObject `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 SEvent

type SEvent struct {
	apis.SStandaloneAnonResourceBase
	Message     string `json:"message"`
	Event       string `json:"event"`
	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) 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"`
	ReceivedAt time.Time `json:"received_at"`
	EventId    string    `json:"event_id"`
	SendTimes  int       `json:"send_times"`
	Tag        string    `json:"tag"`
}

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

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 SReceiver

type SReceiver struct {
	apis.SStatusStandaloneResourceBase
	apis.SDomainizedResourceBase
	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 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"`
}

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

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"`
}

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

type SSubscriberDis

type SSubscriberDis struct {
	SSubscriber
	ReceiverName string `json:"receiver_name"`
	RoleName     string `json:"role_name"`
}

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

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.SStandaloneResourceBase
	apis.SEnabledResourceBase
	Type              string `json:"type"`
	Resources         uint64 `json:"resources"`
	Actions           uint32 `json:"actions"`
	Results           byte   `json:"results"`
	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 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
}

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
}

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 TopicDetails

type TopicDetails struct {
	apis.StandaloneResourceDetails
	STopic

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

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