blob: 8d6f2505349032e6a5f657195eafb61ffb7444f2 [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.
Maciej Żenczykowski9741bab2010-10-17 01:21:45 -070040The currently supported message types are *patchset-created*,
David Pursehoused556c192012-06-12 18:34:37 +090041*draft-published*, *change-abandoned*, *change-restored*,
David Pursehousef9f3b272012-09-28 19:58:59 +090042*change-merged*, *merge-failed*, *comment-added*, *ref-updated* and
43*reviewer-added*.
Kenny Rootd8dffa22010-02-25 22:28:20 -080044
45Note that any field may be missing in the JSON messages, so consumers of
46this JSON stream should deal with that appropriately.
47
Edwin Kempin64059f52013-10-31 13:49:25 +010048[[events]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080049=== Events
50==== Patchset Created
Maciej Żenczykowski9741bab2010-10-17 01:21:45 -070051type:: "patchset-created"
Kenny Rootd8dffa22010-02-25 22:28:20 -080052
Shawn O. Pearce14760b72010-07-19 09:44:46 -070053change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080054
Edwin Kempina19ff372012-06-14 09:04:32 +020055patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080056
Shawn O. Pearce14760b72010-07-19 09:44:46 -070057uploader:: link:json.html#account[account attribute]
Scott Andersonde08e632010-06-15 16:04:28 -070058
Hugo Arès35447532014-12-02 15:03:49 -050059eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
60created.
61
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080062==== Draft Published
David Pursehoused556c192012-06-12 18:34:37 +090063type:: "draft-published"
64
65change:: link:json.html#change[change attribute]
66
David Pursehouse1ecac162013-09-10 20:15:53 +090067patchSet:: link:json.html#patchSet[patchSet attribute]
David Pursehoused556c192012-06-12 18:34:37 +090068
69uploader:: link:json.html#account[account attribute]
70
Hugo Arès35447532014-12-02 15:03:49 -050071eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
72created.
73
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080074==== Change Abandoned
Kenny Rootd8dffa22010-02-25 22:28:20 -080075type:: "change-abandoned"
76
Shawn O. Pearce14760b72010-07-19 09:44:46 -070077change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080078
Edwin Kempina19ff372012-06-14 09:04:32 +020079patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080080
Shawn O. Pearce14760b72010-07-19 09:44:46 -070081abandoner:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080082
Edwin Kempina19ff372012-06-14 09:04:32 +020083reason:: Reason for abandoning the change.
84
Hugo Arès35447532014-12-02 15:03:49 -050085eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
86created.
87
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080088==== Change Restored
Anatol Pomazau32002452010-08-04 11:28:50 -070089type:: "change-restored"
90
91change:: link:json.html#change[change attribute]
92
Edwin Kempina19ff372012-06-14 09:04:32 +020093patchSet:: link:json.html#patchSet[patchSet attribute]
Anatol Pomazau32002452010-08-04 11:28:50 -070094
95restorer:: link:json.html#account[account attribute]
96
Edwin Kempina19ff372012-06-14 09:04:32 +020097reason:: Reason for restoring the change.
98
Hugo Arès35447532014-12-02 15:03:49 -050099eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
100created.
101
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800102==== Change Merged
Kenny Rootd8dffa22010-02-25 22:28:20 -0800103type:: "change-merged"
104
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700105change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800106
Edwin Kempina19ff372012-06-14 09:04:32 +0200107patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800108
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700109submitter:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800110
Hugo Arès35447532014-12-02 15:03:49 -0500111eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
112created.
113
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800114==== Merge Failed
David Pursehousef9f3b272012-09-28 19:58:59 +0900115type:: "merge-failed"
116
117change:: link:json.html#change[change attribute]
118
119patchSet:: link:json.html#patchSet[patchSet attribute]
120
121submitter:: link:json.html#account[account attribute]
122
123reason:: Reason that the merge failed.
124
Hugo Arès35447532014-12-02 15:03:49 -0500125eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
126created.
127
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800128==== Comment Added
Kenny Rootd8dffa22010-02-25 22:28:20 -0800129type:: "comment-added"
130
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700131change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800132
Edwin Kempina19ff372012-06-14 09:04:32 +0200133patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800134
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700135author:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800136
Edwin Kempina19ff372012-06-14 09:04:32 +0200137approvals:: All link:json.html#approval[approval attributes] granted.
138
Kenny Rootd8dffa22010-02-25 22:28:20 -0800139comment:: Comment text author had written
140
Hugo Arès35447532014-12-02 15:03:49 -0500141eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
142created.
143
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800144==== Ref Updated
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500145type:: "ref-updated"
146
147submitter:: link:json.html#account[account attribute]
148
Edwin Kempina19ff372012-06-14 09:04:32 +0200149refUpdate:: link:json.html#refUpdate[refUpdate attribute]
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500150
Hugo Arès35447532014-12-02 15:03:49 -0500151eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
152created.
153
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800154==== Reviewer Added
David Pursehouse2336bd82012-09-21 12:50:19 +0900155type:: "reviewer-added"
156
157change:: link:json.html#change[change attribute]
158
David Pursehouse1ecac162013-09-10 20:15:53 +0900159patchSet:: link:json.html#patchSet[patchSet attribute]
David Pursehouse2336bd82012-09-21 12:50:19 +0900160
161reviewer:: link:json.html#account[account attribute]
162
Hugo Arès35447532014-12-02 15:03:49 -0500163eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
164created.
165
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800166==== Topic Changed
David Pursehouseba3e28d2013-07-12 14:48:51 +0900167type:: "topic-changed"
168
169change:: link:json.html#change[change attribute]
170
171changer:: link:json.html#account[account attribute]
172
173oldTopic:: Topic name before it was changed.
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500174
Hugo Arès35447532014-12-02 15:03:49 -0500175eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
176created.
177
David Pursehousecb2e4852014-09-12 15:09:12 +0200178==== Hashtags Changed
179type:: "hashtags-changed"
180
181change:: link:json.html#change[change attribute]
182
183editor:: link:json.html#account[account attribute]
184
185added:: List of hashtags added to the change
186
187removed:: List of hashtags removed from the change
188
189hashtags:: List of hashtags on the change after tags were added or removed
190
Hugo Arès35447532014-12-02 15:03:49 -0500191eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
192created.
193
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800194== SEE ALSO
Kenny Root15ac1b82010-02-24 00:29:20 -0800195
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700196* link:json.html[JSON Data Formats]
Kenny Root15ac1b82010-02-24 00:29:20 -0800197* link:access-control.html[Access Controls]
198
199GERRIT
200------
201Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700202
203SEARCHBOX
204---------