-
Notifications
You must be signed in to change notification settings - Fork 0
/
event.proto
60 lines (52 loc) · 2.64 KB
/
event.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
// Copyright 2024 Zaphiro Technologies
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
/* <!-- markdownlint-disable -->
Messages to support event detection in the platform.
The event detected may be originated from different sources: devices (e.g. a PMU, RTU), services (e.g. state estimator), or an external service (e.g. SCADA).
*/
package zaphiro.grid.v1;
option go_package = "./grid/v1";
/* The collection of Event Status defined so far.*/
enum EventStatus {
EVENT_STATUS_UNSPECIFIED = 0; //No status defined
EVENT_STATUS_STARTED = 1; //Event started
EVENT_STATUS_IN_PROGRESS = 2; //Event is still active
EVENT_STATUS_ENDED = 3; //Event ended
EVENT_STATUS_UNKNOWN = 4; //Information available don't allow us to know if the even is active or complete
}
enum EventSourceType {
EVENT_SOURCE_UNSPECIFIED = 0; //No source type defined
EVENT_SOURCE_DEVICE = 1; //The source of the event was a device (e.g. PMU)
EVENT_SOURCE_SERVICE = 2; //The source of the event was a service (e.g. state estimator)
EVENT_SOURCE_EXTERNAL_SERVICE = 3; //The source of the event was a service external to SynchroGuard platform (e.g. SCADA)
}
/* A generic event.
Headers used in rabbitMQ (only if not sent as part of `DataSet`):
* `id` (string): id of the `Event`
* `type` (string): always `Event` - used for routing.
* `eventType` (string): the specific type of `Event`, this is required in addition
to `type` for de-serialization of the messages.
* `sourceId` (string): the id of the source (e.g. a PMU) that generated the event.
* `timestampId` (int64): related measurement Unix msec timestamp (if any)
*/
message Event {
string Id = 1; //The uuid of the event.
string sourceId = 2; //The id of the source (e.g. a PMU) that generated the event.
EventSourceType sourceType = 3; //The type of data see `DataType` enum.
int64 occurredAt = 4; //The time of occurency of the event (Unix msec timestamp) usually is the same value as timestampId.
optional int64 detectedAt = 5; //The time of detection of the event (Unix msec timestamp).
string message = 6; //Event message.
optional EventStatus status = 7; //The status of the event.
}