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 | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 957 | [[revision-endpoints]] |
| 958 | Revision Endpoints |
| 959 | ------------------ |
| 960 | |
| 961 | [[get-review]] |
| 962 | GET /changes/\{change-id\}/revisions/\{revision-id\}/review (Get Review) |
| 963 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 964 | Retrieves a review of a revision. |
| 965 | |
| 966 | .Request |
| 967 | ---- |
| 968 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 969 | ---- |
| 970 | |
| 971 | As response a link:#change-info[ChangeInfo] entity with |
| 972 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 973 | detailed accounts] is returned that describes the review of the |
| 974 | revision. The revision for which the review is retrieved is contained |
| 975 | in the `revisions` field. In addition the `current_revision` field is |
| 976 | set, if the revision for which the review is retrieved, is the current |
| 977 | revision of the change. Please note that the returned labels are always |
| 978 | for the current patch set. |
| 979 | |
| 980 | .Response |
| 981 | ---- |
| 982 | HTTP/1.1 200 OK |
| 983 | Content-Disposition: attachment |
| 984 | Content-Type: application/json;charset=UTF-8 |
| 985 | |
| 986 | )]}' |
| 987 | { |
| 988 | "kind": "gerritcodereview#change", |
| 989 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 990 | "project": "myProject", |
| 991 | "branch": "master", |
| 992 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 993 | "subject": "Implementing Feature X", |
| 994 | "status": "NEW", |
| 995 | "created": "2013-02-01 09:59:32.126000000", |
| 996 | "updated": "2013-02-21 11:16:36.775000000", |
| 997 | "reviewed": true, |
| 998 | "mergeable": true, |
| 999 | "_sortkey": "0023412400000f7d", |
| 1000 | "_number": 3965, |
| 1001 | "owner": { |
| 1002 | "_account_id": 1000096, |
| 1003 | "name": "John Doe", |
| 1004 | "email": "john.doe@example.com" |
| 1005 | }, |
| 1006 | "labels": { |
| 1007 | "Verified": { |
| 1008 | "all": [ |
| 1009 | { |
| 1010 | "value": 0, |
| 1011 | "_account_id": 1000096, |
| 1012 | "name": "John Doe", |
| 1013 | "email": "john.doe@example.com" |
| 1014 | }, |
| 1015 | { |
| 1016 | "value": 0, |
| 1017 | "_account_id": 1000097, |
| 1018 | "name": "Jane Roe", |
| 1019 | "email": "jane.roe@example.com" |
| 1020 | } |
| 1021 | ], |
| 1022 | "values": { |
| 1023 | "-1": "Fails", |
| 1024 | " 0": "No score", |
| 1025 | "+1": "Verified" |
| 1026 | } |
| 1027 | }, |
| 1028 | "Code-Review": { |
| 1029 | "all": [ |
| 1030 | { |
| 1031 | "value": -1, |
| 1032 | "_account_id": 1000096, |
| 1033 | "name": "John Doe", |
| 1034 | "email": "john.doe@example.com" |
| 1035 | }, |
| 1036 | { |
| 1037 | "value": 1, |
| 1038 | "_account_id": 1000097, |
| 1039 | "name": "Jane Roe", |
| 1040 | "email": "jane.roe@example.com" |
| 1041 | } |
| 1042 | ] |
| 1043 | "values": { |
| 1044 | "-2": "Do not submit", |
| 1045 | "-1": "I would prefer that you didn\u0027t submit this", |
| 1046 | " 0": "No score", |
| 1047 | "+1": "Looks good to me, but someone else must approve", |
| 1048 | "+2": "Looks good to me, approved" |
| 1049 | } |
| 1050 | } |
| 1051 | }, |
| 1052 | "permitted_labels": { |
| 1053 | "Verified": [ |
| 1054 | "-1", |
| 1055 | " 0", |
| 1056 | "+1" |
| 1057 | ], |
| 1058 | "Code-Review": [ |
| 1059 | "-2", |
| 1060 | "-1", |
| 1061 | " 0", |
| 1062 | "+1", |
| 1063 | "+2" |
| 1064 | ] |
| 1065 | }, |
| 1066 | "removable_reviewers": [ |
| 1067 | { |
| 1068 | "_account_id": 1000096, |
| 1069 | "name": "John Doe", |
| 1070 | "email": "john.doe@example.com" |
| 1071 | }, |
| 1072 | { |
| 1073 | "_account_id": 1000097, |
| 1074 | "name": "Jane Roe", |
| 1075 | "email": "jane.roe@example.com" |
| 1076 | } |
| 1077 | ], |
| 1078 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 1079 | "revisions": { |
| 1080 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
| 1081 | "_number": 2, |
| 1082 | "fetch": { |
| 1083 | "http": { |
| 1084 | "url": "http://gerrit/myProject", |
| 1085 | "ref": "refs/changes/65/3965/2" |
| 1086 | } |
| 1087 | } |
| 1088 | } |
| 1089 | } |
| 1090 | ---- |
| 1091 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1092 | [[set-review]] |
| 1093 | POST /changes/\{change-id\}/revisions/\{revision-id\}/review (Set Review) |
| 1094 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1095 | Sets a review on a revision. |
| 1096 | |
| 1097 | The review must be provided in the request body as a |
| 1098 | link:#review-input[ReviewInput] entity. |
| 1099 | |
| 1100 | .Request |
| 1101 | ---- |
| 1102 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 1103 | Content-Type: application/json;charset=UTF-8 |
| 1104 | |
| 1105 | { |
| 1106 | "message": "Some nits need to be fixed.", |
| 1107 | "labels": { |
| 1108 | "Code-Review": -1 |
| 1109 | }, |
| 1110 | "comments": { |
| 1111 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1112 | { |
| 1113 | "line": 23, |
| 1114 | "message": "[nit] trailing whitespace" |
| 1115 | }, |
| 1116 | { |
| 1117 | "line": 49, |
| 1118 | "message": "[nit] s/conrtol/control" |
| 1119 | } |
| 1120 | ] |
| 1121 | } |
| 1122 | } |
| 1123 | ---- |
| 1124 | |
| 1125 | As response a link:#review-info[ReviewInfo] entity is returned that |
| 1126 | describes the applied labels. |
| 1127 | |
| 1128 | .Response |
| 1129 | ---- |
| 1130 | HTTP/1.1 200 OK |
| 1131 | Content-Disposition: attachment |
| 1132 | Content-Type: application/json;charset=UTF-8 |
| 1133 | |
| 1134 | )]}' |
| 1135 | { |
| 1136 | "labels": { |
| 1137 | "Code-Review": -1 |
| 1138 | } |
| 1139 | } |
| 1140 | ---- |
| 1141 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 1142 | [[submit-revision]] |
| 1143 | POST /changes/\{change-id\}/revisions/\{revision-id\}/submit (Submit Revision) |
| 1144 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1145 | Submits a revision. |
| 1146 | |
| 1147 | The request body only needs to include a link:#submit-input[ |
| 1148 | SubmitInput] entity if the request should wait for the merge to |
| 1149 | complete. |
| 1150 | |
| 1151 | .Request |
| 1152 | ---- |
| 1153 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
| 1154 | Content-Type: application/json;charset=UTF-8 |
| 1155 | |
| 1156 | { |
| 1157 | "wait_for_merge": true |
| 1158 | } |
| 1159 | ---- |
| 1160 | |
| 1161 | As response a link:#submit-info[SubmitInfo] entity is returned that |
| 1162 | describes the status of the submitted change. |
| 1163 | |
| 1164 | .Response |
| 1165 | ---- |
| 1166 | HTTP/1.1 200 OK |
| 1167 | Content-Disposition: attachment |
| 1168 | Content-Type: application/json;charset=UTF-8 |
| 1169 | |
| 1170 | )]}' |
| 1171 | { |
| 1172 | "status": "MERGED" |
| 1173 | } |
| 1174 | ---- |
| 1175 | |
| 1176 | If the revision cannot be submitted, e.g. because the submit rule |
| 1177 | doesn't allow submitting the revision or the revision is not the |
| 1178 | current revision, the response is "`409 Conflict`" and the error |
| 1179 | message is contained in the response body. |
| 1180 | |
| 1181 | .Response |
| 1182 | ---- |
| 1183 | HTTP/1.1 409 Conflict |
| 1184 | Content-Type: text/plain;charset=UTF-8 |
| 1185 | |
| 1186 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 1187 | ---- |
| 1188 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1189 | [[list-drafts]] |
| 1190 | GET /changes/\{change-id\}/revisions/\{revision-id\}/drafts/ (List Drafts) |
| 1191 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1192 | Lists the draft comments of a revision that belong to the calling |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1193 | user. |
| 1194 | |
| 1195 | As result a map is returned that maps the file path to a list of |
| 1196 | link:#comment-info[CommentInfo] entries. The entries in the map are |
| 1197 | sorted by file path. |
| 1198 | |
| 1199 | .Request |
| 1200 | ---- |
| 1201 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 1202 | ---- |
| 1203 | |
| 1204 | .Response |
| 1205 | ---- |
| 1206 | HTTP/1.1 200 OK |
| 1207 | Content-Disposition: attachment |
| 1208 | Content-Type: application/json;charset=UTF-8 |
| 1209 | |
| 1210 | )]}' |
| 1211 | { |
| 1212 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1213 | { |
| 1214 | "kind": "gerritcodereview#comment", |
| 1215 | "id": "TvcXrmjM", |
| 1216 | "line": 23, |
| 1217 | "message": "[nit] trailing whitespace", |
| 1218 | "updated": "2013-02-26 15:40:43.986000000" |
| 1219 | }, |
| 1220 | { |
| 1221 | "kind": "gerritcodereview#comment", |
| 1222 | "id": "TveXwFiA", |
| 1223 | "line": 49, |
| 1224 | "in_reply_to": "TfYX-Iuo", |
| 1225 | "message": "Done", |
| 1226 | "updated": "2013-02-26 15:40:45.328000000" |
| 1227 | } |
| 1228 | ] |
| 1229 | } |
| 1230 | ---- |
| 1231 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1232 | [[create-draft]] |
| 1233 | PUT /changes/\{change-id\}/revisions/\{revision-id\}/drafts (Create Draft) |
| 1234 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1235 | Creates a draft comment on a revision. |
| 1236 | |
| 1237 | The new draft comment must be provided in the request body inside a |
| 1238 | link:#comment-input[CommentInput] entity. |
| 1239 | |
| 1240 | .Request |
| 1241 | ---- |
| 1242 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
| 1243 | Content-Type: application/json;charset=UTF-8 |
| 1244 | |
| 1245 | { |
| 1246 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1247 | "line": 23, |
| 1248 | "message": "[nit] trailing whitespace" |
| 1249 | } |
| 1250 | ---- |
| 1251 | |
| 1252 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1253 | describes the draft comment. |
| 1254 | |
| 1255 | .Response |
| 1256 | ---- |
| 1257 | HTTP/1.1 200 OK |
| 1258 | Content-Disposition: attachment |
| 1259 | Content-Type: application/json;charset=UTF-8 |
| 1260 | |
| 1261 | )]}' |
| 1262 | { |
| 1263 | "kind": "gerritcodereview#comment", |
| 1264 | "id": "TvcXrmjM", |
| 1265 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1266 | "line": 23, |
| 1267 | "message": "[nit] trailing whitespace", |
| 1268 | "updated": "2013-02-26 15:40:43.986000000" |
| 1269 | } |
| 1270 | ---- |
| 1271 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1272 | [[get-draft]] |
| 1273 | GET /changes/\{change-id\}/revisions/\{revision-id\}/drafts/\{draft-id\} (Get Draft) |
| 1274 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1275 | Retrieves a draft comment of a revision that belongs to the calling |
| 1276 | user. |
| 1277 | |
| 1278 | .Request |
| 1279 | ---- |
| 1280 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1281 | ---- |
| 1282 | |
| 1283 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1284 | describes the draft comment. |
| 1285 | |
| 1286 | .Response |
| 1287 | ---- |
| 1288 | HTTP/1.1 200 OK |
| 1289 | Content-Disposition: attachment |
| 1290 | Content-Type: application/json;charset=UTF-8 |
| 1291 | |
| 1292 | )]}' |
| 1293 | { |
| 1294 | "kind": "gerritcodereview#comment", |
| 1295 | "id": "TvcXrmjM", |
| 1296 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1297 | "line": 23, |
| 1298 | "message": "[nit] trailing whitespace", |
| 1299 | "updated": "2013-02-26 15:40:43.986000000" |
| 1300 | } |
| 1301 | ---- |
| 1302 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1303 | [[update-draft]] |
| 1304 | PUT /changes/\{change-id\}/revisions/\{revision-id\}/drafts/\{draft-id\} (Update Draft) |
| 1305 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1306 | Updates a draft comment on a revision. |
| 1307 | |
| 1308 | The new draft comment must be provided in the request body inside a |
| 1309 | link:#comment-input[CommentInput] entity. |
| 1310 | |
| 1311 | .Request |
| 1312 | ---- |
| 1313 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1314 | Content-Type: application/json;charset=UTF-8 |
| 1315 | |
| 1316 | { |
| 1317 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1318 | "line": 23, |
| 1319 | "message": "[nit] trailing whitespace" |
| 1320 | } |
| 1321 | ---- |
| 1322 | |
| 1323 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1324 | describes the draft comment. |
| 1325 | |
| 1326 | .Response |
| 1327 | ---- |
| 1328 | HTTP/1.1 200 OK |
| 1329 | Content-Disposition: attachment |
| 1330 | Content-Type: application/json;charset=UTF-8 |
| 1331 | |
| 1332 | )]}' |
| 1333 | { |
| 1334 | "kind": "gerritcodereview#comment", |
| 1335 | "id": "TvcXrmjM", |
| 1336 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1337 | "line": 23, |
| 1338 | "message": "[nit] trailing whitespace", |
| 1339 | "updated": "2013-02-26 15:40:43.986000000" |
| 1340 | } |
| 1341 | ---- |
| 1342 | |
| 1343 | [[delete-draft]] |
| 1344 | DELETE /changes/\{change-id\}/revisions/\{revision-id\}/drafts/\{draft-id\} (Delete Draft) |
| 1345 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1346 | Deletes a draft comment from a revision. |
| 1347 | |
| 1348 | .Request |
| 1349 | ---- |
| 1350 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1351 | ---- |
| 1352 | |
| 1353 | .Response |
| 1354 | ---- |
| 1355 | HTTP/1.1 204 No Content |
| 1356 | ---- |
| 1357 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame^] | 1358 | [[set-reviewed]] |
| 1359 | PUT /changes/\{change-id\}/revisions/\{revision-id\}/files/\{patch-id\}\reviewed (Set Reviewed) |
| 1360 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1361 | Marks a patch of a revision as reviewed by the calling user. |
| 1362 | |
| 1363 | .Request |
| 1364 | ---- |
| 1365 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 1366 | ---- |
| 1367 | |
| 1368 | .Response |
| 1369 | ---- |
| 1370 | HTTP/1.1 201 Created |
| 1371 | ---- |
| 1372 | |
| 1373 | If the patch was already marked as reviewed by the calling user the |
| 1374 | response is "`200 OK`". |
| 1375 | |
| 1376 | [[delete-reviewed]] |
| 1377 | DELETE /changes/\{change-id\}/revisions/\{revision-id\}/files/\{patch-id\}\reviewed (Delete Reviewed) |
| 1378 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1379 | Deletes the reviewed flag of the calling user from a patch of a revision. |
| 1380 | |
| 1381 | .Request |
| 1382 | ---- |
| 1383 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 1384 | ---- |
| 1385 | |
| 1386 | .Response |
| 1387 | ---- |
| 1388 | HTTP/1.1 204 No Content |
| 1389 | ---- |
| 1390 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 1391 | |
| 1392 | [[ids]] |
| 1393 | IDs |
| 1394 | --- |
| 1395 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 1396 | [[account-id]] |
| 1397 | link:rest-api-accounts.html#account-id[\{account-id\}] |
| 1398 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1399 | -- |
| 1400 | -- |
| 1401 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 1402 | [[change-id]] |
| 1403 | \{change-id\} |
| 1404 | ~~~~~~~~~~~~~ |
| 1405 | Identifier that uniquely identifies one change. |
| 1406 | |
| 1407 | This can be: |
| 1408 | |
| 1409 | * an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'", |
| 1410 | where for the branch the `refs/heads/` prefix can be omitted |
| 1411 | ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$") |
| 1412 | * a Change-Id if it uniquely identifies one change |
| 1413 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
| 1414 | * a legacy numeric change ID ("4247") |
| 1415 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1416 | [[draft-id]] |
| 1417 | \{draft-id\} |
| 1418 | ~~~~~~~~~~~~ |
| 1419 | UUID of a draft comment. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 1420 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame^] | 1421 | [[patch-id]] |
| 1422 | \{patch-id\} |
| 1423 | ~~~~~~~~~~~~ |
| 1424 | The file path of the patch. |
| 1425 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1426 | [[revision-id]] |
| 1427 | \{revision-id\} |
| 1428 | ~~~~~~~~~~~~~~~ |
| 1429 | Identifier that uniquely identifies one revision of a change. |
| 1430 | |
| 1431 | This can be: |
| 1432 | |
| 1433 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 1434 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 1435 | change ("674ac754"), at least 4 digits are required |
| 1436 | * a legacy numeric patch number ("1" for first patch set of the change) |
| 1437 | |
| 1438 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1439 | [[json-entities]] |
| 1440 | JSON Entities |
| 1441 | ------------- |
| 1442 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1443 | [[abandon-input]] |
| 1444 | AbandonInput |
| 1445 | ~~~~~~~~~~~~ |
| 1446 | The `AbandonInput` entity contains information for abandoning a change. |
| 1447 | |
| 1448 | [options="header",width="50%",cols="1,^1,5"] |
| 1449 | |=========================== |
| 1450 | |Field Name ||Description |
| 1451 | |`message` |optional| |
| 1452 | Message to be added as review comment to the change when abandoning the |
| 1453 | change. |
| 1454 | |=========================== |
| 1455 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1456 | [[account-info]] |
| 1457 | AccountInfo |
| 1458 | ~~~~~~~~~~~ |
| 1459 | The `AccountInfo` entity contains information about an account. |
| 1460 | |
| 1461 | [options="header",width="50%",cols="1,^1,5"] |
| 1462 | |=========================== |
| 1463 | |Field Name ||Description |
| 1464 | |`_account_id` ||The numeric ID of the account. |
| 1465 | |`name` |optional|The full name of the user. + |
| 1466 | Only set if link:#detailed-accounts[detailed account information] is |
| 1467 | requested. |
| 1468 | |`email` |optional| |
| 1469 | The email address the user prefers to be contacted through. + |
| 1470 | Only set if link:#detailed-accounts[detailed account information] is |
| 1471 | requested. |
| 1472 | |=========================== |
| 1473 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1474 | [[add-reviewer-result]] |
| 1475 | AddReviewerResult |
| 1476 | ~~~~~~~~~~~~~~~~~ |
| 1477 | The `AddReviewerResult` entity describes the result of adding a |
| 1478 | reviewer to a change. |
| 1479 | |
| 1480 | [options="header",width="50%",cols="1,^1,5"] |
| 1481 | |=========================== |
| 1482 | |Field Name ||Description |
| 1483 | |`reviewers` |optional| |
| 1484 | The newly added reviewers as a list of link:#reviewer-info[ |
| 1485 | ReviewerInfo] entities. |
| 1486 | |`error` |optional| |
| 1487 | Error message explaining why the reviewer could not be added. + |
| 1488 | If a group was specified in the input and an error is returned, it |
| 1489 | means that none of the members were added as reviewer. |
| 1490 | |`confirm` |`false` if not set| |
| 1491 | Whether adding the reviewer requires confirmation. |
| 1492 | |=========================== |
| 1493 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1494 | [[approval-info]] |
| 1495 | ApprovalInfo |
| 1496 | ~~~~~~~~~~~~ |
| 1497 | The `ApprovalInfo` entity contains information about an approval from a |
| 1498 | user for a label on a change. |
| 1499 | |
| 1500 | `ApprovalInfo` has the same fields as link:#account-info[AccountInfo]. |
| 1501 | In addition `ApprovalInfo` has the following fields: |
| 1502 | |
| 1503 | [options="header",width="50%",cols="1,^1,5"] |
| 1504 | |=========================== |
| 1505 | |Field Name ||Description |
| 1506 | |`value` ||The vote that the user has given for the label. |
| 1507 | |=========================== |
| 1508 | |
| 1509 | [[change-info]] |
| 1510 | ChangeInfo |
| 1511 | ~~~~~~~~~~ |
| 1512 | The `ChangeInfo` entity contains information about a change. |
| 1513 | |
| 1514 | [options="header",width="50%",cols="1,^1,5"] |
| 1515 | |================================== |
| 1516 | |Field Name ||Description |
| 1517 | |`kind` ||`gerritcodereview#change` |
| 1518 | |`id` || |
| 1519 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
| 1520 | where project, branch and Change-Id are URL encoded. For branch the |
| 1521 | `refs/heads/` prefix is omitted. |
| 1522 | |`project` ||The name of the project. |
| 1523 | |`branch` || |
| 1524 | The name of the target branch. + |
| 1525 | The `refs/heads/` prefix is omitted. |
Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 1526 | |`topic` |optional|The topic to which this change belongs. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1527 | |`change_id` ||The Change-Id of the change. |
| 1528 | |`subject` || |
| 1529 | The subject of the change (header line of the commit message). |
| 1530 | |`status` || |
| 1531 | The status of the change (`NEW`, `SUBMITTED`, `MERGED`, `ABANDONED`, |
| 1532 | `DRAFT`). |
| 1533 | |`created` || |
| 1534 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 1535 | created. |
| 1536 | |`updated` || |
| 1537 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 1538 | updated. |
| 1539 | |`starred` |not set if `false`| |
| 1540 | Whether the calling user has starred this change. |
| 1541 | |`reviewed` |not set if `false`| |
| 1542 | Whether the change was reviewed by the calling user. |
| 1543 | |`mergeable` ||Whether the change is mergeable. |
| 1544 | |`_sortkey` ||The sortkey of the change. |
| 1545 | |`_number` ||The legacy numeric ID of the change. |
| 1546 | |`owner` || |
| 1547 | The owner of the change as an link:#account-info[AccountInfo] entity. |
| 1548 | |`labels` |optional| |
| 1549 | The labels of the change as a map that maps the label names to |
| 1550 | link:#label-info[LabelInfo] entries. + |
| 1551 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 1552 | labels] are requested. |
| 1553 | |`permitted_labels` |optional| |
| 1554 | A map of the permitted labels that maps a label name to the list of |
| 1555 | values that are allowed for that label. + |
| 1556 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1557 | |`removable_reviewers`|optional| |
| 1558 | The reviewers that can be removed by the calling user as a list of |
| 1559 | link:#account-info[AccountInfo] entities. + |
| 1560 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1561 | |`current_revision` |optional| |
| 1562 | The commit ID of the current patch set of this change. + |
| 1563 | Only set if link:#current-revision[the current revision] is requested |
| 1564 | or if link:#all-revisions[all revisions] are requested. |
| 1565 | |`revisions` |optional| |
| 1566 | All patch sets of this changes as a map that maps the commit ID of the |
| 1567 | patch set to a link:#revision-info[RevisionInfo] entity. + |
| 1568 | Only set if link:#all-revisions[all revisions] are requested. |
| 1569 | |`_more_changes` |optional, not set if `false`| |
| 1570 | Whether the query would deliver more results if not limited. + |
| 1571 | Only set on either the last or the first change that is returned. |
| 1572 | |================================== |
| 1573 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1574 | [[comment-info]] |
| 1575 | CommentInfo |
| 1576 | ~~~~~~~~~~~ |
| 1577 | The `CommitInfo` entity contains information about an inline comment. |
| 1578 | |
| 1579 | [options="header",width="50%",cols="1,^1,5"] |
| 1580 | |=========================== |
| 1581 | |Field Name ||Description |
| 1582 | |`kind` ||`gerritcodereview#comment` |
| 1583 | |`id` ||The URL encoded UUID of the draft comment. |
| 1584 | |`path` |optional| |
| 1585 | The path of the file for which the inline comment was done. + |
| 1586 | Not set if returned in a map where the key is the file path. |
| 1587 | |`side` |optional| |
| 1588 | The side on which the comment was added. + |
| 1589 | Allowed values are `REVISION` and `PARENT`. + |
| 1590 | If not set, the default is `REVISION`. |
| 1591 | |`line` |optional| |
| 1592 | The number of the line for which the comment was done. + |
| 1593 | If not set, it's a file comment. |
| 1594 | |`in_reply_to` |optional| |
| 1595 | The URL encoded UUID of the comment to which this comment is a reply. |
| 1596 | |`message` |optional|The comment message. |
| 1597 | |`updated` || |
| 1598 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 1599 | written. |
| 1600 | |=========================== |
| 1601 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1602 | [[comment-input]] |
| 1603 | CommentInput |
| 1604 | ~~~~~~~~~~~~ |
| 1605 | The `CommitInput` entity contains information for creating an inline |
| 1606 | comment. |
| 1607 | |
| 1608 | [options="header",width="50%",cols="1,^1,5"] |
| 1609 | |=========================== |
| 1610 | |Field Name ||Description |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1611 | |`kind` |optional| |
| 1612 | Must be `gerritcodereview#comment` if provided. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1613 | |`id` |optional| |
Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 1614 | The URL encoded UUID of the comment if an existing draft comment should |
| 1615 | be updated. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1616 | |`path` |optional| |
| 1617 | The path of the file for which the inline comment should be added. + |
| 1618 | Doesn't need to be set if contained in a map where the key is the file |
| 1619 | path. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1620 | |`side` |optional| |
| 1621 | The side on which the comment should be added. + |
| 1622 | Allowed values are `REVISION` and `PARENT`. + |
| 1623 | If not set, the default is `REVISION`. |
| 1624 | |`line` |optional| |
| 1625 | The number of the line for which the comment should be added. + |
| 1626 | `0` if it is a file comment. + |
| 1627 | If not set, a file comment is added. |
| 1628 | |`in_reply_to` |optional| |
| 1629 | The URL encoded UUID of the comment to which this comment is a reply. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1630 | |`updated` |optional| |
| 1631 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 1632 | Accepted but ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1633 | |`message` |optional| |
| 1634 | The comment message. + |
| 1635 | If not set and an existing draft comment is updated, the existing draft |
| 1636 | comment is deleted. |
| 1637 | |=========================== |
| 1638 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1639 | [[commit-info]] |
| 1640 | CommitInfo |
| 1641 | ~~~~~~~~~~ |
| 1642 | The `CommitInfo` entity contains information about a commit. |
| 1643 | |
| 1644 | [options="header",width="50%",cols="1,6"] |
| 1645 | |========================== |
| 1646 | |Field Name |Description |
| 1647 | |`commit` |The commit ID. |
| 1648 | |`parent` | |
| 1649 | The parent commits of this commit as a list of |
| 1650 | link:#commit-info[CommitInfo] entities. |
| 1651 | |`author` |The author of the commit as a |
| 1652 | link:#git-person-info[GitPersonInfo] entity. |
| 1653 | |`committer` |The committer of the commit as a |
| 1654 | link:#git-person-info[GitPersonInfo] entity. |
| 1655 | |`subject` | |
| 1656 | The subject of the commit (header line of the commit message). |
| 1657 | |`message` |The commit message. |
| 1658 | |========================== |
| 1659 | |
| 1660 | [[fetch-info]] |
| 1661 | FetchInfo |
| 1662 | ~~~~~~~~~ |
| 1663 | The `FetchInfo` entity contains information about how to fetch a patch |
| 1664 | set via a certain protocol. |
| 1665 | |
| 1666 | [options="header",width="50%",cols="1,6"] |
| 1667 | |========================== |
| 1668 | |Field Name |Description |
| 1669 | |`url` |The URL of the project. |
| 1670 | |`ref` |The ref of the patch set. |
| 1671 | |========================== |
| 1672 | |
| 1673 | [[file-info]] |
| 1674 | FileInfo |
| 1675 | ~~~~~~~~ |
| 1676 | The `FileInfo` entity contains information about a file in a patch set. |
| 1677 | |
| 1678 | [options="header",width="50%",cols="1,^1,5"] |
| 1679 | |============================= |
| 1680 | |Field Name ||Description |
| 1681 | |`status` |optional| |
| 1682 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 1683 | "`C`"=Copied, "`W`"=Rewritten). + |
| 1684 | Not set if the file was Modified ("`M`"). |
| 1685 | |`binary` |not set if `false`|Whether the file is binary. |
| 1686 | |`old_path` |optional| |
| 1687 | The old file path. + |
| 1688 | Only set if file was renamed or copied. |
| 1689 | |`lines_inserted`|optional| |
| 1690 | Number of inserted lines. + |
| 1691 | Not set for binary files or if no lines were inserted. |
| 1692 | |`lines_deleted` |optional| |
| 1693 | Number of deleted lines. + |
| 1694 | Not set for binary files or if no lines were deleted. |
| 1695 | |============================= |
| 1696 | |
| 1697 | [[git-person-info]] |
| 1698 | GitPersonInfo |
| 1699 | ~~~~~~~~~~~~~ |
| 1700 | The `GitPersonInfo` entity contains information about the |
| 1701 | author/committer of a commit. |
| 1702 | |
| 1703 | [options="header",width="50%",cols="1,6"] |
| 1704 | |========================== |
| 1705 | |Field Name |Description |
| 1706 | |`name` |The name of the author/committer. |
| 1707 | |`email` |The email address of the author/committer. |
| 1708 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 1709 | this identity was constructed. |
| 1710 | |`tz` |The timezone offset from UTC of when this identity was |
| 1711 | constructed. |
| 1712 | |========================== |
| 1713 | |
| 1714 | [[label-info]] |
| 1715 | LabelInfo |
| 1716 | ~~~~~~~~~ |
| 1717 | The `LabelInfo` entity contains information about a label on a change. |
| 1718 | |
| 1719 | [options="header",width="50%",cols="1,^1,5"] |
| 1720 | |=========================== |
| 1721 | |Field Name ||Description |
| 1722 | |`approved` |optional|The user who approved this label on the change |
| 1723 | as a link:#account-info[AccountInfo] entity. + |
| 1724 | Only set if link:#labels[labels] are requested. |
| 1725 | |`rejected` |optional|The user who rejected this label on the change |
| 1726 | as a link:#account-info[AccountInfo] entity. + |
| 1727 | Only set if link:#labels[labels] are requested. |
| 1728 | |`recommended` |optional|The user who recommended this label on the |
| 1729 | change as a link:#account-info[AccountInfo] entity. + |
| 1730 | Only set if link:#labels[labels] are requested. |
| 1731 | |`disliked` |optional|The user who disliked this label on the change |
| 1732 | as a link:#account-info[AccountInfo] entity. + |
| 1733 | Only set if link:#labels[labels] are requested. |
| 1734 | |`value` |optional|The voting value of the user who |
| 1735 | recommended/disliked this label on the change if it is not |
| 1736 | "`+1`"/"`-1`". + |
| 1737 | Only set if link:#labels[labels] are requested. |
| 1738 | |`optional` |not set if `false`| |
| 1739 | Whether the label is optional. Optional means the label may be set, but |
| 1740 | it's neither necessary for submission nor does it block submission if |
| 1741 | set. |
| 1742 | |`all` |optional|List of all approvals for this label as a list |
| 1743 | of link:#approval-info[ApprovalInfo] entities. + |
| 1744 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1745 | |`values` |optional|A map of all values that are allowed for this |
| 1746 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
| 1747 | to the value descriptions. + |
| 1748 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1749 | |=========================== |
| 1750 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1751 | [[restore-input]] |
| 1752 | RestoreInput |
| 1753 | ~~~~~~~~~~~~ |
| 1754 | The `RestoreInput` entity contains information for restoring a change. |
| 1755 | |
| 1756 | [options="header",width="50%",cols="1,^1,5"] |
| 1757 | |=========================== |
| 1758 | |Field Name ||Description |
| 1759 | |`message` |optional| |
| 1760 | Message to be added as review comment to the change when restoring the |
| 1761 | change. |
| 1762 | |=========================== |
| 1763 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1764 | [[revert-input]] |
| 1765 | RevertInput |
| 1766 | ~~~~~~~~~~~ |
| 1767 | The `RevertInput` entity contains information for reverting a change. |
| 1768 | |
| 1769 | [options="header",width="50%",cols="1,^1,5"] |
| 1770 | |=========================== |
| 1771 | |Field Name ||Description |
| 1772 | |`message` |optional| |
| 1773 | Message to be added as review comment to the change when reverting the |
| 1774 | change. |
| 1775 | |=========================== |
| 1776 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1777 | [[review-info]] |
| 1778 | ReviewInfo |
| 1779 | ~~~~~~~~~~ |
| 1780 | The `ReviewInfo` entity contains information about a review. |
| 1781 | |
| 1782 | [options="header",width="50%",cols="1,6"] |
| 1783 | |=========================== |
| 1784 | |Field Name |Description |
| 1785 | |`labels` | |
| 1786 | The labels of the review as a map that maps the label names to the |
| 1787 | voting values. |
| 1788 | |=========================== |
| 1789 | |
| 1790 | [[review-input]] |
| 1791 | ReviewInput |
| 1792 | ~~~~~~~~~~~ |
| 1793 | The `ReviewInput` entity contains information for adding a review to a |
| 1794 | revision. |
| 1795 | |
| 1796 | [options="header",width="50%",cols="1,^1,5"] |
| 1797 | |============================ |
| 1798 | |Field Name ||Description |
| 1799 | |`message` |optional| |
| 1800 | The message to be added as review comment. |
| 1801 | |`labels` |optional| |
| 1802 | The votes that should be added to the revision as a map that maps the |
| 1803 | label names to the voting values. |
| 1804 | |`comments` |optional| |
| 1805 | The comments that should be added as a map that maps a file path to a |
| 1806 | list of link:#comment-input[CommentInput] entities. |
| 1807 | |`strict_labels`|`true` if not set| |
| 1808 | Whether all labels are rquired to be within the user's permitted ranges |
| 1809 | based on access controls. + |
| 1810 | If `true`, attempting to use a label not granted to the user will fail |
| 1811 | the entire modify operation early. + |
| 1812 | If `false`, the operation will execute anyway, but the proposed labels |
| 1813 | will be modified to be the "best" value allowed by the access controls. |
| 1814 | |`drafts` |optional| |
| 1815 | Draft handling that defines how draft comments are handled that are |
| 1816 | already in the database but that were not also described in this |
| 1817 | input. + |
| 1818 | Allowed values are `DELETE`, `PUBLISH` and `KEEP`. + |
| 1819 | If not set, the default is `DELETE`. |
| 1820 | |`notify` |optional| |
| 1821 | Notify handling that defines to whom email notifications should be sent |
| 1822 | after the review is stored. + |
| 1823 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 1824 | If not set, the default is `ALL`. |
| 1825 | |============================ |
| 1826 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 1827 | [[reviewer-info]] |
| 1828 | ReviewerInfo |
| 1829 | ~~~~~~~~~~~~ |
| 1830 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 1831 | votes on a change. |
| 1832 | |
| 1833 | `ReviewerInfo` has the same fields as link:#account-info[AccountInfo] |
| 1834 | and includes link:#detailed-accounts[detailed account information]. |
| 1835 | In addition `ReviewerInfo` has the following fields: |
| 1836 | |
| 1837 | [options="header",width="50%",cols="1,6"] |
| 1838 | |========================== |
| 1839 | |Field Name |Description |
| 1840 | |`kind` |`gerritcodereview#reviewer` |
| 1841 | |`approvals` | |
| 1842 | The approvals of the reviewer as a map that maps the label names to the |
| 1843 | approval values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`"). |
| 1844 | |========================== |
| 1845 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1846 | [[reviewer-input]] |
| 1847 | ReviewerInput |
| 1848 | ~~~~~~~~~~~~~ |
| 1849 | The `ReviewerInput` entity contains information for adding a reviewer |
| 1850 | to a change. |
| 1851 | |
| 1852 | [options="header",width="50%",cols="1,^1,5"] |
| 1853 | |=========================== |
| 1854 | |Field Name ||Description |
| 1855 | |`reviewer` || |
| 1856 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 1857 | should be added as reviewer or the link:rest-api-groups.html#group-id[ |
| 1858 | ID] of one group for which all members should be added as reviewers. + |
| 1859 | If an ID identifies both an account and a group, only the account is |
| 1860 | added as reviewer to the change. |
| 1861 | |`confirmed` |optional| |
| 1862 | Whether adding the reviewer is confirmed. + |
| 1863 | The Gerrit server may be configured to |
| 1864 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 1865 | confirmation] when adding a group as reviewer that has many members. |
| 1866 | |=========================== |
| 1867 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1868 | [[revision-info]] |
| 1869 | RevisionInfo |
| 1870 | ~~~~~~~~~~~~ |
| 1871 | The `RevisionInfo` entity contains information about a patch set. |
| 1872 | |
| 1873 | [options="header",width="50%",cols="1,^1,5"] |
| 1874 | |=========================== |
| 1875 | |Field Name ||Description |
| 1876 | |`draft` |not set if `false`|Whether the patch set is a draft. |
| 1877 | |`_number` ||The patch set number. |
| 1878 | |`fetch` || |
| 1879 | Information about how to fetch this patch set. The fetch information is |
| 1880 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 1881 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
| 1882 | |`commit` ||The commit of the patch set as |
| 1883 | link:#commit-info[CommitInfo] entity. |
| 1884 | |`files` || |
| 1885 | The files of the patch set as a map that maps the file names to |
| 1886 | link:#file-info[FileInfo] entities. |
| 1887 | |=========================== |
| 1888 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 1889 | [[submit-info]] |
| 1890 | SubmitInfo |
| 1891 | ~~~~~~~~~~ |
| 1892 | The `SubmitInfo` entity contains information about the change status |
| 1893 | after submitting. |
| 1894 | |
| 1895 | [options="header",width="50%",cols="1,6"] |
| 1896 | |========================== |
| 1897 | |Field Name |Description |
| 1898 | |`status` | |
| 1899 | The status of the change after submitting, can be `MERGED` or |
| 1900 | `SUBMITTED`. + |
| 1901 | If `wait_for_merge` in the link:#submit-input[SubmitInput] was set to |
| 1902 | `false` the returned status is `SUBMITTED` and the caller can't know |
| 1903 | whether the change could be merged successfully. |
| 1904 | |========================== |
| 1905 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 1906 | [[submit-input]] |
| 1907 | SubmitInput |
| 1908 | ~~~~~~~~~~~ |
| 1909 | The `SubmitInput` entity contains information for submitting a change. |
| 1910 | |
| 1911 | [options="header",width="50%",cols="1,^1,5"] |
| 1912 | |=========================== |
| 1913 | |Field Name ||Description |
| 1914 | |`wait_for_merge`|`false` if not set| |
| 1915 | Whether the request should wait for the merge to complete. + |
| 1916 | If `false` the request returns immediately after the change has been |
| 1917 | added to the merge queue and the caller can't know whether the change |
| 1918 | could be merged successfully. |
| 1919 | |=========================== |
| 1920 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 1921 | [[topic-input]] |
| 1922 | TopicInput |
| 1923 | ~~~~~~~~~~ |
| 1924 | The `TopicInput` entity contains information for setting a topic. |
| 1925 | |
| 1926 | [options="header",width="50%",cols="1,^1,5"] |
| 1927 | |=========================== |
| 1928 | |Field Name ||Description |
| 1929 | |`topic` |optional|The topic. + |
| 1930 | The topic will be deleted if not set. |
| 1931 | |`message` |optional| |
| 1932 | Message to be added as review comment to the change when setting the |
| 1933 | topic. |
| 1934 | |=========================== |
| 1935 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 1936 | |
| 1937 | GERRIT |
| 1938 | ------ |
| 1939 | Part of link:index.html[Gerrit Code Review] |