blob: c754f35019bce5187617d9e13ebb5be8f0ecf37e [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= gerrit stream-events
Kenny Root15ac1b82010-02-24 00:29:20 -08002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== NAME
Edwin Kempinf1acbb82011-09-15 12:49:42 +02004gerrit stream-events - Monitor events occurring in real time
Kenny Root15ac1b82010-02-24 00:29:20 -08005
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006== SYNOPSIS
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08007--
Kenny Root15ac1b82010-02-24 00:29:20 -08008'ssh' -p <port> <host> 'gerrit stream-events'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08009--
Kenny Root15ac1b82010-02-24 00:29:20 -080010
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080011== DESCRIPTION
Kenny Root15ac1b82010-02-24 00:29:20 -080012
Edwin Kempinf1acbb82011-09-15 12:49:42 +020013Provides a portal into the major events occurring on the server,
David Pursehouse92463562013-06-24 10:16:28 +090014outputting activity data in real-time to the client. Events are
Kenny Root15ac1b82010-02-24 00:29:20 -080015filtered by the caller's access permissions, ensuring the caller
16only receives events for changes they can view on the web, or in
17the project repository.
18
19Event output is in JSON, one event per line.
20
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080021== ACCESS
Ed Bartoshd168b812013-04-13 20:15:58 +030022Caller must be a member of the privileged 'Administrators' group,
23or have been granted
24link:access-control.html#capability_streamEvents[the 'Stream Events' global capability].
Kenny Root15ac1b82010-02-24 00:29:20 -080025
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080026== SCRIPTING
Kenny Root15ac1b82010-02-24 00:29:20 -080027This command is intended to be used in scripts.
28
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080029== EXAMPLES
Kenny Root15ac1b82010-02-24 00:29:20 -080030
Shawn O. Pearce47769242011-06-14 16:40:48 -070031====
Kenny Root15ac1b82010-02-24 00:29:20 -080032 $ ssh -p 29418 review.example.com gerrit stream-events
Kenny Rootd8dffa22010-02-25 22:28:20 -080033 {"type":"comment-added",change:{"project":"tools/gerrit", ...}, ...}
34 {"type":"comment-added",change:{"project":"tools/gerrit", ...}, ...}
Shawn O. Pearce47769242011-06-14 16:40:48 -070035====
Kenny Root15ac1b82010-02-24 00:29:20 -080036
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080037== SCHEMA
Kenny Rootd8dffa22010-02-25 22:28:20 -080038The JSON messages consist of nested objects referencing the *change*,
Edwin Kempina19ff372012-06-14 09:04:32 +020039*patchSet*, *account* involved, and other attributes as appropriate.
Kenny Rootd8dffa22010-02-25 22:28:20 -080040
41Note that any field may be missing in the JSON messages, so consumers of
42this JSON stream should deal with that appropriately.
43
Edwin Kempin64059f52013-10-31 13:49:25 +010044[[events]]
David Pursehoused31e1d82014-12-18 16:08:19 +090045== EVENTS
46=== Change Abandoned
David Pursehouseb2161b22014-12-18 16:05:48 +090047
48Sent when a change has been abandoned.
49
Kenny Rootd8dffa22010-02-25 22:28:20 -080050type:: "change-abandoned"
51
Shawn O. Pearce14760b72010-07-19 09:44:46 -070052change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080053
Edwin Kempina19ff372012-06-14 09:04:32 +020054patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080055
Shawn O. Pearce14760b72010-07-19 09:44:46 -070056abandoner:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080057
Edwin Kempina19ff372012-06-14 09:04:32 +020058reason:: Reason for abandoning the change.
59
Hugo Arès35447532014-12-02 15:03:49 -050060eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
61created.
62
David Pursehoused31e1d82014-12-18 16:08:19 +090063=== Change Merged
David Pursehouseb2161b22014-12-18 16:05:48 +090064
65Sent when a change has been merged into the git repository.
66
David Pursehouseb954c0f2014-12-18 15:55:46 +090067type:: "change-merged"
68
69change:: link:json.html#change[change attribute]
70
71patchSet:: link:json.html#patchSet[patchSet attribute]
72
73submitter:: link:json.html#account[account attribute]
74
Sven Selberg9686cf22014-11-17 12:51:06 +010075newRev:: The resulting revision of the merge.
76
David Pursehouseb954c0f2014-12-18 15:55:46 +090077eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
78created.
79
David Pursehoused31e1d82014-12-18 16:08:19 +090080=== Change Restored
David Pursehouseb2161b22014-12-18 16:05:48 +090081
82Sent when an abandoned change has been restored.
83
Anatol Pomazau32002452010-08-04 11:28:50 -070084type:: "change-restored"
85
86change:: link:json.html#change[change attribute]
87
Edwin Kempina19ff372012-06-14 09:04:32 +020088patchSet:: link:json.html#patchSet[patchSet attribute]
Anatol Pomazau32002452010-08-04 11:28:50 -070089
90restorer:: link:json.html#account[account attribute]
91
Edwin Kempina19ff372012-06-14 09:04:32 +020092reason:: Reason for restoring the change.
93
Hugo Arès35447532014-12-02 15:03:49 -050094eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
95created.
96
David Pursehoused31e1d82014-12-18 16:08:19 +090097=== Comment Added
David Pursehouseb2161b22014-12-18 16:05:48 +090098
99Sent when a review comment has been posted on a change.
100
David Pursehouseb954c0f2014-12-18 15:55:46 +0900101type:: "comment-added"
Kenny Rootd8dffa22010-02-25 22:28:20 -0800102
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700103change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800104
Edwin Kempina19ff372012-06-14 09:04:32 +0200105patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800106
David Pursehouseb954c0f2014-12-18 15:55:46 +0900107author:: link:json.html#account[account attribute]
108
109approvals:: All link:json.html#approval[approval attributes] granted.
110
David Pursehouse0549b362014-12-18 16:29:40 +0900111comment:: Review comment cover message.
David Pursehouseb954c0f2014-12-18 15:55:46 +0900112
113eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
114created.
115
David Pursehoused31e1d82014-12-18 16:08:19 +0900116=== Draft Published
David Pursehouseb2161b22014-12-18 16:05:48 +0900117
118Sent when a draft change has been published.
119
David Pursehouseb954c0f2014-12-18 15:55:46 +0900120type:: "draft-published"
121
122change:: link:json.html#change[change attribute]
123
124patchSet:: link:json.html#patchSet[patchSet attribute]
125
126uploader:: link:json.html#account[account attribute]
127
128eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
129created.
130
David Pursehouse0bff1272014-12-18 16:31:39 +0900131=== Dropped Output
132
133Sent to notify a client that events have been dropped.
134
135type:: "dropped-output"
136
David Pursehoused31e1d82014-12-18 16:08:19 +0900137=== Hashtags Changed
David Pursehouseb2161b22014-12-18 16:05:48 +0900138
139Sent when the hashtags have been added to or removed from a change.
140
David Pursehouseb954c0f2014-12-18 15:55:46 +0900141type:: "hashtags-changed"
142
143change:: link:json.html#change[change attribute]
144
145editor:: link:json.html#account[account attribute]
146
147added:: List of hashtags added to the change
148
149removed:: List of hashtags removed from the change
150
151hashtags:: List of hashtags on the change after tags were added or removed
Kenny Rootd8dffa22010-02-25 22:28:20 -0800152
Hugo Arès35447532014-12-02 15:03:49 -0500153eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
154created.
155
David Pursehoused31e1d82014-12-18 16:08:19 +0900156=== Merge Failed
David Pursehouseb2161b22014-12-18 16:05:48 +0900157
158Sent when a change has failed to be merged into the git repository.
159
David Pursehousef9f3b272012-09-28 19:58:59 +0900160type:: "merge-failed"
161
162change:: link:json.html#change[change attribute]
163
164patchSet:: link:json.html#patchSet[patchSet attribute]
165
166submitter:: link:json.html#account[account attribute]
167
168reason:: Reason that the merge failed.
169
Hugo Arès35447532014-12-02 15:03:49 -0500170eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
171created.
172
David Pursehoused31e1d82014-12-18 16:08:19 +0900173=== Patchset Created
David Pursehouseb2161b22014-12-18 16:05:48 +0900174
175Sent when a new change has been uploaded, or a new patch set has been uploaded
176to an existing change.
177
178Note that this event is also sent for changes or patch sets uploaded as draft,
179but is only visible to the change owner, any existing reviewers, and users who
180belong to a group that is granted the
181link:access-control.html#category_view_drafts[View Drafts] capability.
182
David Pursehouseb954c0f2014-12-18 15:55:46 +0900183type:: "patchset-created"
Kenny Rootd8dffa22010-02-25 22:28:20 -0800184
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700185change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800186
Edwin Kempina19ff372012-06-14 09:04:32 +0200187patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800188
David Pursehouseb954c0f2014-12-18 15:55:46 +0900189uploader:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800190
Hugo Arès35447532014-12-02 15:03:49 -0500191eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
192created.
193
David Pursehoused31e1d82014-12-18 16:08:19 +0900194=== Ref Updated
David Pursehouseb2161b22014-12-18 16:05:48 +0900195
196Sent when a reference is updated in a git repository.
197
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500198type:: "ref-updated"
199
200submitter:: link:json.html#account[account attribute]
201
Edwin Kempina19ff372012-06-14 09:04:32 +0200202refUpdate:: link:json.html#refUpdate[refUpdate attribute]
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500203
Hugo Arès35447532014-12-02 15:03:49 -0500204eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
205created.
206
David Pursehoused31e1d82014-12-18 16:08:19 +0900207=== Reviewer Added
David Pursehouseb2161b22014-12-18 16:05:48 +0900208
209Sent when a reviewer is added to a change.
210
David Pursehouse2336bd82012-09-21 12:50:19 +0900211type:: "reviewer-added"
212
213change:: link:json.html#change[change attribute]
214
David Pursehouse1ecac162013-09-10 20:15:53 +0900215patchSet:: link:json.html#patchSet[patchSet attribute]
David Pursehouse2336bd82012-09-21 12:50:19 +0900216
217reviewer:: link:json.html#account[account attribute]
218
Hugo Arès35447532014-12-02 15:03:49 -0500219eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
220created.
221
David Pursehoused31e1d82014-12-18 16:08:19 +0900222=== Topic Changed
David Pursehouseb2161b22014-12-18 16:05:48 +0900223
224Sent when the topic of a change has been changed.
225
David Pursehouseba3e28d2013-07-12 14:48:51 +0900226type:: "topic-changed"
227
228change:: link:json.html#change[change attribute]
229
230changer:: link:json.html#account[account attribute]
231
232oldTopic:: Topic name before it was changed.
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500233
Hugo Arès35447532014-12-02 15:03:49 -0500234eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
235created.
236
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800237== SEE ALSO
Kenny Root15ac1b82010-02-24 00:29:20 -0800238
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700239* link:json.html[JSON Data Formats]
Kenny Root15ac1b82010-02-24 00:29:20 -0800240* link:access-control.html[Access Controls]
241
242GERRIT
243------
244Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700245
246SEARCHBOX
247---------