| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 1 | Gerrit Code Review - '/changes/' REST API |
| 2 | ========================================= |
| 3 | |
| 4 | This page describes the change related REST endpoints. |
| 5 | Please also take note of the general information on the |
| 6 | link:rest-api.html[REST API]. |
| 7 | |
| Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 8 | [[change-endpoints]] |
| 9 | Change Endpoints |
| 10 | ---------------- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 11 | |
| Edwin Kempin | 7620274 | 2013-02-15 13:51:50 +0100 | [diff] [blame] | 12 | [[list-changes]] |
| Edwin Kempin | 82d3037 | 2013-02-04 08:49:34 +0100 | [diff] [blame] | 13 | GET /changes/ (Query Changes) |
| 14 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 15 | Queries changes visible to the caller. The query string must be |
| 16 | provided by the `q` parameter. The `n` parameter can be used to limit |
| 17 | the returned results. |
| 18 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 19 | As result a list of link:#change-info[ChangeInfo] entries is returned. |
| 20 | The change output is sorted by the last update time, most recently |
| 21 | updated to oldest updated. |
| 22 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 23 | Query for open changes of watched projects: |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 24 | |
| 25 | .Request |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 26 | ---- |
| Edwin Kempin | 2091edb | 2013-01-23 19:07:38 +0100 | [diff] [blame] | 27 | GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0 |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 28 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 29 | |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 30 | .Response |
| 31 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 32 | HTTP/1.1 200 OK |
| 33 | Content-Disposition: attachment |
| 34 | Content-Type: application/json;charset=UTF-8 |
| 35 | |
| 36 | )]}' |
| 37 | { |
| 38 | "kind": "gerritcodereview#change", |
| 39 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 40 | "project": "demo", |
| 41 | "branch": "master", |
| 42 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 43 | "subject": "One change", |
| 44 | "status": "NEW", |
| 45 | "created": "2012-07-17 07:18:30.854000000", |
| 46 | "updated": "2012-07-17 07:19:27.766000000", |
| 47 | "reviewed": true, |
| Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 48 | "mergeable": true, |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 49 | "_sortkey": "001e7057000006dc", |
| 50 | "_number": 1756, |
| 51 | "owner": { |
| 52 | "name": "John Doe" |
| 53 | }, |
| 54 | }, |
| 55 | { |
| 56 | "kind": "gerritcodereview#change", |
| 57 | "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 58 | "project": "demo", |
| 59 | "branch": "master", |
| 60 | "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 61 | "subject": "Another change", |
| 62 | "status": "NEW", |
| 63 | "created": "2012-07-17 07:18:30.884000000", |
| 64 | "updated": "2012-07-17 07:18:30.885000000", |
| Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 65 | "mergeable": true, |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 66 | "_sortkey": "001e7056000006dd", |
| 67 | "_number": 1757, |
| 68 | "owner": { |
| 69 | "name": "John Doe" |
| 70 | }, |
| 71 | "_more_changes": true |
| 72 | } |
| 73 | ---- |
| 74 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 75 | If the `n` query parameter is supplied and additional changes exist |
| 76 | that match the query beyond the end, the last change object has a |
| 77 | `_more_changes: true` JSON field set. Callers can resume a query with |
| Christian Aistleitner | 5536401 | 2013-02-17 12:18:22 +0100 | [diff] [blame] | 78 | the `N` query parameter, supplying the last change's `_sortkey` field |
| 79 | as the value. When going in the reverse direction with the `P` query |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 80 | parameter a `_more_changes: true` is put in the first change object if |
| 81 | there are results *before* the first change returned. |
| 82 | |
| 83 | Clients are allowed to specify more than one query by setting the `q` |
| 84 | parameter multiple times. In this case the result is an array of |
| 85 | arrays, one per query in the same order the queries were given in. |
| 86 | |
| Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 87 | .Query for the 25 most recent open changes of the projects that you watch |
| 88 | **** |
| 89 | get::/changes/?q=status:open+is:watched&n=25 |
| 90 | **** |
| 91 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 92 | Query that retrieves changes for a user's dashboard: |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 93 | |
| 94 | .Request |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 95 | ---- |
| 96 | GET /changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS HTTP/1.0 |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 97 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 98 | |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 99 | .Response |
| 100 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 101 | HTTP/1.1 200 OK |
| 102 | Content-Disposition: attachment |
| 103 | Content-Type: application/json;charset=UTF-8 |
| 104 | |
| 105 | )]}' |
| 106 | [ |
| 107 | [ |
| 108 | { |
| 109 | "kind": "gerritcodereview#change", |
| 110 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 111 | "project": "demo", |
| 112 | "branch": "master", |
| 113 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 114 | "subject": "One change", |
| 115 | "status": "NEW", |
| 116 | "created": "2012-07-17 07:18:30.854000000", |
| 117 | "updated": "2012-07-17 07:19:27.766000000", |
| 118 | "reviewed": true, |
| Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 119 | "mergeable": true, |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 120 | "_sortkey": "001e7057000006dc", |
| 121 | "_number": 1756, |
| 122 | "owner": { |
| 123 | "name": "John Doe" |
| 124 | }, |
| 125 | "labels": { |
| 126 | "Verified": {}, |
| 127 | "Code-Review": {} |
| 128 | } |
| 129 | } |
| 130 | ], |
| 131 | [], |
| 132 | [] |
| 133 | ] |
| 134 | ---- |
| 135 | |
| Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 136 | .Query the changes for your user dashboard |
| 137 | **** |
| 138 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 139 | **** |
| 140 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 141 | Additional fields can be obtained by adding `o` parameters, each |
| 142 | option requires more database lookups and slows down the query |
| 143 | response time to the client so they are generally disabled by |
| 144 | default. Optional fields are: |
| 145 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 146 | [[labels]] |
| 147 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 148 | * `LABELS`: a summary of each label required for submit, and |
| 149 | approvers that have granted (or rejected) with that label. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 150 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 151 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 152 | [[detailed-labels]] |
| 153 | -- |
| Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 154 | * `DETAILED_LABELS`: detailed label information, including numeric |
| Dave Borowitz | 992ddd7 | 2013-02-13 11:53:17 -0800 | [diff] [blame] | 155 | values of all existing approvals, recognized label values, values |
| 156 | permitted to be set by the current user, and reviewers that may be |
| 157 | removed by the current user. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 158 | -- |
| Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 159 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 160 | [[current-revision]] |
| 161 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 162 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 163 | of the change, including the commit SHA-1 and URLs to fetch from. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 164 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 165 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 166 | [[all-revisions]] |
| 167 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 168 | * `ALL_REVISIONS`: describe all revisions, not just current. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 169 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 170 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 171 | [[current-commit]] |
| 172 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 173 | * `CURRENT_COMMIT`: parse and output all header fields from the |
| 174 | commit object, including message. Only valid when the current |
| 175 | revision or all revisions are selected. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 176 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 177 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 178 | [[all-commits]] |
| 179 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 180 | * `ALL_COMMITS`: parse and output all header fields from the |
| 181 | output revisions. If only `CURRENT_REVISION` was requested |
| 182 | then only the current revision's commit data will be output. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 183 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 184 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 185 | [[current-files]] |
| 186 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 187 | * `CURRENT_FILES`: list files modified by the commit, including |
| 188 | basic line counts inserted/deleted per file. Only valid when |
| 189 | the current revision or all revisions are selected. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 190 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 191 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 192 | [[all-files]] |
| 193 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 194 | * `ALL_FILES`: list files modified by the commit, including |
| 195 | basic line counts inserted/deleted per file. If only the |
| 196 | `CURRENT_REVISION` was requested the only that commit's |
| 197 | modified files will be output. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 198 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 199 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 200 | [[detailed-accounts]] |
| 201 | -- |
| Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 202 | * `DETAILED_ACCOUNTS`: include `_account_id` and `email` fields when |
| 203 | referencing accounts. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 204 | -- |
| Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 205 | |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 206 | .Request |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 207 | ---- |
| 208 | GET /changes/?q=97&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES HTTP/1.0 |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 209 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 210 | |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 211 | .Response |
| 212 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 213 | HTTP/1.1 200 OK |
| 214 | Content-Disposition: attachment |
| 215 | Content-Type: application/json;charset=UTF-8 |
| 216 | |
| 217 | )]}' |
| 218 | [ |
| 219 | { |
| 220 | "kind": "gerritcodereview#change", |
| 221 | "id": "demo~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 222 | "project": "gerrit", |
| 223 | "branch": "master", |
| 224 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 225 | "subject": "Use an EventBus to manage star icons", |
| 226 | "status": "NEW", |
| 227 | "created": "2012-04-25 00:52:25.580000000", |
| 228 | "updated": "2012-04-25 00:52:25.586000000", |
| Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 229 | "mergeable": true, |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 230 | "_sortkey": "001c9bf400000061", |
| 231 | "_number": 97, |
| 232 | "owner": { |
| 233 | "name": "Shawn Pearce" |
| 234 | }, |
| 235 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 236 | "revisions": { |
| 237 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
| 238 | "_number": 1, |
| 239 | "fetch": { |
| 240 | "git": { |
| 241 | "url": "git://localhost/gerrit", |
| 242 | "ref": "refs/changes/97/97/1" |
| 243 | }, |
| 244 | "http": { |
| 245 | "url": "http://127.0.0.1:8080/gerrit", |
| 246 | "ref": "refs/changes/97/97/1" |
| 247 | } |
| 248 | }, |
| 249 | "commit": { |
| 250 | "parents": [ |
| 251 | { |
| 252 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 253 | "subject": "Migrate contributor agreements to All-Projects." |
| 254 | } |
| 255 | ], |
| 256 | "author": { |
| 257 | "name": "Shawn O. Pearce", |
| 258 | "email": "sop@google.com", |
| 259 | "date": "2012-04-24 18:08:08.000000000", |
| 260 | "tz": -420 |
| 261 | }, |
| 262 | "committer": { |
| 263 | "name": "Shawn O. Pearce", |
| 264 | "email": "sop@google.com", |
| 265 | "date": "2012-04-24 18:08:08.000000000", |
| 266 | "tz": -420 |
| 267 | }, |
| 268 | "subject": "Use an EventBus to manage star icons", |
| 269 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 270 | }, |
| 271 | "files": { |
| 272 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
| 273 | "lines_deleted": 8 |
| 274 | }, |
| 275 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
| 276 | "lines_inserted": 1 |
| 277 | }, |
| 278 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 279 | "lines_inserted": 11, |
| 280 | "lines_deleted": 19 |
| 281 | }, |
| 282 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 283 | "lines_inserted": 23, |
| 284 | "lines_deleted": 20 |
| 285 | }, |
| 286 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 287 | "status": "D", |
| 288 | "lines_deleted": 139 |
| 289 | }, |
| 290 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 291 | "status": "A", |
| 292 | "lines_inserted": 204 |
| 293 | }, |
| 294 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
| 295 | "lines_deleted": 9 |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | ] |
| 302 | ---- |
| 303 | |
| Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 304 | [[get-change]] |
| 305 | GET /changes/\{change-id\} (Get Change) |
| 306 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 307 | Retrieves a change. |
| 308 | |
| 309 | .Request |
| 310 | ---- |
| 311 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 312 | ---- |
| 313 | |
| 314 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 315 | describes the change. |
| 316 | |
| 317 | .Response |
| 318 | ---- |
| 319 | HTTP/1.1 200 OK |
| 320 | Content-Disposition: attachment |
| 321 | Content-Type: application/json;charset=UTF-8 |
| 322 | |
| 323 | )]}' |
| 324 | { |
| 325 | "kind": "gerritcodereview#change", |
| 326 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 327 | "project": "myProject", |
| 328 | "branch": "master", |
| 329 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 330 | "subject": "Implementing Feature X", |
| 331 | "status": "NEW", |
| 332 | "created": "2013-02-01 09:59:32.126000000", |
| 333 | "updated": "2013-02-21 11:16:36.775000000", |
| 334 | "reviewed": true, |
| 335 | "mergeable": true, |
| 336 | "_sortkey": "0023412400000f7d", |
| 337 | "_number": 3965, |
| 338 | "owner": { |
| 339 | "name": "John Doe" |
| 340 | } |
| 341 | } |
| 342 | ---- |
| 343 | |
| Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 344 | [[get-change-detail]] |
| 345 | GET /changes/\{change-id\}/detail (Get Change Detail) |
| 346 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 347 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
| 348 | detailed labels] and link:#detailed-accounts[detailed accounts]. |
| 349 | |
| 350 | .Request |
| 351 | ---- |
| 352 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 353 | ---- |
| 354 | |
| 355 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 356 | describes the change. |
| 357 | |
| 358 | .Response |
| 359 | ---- |
| 360 | HTTP/1.1 200 OK |
| 361 | Content-Disposition: attachment |
| 362 | Content-Type: application/json;charset=UTF-8 |
| 363 | |
| 364 | )]}' |
| 365 | { |
| 366 | "kind": "gerritcodereview#change", |
| 367 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 368 | "project": "myProject", |
| 369 | "branch": "master", |
| 370 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 371 | "subject": "Implementing Feature X", |
| 372 | "status": "NEW", |
| 373 | "created": "2013-02-01 09:59:32.126000000", |
| 374 | "updated": "2013-02-21 11:16:36.775000000", |
| 375 | "reviewed": true, |
| 376 | "mergeable": true, |
| 377 | "_sortkey": "0023412400000f7d", |
| 378 | "_number": 3965, |
| 379 | "owner": { |
| 380 | "_account_id": 1000096, |
| 381 | "name": "John Doe", |
| 382 | "email": "john.doe@example.com" |
| 383 | }, |
| 384 | "labels": { |
| 385 | "Verified": { |
| 386 | "all": [ |
| 387 | { |
| 388 | "value": 0, |
| 389 | "_account_id": 1000096, |
| 390 | "name": "John Doe", |
| 391 | "email": "john.doe@example.com" |
| 392 | }, |
| 393 | { |
| 394 | "value": 0, |
| 395 | "_account_id": 1000097, |
| 396 | "name": "Jane Roe", |
| 397 | "email": "jane.roe@example.com" |
| 398 | } |
| 399 | ], |
| 400 | "values": { |
| 401 | "-1": "Fails", |
| 402 | " 0": "No score", |
| 403 | "+1": "Verified" |
| 404 | } |
| 405 | }, |
| 406 | "Code-Review": { |
| 407 | "recommended": { |
| 408 | "_account_id": 1000097, |
| 409 | "name": "Jane Roe", |
| 410 | "email": "jane.roe@example.com" |
| 411 | }, |
| 412 | "disliked": { |
| 413 | "_account_id": 1000096, |
| 414 | "name": "John Doe", |
| 415 | "email": "john.doe@example.com" |
| 416 | }, |
| 417 | "all": [ |
| 418 | { |
| 419 | "value": -1, |
| 420 | "_account_id": 1000096, |
| 421 | "name": "John Doe", |
| 422 | "email": "john.doe@example.com" |
| 423 | }, |
| 424 | { |
| 425 | "value": 1, |
| 426 | "_account_id": 1000097, |
| 427 | "name": "Jane Roe", |
| 428 | "email": "jane.roe@example.com" |
| 429 | } |
| 430 | ] |
| 431 | "values": { |
| 432 | "-2": "Do not submit", |
| 433 | "-1": "I would prefer that you didn\u0027t submit this", |
| 434 | " 0": "No score", |
| 435 | "+1": "Looks good to me, but someone else must approve", |
| 436 | "+2": "Looks good to me, approved" |
| 437 | } |
| 438 | } |
| 439 | }, |
| 440 | "permitted_labels": { |
| 441 | "Verified": [ |
| 442 | "-1", |
| 443 | " 0", |
| 444 | "+1" |
| 445 | ], |
| 446 | "Code-Review": [ |
| 447 | "-2", |
| 448 | "-1", |
| 449 | " 0", |
| 450 | "+1", |
| 451 | "+2" |
| 452 | ] |
| 453 | }, |
| 454 | "removable_reviewers": [ |
| 455 | { |
| 456 | "_account_id": 1000096, |
| 457 | "name": "John Doe", |
| 458 | "email": "john.doe@example.com" |
| 459 | }, |
| 460 | { |
| 461 | "_account_id": 1000097, |
| 462 | "name": "Jane Roe", |
| 463 | "email": "jane.roe@example.com" |
| 464 | } |
| 465 | ] |
| 466 | } |
| 467 | ---- |
| 468 | |
| Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 469 | [[get-topic]] |
| 470 | GET /changes/\{change-id\}/topic (Get Topic) |
| 471 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 472 | Retrieves the topic of a change. |
| 473 | |
| 474 | .Request |
| 475 | ---- |
| 476 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 477 | ---- |
| 478 | |
| 479 | .Response |
| 480 | ---- |
| 481 | HTTP/1.1 200 OK |
| 482 | Content-Disposition: attachment |
| 483 | Content-Type: application/json;charset=UTF-8 |
| 484 | |
| 485 | )]}' |
| 486 | "Documentation" |
| 487 | ---- |
| 488 | |
| 489 | If the change does not have a topic an empty string is returned. |
| 490 | |
| 491 | [[set-topic]] |
| 492 | PUT /changes/\{change-id\}/topic (Set Topic) |
| 493 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 494 | Sets the topic of a change. |
| 495 | |
| 496 | The new topic must be provided in the request body inside a |
| 497 | link:#topic-input[TopicInput] entity. |
| 498 | |
| 499 | .Request |
| 500 | ---- |
| 501 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 502 | Content-Type: application/json;charset=UTF-8 |
| 503 | |
| 504 | { |
| 505 | "topic": "Documentation" |
| 506 | } |
| 507 | ---- |
| 508 | |
| 509 | As response the new topic is returned. |
| 510 | |
| 511 | .Response |
| 512 | ---- |
| 513 | HTTP/1.1 200 OK |
| 514 | Content-Disposition: attachment |
| 515 | Content-Type: application/json;charset=UTF-8 |
| 516 | |
| 517 | )]}' |
| 518 | "Documentation" |
| 519 | ---- |
| 520 | |
| 521 | If the topic was deleted the response is "`204 No Content`". |
| 522 | |
| 523 | [[delete-topic]] |
| 524 | DELETE /changes/\{change-id\}/topic (Delete Topic) |
| 525 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 526 | Deletes the topic of a change. |
| 527 | |
| 528 | The request body does not need to include a link:#topic-input[ |
| 529 | TopicInput] entity if no review comment is added. |
| 530 | |
| 531 | Please note that some proxies prohibit request bodies for DELETE |
| 532 | requests. In this case, if you want to specify a commit message, use |
| 533 | link:#set-topic[PUT] to delete the topic. |
| 534 | |
| 535 | .Request |
| 536 | ---- |
| 537 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 538 | ---- |
| 539 | |
| 540 | .Response |
| 541 | ---- |
| 542 | HTTP/1.1 204 No Content |
| 543 | ---- |
| 544 | |
| Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 545 | [[abandon-change]] |
| 546 | POST /changes/\{change-id\}/abandon (Abandon Change) |
| 547 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 548 | Abandons a change. |
| 549 | |
| 550 | The request body does not need to include a link:#abandon-input[ |
| 551 | AbandonInput] entity if no review comment is added. |
| 552 | |
| 553 | .Request |
| 554 | ---- |
| 555 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 556 | ---- |
| 557 | |
| 558 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 559 | describes the abandoned change. |
| 560 | |
| 561 | .Response |
| 562 | ---- |
| 563 | HTTP/1.1 200 OK |
| 564 | Content-Disposition: attachment |
| 565 | Content-Type: application/json;charset=UTF-8 |
| 566 | |
| 567 | )]}' |
| 568 | { |
| 569 | "kind": "gerritcodereview#change", |
| 570 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 571 | "project": "myProject", |
| 572 | "branch": "master", |
| 573 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 574 | "subject": "Implementing Feature X", |
| 575 | "status": "ABANDONED", |
| 576 | "created": "2013-02-01 09:59:32.126000000", |
| 577 | "updated": "2013-02-21 11:16:36.775000000", |
| 578 | "reviewed": true, |
| 579 | "mergeable": true, |
| 580 | "_sortkey": "0023412400000f7d", |
| 581 | "_number": 3965, |
| 582 | "owner": { |
| 583 | "name": "John Doe" |
| 584 | } |
| 585 | } |
| 586 | ---- |
| 587 | |
| 588 | If the change cannot be abandoned because the change state doesn't |
| 589 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 590 | the error message is contained in the response body. |
| 591 | |
| 592 | .Response |
| 593 | ---- |
| 594 | HTTP/1.1 409 Conflict |
| 595 | Content-Disposition: attachment |
| 596 | Content-Type: text/plain;charset=UTF-8 |
| 597 | |
| 598 | change is merged |
| 599 | ---- |
| 600 | |
| 601 | [[restore-change]] |
| 602 | POST /changes/\{change-id\}/restore (Restore Change) |
| 603 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 604 | Restores a change. |
| 605 | |
| 606 | The request body does not need to include a link:#restore-input[ |
| 607 | RestoreInput] entity if no review comment is added. |
| 608 | |
| 609 | .Request |
| 610 | ---- |
| 611 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 612 | ---- |
| 613 | |
| 614 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 615 | describes the restored change. |
| 616 | |
| 617 | .Response |
| 618 | ---- |
| 619 | HTTP/1.1 200 OK |
| 620 | Content-Disposition: attachment |
| 621 | Content-Type: application/json;charset=UTF-8 |
| 622 | |
| 623 | )]}' |
| 624 | { |
| 625 | "kind": "gerritcodereview#change", |
| 626 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 627 | "project": "myProject", |
| 628 | "branch": "master", |
| 629 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 630 | "subject": "Implementing Feature X", |
| 631 | "status": "NEW", |
| 632 | "created": "2013-02-01 09:59:32.126000000", |
| 633 | "updated": "2013-02-21 11:16:36.775000000", |
| 634 | "reviewed": true, |
| 635 | "mergeable": true, |
| 636 | "_sortkey": "0023412400000f7d", |
| 637 | "_number": 3965, |
| 638 | "owner": { |
| 639 | "name": "John Doe" |
| 640 | } |
| 641 | } |
| 642 | ---- |
| 643 | |
| 644 | If the change cannot be restored because the change state doesn't |
| 645 | allow restoring the change, the response is "`409 Conflict`" and |
| 646 | the error message is contained in the response body. |
| 647 | |
| 648 | .Response |
| 649 | ---- |
| 650 | HTTP/1.1 409 Conflict |
| 651 | Content-Disposition: attachment |
| 652 | Content-Type: text/plain;charset=UTF-8 |
| 653 | |
| 654 | change is new |
| 655 | ---- |
| 656 | |
| Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 657 | [[revert-change]] |
| 658 | POST /changes/\{change-id\}/revert (Revert Change) |
| 659 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 660 | Reverts a change. |
| 661 | |
| 662 | The request body does not need to include a link:#revert-input[ |
| 663 | RevertInput] entity if no review comment is added. |
| 664 | |
| 665 | .Request |
| 666 | ---- |
| 667 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revert HTTP/1.0 |
| 668 | ---- |
| 669 | |
| 670 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 671 | describes the reverting change. |
| 672 | |
| 673 | .Response |
| 674 | ---- |
| 675 | HTTP/1.1 200 OK |
| 676 | Content-Disposition: attachment |
| 677 | Content-Type: application/json;charset=UTF-8 |
| 678 | |
| 679 | )]}' |
| 680 | { |
| 681 | "kind": "gerritcodereview#change", |
| 682 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 683 | "project": "myProject", |
| 684 | "branch": "master", |
| 685 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 686 | "subject": "Revert \"Implementing Feature X\"", |
| 687 | "status": "NEW", |
| 688 | "created": "2013-02-01 09:59:32.126000000", |
| 689 | "updated": "2013-02-21 11:16:36.775000000", |
| 690 | "reviewed": true, |
| 691 | "mergeable": true, |
| 692 | "_sortkey": "0023412400000f7d", |
| 693 | "_number": 3965, |
| 694 | "owner": { |
| 695 | "name": "John Doe" |
| 696 | } |
| 697 | } |
| 698 | ---- |
| 699 | |
| 700 | If the change cannot be reverted because the change state doesn't |
| 701 | allow reverting the change, the response is "`409 Conflict`" and |
| 702 | the error message is contained in the response body. |
| 703 | |
| 704 | .Response |
| 705 | ---- |
| 706 | HTTP/1.1 409 Conflict |
| 707 | Content-Disposition: attachment |
| 708 | Content-Type: text/plain;charset=UTF-8 |
| 709 | |
| 710 | change is new |
| 711 | ---- |
| 712 | |
| Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 713 | [[submit-change]] |
| 714 | POST /changes/\{change-id\}/submit (Submit Change) |
| 715 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 716 | Submits a change. |
| 717 | |
| 718 | The request body only needs to include a link:#submit-input[ |
| 719 | SubmitInput] entity if the request should wait for the merge to |
| 720 | complete. |
| 721 | |
| 722 | .Request |
| 723 | ---- |
| 724 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
| 725 | Content-Type: application/json;charset=UTF-8 |
| 726 | |
| 727 | { |
| 728 | "wait_for_merge": true |
| 729 | } |
| 730 | ---- |
| 731 | |
| 732 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 733 | describes the submitted/merged change. |
| 734 | |
| 735 | .Response |
| 736 | ---- |
| 737 | HTTP/1.1 200 OK |
| 738 | Content-Disposition: attachment |
| 739 | Content-Type: application/json;charset=UTF-8 |
| 740 | |
| 741 | )]}' |
| 742 | { |
| 743 | "kind": "gerritcodereview#change", |
| 744 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 745 | "project": "myProject", |
| 746 | "branch": "master", |
| 747 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 748 | "subject": "Implementing Feature X", |
| 749 | "status": "MERGED", |
| 750 | "created": "2013-02-01 09:59:32.126000000", |
| 751 | "updated": "2013-02-21 11:16:36.775000000", |
| 752 | "reviewed": true, |
| 753 | "mergeable": true, |
| 754 | "_sortkey": "0023412400000f7d", |
| 755 | "_number": 3965, |
| 756 | "owner": { |
| 757 | "name": "John Doe" |
| 758 | } |
| 759 | } |
| 760 | ---- |
| 761 | |
| 762 | If the change cannot be submitted because the submit rule doesn't allow |
| 763 | submitting the change, the response is "`409 Conflict`" and the error |
| 764 | message is contained in the response body. |
| 765 | |
| 766 | .Response |
| 767 | ---- |
| 768 | HTTP/1.1 409 Conflict |
| 769 | Content-Disposition: attachment |
| 770 | Content-Type: text/plain;charset=UTF-8 |
| 771 | |
| 772 | blocked by Verified |
| 773 | ---- |
| 774 | |
| Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 775 | [[reviewer-endpoints]] |
| 776 | Reviewer Endpoints |
| 777 | ------------------ |
| 778 | |
| 779 | [[list-reviewers]] |
| 780 | GET /changes/\{change-id\}/reviewers/ (List Reviewers) |
| 781 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 782 | Lists the reviewers of a change. |
| 783 | |
| 784 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 785 | |
| 786 | .Request |
| 787 | ---- |
| 788 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 789 | ---- |
| 790 | |
| 791 | .Response |
| 792 | ---- |
| 793 | HTTP/1.1 200 OK |
| 794 | Content-Disposition: attachment |
| 795 | Content-Type: application/json;charset=UTF-8 |
| 796 | |
| 797 | )]}' |
| 798 | [ |
| 799 | { |
| 800 | "kind": "gerritcodereview#reviewer", |
| 801 | "approvals": { |
| 802 | "Verified": "+1", |
| 803 | "Code-Review": "+2" |
| 804 | }, |
| 805 | "_account_id": 1000096, |
| 806 | "name": "John Doe", |
| 807 | "email": "john.doe@example.com" |
| 808 | }, |
| 809 | { |
| 810 | "kind": "gerritcodereview#reviewer", |
| 811 | "approvals": { |
| 812 | "Verified": " 0", |
| 813 | "Code-Review": "-1" |
| 814 | }, |
| 815 | "_account_id": 1000097, |
| 816 | "name": "Jane Roe", |
| 817 | "email": "jane.roe@example.com" |
| 818 | } |
| 819 | ] |
| 820 | ---- |
| 821 | |
| Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 822 | [[get-reviewer]] |
| 823 | GET /changes/\{change-id\}/reviewers/\{account-id\} (Get Reviewer) |
| 824 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 825 | Retrieves a reviewer of a change. |
| 826 | |
| 827 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 828 | describes the reviewer. |
| 829 | |
| 830 | .Request |
| 831 | ---- |
| 832 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 833 | ---- |
| 834 | |
| 835 | .Response |
| 836 | ---- |
| 837 | HTTP/1.1 200 OK |
| 838 | Content-Disposition: attachment |
| 839 | Content-Type: application/json;charset=UTF-8 |
| 840 | |
| 841 | )]}' |
| 842 | { |
| 843 | "kind": "gerritcodereview#reviewer", |
| 844 | "approvals": { |
| 845 | "Verified": "+1", |
| 846 | "Code-Review": "+2" |
| 847 | }, |
| 848 | "_account_id": 1000096, |
| 849 | "name": "John Doe", |
| 850 | "email": "john.doe@example.com" |
| 851 | } |
| 852 | ---- |
| 853 | |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 854 | [[add-reviewer]] |
| 855 | POST /changes/\{change-id\}/reviewers (Add Reviewer) |
| 856 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 857 | Adds one user or all members of one group as reviewer to the change. |
| 858 | |
| 859 | The reviewer to be added to the change must be provided in the request |
| 860 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 861 | |
| 862 | .Request |
| 863 | ---- |
| 864 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 865 | Content-Type: application/json;charset=UTF-8 |
| 866 | |
| 867 | { |
| 868 | "reviewer": "john.doe@example.com" |
| 869 | } |
| 870 | ---- |
| 871 | |
| 872 | As response an link:#add-reviewer-result[AddReviewerResult] entity is |
| 873 | returned that describes the newly added reviewers. |
| 874 | |
| 875 | .Response |
| 876 | ---- |
| 877 | HTTP/1.1 200 OK |
| 878 | Content-Disposition: attachment |
| 879 | Content-Type: application/json;charset=UTF-8 |
| 880 | |
| 881 | )]}' |
| 882 | { |
| 883 | "reviewers": [ |
| 884 | { |
| 885 | "kind": "gerritcodereview#reviewer", |
| 886 | "approvals": { |
| 887 | "Verified": " 0", |
| 888 | "Code-Review": " 0" |
| 889 | }, |
| 890 | "_account_id": 1000096, |
| 891 | "name": "John Doe", |
| 892 | "email": "john.doe@example.com" |
| 893 | } |
| 894 | ] |
| 895 | } |
| 896 | ---- |
| 897 | |
| 898 | If a group is specified, adding the group members as reviewers is an |
| 899 | atomic operation. This means if an error is returned, none of the |
| 900 | members are added as reviewer. |
| 901 | |
| 902 | If a group with many members is added as reviewer a confirmation may be |
| 903 | required. |
| 904 | |
| 905 | .Request |
| 906 | ---- |
| 907 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 908 | Content-Type: application/json;charset=UTF-8 |
| 909 | |
| 910 | { |
| 911 | "reviewer": "MyProjectVerifiers" |
| 912 | } |
| 913 | ---- |
| 914 | |
| 915 | .Response |
| 916 | ---- |
| 917 | HTTP/1.1 200 OK |
| 918 | Content-Disposition: attachment |
| 919 | Content-Type: application/json;charset=UTF-8 |
| 920 | |
| 921 | )]}' |
| 922 | { |
| 923 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 924 | "confirm": true |
| 925 | } |
| 926 | ---- |
| 927 | |
| 928 | To confirm the addition of the reviewers, resend the request with the |
| 929 | `confirm` flag being set. |
| 930 | |
| 931 | .Request |
| 932 | ---- |
| 933 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 934 | Content-Type: application/json;charset=UTF-8 |
| 935 | |
| 936 | { |
| 937 | "reviewer": "MyProjectVerifiers", |
| 938 | "confirm": true |
| 939 | } |
| 940 | ---- |
| 941 | |
| Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame^] | 942 | [[delete-reviewer]] |
| 943 | DELETE /changes/\{change-id\}/reviewers/\{account-id\} (Delete Reviewer) |
| 944 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 945 | Deletes a reviewer from a change. |
| 946 | |
| 947 | .Request |
| 948 | ---- |
| 949 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
| 950 | ---- |
| 951 | |
| 952 | .Response |
| 953 | ---- |
| 954 | HTTP/1.1 204 No Content |
| 955 | ---- |
| 956 | |
| Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 957 | |
| 958 | [[ids]] |
| 959 | IDs |
| 960 | --- |
| 961 | |
| Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 962 | [[account-id]] |
| 963 | link:rest-api-accounts.html#account-id[\{account-id\}] |
| 964 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 965 | -- |
| 966 | -- |
| 967 | |
| Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 968 | [[change-id]] |
| 969 | \{change-id\} |
| 970 | ~~~~~~~~~~~~~ |
| 971 | Identifier that uniquely identifies one change. |
| 972 | |
| 973 | This can be: |
| 974 | |
| 975 | * an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'", |
| 976 | where for the branch the `refs/heads/` prefix can be omitted |
| 977 | ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$") |
| 978 | * a Change-Id if it uniquely identifies one change |
| 979 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
| 980 | * a legacy numeric change ID ("4247") |
| 981 | |
| 982 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 983 | [[json-entities]] |
| 984 | JSON Entities |
| 985 | ------------- |
| 986 | |
| Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 987 | [[abandon-input]] |
| 988 | AbandonInput |
| 989 | ~~~~~~~~~~~~ |
| 990 | The `AbandonInput` entity contains information for abandoning a change. |
| 991 | |
| 992 | [options="header",width="50%",cols="1,^1,5"] |
| 993 | |=========================== |
| 994 | |Field Name ||Description |
| 995 | |`message` |optional| |
| 996 | Message to be added as review comment to the change when abandoning the |
| 997 | change. |
| 998 | |=========================== |
| 999 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1000 | [[account-info]] |
| 1001 | AccountInfo |
| 1002 | ~~~~~~~~~~~ |
| 1003 | The `AccountInfo` entity contains information about an account. |
| 1004 | |
| 1005 | [options="header",width="50%",cols="1,^1,5"] |
| 1006 | |=========================== |
| 1007 | |Field Name ||Description |
| 1008 | |`_account_id` ||The numeric ID of the account. |
| 1009 | |`name` |optional|The full name of the user. + |
| 1010 | Only set if link:#detailed-accounts[detailed account information] is |
| 1011 | requested. |
| 1012 | |`email` |optional| |
| 1013 | The email address the user prefers to be contacted through. + |
| 1014 | Only set if link:#detailed-accounts[detailed account information] is |
| 1015 | requested. |
| 1016 | |=========================== |
| 1017 | |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1018 | [[add-reviewer-result]] |
| 1019 | AddReviewerResult |
| 1020 | ~~~~~~~~~~~~~~~~~ |
| 1021 | The `AddReviewerResult` entity describes the result of adding a |
| 1022 | reviewer to a change. |
| 1023 | |
| 1024 | [options="header",width="50%",cols="1,^1,5"] |
| 1025 | |=========================== |
| 1026 | |Field Name ||Description |
| 1027 | |`reviewers` |optional| |
| 1028 | The newly added reviewers as a list of link:#reviewer-info[ |
| 1029 | ReviewerInfo] entities. |
| 1030 | |`error` |optional| |
| 1031 | Error message explaining why the reviewer could not be added. + |
| 1032 | If a group was specified in the input and an error is returned, it |
| 1033 | means that none of the members were added as reviewer. |
| 1034 | |`confirm` |`false` if not set| |
| 1035 | Whether adding the reviewer requires confirmation. |
| 1036 | |=========================== |
| 1037 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1038 | [[approval-info]] |
| 1039 | ApprovalInfo |
| 1040 | ~~~~~~~~~~~~ |
| 1041 | The `ApprovalInfo` entity contains information about an approval from a |
| 1042 | user for a label on a change. |
| 1043 | |
| 1044 | `ApprovalInfo` has the same fields as link:#account-info[AccountInfo]. |
| 1045 | In addition `ApprovalInfo` has the following fields: |
| 1046 | |
| 1047 | [options="header",width="50%",cols="1,^1,5"] |
| 1048 | |=========================== |
| 1049 | |Field Name ||Description |
| 1050 | |`value` ||The vote that the user has given for the label. |
| 1051 | |=========================== |
| 1052 | |
| 1053 | [[change-info]] |
| 1054 | ChangeInfo |
| 1055 | ~~~~~~~~~~ |
| 1056 | The `ChangeInfo` entity contains information about a change. |
| 1057 | |
| 1058 | [options="header",width="50%",cols="1,^1,5"] |
| 1059 | |================================== |
| 1060 | |Field Name ||Description |
| 1061 | |`kind` ||`gerritcodereview#change` |
| 1062 | |`id` || |
| 1063 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
| 1064 | where project, branch and Change-Id are URL encoded. For branch the |
| 1065 | `refs/heads/` prefix is omitted. |
| 1066 | |`project` ||The name of the project. |
| 1067 | |`branch` || |
| 1068 | The name of the target branch. + |
| 1069 | The `refs/heads/` prefix is omitted. |
| Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 1070 | |`topic` |optional|The topic to which this change belongs. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1071 | |`change_id` ||The Change-Id of the change. |
| 1072 | |`subject` || |
| 1073 | The subject of the change (header line of the commit message). |
| 1074 | |`status` || |
| 1075 | The status of the change (`NEW`, `SUBMITTED`, `MERGED`, `ABANDONED`, |
| 1076 | `DRAFT`). |
| 1077 | |`created` || |
| 1078 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 1079 | created. |
| 1080 | |`updated` || |
| 1081 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 1082 | updated. |
| 1083 | |`starred` |not set if `false`| |
| 1084 | Whether the calling user has starred this change. |
| 1085 | |`reviewed` |not set if `false`| |
| 1086 | Whether the change was reviewed by the calling user. |
| 1087 | |`mergeable` ||Whether the change is mergeable. |
| 1088 | |`_sortkey` ||The sortkey of the change. |
| 1089 | |`_number` ||The legacy numeric ID of the change. |
| 1090 | |`owner` || |
| 1091 | The owner of the change as an link:#account-info[AccountInfo] entity. |
| 1092 | |`labels` |optional| |
| 1093 | The labels of the change as a map that maps the label names to |
| 1094 | link:#label-info[LabelInfo] entries. + |
| 1095 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 1096 | labels] are requested. |
| 1097 | |`permitted_labels` |optional| |
| 1098 | A map of the permitted labels that maps a label name to the list of |
| 1099 | values that are allowed for that label. + |
| 1100 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1101 | |`removable_reviewers`|optional| |
| 1102 | The reviewers that can be removed by the calling user as a list of |
| 1103 | link:#account-info[AccountInfo] entities. + |
| 1104 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1105 | |`current_revision` |optional| |
| 1106 | The commit ID of the current patch set of this change. + |
| 1107 | Only set if link:#current-revision[the current revision] is requested |
| 1108 | or if link:#all-revisions[all revisions] are requested. |
| 1109 | |`revisions` |optional| |
| 1110 | All patch sets of this changes as a map that maps the commit ID of the |
| 1111 | patch set to a link:#revision-info[RevisionInfo] entity. + |
| 1112 | Only set if link:#all-revisions[all revisions] are requested. |
| 1113 | |`_more_changes` |optional, not set if `false`| |
| 1114 | Whether the query would deliver more results if not limited. + |
| 1115 | Only set on either the last or the first change that is returned. |
| 1116 | |================================== |
| 1117 | |
| 1118 | [[commit-info]] |
| 1119 | CommitInfo |
| 1120 | ~~~~~~~~~~ |
| 1121 | The `CommitInfo` entity contains information about a commit. |
| 1122 | |
| 1123 | [options="header",width="50%",cols="1,6"] |
| 1124 | |========================== |
| 1125 | |Field Name |Description |
| 1126 | |`commit` |The commit ID. |
| 1127 | |`parent` | |
| 1128 | The parent commits of this commit as a list of |
| 1129 | link:#commit-info[CommitInfo] entities. |
| 1130 | |`author` |The author of the commit as a |
| 1131 | link:#git-person-info[GitPersonInfo] entity. |
| 1132 | |`committer` |The committer of the commit as a |
| 1133 | link:#git-person-info[GitPersonInfo] entity. |
| 1134 | |`subject` | |
| 1135 | The subject of the commit (header line of the commit message). |
| 1136 | |`message` |The commit message. |
| 1137 | |========================== |
| 1138 | |
| 1139 | [[fetch-info]] |
| 1140 | FetchInfo |
| 1141 | ~~~~~~~~~ |
| 1142 | The `FetchInfo` entity contains information about how to fetch a patch |
| 1143 | set via a certain protocol. |
| 1144 | |
| 1145 | [options="header",width="50%",cols="1,6"] |
| 1146 | |========================== |
| 1147 | |Field Name |Description |
| 1148 | |`url` |The URL of the project. |
| 1149 | |`ref` |The ref of the patch set. |
| 1150 | |========================== |
| 1151 | |
| 1152 | [[file-info]] |
| 1153 | FileInfo |
| 1154 | ~~~~~~~~ |
| 1155 | The `FileInfo` entity contains information about a file in a patch set. |
| 1156 | |
| 1157 | [options="header",width="50%",cols="1,^1,5"] |
| 1158 | |============================= |
| 1159 | |Field Name ||Description |
| 1160 | |`status` |optional| |
| 1161 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 1162 | "`C`"=Copied, "`W`"=Rewritten). + |
| 1163 | Not set if the file was Modified ("`M`"). |
| 1164 | |`binary` |not set if `false`|Whether the file is binary. |
| 1165 | |`old_path` |optional| |
| 1166 | The old file path. + |
| 1167 | Only set if file was renamed or copied. |
| 1168 | |`lines_inserted`|optional| |
| 1169 | Number of inserted lines. + |
| 1170 | Not set for binary files or if no lines were inserted. |
| 1171 | |`lines_deleted` |optional| |
| 1172 | Number of deleted lines. + |
| 1173 | Not set for binary files or if no lines were deleted. |
| 1174 | |============================= |
| 1175 | |
| 1176 | [[git-person-info]] |
| 1177 | GitPersonInfo |
| 1178 | ~~~~~~~~~~~~~ |
| 1179 | The `GitPersonInfo` entity contains information about the |
| 1180 | author/committer of a commit. |
| 1181 | |
| 1182 | [options="header",width="50%",cols="1,6"] |
| 1183 | |========================== |
| 1184 | |Field Name |Description |
| 1185 | |`name` |The name of the author/committer. |
| 1186 | |`email` |The email address of the author/committer. |
| 1187 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 1188 | this identity was constructed. |
| 1189 | |`tz` |The timezone offset from UTC of when this identity was |
| 1190 | constructed. |
| 1191 | |========================== |
| 1192 | |
| 1193 | [[label-info]] |
| 1194 | LabelInfo |
| 1195 | ~~~~~~~~~ |
| 1196 | The `LabelInfo` entity contains information about a label on a change. |
| 1197 | |
| 1198 | [options="header",width="50%",cols="1,^1,5"] |
| 1199 | |=========================== |
| 1200 | |Field Name ||Description |
| 1201 | |`approved` |optional|The user who approved this label on the change |
| 1202 | as a link:#account-info[AccountInfo] entity. + |
| 1203 | Only set if link:#labels[labels] are requested. |
| 1204 | |`rejected` |optional|The user who rejected this label on the change |
| 1205 | as a link:#account-info[AccountInfo] entity. + |
| 1206 | Only set if link:#labels[labels] are requested. |
| 1207 | |`recommended` |optional|The user who recommended this label on the |
| 1208 | change as a link:#account-info[AccountInfo] entity. + |
| 1209 | Only set if link:#labels[labels] are requested. |
| 1210 | |`disliked` |optional|The user who disliked this label on the change |
| 1211 | as a link:#account-info[AccountInfo] entity. + |
| 1212 | Only set if link:#labels[labels] are requested. |
| 1213 | |`value` |optional|The voting value of the user who |
| 1214 | recommended/disliked this label on the change if it is not |
| 1215 | "`+1`"/"`-1`". + |
| 1216 | Only set if link:#labels[labels] are requested. |
| 1217 | |`optional` |not set if `false`| |
| 1218 | Whether the label is optional. Optional means the label may be set, but |
| 1219 | it's neither necessary for submission nor does it block submission if |
| 1220 | set. |
| 1221 | |`all` |optional|List of all approvals for this label as a list |
| 1222 | of link:#approval-info[ApprovalInfo] entities. + |
| 1223 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1224 | |`values` |optional|A map of all values that are allowed for this |
| 1225 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
| 1226 | to the value descriptions. + |
| 1227 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1228 | |=========================== |
| 1229 | |
| Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1230 | [[restore-input]] |
| 1231 | RestoreInput |
| 1232 | ~~~~~~~~~~~~ |
| 1233 | The `RestoreInput` entity contains information for restoring a change. |
| 1234 | |
| 1235 | [options="header",width="50%",cols="1,^1,5"] |
| 1236 | |=========================== |
| 1237 | |Field Name ||Description |
| 1238 | |`message` |optional| |
| 1239 | Message to be added as review comment to the change when restoring the |
| 1240 | change. |
| 1241 | |=========================== |
| 1242 | |
| Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1243 | [[revert-input]] |
| 1244 | RevertInput |
| 1245 | ~~~~~~~~~~~ |
| 1246 | The `RevertInput` entity contains information for reverting a change. |
| 1247 | |
| 1248 | [options="header",width="50%",cols="1,^1,5"] |
| 1249 | |=========================== |
| 1250 | |Field Name ||Description |
| 1251 | |`message` |optional| |
| 1252 | Message to be added as review comment to the change when reverting the |
| 1253 | change. |
| 1254 | |=========================== |
| 1255 | |
| Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 1256 | [[reviewer-info]] |
| 1257 | ReviewerInfo |
| 1258 | ~~~~~~~~~~~~ |
| 1259 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 1260 | votes on a change. |
| 1261 | |
| 1262 | `ReviewerInfo` has the same fields as link:#account-info[AccountInfo] |
| 1263 | and includes link:#detailed-accounts[detailed account information]. |
| 1264 | In addition `ReviewerInfo` has the following fields: |
| 1265 | |
| 1266 | [options="header",width="50%",cols="1,6"] |
| 1267 | |========================== |
| 1268 | |Field Name |Description |
| 1269 | |`kind` |`gerritcodereview#reviewer` |
| 1270 | |`approvals` | |
| 1271 | The approvals of the reviewer as a map that maps the label names to the |
| 1272 | approval values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`"). |
| 1273 | |========================== |
| 1274 | |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1275 | [[reviewer-input]] |
| 1276 | ReviewerInput |
| 1277 | ~~~~~~~~~~~~~ |
| 1278 | The `ReviewerInput` entity contains information for adding a reviewer |
| 1279 | to a change. |
| 1280 | |
| 1281 | [options="header",width="50%",cols="1,^1,5"] |
| 1282 | |=========================== |
| 1283 | |Field Name ||Description |
| 1284 | |`reviewer` || |
| 1285 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 1286 | should be added as reviewer or the link:rest-api-groups.html#group-id[ |
| 1287 | ID] of one group for which all members should be added as reviewers. + |
| 1288 | If an ID identifies both an account and a group, only the account is |
| 1289 | added as reviewer to the change. |
| 1290 | |`confirmed` |optional| |
| 1291 | Whether adding the reviewer is confirmed. + |
| 1292 | The Gerrit server may be configured to |
| 1293 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 1294 | confirmation] when adding a group as reviewer that has many members. |
| 1295 | |=========================== |
| 1296 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1297 | [[revision-info]] |
| 1298 | RevisionInfo |
| 1299 | ~~~~~~~~~~~~ |
| 1300 | The `RevisionInfo` entity contains information about a patch set. |
| 1301 | |
| 1302 | [options="header",width="50%",cols="1,^1,5"] |
| 1303 | |=========================== |
| 1304 | |Field Name ||Description |
| 1305 | |`draft` |not set if `false`|Whether the patch set is a draft. |
| 1306 | |`_number` ||The patch set number. |
| 1307 | |`fetch` || |
| 1308 | Information about how to fetch this patch set. The fetch information is |
| 1309 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 1310 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
| 1311 | |`commit` ||The commit of the patch set as |
| 1312 | link:#commit-info[CommitInfo] entity. |
| 1313 | |`files` || |
| 1314 | The files of the patch set as a map that maps the file names to |
| 1315 | link:#file-info[FileInfo] entities. |
| 1316 | |=========================== |
| 1317 | |
| Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1318 | [[submit-input]] |
| 1319 | SubmitInput |
| 1320 | ~~~~~~~~~~~ |
| 1321 | The `SubmitInput` entity contains information for submitting a change. |
| 1322 | |
| 1323 | [options="header",width="50%",cols="1,^1,5"] |
| 1324 | |=========================== |
| 1325 | |Field Name ||Description |
| 1326 | |`wait_for_merge`|`false` if not set| |
| 1327 | Whether the request should wait for the merge to complete. + |
| 1328 | If `false` the request returns immediately after the change has been |
| 1329 | added to the merge queue and the caller can't know whether the change |
| 1330 | could be merged successfully. |
| 1331 | |=========================== |
| 1332 | |
| Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1333 | [[topic-input]] |
| 1334 | TopicInput |
| 1335 | ~~~~~~~~~~ |
| 1336 | The `TopicInput` entity contains information for setting a topic. |
| 1337 | |
| 1338 | [options="header",width="50%",cols="1,^1,5"] |
| 1339 | |=========================== |
| 1340 | |Field Name ||Description |
| 1341 | |`topic` |optional|The topic. + |
| 1342 | The topic will be deleted if not set. |
| 1343 | |`message` |optional| |
| 1344 | Message to be added as review comment to the change when setting the |
| 1345 | topic. |
| 1346 | |=========================== |
| 1347 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 1348 | |
| 1349 | GERRIT |
| 1350 | ------ |
| 1351 | Part of link:index.html[Gerrit Code Review] |