blob: 68e796a4ba0a60213d1dd2776a17ed36f34491e4 [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
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080059==== Draft Published
David Pursehoused556c192012-06-12 18:34:37 +090060type:: "draft-published"
61
62change:: link:json.html#change[change attribute]
63
David Pursehouse1ecac162013-09-10 20:15:53 +090064patchSet:: link:json.html#patchSet[patchSet attribute]
David Pursehoused556c192012-06-12 18:34:37 +090065
66uploader:: link:json.html#account[account attribute]
67
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080068==== Change Abandoned
Kenny Rootd8dffa22010-02-25 22:28:20 -080069type:: "change-abandoned"
70
Shawn O. Pearce14760b72010-07-19 09:44:46 -070071change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080072
Edwin Kempina19ff372012-06-14 09:04:32 +020073patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080074
Shawn O. Pearce14760b72010-07-19 09:44:46 -070075abandoner:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080076
Edwin Kempina19ff372012-06-14 09:04:32 +020077reason:: Reason for abandoning the change.
78
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080079==== Change Restored
Anatol Pomazau32002452010-08-04 11:28:50 -070080type:: "change-restored"
81
82change:: link:json.html#change[change attribute]
83
Edwin Kempina19ff372012-06-14 09:04:32 +020084patchSet:: link:json.html#patchSet[patchSet attribute]
Anatol Pomazau32002452010-08-04 11:28:50 -070085
86restorer:: link:json.html#account[account attribute]
87
Edwin Kempina19ff372012-06-14 09:04:32 +020088reason:: Reason for restoring the change.
89
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080090==== Change Merged
Kenny Rootd8dffa22010-02-25 22:28:20 -080091type:: "change-merged"
92
Shawn O. Pearce14760b72010-07-19 09:44:46 -070093change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080094
Edwin Kempina19ff372012-06-14 09:04:32 +020095patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080096
Shawn O. Pearce14760b72010-07-19 09:44:46 -070097submitter:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -080098
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080099==== Merge Failed
David Pursehousef9f3b272012-09-28 19:58:59 +0900100type:: "merge-failed"
101
102change:: link:json.html#change[change attribute]
103
104patchSet:: link:json.html#patchSet[patchSet attribute]
105
106submitter:: link:json.html#account[account attribute]
107
108reason:: Reason that the merge failed.
109
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800110==== Comment Added
Kenny Rootd8dffa22010-02-25 22:28:20 -0800111type:: "comment-added"
112
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700113change:: link:json.html#change[change attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800114
Edwin Kempina19ff372012-06-14 09:04:32 +0200115patchSet:: link:json.html#patchSet[patchSet attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800116
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700117author:: link:json.html#account[account attribute]
Kenny Rootd8dffa22010-02-25 22:28:20 -0800118
Edwin Kempina19ff372012-06-14 09:04:32 +0200119approvals:: All link:json.html#approval[approval attributes] granted.
120
Kenny Rootd8dffa22010-02-25 22:28:20 -0800121comment:: Comment text author had written
122
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800123==== Ref Updated
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500124type:: "ref-updated"
125
126submitter:: link:json.html#account[account attribute]
127
Edwin Kempina19ff372012-06-14 09:04:32 +0200128refUpdate:: link:json.html#refUpdate[refUpdate attribute]
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500129
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800130==== Reviewer Added
David Pursehouse2336bd82012-09-21 12:50:19 +0900131type:: "reviewer-added"
132
133change:: link:json.html#change[change attribute]
134
David Pursehouse1ecac162013-09-10 20:15:53 +0900135patchSet:: link:json.html#patchSet[patchSet attribute]
David Pursehouse2336bd82012-09-21 12:50:19 +0900136
137reviewer:: link:json.html#account[account attribute]
138
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800139==== Topic Changed
David Pursehouseba3e28d2013-07-12 14:48:51 +0900140type:: "topic-changed"
141
142change:: link:json.html#change[change attribute]
143
144changer:: link:json.html#account[account attribute]
145
146oldTopic:: Topic name before it was changed.
Jesse Greenwald6cc11902010-10-06 19:46:25 -0500147
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800148== SEE ALSO
Kenny Root15ac1b82010-02-24 00:29:20 -0800149
Shawn O. Pearce14760b72010-07-19 09:44:46 -0700150* link:json.html[JSON Data Formats]
Kenny Root15ac1b82010-02-24 00:29:20 -0800151* link:access-control.html[Access Controls]
152
153GERRIT
154------
155Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700156
157SEARCHBOX
158---------