1
0
mirror of https://github.com/rancher/types.git synced 2025-06-27 22:16:48 +00:00

Support WeChat as notifier

Feature:
Now we don't support WeChat as a notifier. So user can not send the alert to wechat. We needto support it

https://github.com/rancher/rancher/issues/17121
This commit is contained in:
loganhz 2018-12-20 13:17:46 +08:00 committed by Craig Jellick
parent 34d49d1c94
commit 38e1530406

View File

@ -62,7 +62,7 @@ type ProjectAlertSpec struct {
type Recipient struct {
Recipient string `json:"recipient,omitempty"`
NotifierName string `json:"notifierName,omitempty" norman:"required,type=reference[notifier]"`
NotifierType string `json:"notifierType,omitempty" norman:"required,options=slack|email|pagerduty|webhook"`
NotifierType string `json:"notifierType,omitempty" norman:"required,options=slack|email|pagerduty|webhook|wechat"`
}
type TargetNode struct {
@ -267,6 +267,7 @@ type NotifierSpec struct {
SlackConfig *SlackConfig `json:"slackConfig,omitempty"`
PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty"`
WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"`
WechatConfig *WechatConfig `json:"wechatConfig,omitempty"`
}
type Notification struct {
@ -275,6 +276,7 @@ type Notification struct {
SlackConfig *SlackConfig `json:"slackConfig,omitempty"`
PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty"`
WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"`
WechatConfig *WechatConfig `json:"wechatConfig,omitempty"`
}
type SMTPConfig struct {
@ -300,6 +302,14 @@ type WebhookConfig struct {
URL string `json:"url,omitempty" norman:"required"`
}
type WechatConfig struct {
DefaultRecipient string `json:"defaultRecipient,omitempty" norman:"required"`
Secret string `json:"secret,omitempty" norman:"type=password,required"`
Agent string `json:"agent,omitempty" norman:"required"`
Corp string `json:"corp,omitempty" norman:"required"`
RecipientType string `json:"recipientType,omitempty" norman:"required,options=tag|party|user,default=party"`
}
type NotifierStatus struct {
}