xref: /aosp_15_r20/external/autotest/site_utils/cloud_console.proto (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1*9c5db199SXin Lisyntax = "proto2";
2*9c5db199SXin Li
3*9c5db199SXin Li// The types of message notification sent from Moblab.
4*9c5db199SXin Lienum MessageType {
5*9c5db199SXin Li  MSG_UNKNOWN = 0;
6*9c5db199SXin Li  MSG_MOBLAB_HEARTBEAT = 1;
7*9c5db199SXin Li  MSG_MOBLAB_REMOTE_EVENT = 2;
8*9c5db199SXin Li  MSG_MOBLAB_ALERT = 3;
9*9c5db199SXin Li}
10*9c5db199SXin Li
11*9c5db199SXin Li// The common pubsub notification attribute names.
12*9c5db199SXin Lienum MessageAttribute {
13*9c5db199SXin Li  ATTR_INVALID = 0;
14*9c5db199SXin Li  ATTR_MESSAGE_TYPE = 1;
15*9c5db199SXin Li  ATTR_MESSAGE_VERSION = 2;
16*9c5db199SXin Li  ATTR_MOBLAB_MAC_ADDRESS = 3;
17*9c5db199SXin Li  ATTR_MOBLAB_ID = 4;
18*9c5db199SXin Li}
19*9c5db199SXin Li
20*9c5db199SXin Li// Timestamp is not defined in proto2. We need to define it by ourselves.
21*9c5db199SXin Li// It represents a point in time independent of any time zone
22*9c5db199SXin Li// or calendar, represented as seconds and fractions of seconds at
23*9c5db199SXin Li// nanosecond resolution.
24*9c5db199SXin Li// Clone from https://github.com/google/protobuf/blob/master/src/google/protobuf/timestamp.proto. //nocheck
25*9c5db199SXin Limessage Timestamp {
26*9c5db199SXin Li  optional int64 seconds = 1;
27*9c5db199SXin Li  // Non-negative fractions of a second at nanosecond resolution.
28*9c5db199SXin Li  optional int64 nanos = 2 [default = 0];
29*9c5db199SXin Li}
30*9c5db199SXin Li
31*9c5db199SXin Limessage Heartbeat {
32*9c5db199SXin Li  optional Timestamp timestamp = 1;
33*9c5db199SXin Li}
34*9c5db199SXin Li
35*9c5db199SXin Li// The remote event notification message.
36*9c5db199SXin Limessage RemoteEventMessage {
37*9c5db199SXin Li  // EventType is an enumeration of event types sent to cloud console.
38*9c5db199SXin Li  // Any new event type should be added here.
39*9c5db199SXin Li  enum Type {
40*9c5db199SXin Li    EVENT_UNKNOWN = 0;
41*9c5db199SXin Li    EVENT_MOBLAB_BOOT_COMPLETE = 1;
42*9c5db199SXin Li  }
43*9c5db199SXin Li
44*9c5db199SXin Li  optional Type type = 1 [default = EVENT_UNKNOWN];
45*9c5db199SXin Li  optional string data = 2;
46*9c5db199SXin Li}
47*9c5db199SXin Li
48*9c5db199SXin Li// Moblab alerts
49*9c5db199SXin Limessage Alert {
50*9c5db199SXin Li  enum AlertLevel {
51*9c5db199SXin Li    ALERT_UNSPECIFIED = 0;
52*9c5db199SXin Li    ALERT_CRITICAL = 1;
53*9c5db199SXin Li    ALERT_MAJOR = 2;
54*9c5db199SXin Li    ALERT_MINOR = 3;
55*9c5db199SXin Li  }
56*9c5db199SXin Li  optional AlertLevel level = 1;
57*9c5db199SXin Li  optional string data = 2;
58*9c5db199SXin Li  optional Timestamp timestamp = 3;
59*9c5db199SXin Li  optional string source_application = 4;
60*9c5db199SXin Li  optional string source_component = 5;
61*9c5db199SXin Li}
62