-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathcollection_schemes.proto
409 lines (339 loc) · 12.7 KB
/
collection_schemes.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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
syntax = "proto3";
option java_package = "com.amazonaws.iot.autobahn.schemas";
package Aws.IoTFleetWise.Schemas.CollectionSchemesMsg;
/*
* Import common types reused across the project
*/
import "common_types.proto";
/*
* List of collectionSchemes
*/
message CollectionSchemes {
/*
* List of collectionSchemes. On receipt of this, Edge will discard all collectionSchemes it currently has and enact these.
*/
repeated CollectionScheme collection_schemes = 1;
/*
* Timestamp of when the collectionScheme list was created.
*/
uint64 timestamp_ms_epoch = 2;
}
/*
* A definition of an individual collectionScheme containing what/when/how to send vehicle data to cloud. A
* collectionScheme can be condition based, with data sent whenever a condition evaluates to true, or it can be time
* based, with data sent at periodic intervals.
*/
message CollectionScheme {
/*
* Synchronization ID of the campaign this collectionScheme is part of
*/
string campaign_sync_id = 1;
/*
* Synchronization ID of the required decoder manifest for this collectionScheme
*/
string decoder_manifest_sync_id = 2;
/*
* When collectionScheme should start in milliseconds since the Unix epoch
*/
uint64 start_time_ms_epoch = 3;
/*
* When collectionScheme should expire in milliseconds since the Unix epoch. This collectionScheme expiration date
* is meant to serve as an end date for a collectionScheme so it does not keep running forever in the case
* that a vehicle permanently loses internet connection to the cloud
*/
uint64 expiry_time_ms_epoch = 4;
/*
* A collectionScheme type containing attributes that are specific to that collectionScheme type. Currently support
* time based (such as a heartbeat) and condition based collectionSchemes.
*/
oneof collection_scheme_type {
TimeBasedCollectionScheme time_based_collection_scheme = 5;
ConditionBasedCollectionScheme condition_based_collection_scheme = 6;
}
/*
* This specifies how much time to spend collecting data after a condition evaluates to true. When after_duration_ms
* elapses whatever data collected up to that point ( if any was present on the vehicle ) is sent to the cloud.
*/
uint32 after_duration_ms = 7;
/*
* All active DTCs including the time they were first seen active will be sent when the collectionScheme triggers.
*/
bool include_active_dtcs = 8;
/*
* List of signal ids to collect or have attribute(s) required by a condition function node
*/
repeated SignalInformation signal_information = 9;
/*
* List of Raw CAN Frame(s) to be collected and sent to cloud
*/
repeated RawCanFrame raw_can_frames_to_collect = 10;
/*
* When true, all data will be written to persistent storage when vehicle doesn't not have an internet connection
*/
bool persist_all_collected_data = 11;
/*
* When true, collected data will be compressed and then sent to cloud.
*/
bool compress_collected_data = 12;
/*
* An integer between describing the priority for the data collection. CollectionSchemes with low priority numbers
* will have higher priority and will be processed first.
*/
uint32 priority = 13;
/*
* This field was never supported, so it should not be used any more.
*/
reserved 14;
reserved "probabilities";
/*
* This field was never supported, so it should not be used any more.
*/
reserved 15;
reserved "image_data";
/*
* Additional data for S3 upload.
*/
S3UploadMetadata s3_upload_metadata = 16;
/*
* Configuration of store and forward campaign.
*/
StoreAndForwardConfiguration store_and_forward_configuration = 17;
// Signals to fetch configurations.
repeated FetchInformation signal_fetch_information = 18;
/*
* Amazon Resource Name of the campaign this collectionScheme is part of
*/
string campaign_arn = 19;
}
/*
* Condition based fetch configuration
*/
message ConditionBasedFetchConfig {
enum ConditionTriggerMode {
/*
* Condition will evaluate to true regardless of previous state
*/
TRIGGER_ALWAYS = 0;
/*
* Condition will evaluate to true only when it previously evaluated to false
*/
TRIGGER_ONLY_ON_RISING_EDGE = 1;
}
// Condition to be evaluated for fetch to trigger
CommonTypesMsg.ConditionNode condition_tree = 1;
// Trigger mode for condition
ConditionTriggerMode condition_trigger_mode = 2;
}
/*
* Time based fetch configuration
*/
message TimeBasedFetchConfig {
// Max number of time action for fetch should be executed
uint64 max_execution_count = 1;
// Frequency for action execution
uint64 execution_frequency_ms = 2;
// Time after which max_execution_count should be reset to original value
uint64 reset_max_execution_count_interval_ms = 3;
}
message FetchInformation {
// Signal id that will be fetched
uint32 signal_id = 1;
// Fetch configuration for this signal
oneof fetchConfig {
TimeBasedFetchConfig time_based = 2;
ConditionBasedFetchConfig condition_based = 3;
};
// IOT Event expression language version for this config
uint32 condition_language_version = 4;
// Expression for the function(s) to call for fetch
repeated CommonTypesMsg.ConditionNode actions = 5;
}
message S3UploadMetadata {
/*
* Bucket name for the S3 upload.
*/
string bucket_name = 1;
/*
* Prefix for object to upload.
*/
string prefix = 2;
/*
* Region of the S3 bucket.
*/
string region = 3;
/*
* Account ID of the bucket owner, required to enforce the expected bucket owner
*/
string bucket_owner_account_id = 4;
}
/*
* Contains time based specific attributes necessary for time based collectionSchemes such as a heartbeat.
*/
message TimeBasedCollectionScheme {
/*
* Time in milliseconds that will be the interval of a time based collectionScheme if is_time_based_collection_scheme is
* set to true. This field is unused if is_time_based_collection_scheme is set false.
*/
uint32 time_based_collection_scheme_period_ms = 1;
}
/*
* Contains condition based specific attributes necessary for condition based collectionSchemes
*/
message ConditionBasedCollectionScheme {
/*
* The minimum time in milliseconds required to elapse between conditions that evaluate to true for data to be sent
* to the cloud.
*/
uint32 condition_minimum_interval_ms = 1;
/*
* The version number associated with the event condition language used in the abstract syntax tree. We are starting
* at 0 for alpha and we will increment as we add features
*/
uint32 condition_language_version = 2;
/*
* Root condition node for the Abstract Syntax Tree.
*/
CommonTypesMsg.ConditionNode condition_tree = 3;
/*
* Edge can monitor the previous state of a condition and use this information to allow the customer to set a
* trigger mode similar to an oscilloscope trigger.
*/
enum ConditionTriggerMode {
/*
* Condition will evaluate to true regardless of previous state
*/
TRIGGER_ALWAYS = 0;
/*
* Condition will evaluate to true only when it previously evaluated to false
*/
TRIGGER_ONLY_ON_RISING_EDGE = 1;
}
/*
* A triggering mode can be applied to the condition to take in account the previous state of the condition.
*/
ConditionTriggerMode condition_trigger_mode = 4;
}
/*
* This message contains information of signals that are to be collected and sent to cloud, or are part of the condition
* logic and require attribute information.
*/
message SignalInformation {
/*
* Unique identifier of a Signal. Maps directly to a signal defined in the decoder manifest. Signal can also be an
* OBDII PID.
*/
uint32 signal_id = 1;
/*
* signal path specifies the location of partial signal. If signal_id refers to a primitive type, like all CANSignal, signal_path is not allowed be set
* If signal_path for the signal defined in signal_id does not refer to a primitive type the ingestion will change to raw byte ingestion (not vehicle_data.proto)
* PrimitiveTypeInComplexSignal is not used here as signal_path together with the signal_id might refer to an aggregated type and not only to primitive data
*/
CommonTypesMsg.SignalPath signal_path = 6;
/*
* The size of the ring buffer that will contain the data points for this signal
*/
uint32 sample_buffer_size = 2;
/*
* Minimum time period in milliseconds that must elapse between collecting samples. Samples arriving faster than
* this period will be dropped. A value of 0 will collect samples as fast as they arrive.
*/
uint32 minimum_sample_period_ms = 3;
/*
* The size of a fixed window in milliseconds which will be used by aggregate condition functions to calculate
* min/max/avg etc.
*/
uint32 fixed_window_period_ms = 4;
/*
* When true, this signal will not be collected and sent to cloud. It will only be used in the condition logic with
* its associated fixed_window_period_ms. Default is false.
*/
bool condition_only_signal = 5;
/*
* The Id of the partition where this signal should be stored. This Id will be used to index into the partition
* configuration array.
*/
uint32 data_partition_id = 7;
}
/*
* A raw CAN frame specified to be collected and sent to the cloud.
*/
message RawCanFrame {
/*
* The interface ID specified by the Decoder Manifest. This will contain the physical channel id of the hardware CAN
* Bus the frame is present on.
*/
string can_interface_id = 1;
/*
* CAN Message ID to collect. This Raw CAN message will be collected. Whatever number of bytes present on the bus
* for this message ID will be collected.
*/
uint32 can_message_id = 2;
/*
* Ring buffer size used to store these sampled CAN frames. One CAN Frame is a sample.
*/
uint32 sample_buffer_size = 3;
/*
* Minimum time period in milliseconds that must elapse between collecting samples. Samples arriving faster than
* this period will be dropped. A value of 0 will collect samples as fast as they arrive.
*/
uint32 minimum_sample_period_ms = 4;
}
/*
* Store and Forward storage options, required. It defines where and how the data will be stored on the edge. It is only used when
* spoolerMode=TO_DISK. May be non-null only when spoolerMode=TO_DISK.
*/
message StorageOptions {
/*
* The total amount of space allocated to this campaign including all overhead. Limited to a maximum of 1024TB.
*/
uint64 maximum_size_in_bytes = 1;
/*
* Specifies where the data should be stored withing the device. Implementation is defined by the user who
* integrates FWE with their filesystem library.
*/
string storage_location = 2;
/*
* The minimum amount of time to keep data on disk after it is collected. When this TTL expires, data may be
* deleted, but it is not guaranteed to be deleted immediately after expiry. Can hold TTL more than 132 years.
*/
uint32 minimum_time_to_live_in_seconds = 3;
}
/*
* Store and Forward upload options defines when the stored data may be uploaded. It is only used when
* spoolerMode=TO_DISK. May be non-null only when spoolerMode=TO_DISK.
*/
message UploadOptions {
/*
* Root condition node for the Abstract Syntax Tree.
*/
CommonTypesMsg.ConditionNode condition_tree = 1;
}
/*
* Store and Forward configuration for each partition.
*/
message PartitionConfiguration {
/*
* Optional Store and Forward storage options. If not specified, data in this partition will be uploaded in
* realtime.
*/
StorageOptions storage_options = 1;
/*
* Store and Forward upload options defines when the stored data may be uploaded. It is only used when
* spoolingMode=TO_DISK. May be non-null only when spoolingMode=TO_DISK.
*/
UploadOptions upload_options = 2;
}
/*
* When spoolingMode is set to TO_DISK and PartitionConfiguration is not Null, then store and forward subsystem will be
* used to persistently store collected data. If non-null then spoolingMode must be TO_DISK.
*
* Optional. Required if any signalsToCollect specify a non-default partition.
*/
message StoreAndForwardConfiguration {
/*
* Array of Store and Forward configurations for each data partition.
*/
repeated PartitionConfiguration partition_configuration = 1;
}