Edwin Kempin | 2eebd14 | 2013-03-06 15:28:34 +0100 | [diff] [blame] | 1 | Gerrit Code Review - /changes/ REST API |
| 2 | ======================================= |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 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 | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 13 | Query Changes |
| 14 | ~~~~~~~~~~~~~ |
| 15 | [verse] |
| 16 | 'GET /changes/' |
| 17 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 18 | Queries changes visible to the caller. The query string must be |
| 19 | provided by the `q` parameter. The `n` parameter can be used to limit |
| 20 | the returned results. |
| 21 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 22 | As result a list of link:#change-info[ChangeInfo] entries is returned. |
| 23 | The change output is sorted by the last update time, most recently |
| 24 | updated to oldest updated. |
| 25 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 26 | Query for open changes of watched projects: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 27 | |
| 28 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 29 | ---- |
Edwin Kempin | 2091edb | 2013-01-23 19:07:38 +0100 | [diff] [blame] | 30 | GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 31 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 32 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 33 | .Response |
| 34 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 35 | HTTP/1.1 200 OK |
| 36 | Content-Disposition: attachment |
| 37 | Content-Type: application/json;charset=UTF-8 |
| 38 | |
| 39 | )]}' |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 40 | [ |
| 41 | { |
| 42 | "kind": "gerritcodereview#change", |
| 43 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 44 | "project": "demo", |
| 45 | "branch": "master", |
| 46 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 47 | "subject": "One change", |
| 48 | "status": "NEW", |
| 49 | "created": "2012-07-17 07:18:30.854000000", |
| 50 | "updated": "2012-07-17 07:19:27.766000000", |
| 51 | "reviewed": true, |
| 52 | "mergeable": true, |
| 53 | "_sortkey": "001e7057000006dc", |
| 54 | "_number": 1756, |
| 55 | "owner": { |
| 56 | "name": "John Doe" |
| 57 | }, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 58 | }, |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 59 | { |
| 60 | "kind": "gerritcodereview#change", |
| 61 | "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 62 | "project": "demo", |
| 63 | "branch": "master", |
| 64 | "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 65 | "subject": "Another change", |
| 66 | "status": "NEW", |
| 67 | "created": "2012-07-17 07:18:30.884000000", |
| 68 | "updated": "2012-07-17 07:18:30.885000000", |
| 69 | "mergeable": true, |
| 70 | "_sortkey": "001e7056000006dd", |
| 71 | "_number": 1757, |
| 72 | "owner": { |
| 73 | "name": "John Doe" |
| 74 | }, |
| 75 | "_more_changes": true |
| 76 | } |
| 77 | ] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 78 | ---- |
| 79 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 80 | If the `n` query parameter is supplied and additional changes exist |
| 81 | that match the query beyond the end, the last change object has a |
| 82 | `_more_changes: true` JSON field set. Callers can resume a query with |
Christian Aistleitner | 5536401 | 2013-02-17 12:18:22 +0100 | [diff] [blame] | 83 | the `N` query parameter, supplying the last change's `_sortkey` field |
| 84 | 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] | 85 | parameter a `_more_changes: true` is put in the first change object if |
| 86 | there are results *before* the first change returned. |
| 87 | |
| 88 | Clients are allowed to specify more than one query by setting the `q` |
| 89 | parameter multiple times. In this case the result is an array of |
| 90 | arrays, one per query in the same order the queries were given in. |
| 91 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 92 | .Query for the 25 most recent open changes of the projects that you watch |
| 93 | **** |
| 94 | get::/changes/?q=status:open+is:watched&n=25 |
| 95 | **** |
| 96 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 97 | Query that retrieves changes for a user's dashboard: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 98 | |
| 99 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 100 | ---- |
| 101 | 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] | 102 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 103 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 104 | .Response |
| 105 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 106 | HTTP/1.1 200 OK |
| 107 | Content-Disposition: attachment |
| 108 | Content-Type: application/json;charset=UTF-8 |
| 109 | |
| 110 | )]}' |
| 111 | [ |
| 112 | [ |
| 113 | { |
| 114 | "kind": "gerritcodereview#change", |
| 115 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 116 | "project": "demo", |
| 117 | "branch": "master", |
| 118 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 119 | "subject": "One change", |
| 120 | "status": "NEW", |
| 121 | "created": "2012-07-17 07:18:30.854000000", |
| 122 | "updated": "2012-07-17 07:19:27.766000000", |
| 123 | "reviewed": true, |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 124 | "mergeable": true, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 125 | "_sortkey": "001e7057000006dc", |
| 126 | "_number": 1756, |
| 127 | "owner": { |
| 128 | "name": "John Doe" |
| 129 | }, |
| 130 | "labels": { |
| 131 | "Verified": {}, |
| 132 | "Code-Review": {} |
| 133 | } |
| 134 | } |
| 135 | ], |
| 136 | [], |
| 137 | [] |
| 138 | ] |
| 139 | ---- |
| 140 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 141 | .Query the changes for your user dashboard |
| 142 | **** |
| 143 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 144 | **** |
| 145 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 146 | Additional fields can be obtained by adding `o` parameters, each |
| 147 | option requires more database lookups and slows down the query |
| 148 | response time to the client so they are generally disabled by |
| 149 | default. Optional fields are: |
| 150 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 151 | [[labels]] |
| 152 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 153 | * `LABELS`: a summary of each label required for submit, and |
| 154 | approvers that have granted (or rejected) with that label. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 155 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 156 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 157 | [[detailed-labels]] |
| 158 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 159 | * `DETAILED_LABELS`: detailed label information, including numeric |
Dave Borowitz | 992ddd7 | 2013-02-13 11:53:17 -0800 | [diff] [blame] | 160 | values of all existing approvals, recognized label values, values |
| 161 | permitted to be set by the current user, and reviewers that may be |
| 162 | removed by the current user. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 163 | -- |
Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 164 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 165 | [[current-revision]] |
| 166 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 167 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 168 | 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] | 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 | [[all-revisions]] |
| 172 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 173 | * `ALL_REVISIONS`: describe all revisions, not just current. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 174 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 175 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 176 | [[current-commit]] |
| 177 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 178 | * `CURRENT_COMMIT`: parse and output all header fields from the |
| 179 | commit object, including message. Only valid when the current |
| 180 | revision or all revisions are selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 181 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 182 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 183 | [[all-commits]] |
| 184 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 185 | * `ALL_COMMITS`: parse and output all header fields from the |
| 186 | output revisions. If only `CURRENT_REVISION` was requested |
| 187 | then only the current revision's commit data will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 188 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 189 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 190 | [[current-files]] |
| 191 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 192 | * `CURRENT_FILES`: list files modified by the commit, including |
| 193 | basic line counts inserted/deleted per file. Only valid when |
| 194 | the current revision or all revisions are selected. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 195 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 196 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 197 | [[all-files]] |
| 198 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 199 | * `ALL_FILES`: list files modified by the commit, including |
| 200 | basic line counts inserted/deleted per file. If only the |
| 201 | `CURRENT_REVISION` was requested the only that commit's |
| 202 | modified files will be output. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 203 | -- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 204 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 205 | [[detailed-accounts]] |
| 206 | -- |
Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 207 | * `DETAILED_ACCOUNTS`: include `_account_id` and `email` fields when |
| 208 | referencing accounts. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 209 | -- |
Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 210 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 211 | [[messages]] |
| 212 | -- |
| 213 | * `MESSAGES`: include messages associated with the change. |
| 214 | -- |
| 215 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 216 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 217 | ---- |
| 218 | 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] | 219 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 220 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 221 | .Response |
| 222 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 223 | HTTP/1.1 200 OK |
| 224 | Content-Disposition: attachment |
| 225 | Content-Type: application/json;charset=UTF-8 |
| 226 | |
| 227 | )]}' |
| 228 | [ |
| 229 | { |
| 230 | "kind": "gerritcodereview#change", |
| 231 | "id": "demo~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 232 | "project": "gerrit", |
| 233 | "branch": "master", |
| 234 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 235 | "subject": "Use an EventBus to manage star icons", |
| 236 | "status": "NEW", |
| 237 | "created": "2012-04-25 00:52:25.580000000", |
| 238 | "updated": "2012-04-25 00:52:25.586000000", |
Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 239 | "mergeable": true, |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 240 | "_sortkey": "001c9bf400000061", |
| 241 | "_number": 97, |
| 242 | "owner": { |
| 243 | "name": "Shawn Pearce" |
| 244 | }, |
| 245 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 246 | "revisions": { |
| 247 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
| 248 | "_number": 1, |
| 249 | "fetch": { |
| 250 | "git": { |
| 251 | "url": "git://localhost/gerrit", |
| 252 | "ref": "refs/changes/97/97/1" |
| 253 | }, |
| 254 | "http": { |
| 255 | "url": "http://127.0.0.1:8080/gerrit", |
| 256 | "ref": "refs/changes/97/97/1" |
| 257 | } |
| 258 | }, |
| 259 | "commit": { |
| 260 | "parents": [ |
| 261 | { |
| 262 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 263 | "subject": "Migrate contributor agreements to All-Projects." |
| 264 | } |
| 265 | ], |
| 266 | "author": { |
| 267 | "name": "Shawn O. Pearce", |
| 268 | "email": "sop@google.com", |
| 269 | "date": "2012-04-24 18:08:08.000000000", |
| 270 | "tz": -420 |
| 271 | }, |
| 272 | "committer": { |
| 273 | "name": "Shawn O. Pearce", |
| 274 | "email": "sop@google.com", |
| 275 | "date": "2012-04-24 18:08:08.000000000", |
| 276 | "tz": -420 |
| 277 | }, |
| 278 | "subject": "Use an EventBus to manage star icons", |
| 279 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 280 | }, |
| 281 | "files": { |
| 282 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
| 283 | "lines_deleted": 8 |
| 284 | }, |
| 285 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
| 286 | "lines_inserted": 1 |
| 287 | }, |
| 288 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 289 | "lines_inserted": 11, |
| 290 | "lines_deleted": 19 |
| 291 | }, |
| 292 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 293 | "lines_inserted": 23, |
| 294 | "lines_deleted": 20 |
| 295 | }, |
| 296 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 297 | "status": "D", |
| 298 | "lines_deleted": 139 |
| 299 | }, |
| 300 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 301 | "status": "A", |
| 302 | "lines_inserted": 204 |
| 303 | }, |
| 304 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
| 305 | "lines_deleted": 9 |
| 306 | } |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | ] |
| 312 | ---- |
| 313 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 314 | [[get-change]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 315 | Get Change |
| 316 | ~~~~~~~~~~ |
| 317 | [verse] |
| 318 | 'GET /changes/link:#change-id[\{change-id\}]' |
| 319 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 320 | Retrieves a change. |
| 321 | |
| 322 | .Request |
| 323 | ---- |
| 324 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 325 | ---- |
| 326 | |
| 327 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 328 | describes the change. |
| 329 | |
| 330 | .Response |
| 331 | ---- |
| 332 | HTTP/1.1 200 OK |
| 333 | Content-Disposition: attachment |
| 334 | Content-Type: application/json;charset=UTF-8 |
| 335 | |
| 336 | )]}' |
| 337 | { |
| 338 | "kind": "gerritcodereview#change", |
| 339 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 340 | "project": "myProject", |
| 341 | "branch": "master", |
| 342 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 343 | "subject": "Implementing Feature X", |
| 344 | "status": "NEW", |
| 345 | "created": "2013-02-01 09:59:32.126000000", |
| 346 | "updated": "2013-02-21 11:16:36.775000000", |
| 347 | "reviewed": true, |
| 348 | "mergeable": true, |
| 349 | "_sortkey": "0023412400000f7d", |
| 350 | "_number": 3965, |
| 351 | "owner": { |
| 352 | "name": "John Doe" |
| 353 | } |
| 354 | } |
| 355 | ---- |
| 356 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 357 | [[get-change-detail]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 358 | Get Change Detail |
| 359 | ~~~~~~~~~~~~~~~~~ |
| 360 | [verse] |
| 361 | 'GET /changes/link:#change-id[\{change-id\}]/detail' |
| 362 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 363 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 364 | detailed labels], link:#detailed-accounts[detailed accounts], and |
| 365 | link:#messages[messages]. |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 366 | |
Shawn Pearce | 7f3dccf | 2013-07-06 19:24:29 -0700 | [diff] [blame^] | 367 | Additional fields can be obtained by adding `o` parameters, each |
| 368 | option requires more database lookups and slows down the query |
| 369 | response time to the client so they are generally disabled by |
| 370 | default. Fields are described in link:#list-changes[Query Changes]. |
| 371 | |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 372 | .Request |
| 373 | ---- |
| 374 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 375 | ---- |
| 376 | |
| 377 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 378 | describes the change. |
| 379 | |
| 380 | .Response |
| 381 | ---- |
| 382 | HTTP/1.1 200 OK |
| 383 | Content-Disposition: attachment |
| 384 | Content-Type: application/json;charset=UTF-8 |
| 385 | |
| 386 | )]}' |
| 387 | { |
| 388 | "kind": "gerritcodereview#change", |
| 389 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 390 | "project": "myProject", |
| 391 | "branch": "master", |
| 392 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 393 | "subject": "Implementing Feature X", |
| 394 | "status": "NEW", |
| 395 | "created": "2013-02-01 09:59:32.126000000", |
| 396 | "updated": "2013-02-21 11:16:36.775000000", |
| 397 | "reviewed": true, |
| 398 | "mergeable": true, |
| 399 | "_sortkey": "0023412400000f7d", |
| 400 | "_number": 3965, |
| 401 | "owner": { |
| 402 | "_account_id": 1000096, |
| 403 | "name": "John Doe", |
| 404 | "email": "john.doe@example.com" |
| 405 | }, |
| 406 | "labels": { |
| 407 | "Verified": { |
| 408 | "all": [ |
| 409 | { |
| 410 | "value": 0, |
| 411 | "_account_id": 1000096, |
| 412 | "name": "John Doe", |
| 413 | "email": "john.doe@example.com" |
| 414 | }, |
| 415 | { |
| 416 | "value": 0, |
| 417 | "_account_id": 1000097, |
| 418 | "name": "Jane Roe", |
| 419 | "email": "jane.roe@example.com" |
| 420 | } |
| 421 | ], |
| 422 | "values": { |
| 423 | "-1": "Fails", |
| 424 | " 0": "No score", |
| 425 | "+1": "Verified" |
| 426 | } |
| 427 | }, |
| 428 | "Code-Review": { |
| 429 | "recommended": { |
| 430 | "_account_id": 1000097, |
| 431 | "name": "Jane Roe", |
| 432 | "email": "jane.roe@example.com" |
| 433 | }, |
| 434 | "disliked": { |
| 435 | "_account_id": 1000096, |
| 436 | "name": "John Doe", |
| 437 | "email": "john.doe@example.com" |
| 438 | }, |
| 439 | "all": [ |
| 440 | { |
| 441 | "value": -1, |
| 442 | "_account_id": 1000096, |
| 443 | "name": "John Doe", |
| 444 | "email": "john.doe@example.com" |
| 445 | }, |
| 446 | { |
| 447 | "value": 1, |
| 448 | "_account_id": 1000097, |
| 449 | "name": "Jane Roe", |
| 450 | "email": "jane.roe@example.com" |
| 451 | } |
| 452 | ] |
| 453 | "values": { |
| 454 | "-2": "Do not submit", |
| 455 | "-1": "I would prefer that you didn\u0027t submit this", |
| 456 | " 0": "No score", |
| 457 | "+1": "Looks good to me, but someone else must approve", |
| 458 | "+2": "Looks good to me, approved" |
| 459 | } |
| 460 | } |
| 461 | }, |
| 462 | "permitted_labels": { |
| 463 | "Verified": [ |
| 464 | "-1", |
| 465 | " 0", |
| 466 | "+1" |
| 467 | ], |
| 468 | "Code-Review": [ |
| 469 | "-2", |
| 470 | "-1", |
| 471 | " 0", |
| 472 | "+1", |
| 473 | "+2" |
| 474 | ] |
| 475 | }, |
| 476 | "removable_reviewers": [ |
| 477 | { |
| 478 | "_account_id": 1000096, |
| 479 | "name": "John Doe", |
| 480 | "email": "john.doe@example.com" |
| 481 | }, |
| 482 | { |
| 483 | "_account_id": 1000097, |
| 484 | "name": "Jane Roe", |
| 485 | "email": "jane.roe@example.com" |
| 486 | } |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 487 | ], |
| 488 | "messages": [ |
| 489 | { |
| 490 | "id": "YH-egE", |
| 491 | "author": { |
| 492 | "_account_id": 1000096, |
| 493 | "name": "John Doe", |
| 494 | "email": "john.doe@example.com" |
| 495 | }, |
| 496 | "updated": "2013-03-23 21:34:02.419000000", |
| 497 | "message": "Patch Set 1:\n\nThis is the first message.", |
| 498 | "revision_number": 1 |
| 499 | }, |
| 500 | { |
| 501 | "id": "WEEdhU", |
| 502 | "author": { |
| 503 | "_account_id": 1000097, |
| 504 | "name": "Jane Roe", |
| 505 | "email": "jane.roe@example.com" |
| 506 | }, |
| 507 | "updated": "2013-03-23 21:36:52.332000000", |
| 508 | "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.", |
| 509 | "revision_number": 1 |
| 510 | } |
Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 511 | ] |
| 512 | } |
| 513 | ---- |
| 514 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 515 | [[get-topic]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 516 | Get Topic |
| 517 | ~~~~~~~~~ |
| 518 | [verse] |
| 519 | 'GET /changes/link:#change-id[\{change-id\}]/topic' |
| 520 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 521 | Retrieves the topic of a change. |
| 522 | |
| 523 | .Request |
| 524 | ---- |
| 525 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 526 | ---- |
| 527 | |
| 528 | .Response |
| 529 | ---- |
| 530 | HTTP/1.1 200 OK |
| 531 | Content-Disposition: attachment |
| 532 | Content-Type: application/json;charset=UTF-8 |
| 533 | |
| 534 | )]}' |
| 535 | "Documentation" |
| 536 | ---- |
| 537 | |
| 538 | If the change does not have a topic an empty string is returned. |
| 539 | |
| 540 | [[set-topic]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 541 | Set Topic |
| 542 | ~~~~~~~~~ |
| 543 | [verse] |
| 544 | 'PUT /changes/link:#change-id[\{change-id\}]/topic' |
| 545 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 546 | Sets the topic of a change. |
| 547 | |
| 548 | The new topic must be provided in the request body inside a |
| 549 | link:#topic-input[TopicInput] entity. |
| 550 | |
| 551 | .Request |
| 552 | ---- |
| 553 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 554 | Content-Type: application/json;charset=UTF-8 |
| 555 | |
| 556 | { |
| 557 | "topic": "Documentation" |
| 558 | } |
| 559 | ---- |
| 560 | |
| 561 | As response the new topic is returned. |
| 562 | |
| 563 | .Response |
| 564 | ---- |
| 565 | HTTP/1.1 200 OK |
| 566 | Content-Disposition: attachment |
| 567 | Content-Type: application/json;charset=UTF-8 |
| 568 | |
| 569 | )]}' |
| 570 | "Documentation" |
| 571 | ---- |
| 572 | |
| 573 | If the topic was deleted the response is "`204 No Content`". |
| 574 | |
| 575 | [[delete-topic]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 576 | Delete Topic |
| 577 | ~~~~~~~~~~~~ |
| 578 | [verse] |
| 579 | 'DELETE /changes/link:#change-id[\{change-id\}]/topic' |
| 580 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 581 | Deletes the topic of a change. |
| 582 | |
| 583 | The request body does not need to include a link:#topic-input[ |
| 584 | TopicInput] entity if no review comment is added. |
| 585 | |
| 586 | Please note that some proxies prohibit request bodies for DELETE |
| 587 | requests. In this case, if you want to specify a commit message, use |
| 588 | link:#set-topic[PUT] to delete the topic. |
| 589 | |
| 590 | .Request |
| 591 | ---- |
| 592 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 593 | ---- |
| 594 | |
| 595 | .Response |
| 596 | ---- |
| 597 | HTTP/1.1 204 No Content |
| 598 | ---- |
| 599 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 600 | [[abandon-change]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 601 | Abandon Change |
| 602 | ~~~~~~~~~~~~~~ |
| 603 | [verse] |
| 604 | 'POST /changes/link:#change-id[\{change-id\}]/abandon' |
| 605 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 606 | Abandons a change. |
| 607 | |
| 608 | The request body does not need to include a link:#abandon-input[ |
| 609 | AbandonInput] entity if no review comment is added. |
| 610 | |
| 611 | .Request |
| 612 | ---- |
| 613 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 614 | ---- |
| 615 | |
| 616 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 617 | describes the abandoned change. |
| 618 | |
| 619 | .Response |
| 620 | ---- |
| 621 | HTTP/1.1 200 OK |
| 622 | Content-Disposition: attachment |
| 623 | Content-Type: application/json;charset=UTF-8 |
| 624 | |
| 625 | )]}' |
| 626 | { |
| 627 | "kind": "gerritcodereview#change", |
| 628 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 629 | "project": "myProject", |
| 630 | "branch": "master", |
| 631 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 632 | "subject": "Implementing Feature X", |
| 633 | "status": "ABANDONED", |
| 634 | "created": "2013-02-01 09:59:32.126000000", |
| 635 | "updated": "2013-02-21 11:16:36.775000000", |
| 636 | "reviewed": true, |
| 637 | "mergeable": true, |
| 638 | "_sortkey": "0023412400000f7d", |
| 639 | "_number": 3965, |
| 640 | "owner": { |
| 641 | "name": "John Doe" |
| 642 | } |
| 643 | } |
| 644 | ---- |
| 645 | |
| 646 | If the change cannot be abandoned because the change state doesn't |
| 647 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 648 | the error message is contained in the response body. |
| 649 | |
| 650 | .Response |
| 651 | ---- |
| 652 | HTTP/1.1 409 Conflict |
| 653 | Content-Disposition: attachment |
| 654 | Content-Type: text/plain;charset=UTF-8 |
| 655 | |
| 656 | change is merged |
| 657 | ---- |
| 658 | |
| 659 | [[restore-change]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 660 | Restore Change |
| 661 | ~~~~~~~~~~~~~~ |
| 662 | [verse] |
| 663 | 'POST /changes/link:#change-id[\{change-id\}]/restore' |
| 664 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 665 | Restores a change. |
| 666 | |
| 667 | The request body does not need to include a link:#restore-input[ |
| 668 | RestoreInput] entity if no review comment is added. |
| 669 | |
| 670 | .Request |
| 671 | ---- |
| 672 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 673 | ---- |
| 674 | |
| 675 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 676 | describes the restored change. |
| 677 | |
| 678 | .Response |
| 679 | ---- |
| 680 | HTTP/1.1 200 OK |
| 681 | Content-Disposition: attachment |
| 682 | Content-Type: application/json;charset=UTF-8 |
| 683 | |
| 684 | )]}' |
| 685 | { |
| 686 | "kind": "gerritcodereview#change", |
| 687 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 688 | "project": "myProject", |
| 689 | "branch": "master", |
| 690 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 691 | "subject": "Implementing Feature X", |
| 692 | "status": "NEW", |
| 693 | "created": "2013-02-01 09:59:32.126000000", |
| 694 | "updated": "2013-02-21 11:16:36.775000000", |
| 695 | "reviewed": true, |
| 696 | "mergeable": true, |
| 697 | "_sortkey": "0023412400000f7d", |
| 698 | "_number": 3965, |
| 699 | "owner": { |
| 700 | "name": "John Doe" |
| 701 | } |
| 702 | } |
| 703 | ---- |
| 704 | |
| 705 | If the change cannot be restored because the change state doesn't |
| 706 | allow restoring the change, the response is "`409 Conflict`" and |
| 707 | the error message is contained in the response body. |
| 708 | |
| 709 | .Response |
| 710 | ---- |
| 711 | HTTP/1.1 409 Conflict |
| 712 | Content-Disposition: attachment |
| 713 | Content-Type: text/plain;charset=UTF-8 |
| 714 | |
| 715 | change is new |
| 716 | ---- |
| 717 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 718 | [[rebase-change]] |
| 719 | Rebase Change |
| 720 | ~~~~~~~~~~~~~ |
| 721 | [verse] |
| 722 | 'POST /changes/link:#change-id[\{change-id\}]/rebase' |
| 723 | |
| 724 | Rebases a change. |
| 725 | |
| 726 | .Request |
| 727 | ---- |
| 728 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0 |
| 729 | ---- |
| 730 | |
| 731 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 732 | describes the rebased change. Information about the current patch set |
| 733 | is included. |
| 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~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 745 | "project": "myProject", |
| 746 | "branch": "master", |
| 747 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 748 | "subject": "Implement Feature X", |
| 749 | "status": "NEW", |
| 750 | "created": "2013-02-01 09:59:32.126000000", |
| 751 | "updated": "2013-02-21 11:16:36.775000000", |
| 752 | "mergeable": false, |
| 753 | "_sortkey": "0024cf9a000012bf", |
| 754 | "_number": 4799, |
| 755 | "owner": { |
| 756 | "name": "John Doe" |
| 757 | }, |
| 758 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 759 | "revisions": { |
| 760 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
| 761 | "_number": 2, |
| 762 | "fetch": { |
| 763 | "http": { |
| 764 | "url": "http://gerrit:8080/myProject", |
| 765 | "ref": "refs/changes/99/4799/2" |
| 766 | } |
| 767 | }, |
| 768 | "commit": { |
| 769 | "parents": [ |
| 770 | { |
| 771 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 772 | "subject": "Implement Feature A" |
| 773 | } |
| 774 | ], |
| 775 | "author": { |
| 776 | "name": "John Doe", |
| 777 | "email": "john.doe@example.com", |
| 778 | "date": "2013-05-07 15:21:27.000000000", |
| 779 | "tz": 120 |
| 780 | }, |
| 781 | "committer": { |
| 782 | "name": "Gerrit Code Review", |
| 783 | "email": "gerrit-server@example.com", |
| 784 | "date": "2013-05-07 15:35:43.000000000", |
| 785 | "tz": 120 |
| 786 | }, |
| 787 | "subject": "Implement Feature X", |
| 788 | "message": "Implement Feature X\n\nAdded feature X." |
| 789 | } |
| 790 | } |
| 791 | } |
| 792 | ---- |
| 793 | |
| 794 | If the change cannot be rebased, e.g. due to conflicts, the response is |
| 795 | "`409 Conflict`" and the error message is contained in the response |
| 796 | body. |
| 797 | |
| 798 | .Response |
| 799 | ---- |
| 800 | HTTP/1.1 409 Conflict |
| 801 | Content-Disposition: attachment |
| 802 | Content-Type: text/plain;charset=UTF-8 |
| 803 | |
| 804 | The change could not be rebased due to a path conflict during merge. |
| 805 | ---- |
| 806 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 807 | [[revert-change]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 808 | Revert Change |
| 809 | ~~~~~~~~~~~~~ |
| 810 | [verse] |
| 811 | 'POST /changes/link:#change-id[\{change-id\}]/revert' |
| 812 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 813 | Reverts a change. |
| 814 | |
| 815 | The request body does not need to include a link:#revert-input[ |
| 816 | RevertInput] entity if no review comment is added. |
| 817 | |
| 818 | .Request |
| 819 | ---- |
| 820 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revert HTTP/1.0 |
| 821 | ---- |
| 822 | |
| 823 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 824 | describes the reverting change. |
| 825 | |
| 826 | .Response |
| 827 | ---- |
| 828 | HTTP/1.1 200 OK |
| 829 | Content-Disposition: attachment |
| 830 | Content-Type: application/json;charset=UTF-8 |
| 831 | |
| 832 | )]}' |
| 833 | { |
| 834 | "kind": "gerritcodereview#change", |
| 835 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 836 | "project": "myProject", |
| 837 | "branch": "master", |
| 838 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 839 | "subject": "Revert \"Implementing Feature X\"", |
| 840 | "status": "NEW", |
| 841 | "created": "2013-02-01 09:59:32.126000000", |
| 842 | "updated": "2013-02-21 11:16:36.775000000", |
| 843 | "reviewed": true, |
| 844 | "mergeable": true, |
| 845 | "_sortkey": "0023412400000f7d", |
| 846 | "_number": 3965, |
| 847 | "owner": { |
| 848 | "name": "John Doe" |
| 849 | } |
| 850 | } |
| 851 | ---- |
| 852 | |
| 853 | If the change cannot be reverted because the change state doesn't |
| 854 | allow reverting the change, the response is "`409 Conflict`" and |
| 855 | the error message is contained in the response body. |
| 856 | |
| 857 | .Response |
| 858 | ---- |
| 859 | HTTP/1.1 409 Conflict |
| 860 | Content-Disposition: attachment |
| 861 | Content-Type: text/plain;charset=UTF-8 |
| 862 | |
| 863 | change is new |
| 864 | ---- |
| 865 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 866 | [[submit-change]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 867 | Submit Change |
| 868 | ~~~~~~~~~~~~~ |
| 869 | [verse] |
| 870 | 'POST /changes/link:#change-id[\{change-id\}]/submit' |
| 871 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 872 | Submits a change. |
| 873 | |
| 874 | The request body only needs to include a link:#submit-input[ |
| 875 | SubmitInput] entity if the request should wait for the merge to |
| 876 | complete. |
| 877 | |
| 878 | .Request |
| 879 | ---- |
| 880 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
| 881 | Content-Type: application/json;charset=UTF-8 |
| 882 | |
| 883 | { |
| 884 | "wait_for_merge": true |
| 885 | } |
| 886 | ---- |
| 887 | |
| 888 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 889 | describes the submitted/merged change. |
| 890 | |
| 891 | .Response |
| 892 | ---- |
| 893 | HTTP/1.1 200 OK |
| 894 | Content-Disposition: attachment |
| 895 | Content-Type: application/json;charset=UTF-8 |
| 896 | |
| 897 | )]}' |
| 898 | { |
| 899 | "kind": "gerritcodereview#change", |
| 900 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 901 | "project": "myProject", |
| 902 | "branch": "master", |
| 903 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 904 | "subject": "Implementing Feature X", |
| 905 | "status": "MERGED", |
| 906 | "created": "2013-02-01 09:59:32.126000000", |
| 907 | "updated": "2013-02-21 11:16:36.775000000", |
| 908 | "reviewed": true, |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 909 | "_sortkey": "0023412400000f7d", |
| 910 | "_number": 3965, |
| 911 | "owner": { |
| 912 | "name": "John Doe" |
| 913 | } |
| 914 | } |
| 915 | ---- |
| 916 | |
| 917 | If the change cannot be submitted because the submit rule doesn't allow |
| 918 | submitting the change, the response is "`409 Conflict`" and the error |
| 919 | message is contained in the response body. |
| 920 | |
| 921 | .Response |
| 922 | ---- |
| 923 | HTTP/1.1 409 Conflict |
| 924 | Content-Disposition: attachment |
| 925 | Content-Type: text/plain;charset=UTF-8 |
| 926 | |
| 927 | blocked by Verified |
| 928 | ---- |
| 929 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 930 | [[reviewer-endpoints]] |
| 931 | Reviewer Endpoints |
| 932 | ------------------ |
| 933 | |
| 934 | [[list-reviewers]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 935 | List Reviewers |
| 936 | ~~~~~~~~~~~~~~ |
| 937 | [verse] |
| 938 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/' |
| 939 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 940 | Lists the reviewers of a change. |
| 941 | |
| 942 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 943 | |
| 944 | .Request |
| 945 | ---- |
| 946 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 947 | ---- |
| 948 | |
| 949 | .Response |
| 950 | ---- |
| 951 | HTTP/1.1 200 OK |
| 952 | Content-Disposition: attachment |
| 953 | Content-Type: application/json;charset=UTF-8 |
| 954 | |
| 955 | )]}' |
| 956 | [ |
| 957 | { |
| 958 | "kind": "gerritcodereview#reviewer", |
| 959 | "approvals": { |
| 960 | "Verified": "+1", |
| 961 | "Code-Review": "+2" |
| 962 | }, |
| 963 | "_account_id": 1000096, |
| 964 | "name": "John Doe", |
| 965 | "email": "john.doe@example.com" |
| 966 | }, |
| 967 | { |
| 968 | "kind": "gerritcodereview#reviewer", |
| 969 | "approvals": { |
| 970 | "Verified": " 0", |
| 971 | "Code-Review": "-1" |
| 972 | }, |
| 973 | "_account_id": 1000097, |
| 974 | "name": "Jane Roe", |
| 975 | "email": "jane.roe@example.com" |
| 976 | } |
| 977 | ] |
| 978 | ---- |
| 979 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 980 | [[get-reviewer]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 981 | Get Reviewer |
| 982 | ~~~~~~~~~~~~ |
| 983 | [verse] |
| 984 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' |
| 985 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 986 | Retrieves a reviewer of a change. |
| 987 | |
| 988 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 989 | describes the reviewer. |
| 990 | |
| 991 | .Request |
| 992 | ---- |
| 993 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 994 | ---- |
| 995 | |
| 996 | .Response |
| 997 | ---- |
| 998 | HTTP/1.1 200 OK |
| 999 | Content-Disposition: attachment |
| 1000 | Content-Type: application/json;charset=UTF-8 |
| 1001 | |
| 1002 | )]}' |
| 1003 | { |
| 1004 | "kind": "gerritcodereview#reviewer", |
| 1005 | "approvals": { |
| 1006 | "Verified": "+1", |
| 1007 | "Code-Review": "+2" |
| 1008 | }, |
| 1009 | "_account_id": 1000096, |
| 1010 | "name": "John Doe", |
| 1011 | "email": "john.doe@example.com" |
| 1012 | } |
| 1013 | ---- |
| 1014 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1015 | [[add-reviewer]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1016 | Add Reviewer |
| 1017 | ~~~~~~~~~~~~ |
| 1018 | [verse] |
| 1019 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers' |
| 1020 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1021 | Adds one user or all members of one group as reviewer to the change. |
| 1022 | |
| 1023 | The reviewer to be added to the change must be provided in the request |
| 1024 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 1025 | |
| 1026 | .Request |
| 1027 | ---- |
| 1028 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 1029 | Content-Type: application/json;charset=UTF-8 |
| 1030 | |
| 1031 | { |
| 1032 | "reviewer": "john.doe@example.com" |
| 1033 | } |
| 1034 | ---- |
| 1035 | |
| 1036 | As response an link:#add-reviewer-result[AddReviewerResult] entity is |
| 1037 | returned that describes the newly added reviewers. |
| 1038 | |
| 1039 | .Response |
| 1040 | ---- |
| 1041 | HTTP/1.1 200 OK |
| 1042 | Content-Disposition: attachment |
| 1043 | Content-Type: application/json;charset=UTF-8 |
| 1044 | |
| 1045 | )]}' |
| 1046 | { |
| 1047 | "reviewers": [ |
| 1048 | { |
| 1049 | "kind": "gerritcodereview#reviewer", |
| 1050 | "approvals": { |
| 1051 | "Verified": " 0", |
| 1052 | "Code-Review": " 0" |
| 1053 | }, |
| 1054 | "_account_id": 1000096, |
| 1055 | "name": "John Doe", |
| 1056 | "email": "john.doe@example.com" |
| 1057 | } |
| 1058 | ] |
| 1059 | } |
| 1060 | ---- |
| 1061 | |
| 1062 | If a group is specified, adding the group members as reviewers is an |
| 1063 | atomic operation. This means if an error is returned, none of the |
| 1064 | members are added as reviewer. |
| 1065 | |
| 1066 | If a group with many members is added as reviewer a confirmation may be |
| 1067 | required. |
| 1068 | |
| 1069 | .Request |
| 1070 | ---- |
| 1071 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 1072 | Content-Type: application/json;charset=UTF-8 |
| 1073 | |
| 1074 | { |
| 1075 | "reviewer": "MyProjectVerifiers" |
| 1076 | } |
| 1077 | ---- |
| 1078 | |
| 1079 | .Response |
| 1080 | ---- |
| 1081 | HTTP/1.1 200 OK |
| 1082 | Content-Disposition: attachment |
| 1083 | Content-Type: application/json;charset=UTF-8 |
| 1084 | |
| 1085 | )]}' |
| 1086 | { |
| 1087 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 1088 | "confirm": true |
| 1089 | } |
| 1090 | ---- |
| 1091 | |
| 1092 | To confirm the addition of the reviewers, resend the request with the |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 1093 | `confirmed` flag being set. |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1094 | |
| 1095 | .Request |
| 1096 | ---- |
| 1097 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 1098 | Content-Type: application/json;charset=UTF-8 |
| 1099 | |
| 1100 | { |
| 1101 | "reviewer": "MyProjectVerifiers", |
Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 1102 | "confirmed": true |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1103 | } |
| 1104 | ---- |
| 1105 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 1106 | [[delete-reviewer]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1107 | Delete Reviewer |
| 1108 | ~~~~~~~~~~~~~~~ |
| 1109 | [verse] |
| 1110 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' |
| 1111 | |
Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 1112 | Deletes a reviewer from a change. |
| 1113 | |
| 1114 | .Request |
| 1115 | ---- |
| 1116 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
| 1117 | ---- |
| 1118 | |
| 1119 | .Response |
| 1120 | ---- |
| 1121 | HTTP/1.1 204 No Content |
| 1122 | ---- |
| 1123 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1124 | [[revision-endpoints]] |
| 1125 | Revision Endpoints |
| 1126 | ------------------ |
| 1127 | |
| 1128 | [[get-review]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1129 | Get Review |
| 1130 | ~~~~~~~~~~ |
| 1131 | [verse] |
| 1132 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review' |
| 1133 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1134 | Retrieves a review of a revision. |
| 1135 | |
| 1136 | .Request |
| 1137 | ---- |
| 1138 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 1139 | ---- |
| 1140 | |
| 1141 | As response a link:#change-info[ChangeInfo] entity with |
| 1142 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 1143 | detailed accounts] is returned that describes the review of the |
| 1144 | revision. The revision for which the review is retrieved is contained |
| 1145 | in the `revisions` field. In addition the `current_revision` field is |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 1146 | set if the revision for which the review is retrieved is the current |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1147 | revision of the change. Please note that the returned labels are always |
| 1148 | for the current patch set. |
| 1149 | |
| 1150 | .Response |
| 1151 | ---- |
| 1152 | HTTP/1.1 200 OK |
| 1153 | Content-Disposition: attachment |
| 1154 | Content-Type: application/json;charset=UTF-8 |
| 1155 | |
| 1156 | )]}' |
| 1157 | { |
| 1158 | "kind": "gerritcodereview#change", |
| 1159 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1160 | "project": "myProject", |
| 1161 | "branch": "master", |
| 1162 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1163 | "subject": "Implementing Feature X", |
| 1164 | "status": "NEW", |
| 1165 | "created": "2013-02-01 09:59:32.126000000", |
| 1166 | "updated": "2013-02-21 11:16:36.775000000", |
| 1167 | "reviewed": true, |
| 1168 | "mergeable": true, |
| 1169 | "_sortkey": "0023412400000f7d", |
| 1170 | "_number": 3965, |
| 1171 | "owner": { |
| 1172 | "_account_id": 1000096, |
| 1173 | "name": "John Doe", |
| 1174 | "email": "john.doe@example.com" |
| 1175 | }, |
| 1176 | "labels": { |
| 1177 | "Verified": { |
| 1178 | "all": [ |
| 1179 | { |
| 1180 | "value": 0, |
| 1181 | "_account_id": 1000096, |
| 1182 | "name": "John Doe", |
| 1183 | "email": "john.doe@example.com" |
| 1184 | }, |
| 1185 | { |
| 1186 | "value": 0, |
| 1187 | "_account_id": 1000097, |
| 1188 | "name": "Jane Roe", |
| 1189 | "email": "jane.roe@example.com" |
| 1190 | } |
| 1191 | ], |
| 1192 | "values": { |
| 1193 | "-1": "Fails", |
| 1194 | " 0": "No score", |
| 1195 | "+1": "Verified" |
| 1196 | } |
| 1197 | }, |
| 1198 | "Code-Review": { |
| 1199 | "all": [ |
| 1200 | { |
| 1201 | "value": -1, |
| 1202 | "_account_id": 1000096, |
| 1203 | "name": "John Doe", |
| 1204 | "email": "john.doe@example.com" |
| 1205 | }, |
| 1206 | { |
| 1207 | "value": 1, |
| 1208 | "_account_id": 1000097, |
| 1209 | "name": "Jane Roe", |
| 1210 | "email": "jane.roe@example.com" |
| 1211 | } |
| 1212 | ] |
| 1213 | "values": { |
| 1214 | "-2": "Do not submit", |
| 1215 | "-1": "I would prefer that you didn\u0027t submit this", |
| 1216 | " 0": "No score", |
| 1217 | "+1": "Looks good to me, but someone else must approve", |
| 1218 | "+2": "Looks good to me, approved" |
| 1219 | } |
| 1220 | } |
| 1221 | }, |
| 1222 | "permitted_labels": { |
| 1223 | "Verified": [ |
| 1224 | "-1", |
| 1225 | " 0", |
| 1226 | "+1" |
| 1227 | ], |
| 1228 | "Code-Review": [ |
| 1229 | "-2", |
| 1230 | "-1", |
| 1231 | " 0", |
| 1232 | "+1", |
| 1233 | "+2" |
| 1234 | ] |
| 1235 | }, |
| 1236 | "removable_reviewers": [ |
| 1237 | { |
| 1238 | "_account_id": 1000096, |
| 1239 | "name": "John Doe", |
| 1240 | "email": "john.doe@example.com" |
| 1241 | }, |
| 1242 | { |
| 1243 | "_account_id": 1000097, |
| 1244 | "name": "Jane Roe", |
| 1245 | "email": "jane.roe@example.com" |
| 1246 | } |
| 1247 | ], |
| 1248 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 1249 | "revisions": { |
| 1250 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
| 1251 | "_number": 2, |
| 1252 | "fetch": { |
| 1253 | "http": { |
| 1254 | "url": "http://gerrit/myProject", |
| 1255 | "ref": "refs/changes/65/3965/2" |
| 1256 | } |
| 1257 | } |
| 1258 | } |
| 1259 | } |
| 1260 | ---- |
| 1261 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1262 | [[set-review]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1263 | Set Review |
| 1264 | ~~~~~~~~~~ |
| 1265 | [verse] |
| 1266 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review' |
| 1267 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1268 | Sets a review on a revision. |
| 1269 | |
| 1270 | The review must be provided in the request body as a |
| 1271 | link:#review-input[ReviewInput] entity. |
| 1272 | |
| 1273 | .Request |
| 1274 | ---- |
| 1275 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 1276 | Content-Type: application/json;charset=UTF-8 |
| 1277 | |
| 1278 | { |
| 1279 | "message": "Some nits need to be fixed.", |
| 1280 | "labels": { |
| 1281 | "Code-Review": -1 |
| 1282 | }, |
| 1283 | "comments": { |
| 1284 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1285 | { |
| 1286 | "line": 23, |
| 1287 | "message": "[nit] trailing whitespace" |
| 1288 | }, |
| 1289 | { |
| 1290 | "line": 49, |
| 1291 | "message": "[nit] s/conrtol/control" |
| 1292 | } |
| 1293 | ] |
| 1294 | } |
| 1295 | } |
| 1296 | ---- |
| 1297 | |
| 1298 | As response a link:#review-info[ReviewInfo] entity is returned that |
| 1299 | describes the applied labels. |
| 1300 | |
| 1301 | .Response |
| 1302 | ---- |
| 1303 | HTTP/1.1 200 OK |
| 1304 | Content-Disposition: attachment |
| 1305 | Content-Type: application/json;charset=UTF-8 |
| 1306 | |
| 1307 | )]}' |
| 1308 | { |
| 1309 | "labels": { |
| 1310 | "Code-Review": -1 |
| 1311 | } |
| 1312 | } |
| 1313 | ---- |
| 1314 | |
Edwin Kempin | cdae63b | 2013-03-15 15:06:59 +0100 | [diff] [blame] | 1315 | [[rebase-revision]] |
| 1316 | Rebase Revision |
| 1317 | ~~~~~~~~~~~~~~~ |
| 1318 | [verse] |
| 1319 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase' |
| 1320 | |
| 1321 | Rebases a revision. |
| 1322 | |
| 1323 | .Request |
| 1324 | ---- |
| 1325 | POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0 |
| 1326 | ---- |
| 1327 | |
| 1328 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 1329 | describes the rebased change. Information about the current patch set |
| 1330 | is included. |
| 1331 | |
| 1332 | .Response |
| 1333 | ---- |
| 1334 | HTTP/1.1 200 OK |
| 1335 | Content-Disposition: attachment |
| 1336 | Content-Type: application/json;charset=UTF-8 |
| 1337 | |
| 1338 | )]}' |
| 1339 | { |
| 1340 | "kind": "gerritcodereview#change", |
| 1341 | "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1342 | "project": "myProject", |
| 1343 | "branch": "master", |
| 1344 | "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2", |
| 1345 | "subject": "Implement Feature X", |
| 1346 | "status": "NEW", |
| 1347 | "created": "2013-02-01 09:59:32.126000000", |
| 1348 | "updated": "2013-02-21 11:16:36.775000000", |
| 1349 | "mergeable": false, |
| 1350 | "_sortkey": "0024cf9a000012bf", |
| 1351 | "_number": 4799, |
| 1352 | "owner": { |
| 1353 | "name": "John Doe" |
| 1354 | }, |
| 1355 | "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822", |
| 1356 | "revisions": { |
| 1357 | "27cc4558b5a3d3387dd11ee2df7a117e7e581822": { |
| 1358 | "_number": 2, |
| 1359 | "fetch": { |
| 1360 | "http": { |
| 1361 | "url": "http://gerrit:8080/myProject", |
| 1362 | "ref": "refs/changes/99/4799/2" |
| 1363 | } |
| 1364 | }, |
| 1365 | "commit": { |
| 1366 | "parents": [ |
| 1367 | { |
| 1368 | "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70", |
| 1369 | "subject": "Implement Feature A" |
| 1370 | } |
| 1371 | ], |
| 1372 | "author": { |
| 1373 | "name": "John Doe", |
| 1374 | "email": "john.doe@example.com", |
| 1375 | "date": "2013-05-07 15:21:27.000000000", |
| 1376 | "tz": 120 |
| 1377 | }, |
| 1378 | "committer": { |
| 1379 | "name": "Gerrit Code Review", |
| 1380 | "email": "gerrit-server@example.com", |
| 1381 | "date": "2013-05-07 15:35:43.000000000", |
| 1382 | "tz": 120 |
| 1383 | }, |
| 1384 | "subject": "Implement Feature X", |
| 1385 | "message": "Implement Feature X\n\nAdded feature X." |
| 1386 | } |
| 1387 | } |
| 1388 | } |
| 1389 | ---- |
| 1390 | |
| 1391 | If the revision cannot be rebased, e.g. due to conflicts, the response is |
| 1392 | "`409 Conflict`" and the error message is contained in the response |
| 1393 | body. |
| 1394 | |
| 1395 | .Response |
| 1396 | ---- |
| 1397 | HTTP/1.1 409 Conflict |
| 1398 | Content-Disposition: attachment |
| 1399 | Content-Type: text/plain;charset=UTF-8 |
| 1400 | |
| 1401 | The change could not be rebased due to a path conflict during merge. |
| 1402 | ---- |
| 1403 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 1404 | [[submit-revision]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1405 | Submit Revision |
| 1406 | ~~~~~~~~~~~~~~~ |
| 1407 | [verse] |
| 1408 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit' |
| 1409 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 1410 | Submits a revision. |
| 1411 | |
| 1412 | The request body only needs to include a link:#submit-input[ |
| 1413 | SubmitInput] entity if the request should wait for the merge to |
| 1414 | complete. |
| 1415 | |
| 1416 | .Request |
| 1417 | ---- |
| 1418 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
| 1419 | Content-Type: application/json;charset=UTF-8 |
| 1420 | |
| 1421 | { |
| 1422 | "wait_for_merge": true |
| 1423 | } |
| 1424 | ---- |
| 1425 | |
| 1426 | As response a link:#submit-info[SubmitInfo] entity is returned that |
| 1427 | describes the status of the submitted change. |
| 1428 | |
| 1429 | .Response |
| 1430 | ---- |
| 1431 | HTTP/1.1 200 OK |
| 1432 | Content-Disposition: attachment |
| 1433 | Content-Type: application/json;charset=UTF-8 |
| 1434 | |
| 1435 | )]}' |
| 1436 | { |
| 1437 | "status": "MERGED" |
| 1438 | } |
| 1439 | ---- |
| 1440 | |
| 1441 | If the revision cannot be submitted, e.g. because the submit rule |
| 1442 | doesn't allow submitting the revision or the revision is not the |
| 1443 | current revision, the response is "`409 Conflict`" and the error |
| 1444 | message is contained in the response body. |
| 1445 | |
| 1446 | .Response |
| 1447 | ---- |
| 1448 | HTTP/1.1 409 Conflict |
| 1449 | Content-Type: text/plain;charset=UTF-8 |
| 1450 | |
| 1451 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 1452 | ---- |
| 1453 | |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1454 | [[get-patch]] |
| 1455 | Get Patch |
| 1456 | ~~~~~~~~~ |
| 1457 | [verse] |
| 1458 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch' |
| 1459 | |
| 1460 | Gets the formatted patch for one revision. |
| 1461 | |
| 1462 | .Request |
| 1463 | ---- |
| 1464 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0 |
| 1465 | ---- |
| 1466 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 1467 | The formatted patch is returned as text encoded inside base64: |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1468 | |
| 1469 | .Response |
| 1470 | ---- |
| 1471 | HTTP/1.1 200 OK |
| 1472 | Content-Disposition: attachment |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 1473 | Content-Type: text/plain;charset=ISO-8859-1 |
| 1474 | X-FYI-Content-Encoding: base64 |
| 1475 | X-FYI-Content-Type: application/mbox |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1476 | |
Shawn Pearce | 98361f7 | 2013-05-10 16:27:36 -0700 | [diff] [blame] | 1477 | RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY... |
Edwin Kempin | 257d70f | 2013-03-28 14:31:14 +0100 | [diff] [blame] | 1478 | ---- |
| 1479 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1480 | [[get-submit-type]] |
| 1481 | Get Submit Type |
| 1482 | ~~~~~~~~~~~~~~~ |
| 1483 | [verse] |
| 1484 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type' |
| 1485 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1486 | Gets the method the server will use to submit (merge) the change. |
| 1487 | |
| 1488 | .Request |
| 1489 | ---- |
| 1490 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0 |
| 1491 | ---- |
| 1492 | |
| 1493 | .Response |
| 1494 | ---- |
| 1495 | HTTP/1.1 200 OK |
| 1496 | Content-Disposition: attachment |
| 1497 | Content-Type: application/json;charset=UTF-8 |
| 1498 | |
| 1499 | )]}' |
| 1500 | "MERGE_IF_NECESSARY" |
| 1501 | ---- |
| 1502 | |
| 1503 | [[test-submit-type]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1504 | Test Submit Type |
| 1505 | ~~~~~~~~~~~~~~~~ |
| 1506 | [verse] |
| 1507 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type' |
| 1508 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1509 | Tests the submit_type Prolog rule in the project, or the one given. |
| 1510 | |
| 1511 | Request body may be either the Prolog code as `text/plain` or a |
| 1512 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 1513 | may be set to `SKIP` to bypass parent project filters while testing |
| 1514 | a project-specific rule. |
| 1515 | |
| 1516 | .Request |
| 1517 | ---- |
| 1518 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0 |
| 1519 | Content-Type: text/plain;charset-UTF-8 |
| 1520 | |
| 1521 | submit_type(cherry_pick). |
| 1522 | ---- |
| 1523 | |
| 1524 | .Response |
| 1525 | ---- |
| 1526 | HTTP/1.1 200 OK |
| 1527 | Content-Disposition: attachment |
| 1528 | Content-Type: application/json;charset=UTF-8 |
| 1529 | |
| 1530 | )]}' |
| 1531 | "cherry_pick" |
| 1532 | ---- |
| 1533 | |
| 1534 | [[test-submit-rule]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1535 | Test Submit Rule |
| 1536 | ~~~~~~~~~~~~~~~~ |
| 1537 | [verse] |
| 1538 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule' |
| 1539 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1540 | Tests the submit_rule Prolog rule in the project, or the one given. |
| 1541 | |
| 1542 | Request body may be either the Prolog code as `text/plain` or a |
| 1543 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 1544 | may be set to `SKIP` to bypass parent project filters while testing |
| 1545 | a project-specific rule. |
| 1546 | |
| 1547 | .Request |
| 1548 | ---- |
| 1549 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type?filters=SKIP HTTP/1.0 |
| 1550 | Content-Type: text/plain;charset-UTF-8 |
| 1551 | |
| 1552 | submit_rule(submit(R)) :- |
| 1553 | R = label('Any-Label-Name', reject(_)). |
| 1554 | ---- |
| 1555 | |
| 1556 | The response is a list of link:#submit-record[SubmitRecord] entries |
| 1557 | describing the permutations that satisfy the tested submit rule. |
| 1558 | |
| 1559 | .Response |
| 1560 | ---- |
| 1561 | HTTP/1.1 200 OK |
| 1562 | Content-Disposition: attachment |
| 1563 | Content-Type: application/json;charset=UTF-8 |
| 1564 | |
| 1565 | )]}' |
| 1566 | [ |
| 1567 | { |
| 1568 | "status": "NOT_READY", |
| 1569 | "reject": { |
| 1570 | "Any-Label-Name": {} |
| 1571 | } |
| 1572 | } |
| 1573 | ] |
| 1574 | ---- |
| 1575 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1576 | [[list-drafts]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1577 | List Drafts |
| 1578 | ~~~~~~~~~~~ |
| 1579 | [verse] |
| 1580 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/' |
| 1581 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1582 | Lists the draft comments of a revision that belong to the calling |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1583 | user. |
| 1584 | |
| 1585 | As result a map is returned that maps the file path to a list of |
| 1586 | link:#comment-info[CommentInfo] entries. The entries in the map are |
| 1587 | sorted by file path. |
| 1588 | |
| 1589 | .Request |
| 1590 | ---- |
| 1591 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 1592 | ---- |
| 1593 | |
| 1594 | .Response |
| 1595 | ---- |
| 1596 | HTTP/1.1 200 OK |
| 1597 | Content-Disposition: attachment |
| 1598 | Content-Type: application/json;charset=UTF-8 |
| 1599 | |
| 1600 | )]}' |
| 1601 | { |
| 1602 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1603 | { |
| 1604 | "kind": "gerritcodereview#comment", |
| 1605 | "id": "TvcXrmjM", |
| 1606 | "line": 23, |
| 1607 | "message": "[nit] trailing whitespace", |
| 1608 | "updated": "2013-02-26 15:40:43.986000000" |
| 1609 | }, |
| 1610 | { |
| 1611 | "kind": "gerritcodereview#comment", |
| 1612 | "id": "TveXwFiA", |
| 1613 | "line": 49, |
| 1614 | "in_reply_to": "TfYX-Iuo", |
| 1615 | "message": "Done", |
| 1616 | "updated": "2013-02-26 15:40:45.328000000" |
| 1617 | } |
| 1618 | ] |
| 1619 | } |
| 1620 | ---- |
| 1621 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1622 | [[create-draft]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1623 | Create Draft |
| 1624 | ~~~~~~~~~~~~ |
| 1625 | [verse] |
| 1626 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts' |
| 1627 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1628 | Creates a draft comment on a revision. |
| 1629 | |
| 1630 | The new draft comment must be provided in the request body inside a |
| 1631 | link:#comment-input[CommentInput] entity. |
| 1632 | |
| 1633 | .Request |
| 1634 | ---- |
| 1635 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
| 1636 | Content-Type: application/json;charset=UTF-8 |
| 1637 | |
| 1638 | { |
| 1639 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1640 | "line": 23, |
| 1641 | "message": "[nit] trailing whitespace" |
| 1642 | } |
| 1643 | ---- |
| 1644 | |
| 1645 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1646 | describes the draft comment. |
| 1647 | |
| 1648 | .Response |
| 1649 | ---- |
| 1650 | HTTP/1.1 200 OK |
| 1651 | Content-Disposition: attachment |
| 1652 | Content-Type: application/json;charset=UTF-8 |
| 1653 | |
| 1654 | )]}' |
| 1655 | { |
| 1656 | "kind": "gerritcodereview#comment", |
| 1657 | "id": "TvcXrmjM", |
| 1658 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1659 | "line": 23, |
| 1660 | "message": "[nit] trailing whitespace", |
| 1661 | "updated": "2013-02-26 15:40:43.986000000" |
| 1662 | } |
| 1663 | ---- |
| 1664 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1665 | [[get-draft]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1666 | Get Draft |
| 1667 | ~~~~~~~~~ |
| 1668 | [verse] |
| 1669 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
| 1670 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1671 | Retrieves a draft comment of a revision that belongs to the calling |
| 1672 | user. |
| 1673 | |
| 1674 | .Request |
| 1675 | ---- |
| 1676 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1677 | ---- |
| 1678 | |
| 1679 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1680 | describes the draft comment. |
| 1681 | |
| 1682 | .Response |
| 1683 | ---- |
| 1684 | HTTP/1.1 200 OK |
| 1685 | Content-Disposition: attachment |
| 1686 | Content-Type: application/json;charset=UTF-8 |
| 1687 | |
| 1688 | )]}' |
| 1689 | { |
| 1690 | "kind": "gerritcodereview#comment", |
| 1691 | "id": "TvcXrmjM", |
| 1692 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1693 | "line": 23, |
| 1694 | "message": "[nit] trailing whitespace", |
| 1695 | "updated": "2013-02-26 15:40:43.986000000" |
| 1696 | } |
| 1697 | ---- |
| 1698 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1699 | [[update-draft]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1700 | Update Draft |
| 1701 | ~~~~~~~~~~~~ |
| 1702 | [verse] |
| 1703 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
| 1704 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1705 | Updates a draft comment on a revision. |
| 1706 | |
| 1707 | The new draft comment must be provided in the request body inside a |
| 1708 | link:#comment-input[CommentInput] entity. |
| 1709 | |
| 1710 | .Request |
| 1711 | ---- |
| 1712 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1713 | Content-Type: application/json;charset=UTF-8 |
| 1714 | |
| 1715 | { |
| 1716 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1717 | "line": 23, |
| 1718 | "message": "[nit] trailing whitespace" |
| 1719 | } |
| 1720 | ---- |
| 1721 | |
| 1722 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1723 | describes the draft comment. |
| 1724 | |
| 1725 | .Response |
| 1726 | ---- |
| 1727 | HTTP/1.1 200 OK |
| 1728 | Content-Disposition: attachment |
| 1729 | Content-Type: application/json;charset=UTF-8 |
| 1730 | |
| 1731 | )]}' |
| 1732 | { |
| 1733 | "kind": "gerritcodereview#comment", |
| 1734 | "id": "TvcXrmjM", |
| 1735 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1736 | "line": 23, |
| 1737 | "message": "[nit] trailing whitespace", |
| 1738 | "updated": "2013-02-26 15:40:43.986000000" |
| 1739 | } |
| 1740 | ---- |
| 1741 | |
| 1742 | [[delete-draft]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1743 | Delete Draft |
| 1744 | ~~~~~~~~~~~~ |
| 1745 | [verse] |
| 1746 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
| 1747 | |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1748 | Deletes a draft comment from a revision. |
| 1749 | |
| 1750 | .Request |
| 1751 | ---- |
| 1752 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1753 | ---- |
| 1754 | |
| 1755 | .Response |
| 1756 | ---- |
| 1757 | HTTP/1.1 204 No Content |
| 1758 | ---- |
| 1759 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 1760 | [[list-comments]] |
| 1761 | List Comments |
| 1762 | ~~~~~~~~~~~~~ |
| 1763 | [verse] |
| 1764 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/' |
| 1765 | |
| 1766 | Lists the published comments of a revision. |
| 1767 | |
| 1768 | As result a map is returned that maps the file path to a list of |
| 1769 | link:#comment-info[CommentInfo] entries. The entries in the map are |
| 1770 | sorted by file path. |
| 1771 | |
| 1772 | .Request |
| 1773 | ---- |
| 1774 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0 |
| 1775 | ---- |
| 1776 | |
| 1777 | .Response |
| 1778 | ---- |
| 1779 | HTTP/1.1 200 OK |
| 1780 | Content-Disposition: attachment |
| 1781 | Content-Type: application/json;charset=UTF-8 |
| 1782 | |
| 1783 | )]}' |
| 1784 | { |
| 1785 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1786 | { |
| 1787 | "kind": "gerritcodereview#comment", |
| 1788 | "id": "TvcXrmjM", |
| 1789 | "line": 23, |
| 1790 | "message": "[nit] trailing whitespace", |
| 1791 | "updated": "2013-02-26 15:40:43.986000000", |
| 1792 | "author": { |
| 1793 | "_account_id": 1000096, |
| 1794 | "name": "John Doe", |
| 1795 | "email": "john.doe@example.com" |
| 1796 | } |
| 1797 | }, |
| 1798 | { |
| 1799 | "kind": "gerritcodereview#comment", |
| 1800 | "id": "TveXwFiA", |
| 1801 | "line": 49, |
| 1802 | "in_reply_to": "TfYX-Iuo", |
| 1803 | "message": "Done", |
| 1804 | "updated": "2013-02-26 15:40:45.328000000", |
| 1805 | "author": { |
| 1806 | "_account_id": 1000097, |
| 1807 | "name": "Jane Roe", |
| 1808 | "email": "jane.roe@example.com" |
| 1809 | } |
| 1810 | } |
| 1811 | ] |
| 1812 | } |
| 1813 | ---- |
| 1814 | |
| 1815 | [[get-comment]] |
| 1816 | Get Comment |
| 1817 | ~~~~~~~~~~~ |
| 1818 | [verse] |
| 1819 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' |
| 1820 | |
| 1821 | Retrieves a published comment of a revision. |
| 1822 | |
| 1823 | .Request |
| 1824 | ---- |
| 1825 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0 |
| 1826 | ---- |
| 1827 | |
| 1828 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1829 | describes the published comment. |
| 1830 | |
| 1831 | .Response |
| 1832 | ---- |
| 1833 | HTTP/1.1 200 OK |
| 1834 | Content-Disposition: attachment |
| 1835 | Content-Type: application/json;charset=UTF-8 |
| 1836 | |
| 1837 | )]}' |
| 1838 | { |
| 1839 | "kind": "gerritcodereview#comment", |
| 1840 | "id": "TvcXrmjM", |
| 1841 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1842 | "line": 23, |
| 1843 | "message": "[nit] trailing whitespace", |
| 1844 | "updated": "2013-02-26 15:40:43.986000000", |
| 1845 | "author": { |
| 1846 | "_account_id": 1000096, |
| 1847 | "name": "John Doe", |
| 1848 | "email": "john.doe@example.com" |
| 1849 | } |
| 1850 | } |
| 1851 | ---- |
| 1852 | |
Edwin Kempin | 682ac71 | 2013-05-14 13:40:46 +0200 | [diff] [blame] | 1853 | [[list-files]] |
| 1854 | List Files |
| 1855 | ~~~~~~~~~~ |
| 1856 | [verse] |
| 1857 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/' |
| 1858 | |
| 1859 | Lists the files that were modified, added or deleted in a revision. |
| 1860 | |
| 1861 | .Request |
| 1862 | ---- |
| 1863 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0 |
| 1864 | ---- |
| 1865 | |
| 1866 | As result a map is returned that maps the file path to a list of |
| 1867 | link:#file-info[FileInfo] entries. The entries in the map are |
| 1868 | sorted by file path. |
| 1869 | |
| 1870 | .Response |
| 1871 | ---- |
| 1872 | HTTP/1.1 200 OK |
| 1873 | Content-Disposition: attachment |
| 1874 | Content-Type: application/json;charset=UTF-8 |
| 1875 | |
| 1876 | )]}' |
| 1877 | { |
| 1878 | "/COMMIT_MSG": { |
| 1879 | "status": "A", |
| 1880 | "lines_inserted": 7 |
| 1881 | }, |
| 1882 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": { |
| 1883 | "lines_inserted": 5, |
| 1884 | "lines_deleted": 3 |
| 1885 | } |
| 1886 | } |
| 1887 | ---- |
| 1888 | |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 1889 | [[get-content]] |
| 1890 | Get Content |
| 1891 | ~~~~~~~~~~~ |
| 1892 | [verse] |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 1893 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content' |
Edwin Kempin | aef44b0 | 2013-05-07 16:15:55 +0200 | [diff] [blame] | 1894 | |
| 1895 | Gets the content of a file from a certain revision. |
| 1896 | |
| 1897 | .Request |
| 1898 | ---- |
| 1899 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0 |
| 1900 | ---- |
| 1901 | |
| 1902 | The content is returned as base64 encoded string. |
| 1903 | |
| 1904 | .Response |
| 1905 | ---- |
| 1906 | HTTP/1.1 200 OK |
| 1907 | Content-Disposition: attachment |
| 1908 | Content-Type: text/plain;charset=UTF-8 |
| 1909 | |
| 1910 | Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY... |
| 1911 | ---- |
| 1912 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 1913 | [[get-diff]] |
| 1914 | Get Diff |
| 1915 | ~~~~~~~~ |
| 1916 | [verse] |
| 1917 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/diff' |
| 1918 | |
| 1919 | Gets the diff of a file from a certain revision. |
| 1920 | |
| 1921 | .Request |
| 1922 | ---- |
| 1923 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0 |
| 1924 | ---- |
| 1925 | |
| 1926 | As response a link:#diff-info[DiffInfo] entity is returned that describes the diff. |
| 1927 | |
| 1928 | .Response |
| 1929 | ---- |
| 1930 | HTTP/1.1 200 OK |
| 1931 | Content-Disposition: attachment |
| 1932 | Content-Type: application/json;charset=UTF-8 |
| 1933 | |
| 1934 | )] |
| 1935 | { |
| 1936 | "meta_a": { |
| 1937 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1938 | "content_type": "text/x-java-source" |
| 1939 | }, |
| 1940 | "meta_b": { |
| 1941 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1942 | "content_type": "text/x-java-source" |
| 1943 | }, |
| 1944 | "change_type": "MODIFIED", |
| 1945 | "diff_header": [ |
| 1946 | "diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1947 | "index 59b7670..9faf81c 100644", |
| 1948 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1949 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 1950 | ], |
| 1951 | "content": [ |
| 1952 | { |
| 1953 | "ab": [ |
| 1954 | "// Copyright (C) 2010 The Android Open Source Project", |
| 1955 | "//", |
| 1956 | "// Licensed under the Apache License, Version 2.0 (the \"License\");", |
| 1957 | "// you may not use this file except in compliance with the License.", |
| 1958 | "// You may obtain a copy of the License at", |
| 1959 | "//", |
| 1960 | "// http://www.apache.org/licenses/LICENSE-2.0", |
| 1961 | "//", |
| 1962 | "// Unless required by applicable law or agreed to in writing, software", |
| 1963 | "// distributed under the License is distributed on an \"AS IS\" BASIS,", |
| 1964 | "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", |
| 1965 | "// See the License for the specific language governing permissions and", |
| 1966 | "// limitations under the License." |
| 1967 | ] |
| 1968 | }, |
| 1969 | { |
| 1970 | "b": [ |
| 1971 | "//", |
| 1972 | "// Add some more lines in the header." |
| 1973 | ] |
| 1974 | }, |
| 1975 | { |
| 1976 | "ab": [ |
| 1977 | "", |
| 1978 | "package com.google.gerrit.server.project;", |
| 1979 | "", |
| 1980 | "import com.google.common.collect.Maps;", |
| 1981 | ... |
| 1982 | ] |
| 1983 | } |
| 1984 | ... |
| 1985 | ] |
| 1986 | } |
| 1987 | ---- |
| 1988 | |
| 1989 | If the `intraline` parameter is specified, intraline differences are included in the diff. |
| 1990 | |
| 1991 | .Request |
| 1992 | ---- |
| 1993 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/b6b9c10649b9041884046119ab794374470a1b45/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff?intraline HTTP/1.0 |
| 1994 | ---- |
| 1995 | |
| 1996 | .Response |
| 1997 | ---- |
| 1998 | HTTP/1.1 200 OK |
| 1999 | Content-Disposition: attachment |
| 2000 | Content-Type: application/json;charset=UTF-8 |
| 2001 | |
| 2002 | )] |
| 2003 | { |
| 2004 | "meta_a": { |
| 2005 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2006 | "content_type": "text/x-java-source" |
| 2007 | }, |
| 2008 | "meta_b": { |
| 2009 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2010 | "content_type": "text/x-java-source" |
| 2011 | }, |
| 2012 | "change_type": "MODIFIED", |
| 2013 | "diff_header": [ |
| 2014 | "diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2015 | "index 59b7670..9faf81c 100644", |
| 2016 | "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2017 | "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java" |
| 2018 | ], |
| 2019 | "content": [ |
| 2020 | ... |
| 2021 | { |
| 2022 | "a": [ |
| 2023 | "/** Manages access control for Git references (aka branches, tags). */" |
| 2024 | ], |
| 2025 | "b": [ |
| 2026 | "/** Manages access control for the Git references (aka branches, tags). */" |
| 2027 | ], |
| 2028 | "edit_a": [], |
| 2029 | "edit_b": [ |
| 2030 | [ |
| 2031 | 31, |
| 2032 | 4 |
| 2033 | ] |
| 2034 | ] |
| 2035 | } |
| 2036 | ] |
| 2037 | } |
| 2038 | ---- |
| 2039 | |
| 2040 | The `base` parameter can be specified to control the base patch set from which the diff should |
| 2041 | be generated. |
| 2042 | |
| 2043 | .Request |
| 2044 | ---- |
| 2045 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/b6b9c10649b9041884046119ab794374470a1b45/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff?base=2 HTTP/1.0 |
| 2046 | ---- |
| 2047 | |
| 2048 | .Response |
| 2049 | ---- |
| 2050 | HTTP/1.1 200 OK |
| 2051 | Content-Disposition: attachment |
| 2052 | Content-Type: application/json;charset=UTF-8 |
| 2053 | |
| 2054 | )] |
| 2055 | { |
| 2056 | "meta_a": { |
| 2057 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2058 | "content_type": "text/x-java-source" |
| 2059 | }, |
| 2060 | "meta_b": { |
| 2061 | "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 2062 | "content_type": "text/x-java-source" |
| 2063 | }, |
| 2064 | "change_type": "MODIFIED", |
| 2065 | "content": [ |
| 2066 | { |
| 2067 | "skip": 578 |
| 2068 | } |
| 2069 | ] |
| 2070 | } |
| 2071 | ---- |
| 2072 | |
| 2073 | The `ignore-whitespace` parameter can be specified to control how whitespace differences are |
| 2074 | reported in the result. Valid values are `NONE`, `TRAILING`, `CHANGED` or `ALL`. |
| 2075 | |
| 2076 | The `context` parameter can be specified to control the number of lines of surrounding context |
| 2077 | in the diff. Valid values are `ALL` or number of lines. |
| 2078 | |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2079 | [[set-reviewed]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2080 | Set Reviewed |
| 2081 | ~~~~~~~~~~~~ |
| 2082 | [verse] |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2083 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed' |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2084 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2085 | Marks a file of a revision as reviewed by the calling user. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2086 | |
| 2087 | .Request |
| 2088 | ---- |
| 2089 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 2090 | ---- |
| 2091 | |
| 2092 | .Response |
| 2093 | ---- |
| 2094 | HTTP/1.1 201 Created |
| 2095 | ---- |
| 2096 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2097 | If the file was already marked as reviewed by the calling user the |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2098 | response is "`200 OK`". |
| 2099 | |
| 2100 | [[delete-reviewed]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2101 | Delete Reviewed |
| 2102 | ~~~~~~~~~~~~~~~ |
| 2103 | [verse] |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2104 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/reviewed' |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 2105 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2106 | Deletes the reviewed flag of the calling user from a file of a revision. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2107 | |
| 2108 | .Request |
| 2109 | ---- |
| 2110 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 2111 | ---- |
| 2112 | |
| 2113 | .Response |
| 2114 | ---- |
| 2115 | HTTP/1.1 204 No Content |
| 2116 | ---- |
| 2117 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2118 | [[cherry-pick]] |
| 2119 | Cherry Pick Revision |
| 2120 | ~~~~~~~~~~~~~~~~~~~~ |
| 2121 | [verse] |
| 2122 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick' |
| 2123 | |
| 2124 | Cherry picks a revision to a destination branch. |
| 2125 | |
| 2126 | The commit message and destination branch must be provided in the request body inside a |
| 2127 | link:#cherrypick-input[CherryPickInput] entity. |
| 2128 | |
| 2129 | .Request |
| 2130 | ---- |
| 2131 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0 |
| 2132 | Content-Type: application/json;charset=UTF-8 |
| 2133 | |
| 2134 | { |
Gustaf Lundh | 98df5b5 | 2013-05-07 19:22:13 +0100 | [diff] [blame] | 2135 | "message" : "Implementing Feature X", |
| 2136 | "destination" : "release-branch" |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2137 | } |
| 2138 | ---- |
| 2139 | |
| 2140 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 2141 | describes the resulting cherry picked change. |
| 2142 | |
| 2143 | .Response |
| 2144 | ---- |
| 2145 | HTTP/1.1 200 OK |
| 2146 | Content-Disposition: attachment |
| 2147 | Content-Type: application/json;charset=UTF-8 |
| 2148 | |
| 2149 | )]}' |
| 2150 | { |
| 2151 | "kind": "gerritcodereview#change", |
| 2152 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2153 | "project": "myProject", |
| 2154 | "branch": "release-branch", |
| 2155 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941", |
| 2156 | "subject": "Implementing Feature X", |
| 2157 | "status": "NEW", |
| 2158 | "created": "2013-02-01 09:59:32.126000000", |
| 2159 | "updated": "2013-02-21 11:16:36.775000000", |
| 2160 | "reviewed": true, |
| 2161 | "mergeable": true, |
| 2162 | "_sortkey": "0023412400000f7d", |
| 2163 | "_number": 3965, |
| 2164 | "owner": { |
| 2165 | "name": "John Doe" |
| 2166 | } |
| 2167 | } |
| 2168 | ---- |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2169 | |
| 2170 | [[ids]] |
| 2171 | IDs |
| 2172 | --- |
| 2173 | |
Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 2174 | [[account-id]] |
| 2175 | link:rest-api-accounts.html#account-id[\{account-id\}] |
| 2176 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 2177 | -- |
| 2178 | -- |
| 2179 | |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2180 | [[change-id]] |
| 2181 | \{change-id\} |
| 2182 | ~~~~~~~~~~~~~ |
| 2183 | Identifier that uniquely identifies one change. |
| 2184 | |
| 2185 | This can be: |
| 2186 | |
| 2187 | * an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'", |
| 2188 | where for the branch the `refs/heads/` prefix can be omitted |
| 2189 | ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$") |
| 2190 | * a Change-Id if it uniquely identifies one change |
| 2191 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
| 2192 | * a legacy numeric change ID ("4247") |
| 2193 | |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2194 | [[comment-id]] |
| 2195 | \{comment-id\} |
| 2196 | ~~~~~~~~~~~~~~ |
| 2197 | UUID of a published comment. |
| 2198 | |
Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 2199 | [[draft-id]] |
| 2200 | \{draft-id\} |
| 2201 | ~~~~~~~~~~~~ |
| 2202 | UUID of a draft comment. |
Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 2203 | |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2204 | [[file-id]] |
| 2205 | \{file-id\} |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2206 | ~~~~~~~~~~~~ |
Edwin Kempin | bea55a5 | 2013-05-14 13:53:39 +0200 | [diff] [blame] | 2207 | The path of the file. |
Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 2208 | |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 2209 | [[revision-id]] |
| 2210 | \{revision-id\} |
| 2211 | ~~~~~~~~~~~~~~~ |
| 2212 | Identifier that uniquely identifies one revision of a change. |
| 2213 | |
| 2214 | This can be: |
| 2215 | |
Shawn Pearce | 9c0722a | 2013-03-02 15:30:31 -0800 | [diff] [blame] | 2216 | * the literal `current` to name the current patch set/revision |
Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 2217 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 2218 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 2219 | change ("674ac754"), at least 4 digits are required |
| 2220 | * a legacy numeric patch number ("1" for first patch set of the change) |
| 2221 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2222 | [[json-entities]] |
| 2223 | JSON Entities |
| 2224 | ------------- |
| 2225 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 2226 | [[abandon-input]] |
| 2227 | AbandonInput |
| 2228 | ~~~~~~~~~~~~ |
| 2229 | The `AbandonInput` entity contains information for abandoning a change. |
| 2230 | |
| 2231 | [options="header",width="50%",cols="1,^1,5"] |
| 2232 | |=========================== |
| 2233 | |Field Name ||Description |
| 2234 | |`message` |optional| |
| 2235 | Message to be added as review comment to the change when abandoning the |
| 2236 | change. |
| 2237 | |=========================== |
| 2238 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 2239 | [[add-reviewer-result]] |
| 2240 | AddReviewerResult |
| 2241 | ~~~~~~~~~~~~~~~~~ |
| 2242 | The `AddReviewerResult` entity describes the result of adding a |
| 2243 | reviewer to a change. |
| 2244 | |
| 2245 | [options="header",width="50%",cols="1,^1,5"] |
| 2246 | |=========================== |
| 2247 | |Field Name ||Description |
| 2248 | |`reviewers` |optional| |
| 2249 | The newly added reviewers as a list of link:#reviewer-info[ |
| 2250 | ReviewerInfo] entities. |
| 2251 | |`error` |optional| |
| 2252 | Error message explaining why the reviewer could not be added. + |
| 2253 | If a group was specified in the input and an error is returned, it |
| 2254 | means that none of the members were added as reviewer. |
| 2255 | |`confirm` |`false` if not set| |
| 2256 | Whether adding the reviewer requires confirmation. |
| 2257 | |=========================== |
| 2258 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2259 | [[approval-info]] |
| 2260 | ApprovalInfo |
| 2261 | ~~~~~~~~~~~~ |
| 2262 | The `ApprovalInfo` entity contains information about an approval from a |
| 2263 | user for a label on a change. |
| 2264 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 2265 | `ApprovalInfo` has the same fields as |
| 2266 | link:rest-api-accounts.html#account-info[AccountInfo]. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2267 | In addition `ApprovalInfo` has the following fields: |
| 2268 | |
| 2269 | [options="header",width="50%",cols="1,^1,5"] |
| 2270 | |=========================== |
| 2271 | |Field Name ||Description |
Dave Borowitz | a30db91 | 2013-03-22 14:20:33 -0700 | [diff] [blame] | 2272 | |`value` |optional| |
| 2273 | The vote that the user has given for the label. If present and zero, the |
| 2274 | user is permitted to vote on the label. If absent, the user is not |
| 2275 | permitted to vote on that label. |
Gustaf Lundh | 2e07d502 | 2013-05-08 17:07:42 +0100 | [diff] [blame] | 2276 | |`date` |optional| |
| 2277 | The time and date describing when the approval was made. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2278 | |=========================== |
| 2279 | |
| 2280 | [[change-info]] |
| 2281 | ChangeInfo |
| 2282 | ~~~~~~~~~~ |
| 2283 | The `ChangeInfo` entity contains information about a change. |
| 2284 | |
| 2285 | [options="header",width="50%",cols="1,^1,5"] |
| 2286 | |================================== |
| 2287 | |Field Name ||Description |
| 2288 | |`kind` ||`gerritcodereview#change` |
| 2289 | |`id` || |
| 2290 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2291 | where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2292 | `refs/heads/` prefix is omitted. |
| 2293 | |`project` ||The name of the project. |
| 2294 | |`branch` || |
| 2295 | The name of the target branch. + |
| 2296 | The `refs/heads/` prefix is omitted. |
Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 2297 | |`topic` |optional|The topic to which this change belongs. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2298 | |`change_id` ||The Change-Id of the change. |
| 2299 | |`subject` || |
| 2300 | The subject of the change (header line of the commit message). |
| 2301 | |`status` || |
| 2302 | The status of the change (`NEW`, `SUBMITTED`, `MERGED`, `ABANDONED`, |
| 2303 | `DRAFT`). |
| 2304 | |`created` || |
| 2305 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 2306 | created. |
| 2307 | |`updated` || |
| 2308 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 2309 | updated. |
| 2310 | |`starred` |not set if `false`| |
| 2311 | Whether the calling user has starred this change. |
| 2312 | |`reviewed` |not set if `false`| |
| 2313 | Whether the change was reviewed by the calling user. |
Edwin Kempin | baf70e1 | 2013-02-27 10:36:13 +0100 | [diff] [blame] | 2314 | |`mergeable` |optional| |
| 2315 | Whether the change is mergeable. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2316 | Not set for merged changes. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2317 | |`_sortkey` ||The sortkey of the change. |
| 2318 | |`_number` ||The legacy numeric ID of the change. |
| 2319 | |`owner` || |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 2320 | The owner of the change as an link:rest-api-accounts.html#account-info[ |
| 2321 | AccountInfo] entity. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2322 | |`labels` |optional| |
| 2323 | The labels of the change as a map that maps the label names to |
| 2324 | link:#label-info[LabelInfo] entries. + |
| 2325 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 2326 | labels] are requested. |
| 2327 | |`permitted_labels` |optional| |
| 2328 | A map of the permitted labels that maps a label name to the list of |
| 2329 | values that are allowed for that label. + |
| 2330 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 2331 | |`removable_reviewers`|optional| |
| 2332 | The reviewers that can be removed by the calling user as a list of |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 2333 | link:rest-api-accounts.html#account-info[AccountInfo] entities. + |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2334 | Only set if link:#detailed-labels[detailed labels] are requested. |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 2335 | |`messages`|optional| |
| 2336 | Messages associated with the change as a list of |
| 2337 | link:#change-message-info[ChangeMessageInfo] entities. + |
| 2338 | Only set if link:#messages[messages] are requested. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2339 | |`current_revision` |optional| |
| 2340 | The commit ID of the current patch set of this change. + |
| 2341 | Only set if link:#current-revision[the current revision] is requested |
| 2342 | or if link:#all-revisions[all revisions] are requested. |
| 2343 | |`revisions` |optional| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2344 | All patch sets of this change as a map that maps the commit ID of the |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2345 | patch set to a link:#revision-info[RevisionInfo] entity. + |
| 2346 | Only set if link:#all-revisions[all revisions] are requested. |
| 2347 | |`_more_changes` |optional, not set if `false`| |
| 2348 | Whether the query would deliver more results if not limited. + |
| 2349 | Only set on either the last or the first change that is returned. |
| 2350 | |================================== |
| 2351 | |
John Spurlock | 74a70cc | 2013-03-23 16:41:50 -0400 | [diff] [blame] | 2352 | [[change-message-info]] |
| 2353 | ChangeMessageInfo |
| 2354 | ~~~~~~~~~~~~~~~~~ |
| 2355 | The `ChangeMessageInfo` entity contains information about a message |
| 2356 | attached to a change. |
| 2357 | |
| 2358 | [options="header",width="50%",cols="1,^1,5"] |
| 2359 | |================================== |
| 2360 | |Field Name ||Description |
| 2361 | |`id` ||The ID of the message. |
| 2362 | |`author` |optional| |
| 2363 | Author of the message as an |
| 2364 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 2365 | Unset if written by the Gerrit system. |
| 2366 | |`date` || |
| 2367 | The link:rest-api.html#timestamp[timestamp] this message was posted. |
| 2368 | |`message` ||The text left by the user. |
| 2369 | |`_revision_number` |optional| |
| 2370 | Which patchset (if any) generated this message. |
| 2371 | |================================== |
| 2372 | |
Gustaf Lundh | 019fb26 | 2012-11-28 14:20:22 +0100 | [diff] [blame] | 2373 | [[cherrypick-input]] |
| 2374 | CherryPickInput |
| 2375 | ~~~~~~~~~~~~~~~ |
| 2376 | The `CherryPickInput` entity contains information for cherry-picking a change to a new branch. |
| 2377 | |
| 2378 | [options="header",width="50%",cols="1,6"] |
| 2379 | |=========================== |
| 2380 | |Field Name |Description |
| 2381 | |`message` |Commit message for the cherry-picked change |
| 2382 | |`destination` |Destination Branch |
| 2383 | |=========================== |
| 2384 | |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2385 | [[comment-info]] |
| 2386 | CommentInfo |
| 2387 | ~~~~~~~~~~~ |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2388 | The `CommentInfo` entity contains information about an inline comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2389 | |
| 2390 | [options="header",width="50%",cols="1,^1,5"] |
| 2391 | |=========================== |
| 2392 | |Field Name ||Description |
| 2393 | |`kind` ||`gerritcodereview#comment` |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2394 | |`id` ||The URL encoded UUID of the comment. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2395 | |`path` |optional| |
| 2396 | The path of the file for which the inline comment was done. + |
| 2397 | Not set if returned in a map where the key is the file path. |
| 2398 | |`side` |optional| |
| 2399 | The side on which the comment was added. + |
| 2400 | Allowed values are `REVISION` and `PARENT`. + |
| 2401 | If not set, the default is `REVISION`. |
| 2402 | |`line` |optional| |
| 2403 | The number of the line for which the comment was done. + |
| 2404 | If not set, it's a file comment. |
| 2405 | |`in_reply_to` |optional| |
| 2406 | The URL encoded UUID of the comment to which this comment is a reply. |
| 2407 | |`message` |optional|The comment message. |
| 2408 | |`updated` || |
| 2409 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 2410 | written. |
John Spurlock | 5e402f0 | 2013-03-24 11:35:04 -0400 | [diff] [blame] | 2411 | |`author` |optional| |
| 2412 | The author of the message as an + |
| 2413 | link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| 2414 | Unset for draft comments, assumed to be the calling user. |
Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 2415 | |=========================== |
| 2416 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2417 | [[comment-input]] |
| 2418 | CommentInput |
| 2419 | ~~~~~~~~~~~~ |
| 2420 | The `CommitInput` entity contains information for creating an inline |
| 2421 | comment. |
| 2422 | |
| 2423 | [options="header",width="50%",cols="1,^1,5"] |
| 2424 | |=========================== |
| 2425 | |Field Name ||Description |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 2426 | |`kind` |optional| |
| 2427 | Must be `gerritcodereview#comment` if provided. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2428 | |`id` |optional| |
Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 2429 | The URL encoded UUID of the comment if an existing draft comment should |
| 2430 | be updated. |
Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 2431 | |`path` |optional| |
| 2432 | The path of the file for which the inline comment should be added. + |
| 2433 | Doesn't need to be set if contained in a map where the key is the file |
| 2434 | path. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2435 | |`side` |optional| |
| 2436 | The side on which the comment should be added. + |
| 2437 | Allowed values are `REVISION` and `PARENT`. + |
| 2438 | If not set, the default is `REVISION`. |
| 2439 | |`line` |optional| |
| 2440 | The number of the line for which the comment should be added. + |
| 2441 | `0` if it is a file comment. + |
| 2442 | If not set, a file comment is added. |
| 2443 | |`in_reply_to` |optional| |
| 2444 | 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] | 2445 | |`updated` |optional| |
| 2446 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 2447 | Accepted but ignored. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2448 | |`message` |optional| |
| 2449 | The comment message. + |
| 2450 | If not set and an existing draft comment is updated, the existing draft |
| 2451 | comment is deleted. |
| 2452 | |=========================== |
| 2453 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2454 | [[commit-info]] |
| 2455 | CommitInfo |
| 2456 | ~~~~~~~~~~ |
| 2457 | The `CommitInfo` entity contains information about a commit. |
| 2458 | |
| 2459 | [options="header",width="50%",cols="1,6"] |
| 2460 | |========================== |
| 2461 | |Field Name |Description |
| 2462 | |`commit` |The commit ID. |
| 2463 | |`parent` | |
| 2464 | The parent commits of this commit as a list of |
| 2465 | link:#commit-info[CommitInfo] entities. |
| 2466 | |`author` |The author of the commit as a |
| 2467 | link:#git-person-info[GitPersonInfo] entity. |
| 2468 | |`committer` |The committer of the commit as a |
| 2469 | link:#git-person-info[GitPersonInfo] entity. |
| 2470 | |`subject` | |
| 2471 | The subject of the commit (header line of the commit message). |
| 2472 | |`message` |The commit message. |
| 2473 | |========================== |
| 2474 | |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2475 | [[diff-content]] |
| 2476 | DiffContent |
| 2477 | ~~~~~~~~~~~ |
| 2478 | The `DiffContent` entity contains information about the content differences |
| 2479 | in a file. |
| 2480 | |
| 2481 | [options="header",width="50%",cols="1,^1,5"] |
| 2482 | |========================== |
| 2483 | |Field Name ||Description |
| 2484 | |`a` |optional|Content only in the file on side A (deleted in B). |
| 2485 | |`b` |optional|Content only in the file on side B (added in B). |
| 2486 | |`ab` |optional|Content in the file on both sides (unchanged). |
| 2487 | |`edit_a` |only present during a replace, i.e. both `a` and `b` are present| |
| 2488 | Text sections deleted from side A as a |
| 2489 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
| 2490 | |`edit_b` |only present during a replace, i.e. both `a` and `b` are present| |
| 2491 | Text sections inserted in side B as a |
| 2492 | link:#diff-intraline-info[DiffIntralineInfo] entity. |
| 2493 | |`skip` |optional|count of lines skipped on both sides when the file is |
| 2494 | too large to include all common lines. |
| 2495 | |========================== |
| 2496 | |
| 2497 | [[diff-file-meta-info]] |
| 2498 | DiffFileMetaInfo |
| 2499 | ~~~~~~~~~~~~~~~~ |
| 2500 | The `DiffFileMetaInfo` entity contains meta information about a file diff. |
| 2501 | |
| 2502 | [options="header",width="50%",cols="1,6"] |
| 2503 | |========================== |
| 2504 | |Field Name |Description |
| 2505 | |`name` |The name of the file. |
| 2506 | |`content_type`|The content type of the file. |
| 2507 | |========================== |
| 2508 | |
| 2509 | [[diff-info]] |
| 2510 | DiffInfo |
| 2511 | ~~~~~~~~ |
| 2512 | The `DiffInfo` entity contains information about the diff of a file |
| 2513 | in a revision. |
| 2514 | |
| 2515 | [options="header",width="50%",cols="1,^1,5"] |
| 2516 | |========================== |
| 2517 | |Field Name ||Description |
| 2518 | |`meta_a` |not present when the file is added| |
| 2519 | Meta information about the file on side A as a |
| 2520 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 2521 | |`meta_b` |not present when the file is deleted| |
| 2522 | Meta information about the file on side B as a |
| 2523 | link:#diff-file-meta-info[DiffFileMetaInfo] entity. |
| 2524 | |`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED` |
| 2525 | `COPIED`, `REWRITE`). |
| 2526 | |`intraline_status`|only set when the `intraline` parameter was specified in the request| |
| 2527 | Intraline status (`OK`, `ERROR`, `TIMEOUT`). |
| 2528 | |`diff_header` ||A list of strings representing the patch set diff header. |
| 2529 | |`content` ||The content differences in the file as a list of |
| 2530 | link:#diff-content[DiffContent] entities. |
| 2531 | |========================== |
| 2532 | |
| 2533 | [[diff-intraline-info]] |
| 2534 | DiffIntralineInfo |
| 2535 | ~~~~~~~~~~~~~~~~~ |
| 2536 | The `DiffIntralineInfo` entity contains information about intraline edits in a |
| 2537 | file. |
| 2538 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 2539 | The information consists of a list of `<skip length, mark length>` pairs, where |
| 2540 | the skip length is the number of characters between the end of the previous edit |
| 2541 | and the start of this edit, and the mark length is the number of edited characters |
| 2542 | following the skip. The start of the edits is from the beginning of the related |
| 2543 | diff content lines. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2544 | |
David Pursehouse | 31203f5 | 2013-06-08 17:05:45 +0900 | [diff] [blame] | 2545 | Note that the implied newline character at the end of each line is included in |
Colby Ranger | 4c29275 | 2013-06-07 11:11:00 -0700 | [diff] [blame] | 2546 | the length calculation, and thus it is possible for the edits to span newlines. |
David Pursehouse | 882aef2 | 2013-06-05 10:56:37 +0900 | [diff] [blame] | 2547 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2548 | [[fetch-info]] |
| 2549 | FetchInfo |
| 2550 | ~~~~~~~~~ |
| 2551 | The `FetchInfo` entity contains information about how to fetch a patch |
| 2552 | set via a certain protocol. |
| 2553 | |
| 2554 | [options="header",width="50%",cols="1,6"] |
| 2555 | |========================== |
| 2556 | |Field Name |Description |
| 2557 | |`url` |The URL of the project. |
| 2558 | |`ref` |The ref of the patch set. |
| 2559 | |========================== |
| 2560 | |
| 2561 | [[file-info]] |
| 2562 | FileInfo |
| 2563 | ~~~~~~~~ |
| 2564 | The `FileInfo` entity contains information about a file in a patch set. |
| 2565 | |
| 2566 | [options="header",width="50%",cols="1,^1,5"] |
| 2567 | |============================= |
| 2568 | |Field Name ||Description |
| 2569 | |`status` |optional| |
| 2570 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 2571 | "`C`"=Copied, "`W`"=Rewritten). + |
| 2572 | Not set if the file was Modified ("`M`"). |
| 2573 | |`binary` |not set if `false`|Whether the file is binary. |
| 2574 | |`old_path` |optional| |
| 2575 | The old file path. + |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2576 | Only set if the file was renamed or copied. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2577 | |`lines_inserted`|optional| |
| 2578 | Number of inserted lines. + |
| 2579 | Not set for binary files or if no lines were inserted. |
| 2580 | |`lines_deleted` |optional| |
| 2581 | Number of deleted lines. + |
| 2582 | Not set for binary files or if no lines were deleted. |
| 2583 | |============================= |
| 2584 | |
| 2585 | [[git-person-info]] |
| 2586 | GitPersonInfo |
| 2587 | ~~~~~~~~~~~~~ |
| 2588 | The `GitPersonInfo` entity contains information about the |
| 2589 | author/committer of a commit. |
| 2590 | |
| 2591 | [options="header",width="50%",cols="1,6"] |
| 2592 | |========================== |
| 2593 | |Field Name |Description |
| 2594 | |`name` |The name of the author/committer. |
| 2595 | |`email` |The email address of the author/committer. |
| 2596 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 2597 | this identity was constructed. |
| 2598 | |`tz` |The timezone offset from UTC of when this identity was |
| 2599 | constructed. |
| 2600 | |========================== |
| 2601 | |
| 2602 | [[label-info]] |
| 2603 | LabelInfo |
| 2604 | ~~~~~~~~~ |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 2605 | The `LabelInfo` entity contains information about a label on a change, always |
| 2606 | corresponding to the current patch set. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2607 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 2608 | There are two options that control the contents of `LabelInfo`: |
Dave Borowitz | 7d6aa01 | 2013-06-14 16:53:48 -0700 | [diff] [blame] | 2609 | link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`]. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 2610 | |
| 2611 | * For a quick summary of the state of labels, use `LABELS`. |
| 2612 | * For detailed information about labels, including exact numeric votes for all |
| 2613 | users and the allowed range of votes for the current user, use `DETAILED_LABELS`. |
| 2614 | |
| 2615 | Common fields |
| 2616 | ^^^^^^^^^^^^^ |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2617 | [options="header",width="50%",cols="1,^1,5"] |
| 2618 | |=========================== |
| 2619 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2620 | |`optional` |not set if `false`| |
| 2621 | Whether the label is optional. Optional means the label may be set, but |
| 2622 | it's neither necessary for submission nor does it block submission if |
| 2623 | set. |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 2624 | |=========================== |
| 2625 | |
| 2626 | Fields set by `LABELS` |
| 2627 | ^^^^^^^^^^^^^^^^^^^^^^ |
| 2628 | [options="header",width="50%",cols="1,^1,5"] |
| 2629 | |=========================== |
| 2630 | |Field Name ||Description |
| 2631 | |`approved` |optional|One user who approved this label on the change |
| 2632 | (voted the maximum value) as an |
| 2633 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 2634 | |`rejected` |optional|One user who rejected this label on the change |
| 2635 | (voted the minimum value) as an |
| 2636 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 2637 | |`recommended` |optional|One user who recommended this label on the |
| 2638 | change (voted positively, but not the maximum value) as an |
| 2639 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 2640 | |`disliked` |optional|One user who disliked this label on the change |
| 2641 | (voted negatively, but not the minimum value) as an |
| 2642 | link:rest-api-accounts.html#account-info[AccountInfo] entity. |
| 2643 | |`value` |optional|The voting value of the user who |
| 2644 | recommended/disliked this label on the change if it is not |
| 2645 | "`+1`"/"`-1`". |
| 2646 | |=========================== |
| 2647 | |
| 2648 | Fields set by `DETAILED_LABELS` |
| 2649 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 2650 | [options="header",width="50%",cols="1,^1,5"] |
| 2651 | |=========================== |
| 2652 | |Field Name ||Description |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2653 | |`all` |optional|List of all approvals for this label as a list |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 2654 | of link:#approval-info[ApprovalInfo] entities. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2655 | |`values` |optional|A map of all values that are allowed for this |
| 2656 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 2657 | to the value descriptions. |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2658 | |=========================== |
| 2659 | |
Dave Borowitz | 8815951 | 2013-06-14 14:21:50 -0700 | [diff] [blame] | 2660 | |
Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 2661 | [[restore-input]] |
| 2662 | RestoreInput |
| 2663 | ~~~~~~~~~~~~ |
| 2664 | The `RestoreInput` entity contains information for restoring a change. |
| 2665 | |
| 2666 | [options="header",width="50%",cols="1,^1,5"] |
| 2667 | |=========================== |
| 2668 | |Field Name ||Description |
| 2669 | |`message` |optional| |
| 2670 | Message to be added as review comment to the change when restoring the |
| 2671 | change. |
| 2672 | |=========================== |
| 2673 | |
Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 2674 | [[revert-input]] |
| 2675 | RevertInput |
| 2676 | ~~~~~~~~~~~ |
| 2677 | The `RevertInput` entity contains information for reverting a change. |
| 2678 | |
| 2679 | [options="header",width="50%",cols="1,^1,5"] |
| 2680 | |=========================== |
| 2681 | |Field Name ||Description |
| 2682 | |`message` |optional| |
| 2683 | Message to be added as review comment to the change when reverting the |
| 2684 | change. |
| 2685 | |=========================== |
| 2686 | |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2687 | [[review-info]] |
| 2688 | ReviewInfo |
| 2689 | ~~~~~~~~~~ |
| 2690 | The `ReviewInfo` entity contains information about a review. |
| 2691 | |
| 2692 | [options="header",width="50%",cols="1,6"] |
| 2693 | |=========================== |
| 2694 | |Field Name |Description |
| 2695 | |`labels` | |
| 2696 | The labels of the review as a map that maps the label names to the |
| 2697 | voting values. |
| 2698 | |=========================== |
| 2699 | |
| 2700 | [[review-input]] |
| 2701 | ReviewInput |
| 2702 | ~~~~~~~~~~~ |
| 2703 | The `ReviewInput` entity contains information for adding a review to a |
| 2704 | revision. |
| 2705 | |
| 2706 | [options="header",width="50%",cols="1,^1,5"] |
| 2707 | |============================ |
| 2708 | |Field Name ||Description |
| 2709 | |`message` |optional| |
| 2710 | The message to be added as review comment. |
| 2711 | |`labels` |optional| |
| 2712 | The votes that should be added to the revision as a map that maps the |
| 2713 | label names to the voting values. |
| 2714 | |`comments` |optional| |
| 2715 | The comments that should be added as a map that maps a file path to a |
| 2716 | list of link:#comment-input[CommentInput] entities. |
| 2717 | |`strict_labels`|`true` if not set| |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 2718 | Whether all labels are required to be within the user's permitted ranges |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2719 | based on access controls. + |
| 2720 | If `true`, attempting to use a label not granted to the user will fail |
| 2721 | the entire modify operation early. + |
| 2722 | If `false`, the operation will execute anyway, but the proposed labels |
| 2723 | will be modified to be the "best" value allowed by the access controls. |
| 2724 | |`drafts` |optional| |
| 2725 | Draft handling that defines how draft comments are handled that are |
| 2726 | already in the database but that were not also described in this |
| 2727 | input. + |
| 2728 | Allowed values are `DELETE`, `PUBLISH` and `KEEP`. + |
| 2729 | If not set, the default is `DELETE`. |
| 2730 | |`notify` |optional| |
| 2731 | Notify handling that defines to whom email notifications should be sent |
| 2732 | after the review is stored. + |
| 2733 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 2734 | If not set, the default is `ALL`. |
Shawn Pearce | 9d78312 | 2013-06-11 18:18:03 -0700 | [diff] [blame] | 2735 | |`on_behalf_of`|optional| |
| 2736 | link:rest-api-accounts.html#account-id[\{account-id\}] the review |
| 2737 | should be posted on behalf of. To use this option the caller must |
| 2738 | have been granted `labelAs-NAME` permission for all keys of labels. |
Shawn Pearce | ff5e6f6 | 2013-06-26 09:14:08 -0600 | [diff] [blame] | 2739 | |`wait_for_commit`|optional| |
| 2740 | Whether the request should wait for commit to the index to finish. |
| 2741 | If `false` (default) the request returns after the data is sent to |
| 2742 | the index, but searches may not immediately see the update. |
Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 2743 | |============================ |
| 2744 | |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 2745 | [[reviewer-info]] |
| 2746 | ReviewerInfo |
| 2747 | ~~~~~~~~~~~~ |
| 2748 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 2749 | votes on a change. |
| 2750 | |
Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 2751 | `ReviewerInfo` has the same fields as |
| 2752 | link:rest-api-accounts.html#account-info[AccountInfo] and includes |
| 2753 | link:#detailed-accounts[detailed account information]. |
Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 2754 | In addition `ReviewerInfo` has the following fields: |
| 2755 | |
| 2756 | [options="header",width="50%",cols="1,6"] |
| 2757 | |========================== |
| 2758 | |Field Name |Description |
| 2759 | |`kind` |`gerritcodereview#reviewer` |
| 2760 | |`approvals` | |
| 2761 | The approvals of the reviewer as a map that maps the label names to the |
| 2762 | approval values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`"). |
| 2763 | |========================== |
| 2764 | |
Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 2765 | [[reviewer-input]] |
| 2766 | ReviewerInput |
| 2767 | ~~~~~~~~~~~~~ |
| 2768 | The `ReviewerInput` entity contains information for adding a reviewer |
| 2769 | to a change. |
| 2770 | |
| 2771 | [options="header",width="50%",cols="1,^1,5"] |
| 2772 | |=========================== |
| 2773 | |Field Name ||Description |
| 2774 | |`reviewer` || |
| 2775 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 2776 | should be added as reviewer or the link:rest-api-groups.html#group-id[ |
| 2777 | ID] of one group for which all members should be added as reviewers. + |
| 2778 | If an ID identifies both an account and a group, only the account is |
| 2779 | added as reviewer to the change. |
| 2780 | |`confirmed` |optional| |
| 2781 | Whether adding the reviewer is confirmed. + |
| 2782 | The Gerrit server may be configured to |
| 2783 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 2784 | confirmation] when adding a group as reviewer that has many members. |
| 2785 | |=========================== |
| 2786 | |
Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2787 | [[revision-info]] |
| 2788 | RevisionInfo |
| 2789 | ~~~~~~~~~~~~ |
| 2790 | The `RevisionInfo` entity contains information about a patch set. |
| 2791 | |
| 2792 | [options="header",width="50%",cols="1,^1,5"] |
| 2793 | |=========================== |
| 2794 | |Field Name ||Description |
| 2795 | |`draft` |not set if `false`|Whether the patch set is a draft. |
| 2796 | |`_number` ||The patch set number. |
| 2797 | |`fetch` || |
| 2798 | Information about how to fetch this patch set. The fetch information is |
| 2799 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 2800 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
| 2801 | |`commit` ||The commit of the patch set as |
| 2802 | link:#commit-info[CommitInfo] entity. |
| 2803 | |`files` || |
| 2804 | The files of the patch set as a map that maps the file names to |
| 2805 | link:#file-info[FileInfo] entities. |
| 2806 | |=========================== |
| 2807 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2808 | [[rule-input]] |
| 2809 | RuleInput |
| 2810 | ~~~~~~~~~ |
| 2811 | The `RuleInput` entity contains information to test a Prolog rule. |
| 2812 | |
| 2813 | [options="header",width="50%",cols="1,^1,5"] |
| 2814 | |=========================== |
| 2815 | |Field Name ||Description |
| 2816 | |`rule`|| |
| 2817 | Prolog code to execute instead of the code in `refs/meta/config`. |
| 2818 | |`filters`|`RUN` if not set| |
| 2819 | When `RUN` filter rules in the parent projects are called to |
| 2820 | post-process the results of the project specific rule. This |
| 2821 | behavior matches how the rule will execute if installed. + |
| 2822 | If `SKIP` the parent filters are not called, allowing the test |
| 2823 | to return results from the input rule. |
| 2824 | |=========================== |
| 2825 | |
Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 2826 | [[submit-info]] |
| 2827 | SubmitInfo |
| 2828 | ~~~~~~~~~~ |
| 2829 | The `SubmitInfo` entity contains information about the change status |
| 2830 | after submitting. |
| 2831 | |
| 2832 | [options="header",width="50%",cols="1,6"] |
| 2833 | |========================== |
| 2834 | |Field Name |Description |
| 2835 | |`status` | |
| 2836 | The status of the change after submitting, can be `MERGED` or |
| 2837 | `SUBMITTED`. + |
| 2838 | If `wait_for_merge` in the link:#submit-input[SubmitInput] was set to |
| 2839 | `false` the returned status is `SUBMITTED` and the caller can't know |
| 2840 | whether the change could be merged successfully. |
| 2841 | |========================== |
| 2842 | |
Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2843 | [[submit-input]] |
| 2844 | SubmitInput |
| 2845 | ~~~~~~~~~~~ |
| 2846 | The `SubmitInput` entity contains information for submitting a change. |
| 2847 | |
| 2848 | [options="header",width="50%",cols="1,^1,5"] |
| 2849 | |=========================== |
| 2850 | |Field Name ||Description |
| 2851 | |`wait_for_merge`|`false` if not set| |
| 2852 | Whether the request should wait for the merge to complete. + |
| 2853 | If `false` the request returns immediately after the change has been |
| 2854 | added to the merge queue and the caller can't know whether the change |
| 2855 | could be merged successfully. |
| 2856 | |=========================== |
| 2857 | |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2858 | [[submit-record]] |
| 2859 | SubmitRecord |
| 2860 | ~~~~~~~~~~~~ |
| 2861 | The `SubmitRecord` entity describes results from a submit_rule. |
| 2862 | |
| 2863 | [options="header",width="50%",cols="1,^1,5"] |
| 2864 | |=========================== |
| 2865 | |Field Name ||Description |
| 2866 | |`status`|| |
| 2867 | `OK`, the change can be submitted. + |
| 2868 | `NOT_READY`, additional labels are required before submit. + |
| 2869 | `CLOSED`, closed changes cannot be submitted. + |
| 2870 | `RULE_ERROR`, rule code failed with an error. |
| 2871 | |`ok`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 2872 | Map of labels that are approved; an |
| 2873 | link:rest-api-accounts.html#account-info[AccountInfo] identifies the |
| 2874 | voter chosen by the rule. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2875 | |`reject`|optional| |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 2876 | Map of labels that are preventing submit; |
| 2877 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2878 | |`need`|optional| |
| 2879 | Map of labels that need to be given to submit. The value is |
| 2880 | currently an empty object. |
| 2881 | |`may`|optional| |
| 2882 | Map of labels that can be used, but do not affect submit. |
Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 2883 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter, |
| 2884 | if the label has been applied. |
Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2885 | |`impossible`|optional| |
| 2886 | Map of labels that should have been in `need` but cannot be |
| 2887 | used by any user because of access restrictions. The value |
| 2888 | is currently an empty object. |
| 2889 | |`error_message`|optional| |
| 2890 | When status is RULE_ERROR this message provides some text describing |
| 2891 | the failure of the rule predicate. |
| 2892 | |=========================== |
| 2893 | |
Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 2894 | [[topic-input]] |
| 2895 | TopicInput |
| 2896 | ~~~~~~~~~~ |
| 2897 | The `TopicInput` entity contains information for setting a topic. |
| 2898 | |
| 2899 | [options="header",width="50%",cols="1,^1,5"] |
| 2900 | |=========================== |
| 2901 | |Field Name ||Description |
| 2902 | |`topic` |optional|The topic. + |
| 2903 | The topic will be deleted if not set. |
| 2904 | |`message` |optional| |
| 2905 | Message to be added as review comment to the change when setting the |
| 2906 | topic. |
| 2907 | |=========================== |
| 2908 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 2909 | |
| 2910 | GERRIT |
| 2911 | ------ |
| 2912 | Part of link:index.html[Gerrit Code Review] |