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 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 59 | ==== Draft Published |
David Pursehouse | d556c19 | 2012-06-12 18:34:37 +0900 | [diff] [blame] | 60 | type:: "draft-published" |
| 61 | |
| 62 | change:: link:json.html#change[change attribute] |
| 63 | |
David Pursehouse | 1ecac16 | 2013-09-10 20:15:53 +0900 | [diff] [blame] | 64 | patchSet:: link:json.html#patchSet[patchSet attribute] |
David Pursehouse | d556c19 | 2012-06-12 18:34:37 +0900 | [diff] [blame] | 65 | |
| 66 | uploader:: link:json.html#account[account attribute] |
| 67 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 68 | ==== Change Abandoned |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 69 | type:: "change-abandoned" |
| 70 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 71 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 72 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 73 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 74 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 75 | abandoner:: link:json.html#account[account attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 76 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 77 | reason:: Reason for abandoning the change. |
| 78 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 79 | ==== Change Restored |
Anatol Pomazau | 3200245 | 2010-08-04 11:28:50 -0700 | [diff] [blame] | 80 | type:: "change-restored" |
| 81 | |
| 82 | change:: link:json.html#change[change attribute] |
| 83 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 84 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Anatol Pomazau | 3200245 | 2010-08-04 11:28:50 -0700 | [diff] [blame] | 85 | |
| 86 | restorer:: link:json.html#account[account attribute] |
| 87 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 88 | reason:: Reason for restoring the change. |
| 89 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 90 | ==== Change Merged |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 91 | type:: "change-merged" |
| 92 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 93 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 94 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 95 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 96 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 97 | submitter:: link:json.html#account[account attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 98 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 99 | ==== Merge Failed |
David Pursehouse | f9f3b27 | 2012-09-28 19:58:59 +0900 | [diff] [blame] | 100 | type:: "merge-failed" |
| 101 | |
| 102 | change:: link:json.html#change[change attribute] |
| 103 | |
| 104 | patchSet:: link:json.html#patchSet[patchSet attribute] |
| 105 | |
| 106 | submitter:: link:json.html#account[account attribute] |
| 107 | |
| 108 | reason:: Reason that the merge failed. |
| 109 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 110 | ==== Comment Added |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 111 | type:: "comment-added" |
| 112 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 113 | change:: link:json.html#change[change attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 114 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 115 | patchSet:: link:json.html#patchSet[patchSet attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 116 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 117 | author:: link:json.html#account[account attribute] |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 118 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 119 | approvals:: All link:json.html#approval[approval attributes] granted. |
| 120 | |
Kenny Root | d8dffa2 | 2010-02-25 22:28:20 -0800 | [diff] [blame] | 121 | comment:: Comment text author had written |
| 122 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 123 | ==== Ref Updated |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 124 | type:: "ref-updated" |
| 125 | |
| 126 | submitter:: link:json.html#account[account attribute] |
| 127 | |
Edwin Kempin | a19ff37 | 2012-06-14 09:04:32 +0200 | [diff] [blame] | 128 | refUpdate:: link:json.html#refUpdate[refUpdate attribute] |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 129 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 130 | ==== Reviewer Added |
David Pursehouse | 2336bd8 | 2012-09-21 12:50:19 +0900 | [diff] [blame] | 131 | type:: "reviewer-added" |
| 132 | |
| 133 | change:: link:json.html#change[change attribute] |
| 134 | |
David Pursehouse | 1ecac16 | 2013-09-10 20:15:53 +0900 | [diff] [blame] | 135 | patchSet:: link:json.html#patchSet[patchSet attribute] |
David Pursehouse | 2336bd8 | 2012-09-21 12:50:19 +0900 | [diff] [blame] | 136 | |
| 137 | reviewer:: link:json.html#account[account attribute] |
| 138 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 139 | ==== Topic Changed |
David Pursehouse | ba3e28d | 2013-07-12 14:48:51 +0900 | [diff] [blame] | 140 | type:: "topic-changed" |
| 141 | |
| 142 | change:: link:json.html#change[change attribute] |
| 143 | |
| 144 | changer:: link:json.html#account[account attribute] |
| 145 | |
| 146 | oldTopic:: Topic name before it was changed. |
Jesse Greenwald | 6cc1190 | 2010-10-06 19:46:25 -0500 | [diff] [blame] | 147 | |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 148 | == SEE ALSO |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 149 | |
Shawn O. Pearce | 14760b7 | 2010-07-19 09:44:46 -0700 | [diff] [blame] | 150 | * link:json.html[JSON Data Formats] |
Kenny Root | 15ac1b8 | 2010-02-24 00:29:20 -0800 | [diff] [blame] | 151 | * link:access-control.html[Access Controls] |
| 152 | |
| 153 | GERRIT |
| 154 | ------ |
| 155 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 156 | |
| 157 | SEARCHBOX |
| 158 | --------- |