blob: f0ad460380b4a075cb83bea714201d2d93737ac3 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= gerrit stream-events
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002== NAME
David Shevitzc47f2362018-09-27 10:55:35 -07003gerrit stream-events - Monitor events occurring in real time.
Kenny Root15ac1b82010-02-24 00:29:20 -08004
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005== SYNOPSIS
Michael Ochmanne2d76a12016-06-23 17:07:37 +02006[verse]
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08007--
Michael Ochmanne2d76a12016-06-23 17:07:37 +02008_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
David Ostrovsky9503a2e2016-01-03 18:49:26 +010029== OPTIONS
30--subscribe|-s::
31 Type of the event to subscribe to. Multiple --subscribe options
32 may be specified to subscribe to multiple events. When this option
33 is provided, only subscribed events are emitted and all other
34 events are ignored. When this option is omitted, all events are
35 emitted.
36
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080037== EXAMPLES
Kenny Root15ac1b82010-02-24 00:29:20 -080038
Michael Ochmannb99feab2016-07-06 14:10:22 +020039----
David Shevitzc47f2362018-09-27 10:55:35 -070040$ ssh -p 29418 review.example.com gerrit stream-events
41{"type":"comment-added",change:{"project":"tools/gerrit", ...}, ...}
42{"type":"comment-added",change:{"project":"tools/gerrit", ...}, ...}
Michael Ochmannb99feab2016-07-06 14:10:22 +020043----
Kenny Root15ac1b82010-02-24 00:29:20 -080044
David Ostrovsky9503a2e2016-01-03 18:49:26 +010045Only subscribe to specific event types:
46
Michael Ochmannb99feab2016-07-06 14:10:22 +020047----
David Shevitzc47f2362018-09-27 10:55:35 -070048$ ssh -p 29418 review.example.com gerrit stream-events \
49 -s patchset-created -s ref-replicated
Michael Ochmannb99feab2016-07-06 14:10:22 +020050----
David Ostrovsky9503a2e2016-01-03 18:49:26 +010051
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080052== SCHEMA
Kenny Rootd8dffa22010-02-25 22:28:20 -080053The JSON messages consist of nested objects referencing the *change*,
Edwin Kempina19ff372012-06-14 09:04:32 +020054*patchSet*, *account* involved, and other attributes as appropriate.
Kenny Rootd8dffa22010-02-25 22:28:20 -080055
56Note that any field may be missing in the JSON messages, so consumers of
57this JSON stream should deal with that appropriately.
58
Edwin Kempin64059f52013-10-31 13:49:25 +010059[[events]]
David Pursehoused31e1d82014-12-18 16:08:19 +090060== EVENTS
Gustaf Lundh27b133b2016-09-20 17:17:41 +020061=== Assignee Changed
62
63Sent when the assignee of a change has been modified.
64
65type:: "assignee-changed"
66
67change:: link:json.html#change[change attribute]
68
69changer:: link:json.html#account[account attribute]
70
71oldAssignee:: Assignee before it was changed.
72
73eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
74created.
75
David Pursehoused31e1d82014-12-18 16:08:19 +090076=== Change Abandoned
David Pursehouseb2161b22014-12-18 16:05:48 +090077
78Sent when a change has been abandoned.
79
Kenny Rootd8dffa22010-02-25 22:28:20 -080080type:: "change-abandoned"
81
Shawn O. Pearce14760b72010-07-19 09:44:46 -070082change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080083
Edwin Kempina19ff372012-06-14 09:04:32 +020084patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080085
Shawn O. Pearce14760b72010-07-19 09:44:46 -070086abandoner:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080087
Edwin Kempina19ff372012-06-14 09:04:32 +020088reason:: Reason for abandoning the change.
89
Hugo Arès35447532014-12-02 15:03:49 -050090eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
91created.
92
Sven Selberg237f56d2019-10-09 10:21:29 +020093=== Change Deleted
David Pursehousecc9db0f2018-09-12 11:43:14 +090094
95Sent when a change has been deleted.
96
97type:: "change-deleted"
98
99change:: link:json.html#change[change attribute]
100
101deleter:: link:json.html#account[account attribute]
102
David Pursehoused31e1d82014-12-18 16:08:19 +0900103=== Change Merged
David Pursehouseb2161b22014-12-18 16:05:48 +0900104
105Sent when a change has been merged into the git repository.
106
David Pursehouseb954c0f2014-12-18 15:55:46 +0900107type:: "change-merged"
108
109change:: link:json.html#change[change attribute]
110
111patchSet:: link:json.html#patchSet[patchSet attribute]
112
113submitter:: link:json.html#account[account attribute]
114
Sven Selberg77df7872019-06-27 16:39:59 +0200115newRev:: The state (revision) of the target branch after the operation that
116closed the change was completed.
Sven Selberg9686cf22014-11-17 12:51:06 +0100117
David Pursehouseb954c0f2014-12-18 15:55:46 +0900118eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
119created.
120
David Pursehoused31e1d82014-12-18 16:08:19 +0900121=== Change Restored
David Pursehouseb2161b22014-12-18 16:05:48 +0900122
123Sent when an abandoned change has been restored.
124
Anatol Pomazau32002452010-08-04 11:28:50 -0700125type:: "change-restored"
126
127change:: link:json.html#change[change attribute]
128
Edwin Kempina19ff372012-06-14 09:04:32 +0200129patchSet:: link:json.html#patchSet[patchSet attribute]
Anatol Pomazau32002452010-08-04 11:28:50 -0700130
131restorer:: link:json.html#account[account attribute]
132
Edwin Kempina19ff372012-06-14 09:04:32 +0200133reason:: Reason for restoring the change.
134
Hugo Arès35447532014-12-02 15:03:49 -0500135eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
136created.
137
David Pursehoused31e1d82014-12-18 16:08:19 +0900138=== Comment Added
David Pursehouseb2161b22014-12-18 16:05:48 +0900139
140Sent when a review comment has been posted on a change.
141
David Pursehouseb954c0f2014-12-18 15:55:46 +0900142type:: "comment-added"
Kenny Rootd8dffa22010-02-25 22:28:20 -0800143
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700144change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800145
Edwin Kempina19ff372012-06-14 09:04:32 +0200146patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800147
David Pursehouseb954c0f2014-12-18 15:55:46 +0900148author:: link:json.html#account[account attribute]
149
150approvals:: All link:json.html#approval[approval attributes] granted.
151
David Pursehouse0549b362014-12-18 16:29:40 +0900152comment:: Review comment cover message.
David Pursehouseb954c0f2014-12-18 15:55:46 +0900153
154eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
155created.
156
David Pursehouse0bff1272014-12-18 16:31:39 +0900157=== Dropped Output
158
159Sent to notify a client that events have been dropped.
160
161type:: "dropped-output"
162
David Pursehoused31e1d82014-12-18 16:08:19 +0900163=== Hashtags Changed
David Pursehouseb2161b22014-12-18 16:05:48 +0900164
Dave Borowitzdaf0f0f2018-03-15 10:37:54 -0400165Sent when the link:intro-user.html#hashtags[hashtags] have been added to or
166removed from a change.
David Pursehouseb2161b22014-12-18 16:05:48 +0900167
David Pursehouseb954c0f2014-12-18 15:55:46 +0900168type:: "hashtags-changed"
169
170change:: link:json.html#change[change attribute]
171
172editor:: link:json.html#account[account attribute]
173
174added:: List of hashtags added to the change
175
176removed:: List of hashtags removed from the change
177
178hashtags:: List of hashtags on the change after tags were added or removed
Kenny Rootd8dffa22010-02-25 22:28:20 -0800179
Hugo Arès35447532014-12-02 15:03:49 -0500180eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
181created.
182
Liu Forest53286f22015-04-15 14:20:43 +0800183=== Project Created
184
185Sent when a new project has been created.
186
187type:: "project-created"
188
189projectName:: The created project name
190
191projectHead:: The created project head name
192
193eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
194created.
195
David Pursehoused31e1d82014-12-18 16:08:19 +0900196=== Patchset Created
David Pursehouseb2161b22014-12-18 16:05:48 +0900197
198Sent when a new change has been uploaded, or a new patch set has been uploaded
199to an existing change.
200
David Pursehouseb954c0f2014-12-18 15:55:46 +0900201type:: "patchset-created"
Kenny Rootd8dffa22010-02-25 22:28:20 -0800202
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700203change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800204
Edwin Kempina19ff372012-06-14 09:04:32 +0200205patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800206
David Pursehouseb954c0f2014-12-18 15:55:46 +0900207uploader:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800208
Hugo Arès35447532014-12-02 15:03:49 -0500209eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
210created.
211
David Pursehoused31e1d82014-12-18 16:08:19 +0900212=== Ref Updated
David Pursehouseb2161b22014-12-18 16:05:48 +0900213
214Sent when a reference is updated in a git repository.
215
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500216type:: "ref-updated"
217
218submitter:: link:json.html#account[account attribute]
219
Edwin Kempina19ff372012-06-14 09:04:32 +0200220refUpdate:: link:json.html#refUpdate[refUpdate attribute]
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500221
Hugo Arès35447532014-12-02 15:03:49 -0500222eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
223created.
224
David Pursehoused31e1d82014-12-18 16:08:19 +0900225=== Reviewer Added
David Pursehouseb2161b22014-12-18 16:05:48 +0900226
227Sent when a reviewer is added to a change.
228
David Pursehouse2336bd82012-09-21 12:50:19 +0900229type:: "reviewer-added"
230
231change:: link:json.html#change[change attribute]
232
David Pursehouse1ecac162013-09-10 20:15:53 +0900233patchSet:: link:json.html#patchSet[patchSet attribute]
David Pursehouse2336bd82012-09-21 12:50:19 +0900234
235reviewer:: link:json.html#account[account attribute]
236
Jacek Centkowski1d0df4d2019-11-10 06:38:02 +0100237adder:: user that added the reviewer as link:json.html#account[account attribute]
238
Hugo Arès35447532014-12-02 15:03:49 -0500239eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
240created.
241
Khai Do2710a882015-12-10 10:42:03 -0800242=== Reviewer Deleted
243
244Sent when a reviewer (with a vote) is removed from a change.
245
246type:: "reviewer-deleted"
247
248change:: link:json.html#change[change attribute]
249
250patchSet:: link:json.html#patchSet[patchSet attribute]
251
David Pursehousebb6d8832017-07-20 10:39:32 +0900252reviewer:: reviewer that was removed as link:json.html#account[account attribute]
Khai Do2710a882015-12-10 10:42:03 -0800253
David Pursehousebb6d8832017-07-20 10:39:32 +0900254remover:: user that removed the reviewer as link:json.html#account[account attribute]
Khai Do2710a882015-12-10 10:42:03 -0800255
256approvals:: All link:json.html#approval[approval attributes] removed.
257
258comment:: Review comment cover message.
259
260eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
261created.
262
David Pursehoused31e1d82014-12-18 16:08:19 +0900263=== Topic Changed
David Pursehouseb2161b22014-12-18 16:05:48 +0900264
265Sent when the topic of a change has been changed.
266
David Pursehouseba3e28d2013-07-12 14:48:51 +0900267type:: "topic-changed"
268
269change:: link:json.html#change[change attribute]
270
271changer:: link:json.html#account[account attribute]
272
273oldTopic:: Topic name before it was changed.
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500274
Hugo Arès35447532014-12-02 15:03:49 -0500275eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
276created.
277
Sven Selbergbb521dc2017-12-11 14:17:44 +0100278=== Work In Progress State Changed
279
David Pursehouse0722d232018-04-19 09:32:27 +0200280Sent when the link:intro-user.html#wip[WIP] state of the change has changed.
Sven Selbergbb521dc2017-12-11 14:17:44 +0100281
282type:: wip-state-changed
283
284change:: link:json.html#change[change attribute]
285
Paladox none49edfc22019-02-21 19:33:05 +0000286patchSet:: link:json.html#patchSet[patchSet attribute]
287
Sven Selbergbb521dc2017-12-11 14:17:44 +0100288changer:: link:json.html#account[account attribute]
289
290eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
291created.
292
Sven Selberg05354ec2017-12-11 14:17:44 +0100293=== Private State Changed
294
David Pursehouse79ea765f2018-04-19 09:37:19 +0200295Sent when the link:intro-user.html#private-changes[private] state of the
Sven Selberg05354ec2017-12-11 14:17:44 +0100296change has changed.
297
298type:: private-state-changed
299
300change:: link:json.html#change[change attribute]
301
Paladox none49edfc22019-02-21 19:33:05 +0000302patchSet:: link:json.html#patchSet[patchSet attribute]
303
Sven Selberg05354ec2017-12-11 14:17:44 +0100304changer:: link:json.html#account[account attribute]
305
306eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
307created.
308
David Pursehouse94b76cf2017-07-19 16:19:41 +0900309=== Vote Deleted
310
311Sent when a vote was removed from a change.
312
313type:: "vote-deleted"
314
315change:: link:json.html#change[change attribute]
316
317patchSet:: link:json.html#patchSet[patchSet attribute]
318
319reviewer:: user whose vote was removed as link:json.html#account[account attribute]
320
321remover:: user who removed the vote as link:json.html#account[account attribute]
322
323approvals:: all votes as link:json.html#approval[approval attributes]
324
325comment:: Review comment cover message.
326
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800327== SEE ALSO
Kenny Root15ac1b82010-02-24 00:29:20 -0800328
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700329* link:json.html[JSON Data Formats]
Kenny Root15ac1b82010-02-24 00:29:20 -0800330* link:access-control.html[Access Controls]
331
332GERRIT
333------
334Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700335
336SEARCHBOX
337---------