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