Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = gerrit stream-events |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 2 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 3 | == NAME |
Edwin Kempin | f1acbb8 | 2011-09-15 12:49:42 +0200 | [diff] [blame] | 4 | gerrit stream-events - Monitor events occurring in real time |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 5 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 6 | == SYNOPSIS |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 7 | -- |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 8 | 'ssh' -p <port> <host> 'gerrit stream-events' |
Yuxuan 'fishy' Wang | d85b687 | 2013-11-15 11:47:46 -0800 | [diff] [blame] | 9 | -- |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 10 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 11 | == DESCRIPTION |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 12 | |
Edwin Kempin | f1acbb8 | 2011-09-15 12:49:42 +0200 | [diff] [blame] | 13 | Provides a portal into the major events occurring on the server, |
David Pursehouse | 9246356 | 2013-06-24 10:16:28 +0900 | [diff] [blame] | 14 | outputting activity data in real-time to the client. Events are |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 15 | filtered by the caller's access permissions, ensuring the caller |
| 16 | only receives events for changes they can view on the web, or in |
| 17 | the project repository. |
| 18 | |
| 19 | Event output is in JSON, one event per line. |
| 20 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 21 | == ACCESS |
Ed Bartosh | d168b81 | 2013-04-13 20:15:58 +0300 | [diff] [blame] | 22 | Caller must be a member of the privileged 'Administrators' group, |
| 23 | or have been granted |
| 24 | link:access-control.html#capability_streamEvents[the 'Stream Events' global capability]. |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 25 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 26 | == SCRIPTING |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 27 | This command is intended to be used in scripts. |
| 28 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 29 | == EXAMPLES |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 30 | |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 31 | ==== |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 32 | $ ssh -p 29418 review.example.com gerrit stream-events |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 33 | {"type":"comment-added",change:{"project":"tools/gerrit", ...}, ...} |
| 34 | {"type":"comment-added",change:{"project":"tools/gerrit", ...}, ...} |
Shawn O. Pearce | 4776924 | 2011-06-14 16:40:48 -0700 | [diff] [blame] | 35 | ==== |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 36 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 37 | == SCHEMA |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 38 | The JSON messages consist of nested objects referencing the *change*, |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 39 | *patchSet*, *account* involved, and other attributes as appropriate. |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 40 | |
| 41 | Note that any field may be missing in the JSON messages, so consumers of |
| 42 | this JSON stream should deal with that appropriately. |
| 43 | |
Edwin Kempin | 64059f5 | 2013-10-31 13:49:25 +0100 | [diff] [blame] | 44 | [[events]] |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 45 | == EVENTS |
| 46 | === Change Abandoned |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 47 | |
| 48 | Sent when a change has been abandoned. |
| 49 | |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 50 | type:: "change-abandoned" |
| 51 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 52 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 53 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 54 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 55 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 56 | abandoner:: link:json.html#account[account attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 57 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 58 | reason:: Reason for abandoning the change. |
| 59 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame] | 60 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 61 | created. |
| 62 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 63 | === Change Merged |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 64 | |
| 65 | Sent when a change has been merged into the git repository. |
| 66 | |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 67 | type:: "change-merged" |
| 68 | |
| 69 | change:: link:json.html#change[change attribute] |
| 70 | |
| 71 | patchSet:: link:json.html#patchSet[patchSet attribute] |
| 72 | |
| 73 | submitter:: link:json.html#account[account attribute] |
| 74 | |
Sven Selberg | 9686cf2 | 2014-11-17 12:51:06 +0100 | [diff] [blame] | 75 | newRev:: The resulting revision of the merge. |
| 76 | |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 77 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 78 | created. |
| 79 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 80 | === Change Restored |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 81 | |
| 82 | Sent when an abandoned change has been restored. |
| 83 | |
Anatol Pomazau | 3200245 | 2010-08-04 11:28:50 -0700 | [diff] [blame] | 84 | type:: "change-restored" |
| 85 | |
| 86 | change:: link:json.html#change[change attribute] |
| 87 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 88 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Anatol Pomazau | 3200245 | 2010-08-04 11:28:50 -0700 | [diff] [blame] | 89 | |
| 90 | restorer:: link:json.html#account[account attribute] |
| 91 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 92 | reason:: Reason for restoring the change. |
| 93 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame] | 94 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 95 | created. |
| 96 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 97 | === Comment Added |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 98 | |
| 99 | Sent when a review comment has been posted on a change. |
| 100 | |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 101 | type:: "comment-added" |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 102 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 103 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 104 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 105 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 106 | |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 107 | author:: link:json.html#account[account attribute] |
| 108 | |
| 109 | approvals:: All link:json.html#approval[approval attributes] granted. |
| 110 | |
David Pursehouse | 0549b36 | 2014-12-18 16:29:40 +0900 | [diff] [blame] | 111 | comment:: Review comment cover message. |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 112 | |
| 113 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 114 | created. |
| 115 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 116 | === Draft Published |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 117 | |
| 118 | Sent when a draft change has been published. |
| 119 | |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 120 | type:: "draft-published" |
| 121 | |
| 122 | change:: link:json.html#change[change attribute] |
| 123 | |
| 124 | patchSet:: link:json.html#patchSet[patchSet attribute] |
| 125 | |
| 126 | uploader:: link:json.html#account[account attribute] |
| 127 | |
| 128 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 129 | created. |
| 130 | |
David Pursehouse | 0bff127 | 2014-12-18 16:31:39 +0900 | [diff] [blame] | 131 | === Dropped Output |
| 132 | |
| 133 | Sent to notify a client that events have been dropped. |
| 134 | |
| 135 | type:: "dropped-output" |
| 136 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 137 | === Hashtags Changed |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 138 | |
| 139 | Sent when the hashtags have been added to or removed from a change. |
| 140 | |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 141 | type:: "hashtags-changed" |
| 142 | |
| 143 | change:: link:json.html#change[change attribute] |
| 144 | |
| 145 | editor:: link:json.html#account[account attribute] |
| 146 | |
| 147 | added:: List of hashtags added to the change |
| 148 | |
| 149 | removed:: List of hashtags removed from the change |
| 150 | |
| 151 | hashtags:: List of hashtags on the change after tags were added or removed |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 152 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame] | 153 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 154 | created. |
| 155 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 156 | === Merge Failed |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 157 | |
| 158 | Sent when a change has failed to be merged into the git repository. |
| 159 | |
David Pursehouse | f9f3b27 | 2012-09-28 19:58:59 +0900 | [diff] [blame] | 160 | type:: "merge-failed" |
| 161 | |
| 162 | change:: link:json.html#change[change attribute] |
| 163 | |
| 164 | patchSet:: link:json.html#patchSet[patchSet attribute] |
| 165 | |
| 166 | submitter:: link:json.html#account[account attribute] |
| 167 | |
| 168 | reason:: Reason that the merge failed. |
| 169 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame] | 170 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 171 | created. |
| 172 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 173 | === Patchset Created |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 174 | |
| 175 | Sent when a new change has been uploaded, or a new patch set has been uploaded |
| 176 | to an existing change. |
| 177 | |
| 178 | Note that this event is also sent for changes or patch sets uploaded as draft, |
| 179 | but is only visible to the change owner, any existing reviewers, and users who |
| 180 | belong to a group that is granted the |
| 181 | link:access-control.html#category_view_drafts[View Drafts] capability. |
| 182 | |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 183 | type:: "patchset-created" |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 184 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 185 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 186 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 187 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 188 | |
David Pursehouse | b954c0f | 2014-12-18 15:55:46 +0900 | [diff] [blame] | 189 | uploader:: link:json.html#account[account attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 190 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame] | 191 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 192 | created. |
| 193 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 194 | === Ref Updated |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 195 | |
| 196 | Sent when a reference is updated in a git repository. |
| 197 | |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 198 | type:: "ref-updated" |
| 199 | |
| 200 | submitter:: link:json.html#account[account attribute] |
| 201 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 202 | refUpdate:: link:json.html#refUpdate[refUpdate attribute] |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 203 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame] | 204 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 205 | created. |
| 206 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 207 | === Reviewer Added |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 208 | |
| 209 | Sent when a reviewer is added to a change. |
| 210 | |
David Pursehouse | 2336bd8 | 2012-09-21 12:50:19 +0900 | [diff] [blame] | 211 | type:: "reviewer-added" |
| 212 | |
| 213 | change:: link:json.html#change[change attribute] |
| 214 | |
David Pursehouse | 1ecac16 | 2013-09-10 20:15:53 +0900 | [diff] [blame] | 215 | patchSet:: link:json.html#patchSet[patchSet attribute] |
David Pursehouse | 2336bd8 | 2012-09-21 12:50:19 +0900 | [diff] [blame] | 216 | |
| 217 | reviewer:: link:json.html#account[account attribute] |
| 218 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame] | 219 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 220 | created. |
| 221 | |
David Pursehouse | d31e1d8 | 2014-12-18 16:08:19 +0900 | [diff] [blame] | 222 | === Topic Changed |
David Pursehouse | b2161b2 | 2014-12-18 16:05:48 +0900 | [diff] [blame] | 223 | |
| 224 | Sent when the topic of a change has been changed. |
| 225 | |
David Pursehouse | ba3e28d | 2013-07-12 14:48:51 +0900 | [diff] [blame] | 226 | type:: "topic-changed" |
| 227 | |
| 228 | change:: link:json.html#change[change attribute] |
| 229 | |
| 230 | changer:: link:json.html#account[account attribute] |
| 231 | |
| 232 | oldTopic:: Topic name before it was changed. |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 233 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame] | 234 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 235 | created. |
| 236 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 237 | == SEE ALSO |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 238 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 239 | * link:json.html[JSON Data Formats] |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 240 | * link:access-control.html[Access Controls] |
| 241 | |
| 242 | GERRIT |
| 243 | ------ |
| 244 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 245 | |
| 246 | SEARCHBOX |
| 247 | --------- |