-
Notifications
You must be signed in to change notification settings - Fork 2
/
integration_slack.proto
260 lines (201 loc) · 8.21 KB
/
integration_slack.proto
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
syntax = "proto3";
package hiber.integration.slack;
import "base.proto";
import "tag.proto";
option java_multiple_files = false;
option java_package = "global.hiber.api.grpc.integration.slack";
option java_outer_classname = "SlackIntegrationApi";
option go_package = ".;hiber";
service SlackIntegrationService {
rpc List (ListSlackPublishersRequest) returns (ListSlackPublishersRequest.Response);
rpc Create (CreateSlackPublisherRequest) returns (SlackPublisher);
rpc Update (UpdateSlackPublisherRequest) returns (SlackPublisher);
rpc UpdateTags (UpdateSlackPublisherTagsRequest) returns (UpdateSlackPublisherTagsRequest.Response);
rpc Enable (EnableSlackPublisherRequest) returns (EnableSlackPublisherRequest.Response);
rpc Disable (DisableSlackPublisherRequest) returns (DisableSlackPublisherRequest.Response);
rpc Delete (DeleteSlackPublisherRequest) returns (DeleteSlackPublisherRequest.Response);
rpc History (SlackPublisherHistoryRequest) returns (SlackPublisherHistoryRequest.Response);
}
message SlackPublisher {
int64 id = 1;
string description = 2;
/* The uid of the user that created this publisher */
string created_by = 10;
Data data = 3;
Filter.Events filter_event_types = 4;
Filter.Modems filter_modem_numbers = 5;
Filter.Tags filter_tags = 6;
/* Filter events by health level caused. */
repeated string filter_health_levels = 11;
Health health = 7;
HealthConfig health_config = 9;
repeated hiber.tag.Tag tags = 8;
message Data {
/* The slack webhook URL. See https://api.slack.com/messaging/webhooks for information on Slack webhooks. */
string url = 1;
/* The channel the webhook is configured to send to. This is used purely for display purposes,
* since Slack webhooks are bound to a single channel.
*/
string channel = 2;
bool disabled = 3;
}
/* Health configuration for the slack integration. Defines how the health is calculated. */
message HealthConfig {
reserved 1;
/* Period to consider when determining health from warning events. Warning events cannot be resolved. */
Duration health_warning_period = 2;
/* Allowed percentage of failures.
* If the failure percentage is higher, within the warning period, the health is switched to WARNING.
*/
int32 health_warning_failure_percentage = 3;
}
}
message SlackMessage {
Timestamp time = 1;
SlackPublisher.Data publisher_data = 2;
BytesOrHex message = 3;
bool successful = 4;
string error = 5;
}
message SlackPublisherSelection {
/* Filter by id. */
optional Filter.Publishers publishers = 1;
/* Partial text match on the description. */
optional string description = 2;
/* Partial text match on the url. */
optional string search_url = 3;
/* Partial text match on the channel. */
optional string search_channel = 4;
optional hiber.tag.TagSelection tags = 5;
repeated Health health = 6;
/* Search in the all available text, like description and url. */
optional string search =7;
}
message ListSlackPublishersRequest {
enum Sort {
/* Sort by id. */
DEFAULT = 0;
/* Sort by id, high to low. */
ID_DESC = 1;
/* Sort by description. */
DESCRIPTION = 2;
/* Sort by description, z to a. */
DESCRIPTION_DESC = 3;
/* Sort by url. */
URL = 4;
/* Sort by url, z to a. */
URL_DESC = 5;
/* Sort by channel. */
CHANNEL = 6;
/* Sort by channel, z to a. */
CHANNEL_DESC = 7;
/* Sort unhealthy webhooks before health webhooks. */
HEALTH = 8;
}
message Response {
repeated SlackPublisher publishers = 1;
ListSlackPublishersRequest request = 2;
Pagination.Result pagination = 3;
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
optional SlackPublisherSelection selection = 2;
optional Pagination pagination = 3;
repeated Sort sort = 4;
}
message SlackPublisherHistorySelection {
optional TimeRange time_range = 1;
optional bool only_failures = 2;
}
message SlackPublisherHistoryRequest {
message Response {
repeated SlackMessage items = 1;
SlackPublisherHistoryRequest request = 2;
Pagination.Result pagination = 3;
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
int64 id = 2;
optional SlackPublisherHistorySelection selection = 3;
optional Pagination pagination = 4;
}
message CreateSlackPublisherRequest {
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
string description = 2;
optional Filter.Events filter_event_types = 3;
optional Filter.Modems filter_modem_numbers = 4;
optional Filter.Tags filter_tags = 5;
/* Filter events by health level caused. */
repeated string filter_health_levels = 11;
string url = 6;
optional string channel = 7;
optional bool disabled = 8;
repeated int64 tags = 10;
}
/* Enable a disabled publisher or re-enable a publisher that's failed and is in cooldown. */
message EnableSlackPublisherRequest {
message Response {
repeated SlackPublisher publishers = 1;
EnableSlackPublisherRequest request = 2;
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
SlackPublisherSelection selection = 2;
}
message DisableSlackPublisherRequest {
message Response {
repeated SlackPublisher publishers = 1;
DisableSlackPublisherRequest request = 2;
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
SlackPublisherSelection selection = 2;
}
message UpdateSlackPublisherRequest {
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
int64 id = 2;
optional Filter.Events.Update deprecated_filter_event_types = 3 [deprecated = true];
optional Filter.Events filter_event_types = 23;
optional Filter.Modems.Update deprecated_filter_modem_numbers = 4 [deprecated = true];
optional Filter.Modems filter_modem_numbers = 24;
optional Filter.Tags.Update deprecated_filter_tags = 5 [deprecated = true];
optional Filter.Tags filter_tags = 25;
/* Add health levels to the health levels filter. */
repeated string add_health_levels_to_filter = 6;
/* Remove health levels from the health levels filter. */
repeated string remove_health_levels_from_filter = 7;
optional string description = 19;
optional UpdateClearableString deprecated_description = 10 [deprecated = true];
optional string url = 11;
optional string channel = 20;
optional UpdateClearableString deprecated_channel = 12 [deprecated = true];
optional bool active = 21;
optional UpdateBoolean deprecated_active = 15 [deprecated = true];
reserved 16;
/* Period to consider when determining health from warning events. Warning events cannot be resolved.
* Set this to 0 to disable warnings based on failure percentage.
*/
optional Duration health_warning_period = 17;
/* Allowed percentage of call failures.
* If the failure percentage is higher, within the warning period, the health is switched to WARNING.
*/
optional uint32 health_warning_failure_percentage = 26;
optional UpdateZeroableInt deprecated_health_warning_failure_percentage = 18 [deprecated = true];
}
message UpdateSlackPublisherTagsRequest {
message Response {
repeated SlackPublisher slack_publishers = 1;
}
optional string organization = 1;
SlackPublisherSelection selection = 2;
hiber.tag.UpdateTagsForItem update = 3;
}
message DeleteSlackPublisherRequest {
message Response {
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
int64 id = 2;
}