mirror of
https://github.com/rancher/types.git
synced 2025-09-24 19:39:13 +00:00
Merge pull request #1167 from GGGitBoy/alert-enhance-pr-2.4
[2.4.6] Add DingtalkConfig and MicrosoftConfig for notifiers
This commit is contained in:
@@ -83,7 +83,7 @@ func (p *ProjectAlertSpec) ObjClusterName() string {
|
||||
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|wechat"`
|
||||
NotifierType string `json:"notifierType,omitempty" norman:"required,options=slack|email|pagerduty|webhook|wechat|dingtalk|msteams"`
|
||||
}
|
||||
|
||||
type TargetNode struct {
|
||||
@@ -337,6 +337,8 @@ type NotifierSpec struct {
|
||||
PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty"`
|
||||
WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"`
|
||||
WechatConfig *WechatConfig `json:"wechatConfig,omitempty"`
|
||||
DingtalkConfig *DingtalkConfig `json:"dingtalkConfig,omitempty"`
|
||||
MSTeamsConfig *MSTeamsConfig `json:"msteamsConfig,omitempty"`
|
||||
}
|
||||
|
||||
func (n *NotifierSpec) ObjClusterName() string {
|
||||
@@ -350,6 +352,8 @@ type Notification struct {
|
||||
PagerdutyConfig *PagerdutyConfig `json:"pagerdutyConfig,omitempty"`
|
||||
WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"`
|
||||
WechatConfig *WechatConfig `json:"wechatConfig,omitempty"`
|
||||
DingtalkConfig *DingtalkConfig `json:"dingtalkConfig,omitempty"`
|
||||
MSTeamsConfig *MSTeamsConfig `json:"msteamsConfig,omitempty"`
|
||||
}
|
||||
|
||||
type SMTPConfig struct {
|
||||
@@ -378,6 +382,17 @@ type WebhookConfig struct {
|
||||
*HTTPClientConfig
|
||||
}
|
||||
|
||||
type DingtalkConfig struct {
|
||||
URL string `json:"url,omitempty" norman:"required"`
|
||||
Secret string `json:"secret,omitempty" norman:"type=password"`
|
||||
*HTTPClientConfig
|
||||
}
|
||||
|
||||
type MSTeamsConfig struct {
|
||||
URL string `json:"url,omitempty" norman:"required"`
|
||||
*HTTPClientConfig
|
||||
}
|
||||
|
||||
type WechatConfig struct {
|
||||
DefaultRecipient string `json:"defaultRecipient,omitempty" norman:"required"`
|
||||
Secret string `json:"secret,omitempty" norman:"type=password,required"`
|
||||
|
@@ -3029,6 +3029,27 @@ func (in *DeploymentStrategy) DeepCopy() *DeploymentStrategy {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DingtalkConfig) DeepCopyInto(out *DingtalkConfig) {
|
||||
*out = *in
|
||||
if in.HTTPClientConfig != nil {
|
||||
in, out := &in.HTTPClientConfig, &out.HTTPClientConfig
|
||||
*out = new(HTTPClientConfig)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DingtalkConfig.
|
||||
func (in *DingtalkConfig) DeepCopy() *DingtalkConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(DingtalkConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *DiskVsphereOpts) DeepCopyInto(out *DiskVsphereOpts) {
|
||||
*out = *in
|
||||
@@ -5249,6 +5270,27 @@ func (in *LoggingTargets) DeepCopy() *LoggingTargets {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MSTeamsConfig) DeepCopyInto(out *MSTeamsConfig) {
|
||||
*out = *in
|
||||
if in.HTTPClientConfig != nil {
|
||||
in, out := &in.HTTPClientConfig, &out.HTTPClientConfig
|
||||
*out = new(HTTPClientConfig)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MSTeamsConfig.
|
||||
func (in *MSTeamsConfig) DeepCopy() *MSTeamsConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(MSTeamsConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MapDelta) DeepCopyInto(out *MapDelta) {
|
||||
*out = *in
|
||||
@@ -6604,6 +6646,16 @@ func (in *Notification) DeepCopyInto(out *Notification) {
|
||||
*out = new(WechatConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.DingtalkConfig != nil {
|
||||
in, out := &in.DingtalkConfig, &out.DingtalkConfig
|
||||
*out = new(DingtalkConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.MSTeamsConfig != nil {
|
||||
in, out := &in.MSTeamsConfig, &out.MSTeamsConfig
|
||||
*out = new(MSTeamsConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -6707,6 +6759,16 @@ func (in *NotifierSpec) DeepCopyInto(out *NotifierSpec) {
|
||||
*out = new(WechatConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.DingtalkConfig != nil {
|
||||
in, out := &in.DingtalkConfig, &out.DingtalkConfig
|
||||
*out = new(DingtalkConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.MSTeamsConfig != nil {
|
||||
in, out := &in.MSTeamsConfig, &out.MSTeamsConfig
|
||||
*out = new(MSTeamsConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user