-
Notifications
You must be signed in to change notification settings - Fork 2
/
integration_mqtt.proto
349 lines (266 loc) · 11.3 KB
/
integration_mqtt.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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
syntax = "proto3";
package hiber.integration.mqtt;
import "base.proto";
import "tag.proto";
option java_multiple_files = false;
option java_package = "global.hiber.api.grpc.integration.mqtt";
option java_outer_classname = "MQTTIntegrationApi";
option go_package = ".;hiber";
service MQTTService {
rpc List (ListMQTTPublishersRequest) returns (ListMQTTPublishersRequest.Response);
rpc Create (CreateMQTTPublisherRequest) returns (MQTTPublisher);
rpc Update (UpdateMQTTPublisherRequest) returns (MQTTPublisher);
rpc UpdateTags (UpdateMQTTPublisherTagsRequest) returns (UpdateMQTTPublisherTagsRequest.Response);
rpc Enable (EnableMQTTPublisherRequest) returns (EnableMQTTPublisherRequest.Response);
rpc Disable (DisableMQTTPublisherRequest) returns (DisableMQTTPublisherRequest.Response);
rpc Delete (DeleteMQTTPublisherRequest) returns (DeleteMQTTPublisherRequest.Response);
rpc History (MQTTPublisherHistoryRequest) returns (MQTTPublisherHistoryRequest.Response);
}
message MQTTPublisher {
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;
Health health = 7;
HealthConfig health_config = 9;
repeated hiber.tag.Tag tags = 8;
enum ContentType {
DEFAULT = 0;
JSON = 1;
PROTO = 2;
}
message Data {
/* The url of an MQTT server to send the events to, i.e. mqtt[s]://example.com:8883 */
string url = 1;
ContentType content_type = 2;
/* The MQTT topic to send to on the receiving server. */
string topic = 3;
/* MQTT QoS value. */
QoS qos = 4;
/* Identifier used by the MQTT client. Defaults to "hiber". */
string identifier = 5;
/* Optional username to authenticate with. */
string username = 6;
/* Optional password to authenticate with. Requires username to be set. */
string password = 7;
/* Client certificate to use when connecting to the MQTT server. */
int64 certificate_id = 8;
string certificate_name = 10;
/* CA certificate for the client certificate to use when connecting to the MQTT server. */
int64 ca_certificate_id = 11;
string ca_certificate_name = 12;
/* Server CA certificate to use when connecting to the MQTT server. */
int64 server_ca_certificate_id = 13;
string server_ca_certificate_name = 14;
bool disabled = 9;
enum QoS {
DEFAULT = 0;
/* Qos level 0 */
AT_MOST_ONCE = 1;
/* Qos level 1 */
AT_LEAST_ONCE = 2;
/* Qos level 2 */
EXACTLY_ONCE = 3;
}
}
/* Health configuration for the mqtt 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 MQTTMessage {
Timestamp time = 1;
MQTTPublisher.Data publisher_data = 2;
BytesOrHex message = 3;
bool successful = 4;
string error = 5;
}
message MQTTPublisherSelection {
/* 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 topic. */
optional string search_topic = 4;
/* Only return MQTT integrations that use the given content types. */
repeated MQTTPublisher.ContentType content_types = 5;
/* Filter by referenced certificate (id), either as client or server certificate. */
repeated int64 certificate_ids = 6;
optional hiber.tag.TagSelection tags = 7;
repeated Health health = 8;
}
message ListMQTTPublishersRequest {
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 topic. */
TOPIC = 6;
/* Sort by topic, z to a. */
TOPIC_DESC = 7;
/* Sort unhealthy webhooks before health webhooks. */
HEALTH = 8;
}
message Response {
repeated MQTTPublisher publishers = 1;
ListMQTTPublishersRequest request = 2;
Pagination.Result pagination = 3;
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
optional MQTTPublisherSelection selection = 2;
optional Pagination pagination = 3;
repeated Sort sort = 4;
}
message MQTTPublisherHistorySelection {
optional TimeRange time_range = 1;
optional bool only_failures = 2;
}
message MQTTPublisherHistoryRequest {
message Response {
repeated MQTTMessage items = 1;
MQTTPublisherHistoryRequest 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 MQTTPublisherHistorySelection selection = 3;
optional Pagination pagination = 4;
}
message CreateMQTTPublisherRequest {
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
optional string description = 2;
optional Filter.Events filter_event_types = 3;
optional Filter.Modems filter_modem_numbers = 4;
optional Filter.Tags filter_tags = 5;
/* The url of an MQTT server to send the events to, i.e. mqtt[s]://example.com:8883 */
string url = 10;
MQTTPublisher.ContentType content_type = 11;
/* The MQTT topic to send to on the receiving server. */
string topic = 12;
/* MQTT QoS value. */
MQTTPublisher.Data.QoS qos = 13;
/* Identifier used by the MQTT client. Defaults to "hiber". */
optional string identifier = 14;
/* Optional username to authenticate with. */
optional string username = 15;
/* Optional password to authenticate with. Requires username to be set. */
optional string password = 16;
/* Client certificate to use when connecting to the MQTT server. */
optional int64 certificate_id = 17;
/* Server CA certificate to use when connecting to the MQTT server. */
optional int64 server_ca_certificate_id = 21;
/* Disable the MQTT publisher after creation, so it needs to be enabled before it is active. */
optional bool disabled = 18;
repeated int64 tags = 20;
/* Set this flag to not parse the url or enforce mqtts. */
optional bool override_url_validation = 22;
reserved 19;
}
/* Enable a disabled publisher or re-enable a publisher that's failed and is in cooldown. */
message EnableMQTTPublisherRequest {
message Response {
repeated MQTTPublisher publishers = 1;
EnableMQTTPublisherRequest request = 2;
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
MQTTPublisherSelection selection = 2;
}
message DisableMQTTPublisherRequest {
message Response {
repeated MQTTPublisher publishers = 1;
DisableMQTTPublisherRequest request = 2;
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
MQTTPublisherSelection selection = 2;
}
message UpdateMQTTPublisherRequest {
/* 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 = 24;
optional Filter.Modems.Update deprecated_filter_modem_numbers = 4 [deprecated = true];
optional Filter.Modems filter_modem_numbers = 25;
optional Filter.Tags.Update deprecated_filter_tags = 5 [deprecated = true];
optional Filter.Tags filter_tags = 26;
optional UpdateClearableString deprecated_description = 10 [deprecated = true];
optional string description = 27;
/* The url of an MQTT server to send the events to, i.e. mqtt[s]://example.com:8883 */
optional string url = 11;
optional MQTTPublisher.ContentType content_type = 12;
/* The MQTT topic to send to on the receiving server. */
optional string topic = 13;
/* MQTT QoS value. */
optional MQTTPublisher.Data.QoS qos = 14;
/* Identifier used by the MQTT client. Defaults to "hiber". */
optional string identifier = 28;
optional UpdateClearableString deprecated_identifier = 15 [deprecated = true];
/* Optional username to authenticate with. */
optional string username = 29;
optional UpdateClearableString deprecated_username = 16 [deprecated = true];
/* Optional password to authenticate with. Requires username to be set. */
optional string password = 30;
optional UpdateClearableString deprecated_password = 17 [deprecated = true];
/* Update or remove the client certificate to use when connecting to the MQTT server. */
optional int64 certificate_id = 31;
optional UpdateOptionalId deprecated_certificate_id = 18 [deprecated = true];
/* Update or remove the server CA certificate to use when connecting to the MQTT server. */
optional int64 server_ca_certificate_id = 32;
optional UpdateOptionalId deprecated_server_ca_certificate_id = 23 [deprecated = true];
/* Disable the MQTT publisher, so it needs to be enabled again before it is active. */
optional bool active = 33;
optional UpdateBoolean deprecated_active = 19 [deprecated = true];
reserved 20;
/* 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 = 21;
/* 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 = 34;
optional UpdateZeroableInt deprecated_health_warning_failure_percentage = 22 [deprecated = true];
/* Set this flag to not parse the url or enforce mqtts. */
optional bool override_url_validation = 35;
}
message UpdateMQTTPublisherTagsRequest {
message Response {
repeated MQTTPublisher mqtt_publishers = 1;
}
optional string organization = 1;
MQTTPublisherSelection selection = 2;
hiber.tag.UpdateTagsForItem update = 3;
}
message DeleteMQTTPublisherRequest {
message Response {
}
/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
optional string organization = 1;
int64 id = 2;
}