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. |
Maciej Żenczykowski | 9741bab | 2010-10-17 01:21:45 -0700 | [diff] [blame] | 40 | The currently supported message types are *patchset-created*, |
David Pursehouse | d556c19 | 2012-06-12 18:34:37 +0900 | [diff] [blame] | 41 | *draft-published*, *change-abandoned*, *change-restored*, |
David Pursehouse | f9f3b27 | 2012-09-28 19:58:59 +0900 | [diff] [blame] | 42 | *change-merged*, *merge-failed*, *comment-added*, *ref-updated* and |
| 43 | *reviewer-added*. |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 44 | |
| 45 | Note that any field may be missing in the JSON messages, so consumers of |
| 46 | this JSON stream should deal with that appropriately. |
| 47 | |
Edwin Kempin | 64059f5 | 2013-10-31 13:49:25 +0100 | [diff] [blame] | 48 | [[events]] |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 49 | === Events |
| 50 | ==== Patchset Created |
Maciej Żenczykowski | 9741bab | 2010-10-17 01:21:45 -0700 | [diff] [blame] | 51 | type:: "patchset-created" |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 52 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 53 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 54 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 55 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 56 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 57 | uploader:: link:json.html#account[account attribute] |
Scott Anderson | de08e63 | 2010-06-15 16:04:28 -0700 | [diff] [blame] | 58 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 59 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 60 | created. |
| 61 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 62 | ==== Draft Published |
David Pursehouse | d556c19 | 2012-06-12 18:34:37 +0900 | [diff] [blame] | 63 | type:: "draft-published" |
| 64 | |
| 65 | change:: link:json.html#change[change attribute] |
| 66 | |
David Pursehouse | 1ecac16 | 2013-09-10 20:15:53 +0900 | [diff] [blame] | 67 | patchSet:: link:json.html#patchSet[patchSet attribute] |
David Pursehouse | d556c19 | 2012-06-12 18:34:37 +0900 | [diff] [blame] | 68 | |
| 69 | uploader:: link:json.html#account[account attribute] |
| 70 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 71 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 72 | created. |
| 73 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 74 | ==== Change Abandoned |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 75 | type:: "change-abandoned" |
| 76 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 77 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 78 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 79 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 80 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 81 | abandoner:: link:json.html#account[account attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 82 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 83 | reason:: Reason for abandoning the change. |
| 84 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 85 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 86 | created. |
| 87 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 88 | ==== Change Restored |
Anatol Pomazau | 3200245 | 2010-08-04 11:28:50 -0700 | [diff] [blame] | 89 | type:: "change-restored" |
| 90 | |
| 91 | change:: link:json.html#change[change attribute] |
| 92 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 93 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Anatol Pomazau | 3200245 | 2010-08-04 11:28:50 -0700 | [diff] [blame] | 94 | |
| 95 | restorer:: link:json.html#account[account attribute] |
| 96 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 97 | reason:: Reason for restoring the change. |
| 98 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 99 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 100 | created. |
| 101 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 102 | ==== Change Merged |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 103 | type:: "change-merged" |
| 104 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 105 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 106 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 107 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 108 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 109 | submitter:: link:json.html#account[account attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 110 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 111 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 112 | created. |
| 113 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 114 | ==== Merge Failed |
David Pursehouse | f9f3b27 | 2012-09-28 19:58:59 +0900 | [diff] [blame] | 115 | type:: "merge-failed" |
| 116 | |
| 117 | change:: link:json.html#change[change attribute] |
| 118 | |
| 119 | patchSet:: link:json.html#patchSet[patchSet attribute] |
| 120 | |
| 121 | submitter:: link:json.html#account[account attribute] |
| 122 | |
| 123 | reason:: Reason that the merge failed. |
| 124 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 125 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 126 | created. |
| 127 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 128 | ==== Comment Added |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 129 | type:: "comment-added" |
| 130 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 131 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 132 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 133 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 134 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 135 | author:: link:json.html#account[account attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 136 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 137 | approvals:: All link:json.html#approval[approval attributes] granted. |
| 138 | |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 139 | comment:: Comment text author had written |
| 140 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 141 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 142 | created. |
| 143 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 144 | ==== Ref Updated |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 145 | type:: "ref-updated" |
| 146 | |
| 147 | submitter:: link:json.html#account[account attribute] |
| 148 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 149 | refUpdate:: link:json.html#refUpdate[refUpdate attribute] |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 150 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 151 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 152 | created. |
| 153 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 154 | ==== Reviewer Added |
David Pursehouse | 2336bd8 | 2012-09-21 12:50:19 +0900 | [diff] [blame] | 155 | type:: "reviewer-added" |
| 156 | |
| 157 | change:: link:json.html#change[change attribute] |
| 158 | |
David Pursehouse | 1ecac16 | 2013-09-10 20:15:53 +0900 | [diff] [blame] | 159 | patchSet:: link:json.html#patchSet[patchSet attribute] |
David Pursehouse | 2336bd8 | 2012-09-21 12:50:19 +0900 | [diff] [blame] | 160 | |
| 161 | reviewer:: link:json.html#account[account attribute] |
| 162 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 163 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 164 | created. |
| 165 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 166 | ==== Topic Changed |
David Pursehouse | ba3e28d | 2013-07-12 14:48:51 +0900 | [diff] [blame] | 167 | type:: "topic-changed" |
| 168 | |
| 169 | change:: link:json.html#change[change attribute] |
| 170 | |
| 171 | changer:: link:json.html#account[account attribute] |
| 172 | |
| 173 | oldTopic:: Topic name before it was changed. |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 174 | |
Hugo Arès | 3544753 | 2014-12-02 15:03:49 -0500 | [diff] [blame^] | 175 | eventCreatedOn:: Time in seconds since the UNIX epoch when this event was |
| 176 | created. |
| 177 | |
David Pursehouse | cb2e485 | 2014-09-12 15:09:12 +0200 | [diff] [blame] | 178 | ==== Hashtags Changed |
| 179 | type:: "hashtags-changed" |
| 180 | |
| 181 | change:: link:json.html#change[change attribute] |
| 182 | |
| 183 | editor:: link:json.html#account[account attribute] |
| 184 | |
| 185 | added:: List of hashtags added to the change |
| 186 | |
| 187 | removed:: List of hashtags removed from the change |
| 188 | |
| 189 | hashtags:: List of hashtags on the change after tags were added or removed |
| 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 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 194 | == SEE ALSO |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 195 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 196 | * link:json.html[JSON Data Formats] |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 197 | * link:access-control.html[Access Controls] |
| 198 | |
| 199 | GERRIT |
| 200 | ------ |
| 201 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 202 | |
| 203 | SEARCHBOX |
| 204 | --------- |