aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve/proto.rb
blob: 5c00572ac6157c9771d37a33fca9c58d4f18ba40 (plain)
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
### Generated by rprotoc. DO NOT EDIT!
### <proto file: mauve.proto>
# package mauve.proto;
# 
# // An alert is a notification of an event in your business, project or
# // enterprise for which someone might want to stop what they're doing and
# // attend to.
# //
# // Alerts
# //
# message Alert {
#   // Every separate alert must have a unique Id attached.  When sending a 
#   // repeated or altered alert, using the same alert id will overwrite
#   // the previous settings.  
#   //
#   required string id = 1;
#   
#   // The UNIX time at which this alert was or will be raised.  If set to zero it
#   // means 'this alert is assumed to be raised already'.
#   //
#   optional uint64 raise_time = 2;
#     
#   // The UNIX time at which this alert was or will be cleared.  If set to zero
#   // it means 'do not clear automatically'.  Messages with clear times set before 
#   // alert times are not valid, and will be ignored.
#   //
#   optional uint64 clear_time = 3;
#   
#   // The subject is the name of the server/device/entity that is being alerted
#   // about.  If not supplied, assumed to be the same as source.
#   //
#   optional string subject = 4;
#   
#   // The summary is a summary of an alert (100 characters or less) that
#   // can be fitted into a pager or SMS message, along with the source & subject.
#   //
#   optional string summary = 5;
#   
#   // The detail can be an arbitrary HTML fragment for display on suitable
#   // devices giving fuller information about the alert.
#   //
#   optional string detail = 6;
#   
#   // The importance of this alert (relative to others from this source).  Zero
#   // is 'unspecified importance' which will use the server's default.
#   //
#   optional uint32 importance = 7;
# 
#   // Suppress any notifications about this alert until this UNIX time.
#   //
#   optional uint64 suppress_until = 8;
# }
# 
# // The AlertUpdate is the unit of communication from an alerting source;
# // it consists of one or more alerts, which can either replace, or supplement
# // the alert data for that source.
# //
# message AlertUpdate {  
#   // Random number with each transmission, so that destinations can easily
#   // identify and discard duplicate transmissions that are inherent to the
#   // protocol.
#   //
#   required uint64 transmission_id = 1;
# 
#   // The source of an alert represents the sender - each possible sender
#   // should set this consistently (e.g. the name of the monitoring system
#   // that is generating a particular class of alerts).
#   //
#   required string source = 2;
#   
#   // When set to true,  signals that this update should completely replace
#   // all current data for this source (so unlisted previous alerts are deemed
#   // to be cleared).
#   //
#   required bool replace = 3 [ default = false ];
#   
#   // Alert data follows
#   //
#   repeated Alert alert = 4;
# 
#   // Signature to authenticate this data - no scheme defined currently, maybe
#   // SHA1(alert.raw + password) ?
#   //
#   optional bytes signature = 5;
#   
#   // The UNIX time at which the packet was sent by the server.
#   //
#   optional uint64 transmission_time = 8;
# }
# 

require 'protobuf/message/message'
require 'protobuf/message/enum'
require 'protobuf/message/service'
require 'protobuf/message/extend'

module Mauve
  module Proto
    class Alert < ::Protobuf::Message
      defined_in __FILE__
      required :string, :id, 1
      optional :uint64, :raise_time, 2
      optional :uint64, :clear_time, 3
      optional :string, :subject, 4
      optional :string, :summary, 5
      optional :string, :detail, 6
      optional :uint32, :importance, 7
      optional :uint64, :suppress_until, 8
    end
    class AlertUpdate < ::Protobuf::Message
      defined_in __FILE__
      required :uint64, :transmission_id, 1
      required :string, :source, 2
      required :bool, :replace, 3, :default => false
      repeated :Alert, :alert, 4
      optional :bytes, :signature, 5
      optional :uint64, :transmission_time, 8
    end
  end
end