saba-webhook-gateway 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +306 -0
- data/Gemfile +2 -0
- data/Gemfile-lambda +3 -0
- data/LICENSE +21 -0
- data/README.md +144 -0
- data/Rakefile +15 -0
- data/exe/lambda-handler-googlechat.rb +26 -0
- data/exe/webhook-handler-googlechat.rb +30 -0
- data/googlechat.png +0 -0
- data/lib/saba-webhook-gateway/base.rb +359 -0
- data/lib/saba-webhook-gateway/googlechat.rb +326 -0
- data/lib/saba-webhook-gateway.rb +5 -0
- data/make-lambda-zip.sh +7 -0
- data/saba-webhook-gateway.gemspec +32 -0
- data/saba-webhook-gateway.png +0 -0
- data/webhooks/alert.json +887 -0
- data/webhooks/alertgroup.json +204 -0
- data/webhooks/host-register.json +305 -0
- data/webhooks/host-retire.json +279 -0
- data/webhooks/host-status.json +283 -0
- data/webhooks/monitor-create.json +580 -0
- data/webhooks/monitor-delete.json +545 -0
- data/webhooks/monitor-update.json +545 -0
- data/webhooks/sample.json +52 -0
- metadata +157 -0
@@ -0,0 +1,204 @@
|
|
1
|
+
{
|
2
|
+
"$id": "https://mackerel.io/json/alertgroup.json",
|
3
|
+
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
4
|
+
"additionalProperties": false,
|
5
|
+
"default": {},
|
6
|
+
"definitions": {
|
7
|
+
"imageUrl": {
|
8
|
+
"default": null,
|
9
|
+
"examples": [
|
10
|
+
null,
|
11
|
+
"https://mackerel.io/embed/public/alert/RANDOM_GRAPH_URL.png"
|
12
|
+
],
|
13
|
+
"title": "グラフ画像URL",
|
14
|
+
"type": [
|
15
|
+
"null",
|
16
|
+
"string"
|
17
|
+
]
|
18
|
+
},
|
19
|
+
"memo": {
|
20
|
+
"examples": [
|
21
|
+
"MY_MEMO",
|
22
|
+
"MY_MEMO\nMY_MEMO2\nMY_MEMO3"
|
23
|
+
],
|
24
|
+
"title": "メモ",
|
25
|
+
"type": "string"
|
26
|
+
}
|
27
|
+
},
|
28
|
+
"examples": [
|
29
|
+
{
|
30
|
+
"alertGroup": {
|
31
|
+
"closedAt": null,
|
32
|
+
"createdAt": 1693211901,
|
33
|
+
"id": "ALERTGROUP_ID",
|
34
|
+
"status": "WARNING",
|
35
|
+
"url": "https://mackerel.io/orgs/MY_ORG/alert-groups/ALERTGROUP_ID"
|
36
|
+
},
|
37
|
+
"alertGroupSetting": {
|
38
|
+
"id": "ALERTGROUPSETTING_ID",
|
39
|
+
"memo": "MY_MEMO",
|
40
|
+
"name": "MY_ALERTGROUP",
|
41
|
+
"url": "https://mackerel.io/orgs/MY_ORG/alert-group-settings/ALERTGROUPSETTING_ID"
|
42
|
+
},
|
43
|
+
"event": "alertGroup",
|
44
|
+
"imageUrl": null,
|
45
|
+
"orgName": "MY_ORG"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"alertGroup": {
|
49
|
+
"closedAt": 1693749741,
|
50
|
+
"createdAt": 1693749321,
|
51
|
+
"id": "ALERTGROUP_ID",
|
52
|
+
"status": "OK",
|
53
|
+
"url": "https://mackerel.io/orgs/MY_ORG/alert-groups/ALERTGROUP_ID"
|
54
|
+
},
|
55
|
+
"alertGroupSetting": {
|
56
|
+
"id": "ALERTGROUPSETTING_ID",
|
57
|
+
"memo": "",
|
58
|
+
"name": "MY_ALERTGROUP",
|
59
|
+
"url": "https://mackerel.io/orgs/MY_ORG/alert-group-settings/ALERTGROUPSETTING_ID"
|
60
|
+
},
|
61
|
+
"event": "alertGroup",
|
62
|
+
"imageUrl": null,
|
63
|
+
"orgName": "MY_ORG"
|
64
|
+
}
|
65
|
+
],
|
66
|
+
"properties": {
|
67
|
+
"alertGroup": {
|
68
|
+
"default": {},
|
69
|
+
"examples": [
|
70
|
+
{
|
71
|
+
"closedAt": null,
|
72
|
+
"createdAt": 1693211901,
|
73
|
+
"id": "ALERTGROUP_ID",
|
74
|
+
"status": "WARNING",
|
75
|
+
"url": "https://mackerel.io/orgs/MY_ORG/alert-groups/ALERTGROUP_ID"
|
76
|
+
}
|
77
|
+
],
|
78
|
+
"properties": {
|
79
|
+
"closedAt": {
|
80
|
+
"default": null,
|
81
|
+
"examples": [
|
82
|
+
null
|
83
|
+
],
|
84
|
+
"title": "アラート終了epoch時間",
|
85
|
+
"type": [
|
86
|
+
"null",
|
87
|
+
"integer"
|
88
|
+
]
|
89
|
+
},
|
90
|
+
"createdAt": {
|
91
|
+
"examples": [
|
92
|
+
1693211901
|
93
|
+
],
|
94
|
+
"title": "アラート発生epoch時間",
|
95
|
+
"type": "integer"
|
96
|
+
},
|
97
|
+
"id": {
|
98
|
+
"examples": [
|
99
|
+
"ALERTGROUP_ID"
|
100
|
+
],
|
101
|
+
"title": "アラートグループID",
|
102
|
+
"type": "string"
|
103
|
+
},
|
104
|
+
"status": {
|
105
|
+
"enum": [
|
106
|
+
"WARNING",
|
107
|
+
"CRITICAL",
|
108
|
+
"OK",
|
109
|
+
"UNKNOWN"
|
110
|
+
],
|
111
|
+
"title": "ステータス",
|
112
|
+
"type": "string"
|
113
|
+
},
|
114
|
+
"url": {
|
115
|
+
"examples": [
|
116
|
+
"https://mackerel.io/orgs/MY_ORG/alert-groups/ALERTGROUP_ID"
|
117
|
+
],
|
118
|
+
"format": "uri",
|
119
|
+
"title": "アラートグループURL",
|
120
|
+
"type": "string"
|
121
|
+
}
|
122
|
+
},
|
123
|
+
"required": [
|
124
|
+
"id",
|
125
|
+
"url",
|
126
|
+
"status",
|
127
|
+
"createdAt",
|
128
|
+
"closedAt"
|
129
|
+
],
|
130
|
+
"title": "アラートグループ情報",
|
131
|
+
"type": "object"
|
132
|
+
},
|
133
|
+
"alertGroupSetting": {
|
134
|
+
"default": {},
|
135
|
+
"examples": [
|
136
|
+
{
|
137
|
+
"id": "ALERTGROUPSETTING_ID",
|
138
|
+
"memo": "MY_MEMO",
|
139
|
+
"name": "MY_ALERTGROUP",
|
140
|
+
"url": "https://mackerel.io/orgs/MY_ORG/alert-group-settings/ALERTGROUPSETTING_ID"
|
141
|
+
}
|
142
|
+
],
|
143
|
+
"properties": {
|
144
|
+
"id": {
|
145
|
+
"examples": [
|
146
|
+
"ALERTGROUPSETTING_ID"
|
147
|
+
],
|
148
|
+
"title": "アラートグループ設定ID",
|
149
|
+
"type": "string"
|
150
|
+
},
|
151
|
+
"memo": {
|
152
|
+
"$ref": "#/definitions/memo"
|
153
|
+
},
|
154
|
+
"name": {
|
155
|
+
"examples": [
|
156
|
+
"MY_ALERTGROUP"
|
157
|
+
],
|
158
|
+
"title": "アラートグループ設定名",
|
159
|
+
"type": "string"
|
160
|
+
},
|
161
|
+
"url": {
|
162
|
+
"examples": [
|
163
|
+
"https://mackerel.io/orgs/MY_ORG/alert-group-settings/ALERTGROUPSETTING_ID"
|
164
|
+
],
|
165
|
+
"format": "uri",
|
166
|
+
"title": "アラートグループ設定URL",
|
167
|
+
"type": "string"
|
168
|
+
}
|
169
|
+
},
|
170
|
+
"required": [
|
171
|
+
"id",
|
172
|
+
"url",
|
173
|
+
"name"
|
174
|
+
],
|
175
|
+
"title": "アラートグループ設定",
|
176
|
+
"type": "object"
|
177
|
+
},
|
178
|
+
"event": {
|
179
|
+
"enum": [
|
180
|
+
"alertGroup"
|
181
|
+
],
|
182
|
+
"title": "イベントの種類",
|
183
|
+
"type": "string"
|
184
|
+
},
|
185
|
+
"imageUrl": {
|
186
|
+
"$ref": "#/definitions/imageUrl"
|
187
|
+
},
|
188
|
+
"orgName": {
|
189
|
+
"examples": [
|
190
|
+
"MY_ORG"
|
191
|
+
],
|
192
|
+
"title": "オーガニゼーション名",
|
193
|
+
"type": "string"
|
194
|
+
}
|
195
|
+
},
|
196
|
+
"required": [
|
197
|
+
"orgName",
|
198
|
+
"event",
|
199
|
+
"alertGroup",
|
200
|
+
"alertGroupSetting"
|
201
|
+
],
|
202
|
+
"title": "ルート",
|
203
|
+
"type": "object"
|
204
|
+
}
|
@@ -0,0 +1,305 @@
|
|
1
|
+
{
|
2
|
+
"$id": "https://mackerel.io/json/host-register.json",
|
3
|
+
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
4
|
+
"additionalProperties": false,
|
5
|
+
"default": {},
|
6
|
+
"definitions": {
|
7
|
+
"imageUrl": {
|
8
|
+
"default": null,
|
9
|
+
"examples": [
|
10
|
+
null,
|
11
|
+
"https://mackerel.io/embed/public/alert/RANDOM_GRAPH_URL.png"
|
12
|
+
],
|
13
|
+
"title": "グラフ画像URL",
|
14
|
+
"type": [
|
15
|
+
"null",
|
16
|
+
"string"
|
17
|
+
]
|
18
|
+
},
|
19
|
+
"memo": {
|
20
|
+
"examples": [
|
21
|
+
"MY_MEMO",
|
22
|
+
"MY_MEMO\nMY_MEMO2\nMY_MEMO3"
|
23
|
+
],
|
24
|
+
"title": "メモ",
|
25
|
+
"type": "string"
|
26
|
+
},
|
27
|
+
"roles": {
|
28
|
+
"default": [],
|
29
|
+
"examples": [
|
30
|
+
[
|
31
|
+
{
|
32
|
+
"fullname": "MY_SERVICE: MY_ROLE",
|
33
|
+
"roleName": "MY_ROLE",
|
34
|
+
"roleUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE#role=MY_ROLE",
|
35
|
+
"serviceName": "MY_SERVICE",
|
36
|
+
"serviceUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE"
|
37
|
+
}
|
38
|
+
]
|
39
|
+
],
|
40
|
+
"items": {
|
41
|
+
"additionalProperties": false,
|
42
|
+
"examples": [
|
43
|
+
{
|
44
|
+
"fullname": "MY_SERVICE: MY_ROLE",
|
45
|
+
"roleName": "MY_ROLE",
|
46
|
+
"roleUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE#role=MY_ROLE",
|
47
|
+
"serviceName": "MY_SERVICE",
|
48
|
+
"serviceUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE"
|
49
|
+
}
|
50
|
+
],
|
51
|
+
"properties": {
|
52
|
+
"fullname": {
|
53
|
+
"examples": [
|
54
|
+
"MY_SERVICE: MY_ROLE"
|
55
|
+
],
|
56
|
+
"title": "サービスとロールの結合名",
|
57
|
+
"type": "string"
|
58
|
+
},
|
59
|
+
"roleName": {
|
60
|
+
"examples": [
|
61
|
+
"MY_ROLE"
|
62
|
+
],
|
63
|
+
"title": "ロール名",
|
64
|
+
"type": "string"
|
65
|
+
},
|
66
|
+
"roleUrl": {
|
67
|
+
"examples": [
|
68
|
+
"https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE#role=MY_ROLE"
|
69
|
+
],
|
70
|
+
"format": "uri",
|
71
|
+
"title": "ロールURL",
|
72
|
+
"type": "string"
|
73
|
+
},
|
74
|
+
"serviceName": {
|
75
|
+
"examples": [
|
76
|
+
"MY_SERVICE"
|
77
|
+
],
|
78
|
+
"title": "サービス名",
|
79
|
+
"type": "string"
|
80
|
+
},
|
81
|
+
"serviceUrl": {
|
82
|
+
"examples": [
|
83
|
+
"https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE"
|
84
|
+
],
|
85
|
+
"format": "uri",
|
86
|
+
"title": "サービスURL",
|
87
|
+
"type": "string"
|
88
|
+
}
|
89
|
+
},
|
90
|
+
"required": [
|
91
|
+
"fullname",
|
92
|
+
"serviceName",
|
93
|
+
"roleName",
|
94
|
+
"serviceUrl",
|
95
|
+
"roleUrl"
|
96
|
+
],
|
97
|
+
"title": "ロール詳細情報",
|
98
|
+
"type": "object"
|
99
|
+
},
|
100
|
+
"title": "ロール情報",
|
101
|
+
"type": "array"
|
102
|
+
},
|
103
|
+
"user": {
|
104
|
+
"additionalProperties": false,
|
105
|
+
"default": null,
|
106
|
+
"examples": [
|
107
|
+
null
|
108
|
+
],
|
109
|
+
"properties": {
|
110
|
+
"id": {
|
111
|
+
"examples": [
|
112
|
+
"USER_ID"
|
113
|
+
],
|
114
|
+
"title": "ユーザーID",
|
115
|
+
"type": "string"
|
116
|
+
},
|
117
|
+
"screenName": {
|
118
|
+
"examples": [
|
119
|
+
"MY_NAME",
|
120
|
+
"MY_EMAIL_ADDRESS"
|
121
|
+
],
|
122
|
+
"title": "表示名",
|
123
|
+
"type": "string"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
"title": "ユーザー情報",
|
127
|
+
"type": [
|
128
|
+
"null",
|
129
|
+
"object"
|
130
|
+
]
|
131
|
+
}
|
132
|
+
},
|
133
|
+
"examples": [
|
134
|
+
{
|
135
|
+
"event": "hostRegister",
|
136
|
+
"host": {
|
137
|
+
"id": "HOST_ID",
|
138
|
+
"isRetired": false,
|
139
|
+
"memo": "",
|
140
|
+
"name": "MY_HOST",
|
141
|
+
"roles": [],
|
142
|
+
"status": "working",
|
143
|
+
"url": "https://mackerel.io/orgs/MY_ORG/hosts/HOST_ID"
|
144
|
+
},
|
145
|
+
"imageUrl": null,
|
146
|
+
"orgName": "MY_ORG",
|
147
|
+
"user": null
|
148
|
+
},
|
149
|
+
{
|
150
|
+
"event": "hostRegister",
|
151
|
+
"host": {
|
152
|
+
"id": "HOST_ID",
|
153
|
+
"isRetired": false,
|
154
|
+
"memo": "",
|
155
|
+
"name": "MY_HOST",
|
156
|
+
"roles": [
|
157
|
+
{
|
158
|
+
"fullname": "MY_SERVICE: MY_ROLE",
|
159
|
+
"roleName": "MY_ROLE",
|
160
|
+
"roleUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE#role=MY_ROLE",
|
161
|
+
"serviceName": "MY_SERVICE",
|
162
|
+
"serviceUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE"
|
163
|
+
},
|
164
|
+
{
|
165
|
+
"fullname": "MY_SERVICE2: MY_ROLE2",
|
166
|
+
"roleName": "MY_ROLE2",
|
167
|
+
"roleUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE2#role=MY_ROLE2",
|
168
|
+
"serviceName": "MY_SERVICE2",
|
169
|
+
"serviceUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE2"
|
170
|
+
}
|
171
|
+
],
|
172
|
+
"status": "working",
|
173
|
+
"url": "https://mackerel.io/orgs/MY_ORG/hosts/HOST_ID"
|
174
|
+
},
|
175
|
+
"imageUrl": null,
|
176
|
+
"orgName": "MY_ORG",
|
177
|
+
"user": null
|
178
|
+
},
|
179
|
+
{
|
180
|
+
"event": "hostRegister",
|
181
|
+
"host": {
|
182
|
+
"id": "HOST_ID",
|
183
|
+
"isRetired": false,
|
184
|
+
"memo": "",
|
185
|
+
"name": "MY_HOST",
|
186
|
+
"roles": [
|
187
|
+
{
|
188
|
+
"fullname": "MY_SERVICE: MY_ROLE",
|
189
|
+
"roleName": "MY_ROLE",
|
190
|
+
"roleUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE#role=MY_ROLE",
|
191
|
+
"serviceName": "MY_SERVICE",
|
192
|
+
"serviceUrl": "https://mackerel.io/orgs/MY_ORG/services/MY_SERVICE"
|
193
|
+
}
|
194
|
+
],
|
195
|
+
"status": "working",
|
196
|
+
"url": "https://mackerel.io/orgs/MY_ORG/hosts/HOST_ID"
|
197
|
+
},
|
198
|
+
"orgName": "MY_ORG",
|
199
|
+
"user": null
|
200
|
+
}
|
201
|
+
],
|
202
|
+
"properties": {
|
203
|
+
"event": {
|
204
|
+
"enum": [
|
205
|
+
"hostRegister"
|
206
|
+
],
|
207
|
+
"title": "イベントの種類",
|
208
|
+
"type": "string"
|
209
|
+
},
|
210
|
+
"host": {
|
211
|
+
"additionalProperties": false,
|
212
|
+
"default": {},
|
213
|
+
"examples": [
|
214
|
+
{
|
215
|
+
"id": "HOST_ID",
|
216
|
+
"isRetired": false,
|
217
|
+
"memo": "",
|
218
|
+
"name": "MY_HOST",
|
219
|
+
"roles": [],
|
220
|
+
"status": "working",
|
221
|
+
"url": "https://mackerel.io/orgs/MY_ORG/hosts/HOST_ID"
|
222
|
+
}
|
223
|
+
],
|
224
|
+
"properties": {
|
225
|
+
"id": {
|
226
|
+
"examples": [
|
227
|
+
"HOST_ID"
|
228
|
+
],
|
229
|
+
"title": "ホストID",
|
230
|
+
"type": "string"
|
231
|
+
},
|
232
|
+
"isRetired": {
|
233
|
+
"default": false,
|
234
|
+
"examples": [
|
235
|
+
false
|
236
|
+
],
|
237
|
+
"title": "退役済みかどうか",
|
238
|
+
"type": "boolean"
|
239
|
+
},
|
240
|
+
"memo": {
|
241
|
+
"$ref": "#/definitions/memo"
|
242
|
+
},
|
243
|
+
"name": {
|
244
|
+
"examples": [
|
245
|
+
"MY_HOST"
|
246
|
+
],
|
247
|
+
"title": "ホスト名",
|
248
|
+
"type": "string"
|
249
|
+
},
|
250
|
+
"roles": {
|
251
|
+
"$ref": "#/definitions/roles"
|
252
|
+
},
|
253
|
+
"status": {
|
254
|
+
"enum": [
|
255
|
+
"working",
|
256
|
+
"standby",
|
257
|
+
"maintenance",
|
258
|
+
"poweroff"
|
259
|
+
],
|
260
|
+
"title": "ステータス",
|
261
|
+
"type": "string"
|
262
|
+
},
|
263
|
+
"url": {
|
264
|
+
"examples": [
|
265
|
+
"https://mackerel.io/orgs/MY_ORG/hosts/HOST_ID"
|
266
|
+
],
|
267
|
+
"format": "uri",
|
268
|
+
"title": "ホストURL",
|
269
|
+
"type": "string"
|
270
|
+
}
|
271
|
+
},
|
272
|
+
"required": [
|
273
|
+
"name",
|
274
|
+
"isRetired",
|
275
|
+
"id",
|
276
|
+
"url",
|
277
|
+
"status",
|
278
|
+
"roles"
|
279
|
+
],
|
280
|
+
"title": "ホスト情報",
|
281
|
+
"type": "object"
|
282
|
+
},
|
283
|
+
"imageUrl": {
|
284
|
+
"$ref": "#/definitions/imageUrl"
|
285
|
+
},
|
286
|
+
"orgName": {
|
287
|
+
"examples": [
|
288
|
+
"MY_ORG"
|
289
|
+
],
|
290
|
+
"title": "オーガニゼーション名",
|
291
|
+
"type": "string"
|
292
|
+
},
|
293
|
+
"user": {
|
294
|
+
"$ref": "#/definitions/user"
|
295
|
+
}
|
296
|
+
},
|
297
|
+
"required": [
|
298
|
+
"orgName",
|
299
|
+
"event",
|
300
|
+
"host",
|
301
|
+
"user"
|
302
|
+
],
|
303
|
+
"title": "ルート",
|
304
|
+
"type": "object"
|
305
|
+
}
|