-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::Notify::DingTalkWebhook.json
157 lines (157 loc) · 4.17 KB
/
ACS::Notify::DingTalkWebhook.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"name-en": "ACS::Notify::DingTalkWebhook",
"name-zh-cn": "发送通知(DingTalk)",
"en": "Sends notification to DingTalk via webhook. Please refer https://open.dingtalk.com/document/isvapp/message-type for details",
"zh-cn": "通过webhook发送通知到DingTalk。详情请参阅https://open.dingtalk.com/document/isvapp/message-type"
},
"Parameters": {
"webhook": {
"Description": {
"en": "DingTalk webhook to notify",
"zh-cn": "DingTalk webhook来通知"
},
"Type": "String"
},
"msgtype": {
"Description": {
"en": "Message types",
"zh-cn": "消息类型"
},
"Type": "String",
"AllowedValues": [
"text",
"link",
"markdown"
],
"Default": "text"
},
"text": {
"Description": {
"en": "Text param. If msgtype is text, this field is needed",
"zh-cn": "文本参数。如果msgtype为text,则需要输入该字段"
},
"Type": "Json",
"Default": {
"content": "我就是我, 是不一样的烟火"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Equals": [
"${msgtype}",
"text"
]
}
}
}
},
"link": {
"Description": {
"en": "Link param. If msgtype is link, this field is needed",
"zh-cn": "链接参数。如果“msgtype”为“link”,则需要输入该字段"
},
"Type": "Json",
"Default": {
"text": "这是Link消息",
"title": "这是一个Link消息",
"picUrl": "https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png",
"messageUrl": "https://open.dingtalk.com/document/"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Equals": [
"${msgtype}",
"link"
]
}
}
}
},
"markdown": {
"Description": {
"en": "MarkDown param. If msgtype is markdown, this field is needed",
"zh-cn": "MarkDown参数。如果msgtype为markdown,则需要此字段"
},
"Type": "Json",
"Default": {
"title": "杭州天气",
"text": "#### 杭州天气 \n> 9度,西北风1级,空气良89,相对温度73%\n> ![screenshot](https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png)\n> ###### 10点20分发布 [天气](https://www.dingalk.com)\n"
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Equals": [
"${msgtype}",
"markdown"
]
}
}
}
},
"at": {
"Description": {
"en": "@ people to read the notification",
"zh-cn": "@人们阅读通知"
},
"Type": "Json",
"Default": {
"atMobiles": [
"150XXXXXXXX"
],
"atUserIds": [
"user123"
],
"isAtAll": false
},
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Or": [
{
"Fn::Equals": [
"${msgtype}",
"text"
]
},
{
"Fn::Equals": [
"${msgtype}",
"markdown"
]
}
]
}
}
}
}
},
"Tasks": [
{
"Name": "notifyDingTaskWebhook",
"Action": "ACS::Notify",
"Description": {
"en": "Sends notification to DingTalk via webhook",
"zh-cn": "通过webhook发送通知到DingTalk"
},
"Properties": {
"NotifyType": "WebHook",
"WebHook": {
"URI": "{{ webhook }}",
"Headers": {
"Content-Type": "application/json"
},
"Content": {
"msgtype": "{{ msgtype }}",
"text": "{{ text }}",
"link": "{{ link }}",
"markdown": "{{ markdown }}",
"at": "{{ at }}"
}
}
}
}
]
}