| 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 | )]}' |
| 40 | { |
| 41 | "kind": "gerritcodereview#change", |
| 42 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 43 | "project": "demo", |
| 44 | "branch": "master", |
| 45 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 46 | "subject": "One change", |
| 47 | "status": "NEW", |
| 48 | "created": "2012-07-17 07:18:30.854000000", |
| 49 | "updated": "2012-07-17 07:19:27.766000000", |
| 50 | "reviewed": true, |
| Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 51 | "mergeable": true, |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 52 | "_sortkey": "001e7057000006dc", |
| 53 | "_number": 1756, |
| 54 | "owner": { |
| 55 | "name": "John Doe" |
| 56 | }, |
| 57 | }, |
| 58 | { |
| 59 | "kind": "gerritcodereview#change", |
| 60 | "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 61 | "project": "demo", |
| 62 | "branch": "master", |
| 63 | "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501", |
| 64 | "subject": "Another change", |
| 65 | "status": "NEW", |
| 66 | "created": "2012-07-17 07:18:30.884000000", |
| 67 | "updated": "2012-07-17 07:18:30.885000000", |
| Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 68 | "mergeable": true, |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 69 | "_sortkey": "001e7056000006dd", |
| 70 | "_number": 1757, |
| 71 | "owner": { |
| 72 | "name": "John Doe" |
| 73 | }, |
| 74 | "_more_changes": true |
| 75 | } |
| 76 | ---- |
| 77 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 78 | If the `n` query parameter is supplied and additional changes exist |
| 79 | that match the query beyond the end, the last change object has a |
| 80 | `_more_changes: true` JSON field set. Callers can resume a query with |
| Christian Aistleitner | 5536401 | 2013-02-17 12:18:22 +0100 | [diff] [blame] | 81 | the `N` query parameter, supplying the last change's `_sortkey` field |
| 82 | 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] | 83 | parameter a `_more_changes: true` is put in the first change object if |
| 84 | there are results *before* the first change returned. |
| 85 | |
| 86 | Clients are allowed to specify more than one query by setting the `q` |
| 87 | parameter multiple times. In this case the result is an array of |
| 88 | arrays, one per query in the same order the queries were given in. |
| 89 | |
| Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 90 | .Query for the 25 most recent open changes of the projects that you watch |
| 91 | **** |
| 92 | get::/changes/?q=status:open+is:watched&n=25 |
| 93 | **** |
| 94 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 95 | Query that retrieves changes for a user's dashboard: |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 96 | |
| 97 | .Request |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 98 | ---- |
| 99 | 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] | 100 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 101 | |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 102 | .Response |
| 103 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 104 | HTTP/1.1 200 OK |
| 105 | Content-Disposition: attachment |
| 106 | Content-Type: application/json;charset=UTF-8 |
| 107 | |
| 108 | )]}' |
| 109 | [ |
| 110 | [ |
| 111 | { |
| 112 | "kind": "gerritcodereview#change", |
| 113 | "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 114 | "project": "demo", |
| 115 | "branch": "master", |
| 116 | "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57", |
| 117 | "subject": "One change", |
| 118 | "status": "NEW", |
| 119 | "created": "2012-07-17 07:18:30.854000000", |
| 120 | "updated": "2012-07-17 07:19:27.766000000", |
| 121 | "reviewed": true, |
| Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 122 | "mergeable": true, |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 123 | "_sortkey": "001e7057000006dc", |
| 124 | "_number": 1756, |
| 125 | "owner": { |
| 126 | "name": "John Doe" |
| 127 | }, |
| 128 | "labels": { |
| 129 | "Verified": {}, |
| 130 | "Code-Review": {} |
| 131 | } |
| 132 | } |
| 133 | ], |
| 134 | [], |
| 135 | [] |
| 136 | ] |
| 137 | ---- |
| 138 | |
| Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 139 | .Query the changes for your user dashboard |
| 140 | **** |
| 141 | get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS |
| 142 | **** |
| 143 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 144 | Additional fields can be obtained by adding `o` parameters, each |
| 145 | option requires more database lookups and slows down the query |
| 146 | response time to the client so they are generally disabled by |
| 147 | default. Optional fields are: |
| 148 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 149 | [[labels]] |
| 150 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 151 | * `LABELS`: a summary of each label required for submit, and |
| 152 | approvers that have granted (or rejected) with that label. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 153 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 154 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 155 | [[detailed-labels]] |
| 156 | -- |
| Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 157 | * `DETAILED_LABELS`: detailed label information, including numeric |
| Dave Borowitz | 992ddd7 | 2013-02-13 11:53:17 -0800 | [diff] [blame] | 158 | values of all existing approvals, recognized label values, values |
| 159 | permitted to be set by the current user, and reviewers that may be |
| 160 | removed by the current user. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 161 | -- |
| Dave Borowitz | 4c7231a | 2013-01-30 16:18:59 -0800 | [diff] [blame] | 162 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 163 | [[current-revision]] |
| 164 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 165 | * `CURRENT_REVISION`: describe the current revision (patch set) |
| 166 | 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] | 167 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 168 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 169 | [[all-revisions]] |
| 170 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 171 | * `ALL_REVISIONS`: describe all revisions, not just current. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 172 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 173 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 174 | [[current-commit]] |
| 175 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 176 | * `CURRENT_COMMIT`: parse and output all header fields from the |
| 177 | commit object, including message. Only valid when the current |
| 178 | revision or all revisions are selected. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 179 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 180 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 181 | [[all-commits]] |
| 182 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 183 | * `ALL_COMMITS`: parse and output all header fields from the |
| 184 | output revisions. If only `CURRENT_REVISION` was requested |
| 185 | then only the current revision's commit data will be output. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 186 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 187 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 188 | [[current-files]] |
| 189 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 190 | * `CURRENT_FILES`: list files modified by the commit, including |
| 191 | basic line counts inserted/deleted per file. Only valid when |
| 192 | the current revision or all revisions are selected. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 193 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 194 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 195 | [[all-files]] |
| 196 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 197 | * `ALL_FILES`: list files modified by the commit, including |
| 198 | basic line counts inserted/deleted per file. If only the |
| 199 | `CURRENT_REVISION` was requested the only that commit's |
| 200 | modified files will be output. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 201 | -- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 202 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 203 | [[detailed-accounts]] |
| 204 | -- |
| Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 205 | * `DETAILED_ACCOUNTS`: include `_account_id` and `email` fields when |
| 206 | referencing accounts. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 207 | -- |
| Dave Borowitz | 8926a88 | 2013-02-01 14:32:48 -0800 | [diff] [blame] | 208 | |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 209 | .Request |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 210 | ---- |
| 211 | 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] | 212 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 213 | |
| Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 214 | .Response |
| 215 | ---- |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 216 | HTTP/1.1 200 OK |
| 217 | Content-Disposition: attachment |
| 218 | Content-Type: application/json;charset=UTF-8 |
| 219 | |
| 220 | )]}' |
| 221 | [ |
| 222 | { |
| 223 | "kind": "gerritcodereview#change", |
| 224 | "id": "demo~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 225 | "project": "gerrit", |
| 226 | "branch": "master", |
| 227 | "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a", |
| 228 | "subject": "Use an EventBus to manage star icons", |
| 229 | "status": "NEW", |
| 230 | "created": "2012-04-25 00:52:25.580000000", |
| 231 | "updated": "2012-04-25 00:52:25.586000000", |
| Edwin Kempin | db1f0b8 | 2013-02-21 15:07:00 +0100 | [diff] [blame] | 232 | "mergeable": true, |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 233 | "_sortkey": "001c9bf400000061", |
| 234 | "_number": 97, |
| 235 | "owner": { |
| 236 | "name": "Shawn Pearce" |
| 237 | }, |
| 238 | "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c", |
| 239 | "revisions": { |
| 240 | "184ebe53805e102605d11f6b143486d15c23a09c": { |
| 241 | "_number": 1, |
| 242 | "fetch": { |
| 243 | "git": { |
| 244 | "url": "git://localhost/gerrit", |
| 245 | "ref": "refs/changes/97/97/1" |
| 246 | }, |
| 247 | "http": { |
| 248 | "url": "http://127.0.0.1:8080/gerrit", |
| 249 | "ref": "refs/changes/97/97/1" |
| 250 | } |
| 251 | }, |
| 252 | "commit": { |
| 253 | "parents": [ |
| 254 | { |
| 255 | "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646", |
| 256 | "subject": "Migrate contributor agreements to All-Projects." |
| 257 | } |
| 258 | ], |
| 259 | "author": { |
| 260 | "name": "Shawn O. Pearce", |
| 261 | "email": "sop@google.com", |
| 262 | "date": "2012-04-24 18:08:08.000000000", |
| 263 | "tz": -420 |
| 264 | }, |
| 265 | "committer": { |
| 266 | "name": "Shawn O. Pearce", |
| 267 | "email": "sop@google.com", |
| 268 | "date": "2012-04-24 18:08:08.000000000", |
| 269 | "tz": -420 |
| 270 | }, |
| 271 | "subject": "Use an EventBus to manage star icons", |
| 272 | "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..." |
| 273 | }, |
| 274 | "files": { |
| 275 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": { |
| 276 | "lines_deleted": 8 |
| 277 | }, |
| 278 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": { |
| 279 | "lines_inserted": 1 |
| 280 | }, |
| 281 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": { |
| 282 | "lines_inserted": 11, |
| 283 | "lines_deleted": 19 |
| 284 | }, |
| 285 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": { |
| 286 | "lines_inserted": 23, |
| 287 | "lines_deleted": 20 |
| 288 | }, |
| 289 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": { |
| 290 | "status": "D", |
| 291 | "lines_deleted": 139 |
| 292 | }, |
| 293 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": { |
| 294 | "status": "A", |
| 295 | "lines_inserted": 204 |
| 296 | }, |
| 297 | "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": { |
| 298 | "lines_deleted": 9 |
| 299 | } |
| 300 | } |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 | ] |
| 305 | ---- |
| 306 | |
| Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 307 | [[get-change]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 308 | Get Change |
| 309 | ~~~~~~~~~~ |
| 310 | [verse] |
| 311 | 'GET /changes/link:#change-id[\{change-id\}]' |
| 312 | |
| Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 313 | Retrieves a change. |
| 314 | |
| 315 | .Request |
| 316 | ---- |
| 317 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0 |
| 318 | ---- |
| 319 | |
| 320 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 321 | describes the change. |
| 322 | |
| 323 | .Response |
| 324 | ---- |
| 325 | HTTP/1.1 200 OK |
| 326 | Content-Disposition: attachment |
| 327 | Content-Type: application/json;charset=UTF-8 |
| 328 | |
| 329 | )]}' |
| 330 | { |
| 331 | "kind": "gerritcodereview#change", |
| 332 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 333 | "project": "myProject", |
| 334 | "branch": "master", |
| 335 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 336 | "subject": "Implementing Feature X", |
| 337 | "status": "NEW", |
| 338 | "created": "2013-02-01 09:59:32.126000000", |
| 339 | "updated": "2013-02-21 11:16:36.775000000", |
| 340 | "reviewed": true, |
| 341 | "mergeable": true, |
| 342 | "_sortkey": "0023412400000f7d", |
| 343 | "_number": 3965, |
| 344 | "owner": { |
| 345 | "name": "John Doe" |
| 346 | } |
| 347 | } |
| 348 | ---- |
| 349 | |
| Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 350 | [[get-change-detail]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 351 | Get Change Detail |
| 352 | ~~~~~~~~~~~~~~~~~ |
| 353 | [verse] |
| 354 | 'GET /changes/link:#change-id[\{change-id\}]/detail' |
| 355 | |
| Edwin Kempin | 8e49220 | 2013-02-21 15:38:25 +0100 | [diff] [blame] | 356 | Retrieves a change with link:#labels[labels], link:#detailed-labels[ |
| 357 | detailed labels] and link:#detailed-accounts[detailed accounts]. |
| 358 | |
| 359 | .Request |
| 360 | ---- |
| 361 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0 |
| 362 | ---- |
| 363 | |
| 364 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 365 | describes the change. |
| 366 | |
| 367 | .Response |
| 368 | ---- |
| 369 | HTTP/1.1 200 OK |
| 370 | Content-Disposition: attachment |
| 371 | Content-Type: application/json;charset=UTF-8 |
| 372 | |
| 373 | )]}' |
| 374 | { |
| 375 | "kind": "gerritcodereview#change", |
| 376 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 377 | "project": "myProject", |
| 378 | "branch": "master", |
| 379 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 380 | "subject": "Implementing Feature X", |
| 381 | "status": "NEW", |
| 382 | "created": "2013-02-01 09:59:32.126000000", |
| 383 | "updated": "2013-02-21 11:16:36.775000000", |
| 384 | "reviewed": true, |
| 385 | "mergeable": true, |
| 386 | "_sortkey": "0023412400000f7d", |
| 387 | "_number": 3965, |
| 388 | "owner": { |
| 389 | "_account_id": 1000096, |
| 390 | "name": "John Doe", |
| 391 | "email": "john.doe@example.com" |
| 392 | }, |
| 393 | "labels": { |
| 394 | "Verified": { |
| 395 | "all": [ |
| 396 | { |
| 397 | "value": 0, |
| 398 | "_account_id": 1000096, |
| 399 | "name": "John Doe", |
| 400 | "email": "john.doe@example.com" |
| 401 | }, |
| 402 | { |
| 403 | "value": 0, |
| 404 | "_account_id": 1000097, |
| 405 | "name": "Jane Roe", |
| 406 | "email": "jane.roe@example.com" |
| 407 | } |
| 408 | ], |
| 409 | "values": { |
| 410 | "-1": "Fails", |
| 411 | " 0": "No score", |
| 412 | "+1": "Verified" |
| 413 | } |
| 414 | }, |
| 415 | "Code-Review": { |
| 416 | "recommended": { |
| 417 | "_account_id": 1000097, |
| 418 | "name": "Jane Roe", |
| 419 | "email": "jane.roe@example.com" |
| 420 | }, |
| 421 | "disliked": { |
| 422 | "_account_id": 1000096, |
| 423 | "name": "John Doe", |
| 424 | "email": "john.doe@example.com" |
| 425 | }, |
| 426 | "all": [ |
| 427 | { |
| 428 | "value": -1, |
| 429 | "_account_id": 1000096, |
| 430 | "name": "John Doe", |
| 431 | "email": "john.doe@example.com" |
| 432 | }, |
| 433 | { |
| 434 | "value": 1, |
| 435 | "_account_id": 1000097, |
| 436 | "name": "Jane Roe", |
| 437 | "email": "jane.roe@example.com" |
| 438 | } |
| 439 | ] |
| 440 | "values": { |
| 441 | "-2": "Do not submit", |
| 442 | "-1": "I would prefer that you didn\u0027t submit this", |
| 443 | " 0": "No score", |
| 444 | "+1": "Looks good to me, but someone else must approve", |
| 445 | "+2": "Looks good to me, approved" |
| 446 | } |
| 447 | } |
| 448 | }, |
| 449 | "permitted_labels": { |
| 450 | "Verified": [ |
| 451 | "-1", |
| 452 | " 0", |
| 453 | "+1" |
| 454 | ], |
| 455 | "Code-Review": [ |
| 456 | "-2", |
| 457 | "-1", |
| 458 | " 0", |
| 459 | "+1", |
| 460 | "+2" |
| 461 | ] |
| 462 | }, |
| 463 | "removable_reviewers": [ |
| 464 | { |
| 465 | "_account_id": 1000096, |
| 466 | "name": "John Doe", |
| 467 | "email": "john.doe@example.com" |
| 468 | }, |
| 469 | { |
| 470 | "_account_id": 1000097, |
| 471 | "name": "Jane Roe", |
| 472 | "email": "jane.roe@example.com" |
| 473 | } |
| 474 | ] |
| 475 | } |
| 476 | ---- |
| 477 | |
| Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 478 | [[get-topic]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 479 | Get Topic |
| 480 | ~~~~~~~~~ |
| 481 | [verse] |
| 482 | 'GET /changes/link:#change-id[\{change-id\}]/topic' |
| 483 | |
| Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 484 | Retrieves the topic of a change. |
| 485 | |
| 486 | .Request |
| 487 | ---- |
| 488 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 489 | ---- |
| 490 | |
| 491 | .Response |
| 492 | ---- |
| 493 | HTTP/1.1 200 OK |
| 494 | Content-Disposition: attachment |
| 495 | Content-Type: application/json;charset=UTF-8 |
| 496 | |
| 497 | )]}' |
| 498 | "Documentation" |
| 499 | ---- |
| 500 | |
| 501 | If the change does not have a topic an empty string is returned. |
| 502 | |
| 503 | [[set-topic]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 504 | Set Topic |
| 505 | ~~~~~~~~~ |
| 506 | [verse] |
| 507 | 'PUT /changes/link:#change-id[\{change-id\}]/topic' |
| 508 | |
| Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 509 | Sets the topic of a change. |
| 510 | |
| 511 | The new topic must be provided in the request body inside a |
| 512 | link:#topic-input[TopicInput] entity. |
| 513 | |
| 514 | .Request |
| 515 | ---- |
| 516 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 517 | Content-Type: application/json;charset=UTF-8 |
| 518 | |
| 519 | { |
| 520 | "topic": "Documentation" |
| 521 | } |
| 522 | ---- |
| 523 | |
| 524 | As response the new topic is returned. |
| 525 | |
| 526 | .Response |
| 527 | ---- |
| 528 | HTTP/1.1 200 OK |
| 529 | Content-Disposition: attachment |
| 530 | Content-Type: application/json;charset=UTF-8 |
| 531 | |
| 532 | )]}' |
| 533 | "Documentation" |
| 534 | ---- |
| 535 | |
| 536 | If the topic was deleted the response is "`204 No Content`". |
| 537 | |
| 538 | [[delete-topic]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 539 | Delete Topic |
| 540 | ~~~~~~~~~~~~ |
| 541 | [verse] |
| 542 | 'DELETE /changes/link:#change-id[\{change-id\}]/topic' |
| 543 | |
| Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 544 | Deletes the topic of a change. |
| 545 | |
| 546 | The request body does not need to include a link:#topic-input[ |
| 547 | TopicInput] entity if no review comment is added. |
| 548 | |
| 549 | Please note that some proxies prohibit request bodies for DELETE |
| 550 | requests. In this case, if you want to specify a commit message, use |
| 551 | link:#set-topic[PUT] to delete the topic. |
| 552 | |
| 553 | .Request |
| 554 | ---- |
| 555 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0 |
| 556 | ---- |
| 557 | |
| 558 | .Response |
| 559 | ---- |
| 560 | HTTP/1.1 204 No Content |
| 561 | ---- |
| 562 | |
| Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 563 | [[abandon-change]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 564 | Abandon Change |
| 565 | ~~~~~~~~~~~~~~ |
| 566 | [verse] |
| 567 | 'POST /changes/link:#change-id[\{change-id\}]/abandon' |
| 568 | |
| Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 569 | Abandons a change. |
| 570 | |
| 571 | The request body does not need to include a link:#abandon-input[ |
| 572 | AbandonInput] entity if no review comment is added. |
| 573 | |
| 574 | .Request |
| 575 | ---- |
| 576 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0 |
| 577 | ---- |
| 578 | |
| 579 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 580 | describes the abandoned change. |
| 581 | |
| 582 | .Response |
| 583 | ---- |
| 584 | HTTP/1.1 200 OK |
| 585 | Content-Disposition: attachment |
| 586 | Content-Type: application/json;charset=UTF-8 |
| 587 | |
| 588 | )]}' |
| 589 | { |
| 590 | "kind": "gerritcodereview#change", |
| 591 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 592 | "project": "myProject", |
| 593 | "branch": "master", |
| 594 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 595 | "subject": "Implementing Feature X", |
| 596 | "status": "ABANDONED", |
| 597 | "created": "2013-02-01 09:59:32.126000000", |
| 598 | "updated": "2013-02-21 11:16:36.775000000", |
| 599 | "reviewed": true, |
| 600 | "mergeable": true, |
| 601 | "_sortkey": "0023412400000f7d", |
| 602 | "_number": 3965, |
| 603 | "owner": { |
| 604 | "name": "John Doe" |
| 605 | } |
| 606 | } |
| 607 | ---- |
| 608 | |
| 609 | If the change cannot be abandoned because the change state doesn't |
| 610 | allow abandoning of the change, the response is "`409 Conflict`" and |
| 611 | the error message is contained in the response body. |
| 612 | |
| 613 | .Response |
| 614 | ---- |
| 615 | HTTP/1.1 409 Conflict |
| 616 | Content-Disposition: attachment |
| 617 | Content-Type: text/plain;charset=UTF-8 |
| 618 | |
| 619 | change is merged |
| 620 | ---- |
| 621 | |
| 622 | [[restore-change]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 623 | Restore Change |
| 624 | ~~~~~~~~~~~~~~ |
| 625 | [verse] |
| 626 | 'POST /changes/link:#change-id[\{change-id\}]/restore' |
| 627 | |
| Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 628 | Restores a change. |
| 629 | |
| 630 | The request body does not need to include a link:#restore-input[ |
| 631 | RestoreInput] entity if no review comment is added. |
| 632 | |
| 633 | .Request |
| 634 | ---- |
| 635 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0 |
| 636 | ---- |
| 637 | |
| 638 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 639 | describes the restored change. |
| 640 | |
| 641 | .Response |
| 642 | ---- |
| 643 | HTTP/1.1 200 OK |
| 644 | Content-Disposition: attachment |
| 645 | Content-Type: application/json;charset=UTF-8 |
| 646 | |
| 647 | )]}' |
| 648 | { |
| 649 | "kind": "gerritcodereview#change", |
| 650 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 651 | "project": "myProject", |
| 652 | "branch": "master", |
| 653 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 654 | "subject": "Implementing Feature X", |
| 655 | "status": "NEW", |
| 656 | "created": "2013-02-01 09:59:32.126000000", |
| 657 | "updated": "2013-02-21 11:16:36.775000000", |
| 658 | "reviewed": true, |
| 659 | "mergeable": true, |
| 660 | "_sortkey": "0023412400000f7d", |
| 661 | "_number": 3965, |
| 662 | "owner": { |
| 663 | "name": "John Doe" |
| 664 | } |
| 665 | } |
| 666 | ---- |
| 667 | |
| 668 | If the change cannot be restored because the change state doesn't |
| 669 | allow restoring the change, the response is "`409 Conflict`" and |
| 670 | the error message is contained in the response body. |
| 671 | |
| 672 | .Response |
| 673 | ---- |
| 674 | HTTP/1.1 409 Conflict |
| 675 | Content-Disposition: attachment |
| 676 | Content-Type: text/plain;charset=UTF-8 |
| 677 | |
| 678 | change is new |
| 679 | ---- |
| 680 | |
| Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 681 | [[revert-change]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 682 | Revert Change |
| 683 | ~~~~~~~~~~~~~ |
| 684 | [verse] |
| 685 | 'POST /changes/link:#change-id[\{change-id\}]/revert' |
| 686 | |
| Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 687 | Reverts a change. |
| 688 | |
| 689 | The request body does not need to include a link:#revert-input[ |
| 690 | RevertInput] entity if no review comment is added. |
| 691 | |
| 692 | .Request |
| 693 | ---- |
| 694 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revert HTTP/1.0 |
| 695 | ---- |
| 696 | |
| 697 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 698 | describes the reverting change. |
| 699 | |
| 700 | .Response |
| 701 | ---- |
| 702 | HTTP/1.1 200 OK |
| 703 | Content-Disposition: attachment |
| 704 | Content-Type: application/json;charset=UTF-8 |
| 705 | |
| 706 | )]}' |
| 707 | { |
| 708 | "kind": "gerritcodereview#change", |
| 709 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 710 | "project": "myProject", |
| 711 | "branch": "master", |
| 712 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 713 | "subject": "Revert \"Implementing Feature X\"", |
| 714 | "status": "NEW", |
| 715 | "created": "2013-02-01 09:59:32.126000000", |
| 716 | "updated": "2013-02-21 11:16:36.775000000", |
| 717 | "reviewed": true, |
| 718 | "mergeable": true, |
| 719 | "_sortkey": "0023412400000f7d", |
| 720 | "_number": 3965, |
| 721 | "owner": { |
| 722 | "name": "John Doe" |
| 723 | } |
| 724 | } |
| 725 | ---- |
| 726 | |
| 727 | If the change cannot be reverted because the change state doesn't |
| 728 | allow reverting the change, the response is "`409 Conflict`" and |
| 729 | the error message is contained in the response body. |
| 730 | |
| 731 | .Response |
| 732 | ---- |
| 733 | HTTP/1.1 409 Conflict |
| 734 | Content-Disposition: attachment |
| 735 | Content-Type: text/plain;charset=UTF-8 |
| 736 | |
| 737 | change is new |
| 738 | ---- |
| 739 | |
| Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 740 | [[submit-change]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 741 | Submit Change |
| 742 | ~~~~~~~~~~~~~ |
| 743 | [verse] |
| 744 | 'POST /changes/link:#change-id[\{change-id\}]/submit' |
| 745 | |
| Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 746 | Submits a change. |
| 747 | |
| 748 | The request body only needs to include a link:#submit-input[ |
| 749 | SubmitInput] entity if the request should wait for the merge to |
| 750 | complete. |
| 751 | |
| 752 | .Request |
| 753 | ---- |
| 754 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0 |
| 755 | Content-Type: application/json;charset=UTF-8 |
| 756 | |
| 757 | { |
| 758 | "wait_for_merge": true |
| 759 | } |
| 760 | ---- |
| 761 | |
| 762 | As response a link:#change-info[ChangeInfo] entity is returned that |
| 763 | describes the submitted/merged change. |
| 764 | |
| 765 | .Response |
| 766 | ---- |
| 767 | HTTP/1.1 200 OK |
| 768 | Content-Disposition: attachment |
| 769 | Content-Type: application/json;charset=UTF-8 |
| 770 | |
| 771 | )]}' |
| 772 | { |
| 773 | "kind": "gerritcodereview#change", |
| 774 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 775 | "project": "myProject", |
| 776 | "branch": "master", |
| 777 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 778 | "subject": "Implementing Feature X", |
| 779 | "status": "MERGED", |
| 780 | "created": "2013-02-01 09:59:32.126000000", |
| 781 | "updated": "2013-02-21 11:16:36.775000000", |
| 782 | "reviewed": true, |
| Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 783 | "_sortkey": "0023412400000f7d", |
| 784 | "_number": 3965, |
| 785 | "owner": { |
| 786 | "name": "John Doe" |
| 787 | } |
| 788 | } |
| 789 | ---- |
| 790 | |
| 791 | If the change cannot be submitted because the submit rule doesn't allow |
| 792 | submitting the change, the response is "`409 Conflict`" and the error |
| 793 | message is contained in the response body. |
| 794 | |
| 795 | .Response |
| 796 | ---- |
| 797 | HTTP/1.1 409 Conflict |
| 798 | Content-Disposition: attachment |
| 799 | Content-Type: text/plain;charset=UTF-8 |
| 800 | |
| 801 | blocked by Verified |
| 802 | ---- |
| 803 | |
| Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 804 | [[reviewer-endpoints]] |
| 805 | Reviewer Endpoints |
| 806 | ------------------ |
| 807 | |
| 808 | [[list-reviewers]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 809 | List Reviewers |
| 810 | ~~~~~~~~~~~~~~ |
| 811 | [verse] |
| 812 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/' |
| 813 | |
| Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 814 | Lists the reviewers of a change. |
| 815 | |
| 816 | As result a list of link:#reviewer-info[ReviewerInfo] entries is returned. |
| 817 | |
| 818 | .Request |
| 819 | ---- |
| 820 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0 |
| 821 | ---- |
| 822 | |
| 823 | .Response |
| 824 | ---- |
| 825 | HTTP/1.1 200 OK |
| 826 | Content-Disposition: attachment |
| 827 | Content-Type: application/json;charset=UTF-8 |
| 828 | |
| 829 | )]}' |
| 830 | [ |
| 831 | { |
| 832 | "kind": "gerritcodereview#reviewer", |
| 833 | "approvals": { |
| 834 | "Verified": "+1", |
| 835 | "Code-Review": "+2" |
| 836 | }, |
| 837 | "_account_id": 1000096, |
| 838 | "name": "John Doe", |
| 839 | "email": "john.doe@example.com" |
| 840 | }, |
| 841 | { |
| 842 | "kind": "gerritcodereview#reviewer", |
| 843 | "approvals": { |
| 844 | "Verified": " 0", |
| 845 | "Code-Review": "-1" |
| 846 | }, |
| 847 | "_account_id": 1000097, |
| 848 | "name": "Jane Roe", |
| 849 | "email": "jane.roe@example.com" |
| 850 | } |
| 851 | ] |
| 852 | ---- |
| 853 | |
| Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 854 | [[get-reviewer]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 855 | Get Reviewer |
| 856 | ~~~~~~~~~~~~ |
| 857 | [verse] |
| 858 | 'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' |
| 859 | |
| Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 860 | Retrieves a reviewer of a change. |
| 861 | |
| 862 | As response a link:#reviewer-info[ReviewerInfo] entity is returned that |
| 863 | describes the reviewer. |
| 864 | |
| 865 | .Request |
| 866 | ---- |
| 867 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0 |
| 868 | ---- |
| 869 | |
| 870 | .Response |
| 871 | ---- |
| 872 | HTTP/1.1 200 OK |
| 873 | Content-Disposition: attachment |
| 874 | Content-Type: application/json;charset=UTF-8 |
| 875 | |
| 876 | )]}' |
| 877 | { |
| 878 | "kind": "gerritcodereview#reviewer", |
| 879 | "approvals": { |
| 880 | "Verified": "+1", |
| 881 | "Code-Review": "+2" |
| 882 | }, |
| 883 | "_account_id": 1000096, |
| 884 | "name": "John Doe", |
| 885 | "email": "john.doe@example.com" |
| 886 | } |
| 887 | ---- |
| 888 | |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 889 | [[add-reviewer]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 890 | Add Reviewer |
| 891 | ~~~~~~~~~~~~ |
| 892 | [verse] |
| 893 | 'POST /changes/link:#change-id[\{change-id\}]/reviewers' |
| 894 | |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 895 | Adds one user or all members of one group as reviewer to the change. |
| 896 | |
| 897 | The reviewer to be added to the change must be provided in the request |
| 898 | body as a link:#reviewer-input[ReviewerInput] entity. |
| 899 | |
| 900 | .Request |
| 901 | ---- |
| 902 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 903 | Content-Type: application/json;charset=UTF-8 |
| 904 | |
| 905 | { |
| 906 | "reviewer": "john.doe@example.com" |
| 907 | } |
| 908 | ---- |
| 909 | |
| 910 | As response an link:#add-reviewer-result[AddReviewerResult] entity is |
| 911 | returned that describes the newly added reviewers. |
| 912 | |
| 913 | .Response |
| 914 | ---- |
| 915 | HTTP/1.1 200 OK |
| 916 | Content-Disposition: attachment |
| 917 | Content-Type: application/json;charset=UTF-8 |
| 918 | |
| 919 | )]}' |
| 920 | { |
| 921 | "reviewers": [ |
| 922 | { |
| 923 | "kind": "gerritcodereview#reviewer", |
| 924 | "approvals": { |
| 925 | "Verified": " 0", |
| 926 | "Code-Review": " 0" |
| 927 | }, |
| 928 | "_account_id": 1000096, |
| 929 | "name": "John Doe", |
| 930 | "email": "john.doe@example.com" |
| 931 | } |
| 932 | ] |
| 933 | } |
| 934 | ---- |
| 935 | |
| 936 | If a group is specified, adding the group members as reviewers is an |
| 937 | atomic operation. This means if an error is returned, none of the |
| 938 | members are added as reviewer. |
| 939 | |
| 940 | If a group with many members is added as reviewer a confirmation may be |
| 941 | required. |
| 942 | |
| 943 | .Request |
| 944 | ---- |
| 945 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 946 | Content-Type: application/json;charset=UTF-8 |
| 947 | |
| 948 | { |
| 949 | "reviewer": "MyProjectVerifiers" |
| 950 | } |
| 951 | ---- |
| 952 | |
| 953 | .Response |
| 954 | ---- |
| 955 | HTTP/1.1 200 OK |
| 956 | Content-Disposition: attachment |
| 957 | Content-Type: application/json;charset=UTF-8 |
| 958 | |
| 959 | )]}' |
| 960 | { |
| 961 | "error": "The group My Group has 15 members. Do you want to add them all as reviewers?", |
| 962 | "confirm": true |
| 963 | } |
| 964 | ---- |
| 965 | |
| 966 | To confirm the addition of the reviewers, resend the request with the |
| Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 967 | `confirmed` flag being set. |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 968 | |
| 969 | .Request |
| 970 | ---- |
| 971 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0 |
| 972 | Content-Type: application/json;charset=UTF-8 |
| 973 | |
| 974 | { |
| 975 | "reviewer": "MyProjectVerifiers", |
| Edwin Kempin | 08da43d | 2013-02-26 11:06:58 +0100 | [diff] [blame] | 976 | "confirmed": true |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 977 | } |
| 978 | ---- |
| 979 | |
| Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 980 | [[delete-reviewer]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 981 | Delete Reviewer |
| 982 | ~~~~~~~~~~~~~~~ |
| 983 | [verse] |
| 984 | 'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' |
| 985 | |
| Edwin Kempin | 5330107 | 2013-02-25 12:57:07 +0100 | [diff] [blame] | 986 | Deletes a reviewer from a change. |
| 987 | |
| 988 | .Request |
| 989 | ---- |
| 990 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0 |
| 991 | ---- |
| 992 | |
| 993 | .Response |
| 994 | ---- |
| 995 | HTTP/1.1 204 No Content |
| 996 | ---- |
| 997 | |
| Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 998 | [[revision-endpoints]] |
| 999 | Revision Endpoints |
| 1000 | ------------------ |
| 1001 | |
| 1002 | [[get-review]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1003 | Get Review |
| 1004 | ~~~~~~~~~~ |
| 1005 | [verse] |
| 1006 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review' |
| 1007 | |
| Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1008 | Retrieves a review of a revision. |
| 1009 | |
| 1010 | .Request |
| 1011 | ---- |
| 1012 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 1013 | ---- |
| 1014 | |
| 1015 | As response a link:#change-info[ChangeInfo] entity with |
| 1016 | link:#detailed-labels[detailed labels] and link:#detailed-accounts[ |
| 1017 | detailed accounts] is returned that describes the review of the |
| 1018 | revision. The revision for which the review is retrieved is contained |
| 1019 | in the `revisions` field. In addition the `current_revision` field is |
| 1020 | set, if the revision for which the review is retrieved, is the current |
| 1021 | revision of the change. Please note that the returned labels are always |
| 1022 | for the current patch set. |
| 1023 | |
| 1024 | .Response |
| 1025 | ---- |
| 1026 | HTTP/1.1 200 OK |
| 1027 | Content-Disposition: attachment |
| 1028 | Content-Type: application/json;charset=UTF-8 |
| 1029 | |
| 1030 | )]}' |
| 1031 | { |
| 1032 | "kind": "gerritcodereview#change", |
| 1033 | "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1034 | "project": "myProject", |
| 1035 | "branch": "master", |
| 1036 | "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940", |
| 1037 | "subject": "Implementing Feature X", |
| 1038 | "status": "NEW", |
| 1039 | "created": "2013-02-01 09:59:32.126000000", |
| 1040 | "updated": "2013-02-21 11:16:36.775000000", |
| 1041 | "reviewed": true, |
| 1042 | "mergeable": true, |
| 1043 | "_sortkey": "0023412400000f7d", |
| 1044 | "_number": 3965, |
| 1045 | "owner": { |
| 1046 | "_account_id": 1000096, |
| 1047 | "name": "John Doe", |
| 1048 | "email": "john.doe@example.com" |
| 1049 | }, |
| 1050 | "labels": { |
| 1051 | "Verified": { |
| 1052 | "all": [ |
| 1053 | { |
| 1054 | "value": 0, |
| 1055 | "_account_id": 1000096, |
| 1056 | "name": "John Doe", |
| 1057 | "email": "john.doe@example.com" |
| 1058 | }, |
| 1059 | { |
| 1060 | "value": 0, |
| 1061 | "_account_id": 1000097, |
| 1062 | "name": "Jane Roe", |
| 1063 | "email": "jane.roe@example.com" |
| 1064 | } |
| 1065 | ], |
| 1066 | "values": { |
| 1067 | "-1": "Fails", |
| 1068 | " 0": "No score", |
| 1069 | "+1": "Verified" |
| 1070 | } |
| 1071 | }, |
| 1072 | "Code-Review": { |
| 1073 | "all": [ |
| 1074 | { |
| 1075 | "value": -1, |
| 1076 | "_account_id": 1000096, |
| 1077 | "name": "John Doe", |
| 1078 | "email": "john.doe@example.com" |
| 1079 | }, |
| 1080 | { |
| 1081 | "value": 1, |
| 1082 | "_account_id": 1000097, |
| 1083 | "name": "Jane Roe", |
| 1084 | "email": "jane.roe@example.com" |
| 1085 | } |
| 1086 | ] |
| 1087 | "values": { |
| 1088 | "-2": "Do not submit", |
| 1089 | "-1": "I would prefer that you didn\u0027t submit this", |
| 1090 | " 0": "No score", |
| 1091 | "+1": "Looks good to me, but someone else must approve", |
| 1092 | "+2": "Looks good to me, approved" |
| 1093 | } |
| 1094 | } |
| 1095 | }, |
| 1096 | "permitted_labels": { |
| 1097 | "Verified": [ |
| 1098 | "-1", |
| 1099 | " 0", |
| 1100 | "+1" |
| 1101 | ], |
| 1102 | "Code-Review": [ |
| 1103 | "-2", |
| 1104 | "-1", |
| 1105 | " 0", |
| 1106 | "+1", |
| 1107 | "+2" |
| 1108 | ] |
| 1109 | }, |
| 1110 | "removable_reviewers": [ |
| 1111 | { |
| 1112 | "_account_id": 1000096, |
| 1113 | "name": "John Doe", |
| 1114 | "email": "john.doe@example.com" |
| 1115 | }, |
| 1116 | { |
| 1117 | "_account_id": 1000097, |
| 1118 | "name": "Jane Roe", |
| 1119 | "email": "jane.roe@example.com" |
| 1120 | } |
| 1121 | ], |
| 1122 | "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1", |
| 1123 | "revisions": { |
| 1124 | "674ac754f91e64a0efb8087e59a176484bd534d1": { |
| 1125 | "_number": 2, |
| 1126 | "fetch": { |
| 1127 | "http": { |
| 1128 | "url": "http://gerrit/myProject", |
| 1129 | "ref": "refs/changes/65/3965/2" |
| 1130 | } |
| 1131 | } |
| 1132 | } |
| 1133 | } |
| 1134 | ---- |
| 1135 | |
| Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1136 | [[set-review]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1137 | Set Review |
| 1138 | ~~~~~~~~~~ |
| 1139 | [verse] |
| 1140 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review' |
| 1141 | |
| Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1142 | Sets a review on a revision. |
| 1143 | |
| 1144 | The review must be provided in the request body as a |
| 1145 | link:#review-input[ReviewInput] entity. |
| 1146 | |
| 1147 | .Request |
| 1148 | ---- |
| 1149 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0 |
| 1150 | Content-Type: application/json;charset=UTF-8 |
| 1151 | |
| 1152 | { |
| 1153 | "message": "Some nits need to be fixed.", |
| 1154 | "labels": { |
| 1155 | "Code-Review": -1 |
| 1156 | }, |
| 1157 | "comments": { |
| 1158 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1159 | { |
| 1160 | "line": 23, |
| 1161 | "message": "[nit] trailing whitespace" |
| 1162 | }, |
| 1163 | { |
| 1164 | "line": 49, |
| 1165 | "message": "[nit] s/conrtol/control" |
| 1166 | } |
| 1167 | ] |
| 1168 | } |
| 1169 | } |
| 1170 | ---- |
| 1171 | |
| 1172 | As response a link:#review-info[ReviewInfo] entity is returned that |
| 1173 | describes the applied labels. |
| 1174 | |
| 1175 | .Response |
| 1176 | ---- |
| 1177 | HTTP/1.1 200 OK |
| 1178 | Content-Disposition: attachment |
| 1179 | Content-Type: application/json;charset=UTF-8 |
| 1180 | |
| 1181 | )]}' |
| 1182 | { |
| 1183 | "labels": { |
| 1184 | "Code-Review": -1 |
| 1185 | } |
| 1186 | } |
| 1187 | ---- |
| 1188 | |
| Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 1189 | [[submit-revision]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1190 | Submit Revision |
| 1191 | ~~~~~~~~~~~~~~~ |
| 1192 | [verse] |
| 1193 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit' |
| 1194 | |
| Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 1195 | Submits a revision. |
| 1196 | |
| 1197 | The request body only needs to include a link:#submit-input[ |
| 1198 | SubmitInput] entity if the request should wait for the merge to |
| 1199 | complete. |
| 1200 | |
| 1201 | .Request |
| 1202 | ---- |
| 1203 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0 |
| 1204 | Content-Type: application/json;charset=UTF-8 |
| 1205 | |
| 1206 | { |
| 1207 | "wait_for_merge": true |
| 1208 | } |
| 1209 | ---- |
| 1210 | |
| 1211 | As response a link:#submit-info[SubmitInfo] entity is returned that |
| 1212 | describes the status of the submitted change. |
| 1213 | |
| 1214 | .Response |
| 1215 | ---- |
| 1216 | HTTP/1.1 200 OK |
| 1217 | Content-Disposition: attachment |
| 1218 | Content-Type: application/json;charset=UTF-8 |
| 1219 | |
| 1220 | )]}' |
| 1221 | { |
| 1222 | "status": "MERGED" |
| 1223 | } |
| 1224 | ---- |
| 1225 | |
| 1226 | If the revision cannot be submitted, e.g. because the submit rule |
| 1227 | doesn't allow submitting the revision or the revision is not the |
| 1228 | current revision, the response is "`409 Conflict`" and the error |
| 1229 | message is contained in the response body. |
| 1230 | |
| 1231 | .Response |
| 1232 | ---- |
| 1233 | HTTP/1.1 409 Conflict |
| 1234 | Content-Type: text/plain;charset=UTF-8 |
| 1235 | |
| 1236 | "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision" |
| 1237 | ---- |
| 1238 | |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1239 | [[get-submit-type]] |
| 1240 | Get Submit Type |
| 1241 | ~~~~~~~~~~~~~~~ |
| 1242 | [verse] |
| 1243 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type' |
| 1244 | |
| Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1245 | Gets the method the server will use to submit (merge) the change. |
| 1246 | |
| 1247 | .Request |
| 1248 | ---- |
| 1249 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0 |
| 1250 | ---- |
| 1251 | |
| 1252 | .Response |
| 1253 | ---- |
| 1254 | HTTP/1.1 200 OK |
| 1255 | Content-Disposition: attachment |
| 1256 | Content-Type: application/json;charset=UTF-8 |
| 1257 | |
| 1258 | )]}' |
| 1259 | "MERGE_IF_NECESSARY" |
| 1260 | ---- |
| 1261 | |
| 1262 | [[test-submit-type]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1263 | Test Submit Type |
| 1264 | ~~~~~~~~~~~~~~~~ |
| 1265 | [verse] |
| 1266 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type' |
| 1267 | |
| Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1268 | Tests the submit_type Prolog rule in the project, or the one given. |
| 1269 | |
| 1270 | Request body may be either the Prolog code as `text/plain` or a |
| 1271 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 1272 | may be set to `SKIP` to bypass parent project filters while testing |
| 1273 | a project-specific rule. |
| 1274 | |
| 1275 | .Request |
| 1276 | ---- |
| 1277 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0 |
| 1278 | Content-Type: text/plain;charset-UTF-8 |
| 1279 | |
| 1280 | submit_type(cherry_pick). |
| 1281 | ---- |
| 1282 | |
| 1283 | .Response |
| 1284 | ---- |
| 1285 | HTTP/1.1 200 OK |
| 1286 | Content-Disposition: attachment |
| 1287 | Content-Type: application/json;charset=UTF-8 |
| 1288 | |
| 1289 | )]}' |
| 1290 | "cherry_pick" |
| 1291 | ---- |
| 1292 | |
| 1293 | [[test-submit-rule]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1294 | Test Submit Rule |
| 1295 | ~~~~~~~~~~~~~~~~ |
| 1296 | [verse] |
| 1297 | 'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule' |
| 1298 | |
| Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 1299 | Tests the submit_rule Prolog rule in the project, or the one given. |
| 1300 | |
| 1301 | Request body may be either the Prolog code as `text/plain` or a |
| 1302 | link:#rule-input[RuleInput] object. The query parameter `filters` |
| 1303 | may be set to `SKIP` to bypass parent project filters while testing |
| 1304 | a project-specific rule. |
| 1305 | |
| 1306 | .Request |
| 1307 | ---- |
| 1308 | POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type?filters=SKIP HTTP/1.0 |
| 1309 | Content-Type: text/plain;charset-UTF-8 |
| 1310 | |
| 1311 | submit_rule(submit(R)) :- |
| 1312 | R = label('Any-Label-Name', reject(_)). |
| 1313 | ---- |
| 1314 | |
| 1315 | The response is a list of link:#submit-record[SubmitRecord] entries |
| 1316 | describing the permutations that satisfy the tested submit rule. |
| 1317 | |
| 1318 | .Response |
| 1319 | ---- |
| 1320 | HTTP/1.1 200 OK |
| 1321 | Content-Disposition: attachment |
| 1322 | Content-Type: application/json;charset=UTF-8 |
| 1323 | |
| 1324 | )]}' |
| 1325 | [ |
| 1326 | { |
| 1327 | "status": "NOT_READY", |
| 1328 | "reject": { |
| 1329 | "Any-Label-Name": {} |
| 1330 | } |
| 1331 | } |
| 1332 | ] |
| 1333 | ---- |
| 1334 | |
| Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1335 | [[list-drafts]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1336 | List Drafts |
| 1337 | ~~~~~~~~~~~ |
| 1338 | [verse] |
| 1339 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/' |
| 1340 | |
| Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1341 | Lists the draft comments of a revision that belong to the calling |
| Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1342 | user. |
| 1343 | |
| 1344 | As result a map is returned that maps the file path to a list of |
| 1345 | link:#comment-info[CommentInfo] entries. The entries in the map are |
| 1346 | sorted by file path. |
| 1347 | |
| 1348 | .Request |
| 1349 | ---- |
| 1350 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0 |
| 1351 | ---- |
| 1352 | |
| 1353 | .Response |
| 1354 | ---- |
| 1355 | HTTP/1.1 200 OK |
| 1356 | Content-Disposition: attachment |
| 1357 | Content-Type: application/json;charset=UTF-8 |
| 1358 | |
| 1359 | )]}' |
| 1360 | { |
| 1361 | "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [ |
| 1362 | { |
| 1363 | "kind": "gerritcodereview#comment", |
| 1364 | "id": "TvcXrmjM", |
| 1365 | "line": 23, |
| 1366 | "message": "[nit] trailing whitespace", |
| 1367 | "updated": "2013-02-26 15:40:43.986000000" |
| 1368 | }, |
| 1369 | { |
| 1370 | "kind": "gerritcodereview#comment", |
| 1371 | "id": "TveXwFiA", |
| 1372 | "line": 49, |
| 1373 | "in_reply_to": "TfYX-Iuo", |
| 1374 | "message": "Done", |
| 1375 | "updated": "2013-02-26 15:40:45.328000000" |
| 1376 | } |
| 1377 | ] |
| 1378 | } |
| 1379 | ---- |
| 1380 | |
| Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1381 | [[create-draft]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1382 | Create Draft |
| 1383 | ~~~~~~~~~~~~ |
| 1384 | [verse] |
| 1385 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts' |
| 1386 | |
| Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1387 | Creates a draft comment on a revision. |
| 1388 | |
| 1389 | The new draft comment must be provided in the request body inside a |
| 1390 | link:#comment-input[CommentInput] entity. |
| 1391 | |
| 1392 | .Request |
| 1393 | ---- |
| 1394 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0 |
| 1395 | Content-Type: application/json;charset=UTF-8 |
| 1396 | |
| 1397 | { |
| 1398 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1399 | "line": 23, |
| 1400 | "message": "[nit] trailing whitespace" |
| 1401 | } |
| 1402 | ---- |
| 1403 | |
| 1404 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1405 | describes the draft comment. |
| 1406 | |
| 1407 | .Response |
| 1408 | ---- |
| 1409 | HTTP/1.1 200 OK |
| 1410 | Content-Disposition: attachment |
| 1411 | Content-Type: application/json;charset=UTF-8 |
| 1412 | |
| 1413 | )]}' |
| 1414 | { |
| 1415 | "kind": "gerritcodereview#comment", |
| 1416 | "id": "TvcXrmjM", |
| 1417 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1418 | "line": 23, |
| 1419 | "message": "[nit] trailing whitespace", |
| 1420 | "updated": "2013-02-26 15:40:43.986000000" |
| 1421 | } |
| 1422 | ---- |
| 1423 | |
| Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1424 | [[get-draft]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1425 | Get Draft |
| 1426 | ~~~~~~~~~ |
| 1427 | [verse] |
| 1428 | 'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
| 1429 | |
| Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1430 | Retrieves a draft comment of a revision that belongs to the calling |
| 1431 | user. |
| 1432 | |
| 1433 | .Request |
| 1434 | ---- |
| 1435 | GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1436 | ---- |
| 1437 | |
| 1438 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1439 | describes the draft comment. |
| 1440 | |
| 1441 | .Response |
| 1442 | ---- |
| 1443 | HTTP/1.1 200 OK |
| 1444 | Content-Disposition: attachment |
| 1445 | Content-Type: application/json;charset=UTF-8 |
| 1446 | |
| 1447 | )]}' |
| 1448 | { |
| 1449 | "kind": "gerritcodereview#comment", |
| 1450 | "id": "TvcXrmjM", |
| 1451 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1452 | "line": 23, |
| 1453 | "message": "[nit] trailing whitespace", |
| 1454 | "updated": "2013-02-26 15:40:43.986000000" |
| 1455 | } |
| 1456 | ---- |
| 1457 | |
| Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1458 | [[update-draft]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1459 | Update Draft |
| 1460 | ~~~~~~~~~~~~ |
| 1461 | [verse] |
| 1462 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
| 1463 | |
| Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1464 | Updates a draft comment on a revision. |
| 1465 | |
| 1466 | The new draft comment must be provided in the request body inside a |
| 1467 | link:#comment-input[CommentInput] entity. |
| 1468 | |
| 1469 | .Request |
| 1470 | ---- |
| 1471 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1472 | Content-Type: application/json;charset=UTF-8 |
| 1473 | |
| 1474 | { |
| 1475 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1476 | "line": 23, |
| 1477 | "message": "[nit] trailing whitespace" |
| 1478 | } |
| 1479 | ---- |
| 1480 | |
| 1481 | As response a link:#comment-info[CommentInfo] entity is returned that |
| 1482 | describes the draft comment. |
| 1483 | |
| 1484 | .Response |
| 1485 | ---- |
| 1486 | HTTP/1.1 200 OK |
| 1487 | Content-Disposition: attachment |
| 1488 | Content-Type: application/json;charset=UTF-8 |
| 1489 | |
| 1490 | )]}' |
| 1491 | { |
| 1492 | "kind": "gerritcodereview#comment", |
| 1493 | "id": "TvcXrmjM", |
| 1494 | "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java", |
| 1495 | "line": 23, |
| 1496 | "message": "[nit] trailing whitespace", |
| 1497 | "updated": "2013-02-26 15:40:43.986000000" |
| 1498 | } |
| 1499 | ---- |
| 1500 | |
| 1501 | [[delete-draft]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1502 | Delete Draft |
| 1503 | ~~~~~~~~~~~~ |
| 1504 | [verse] |
| 1505 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/link:#draft-id[\{draft-id\}]' |
| 1506 | |
| Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1507 | Deletes a draft comment from a revision. |
| 1508 | |
| 1509 | .Request |
| 1510 | ---- |
| 1511 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0 |
| 1512 | ---- |
| 1513 | |
| 1514 | .Response |
| 1515 | ---- |
| 1516 | HTTP/1.1 204 No Content |
| 1517 | ---- |
| 1518 | |
| Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 1519 | [[set-reviewed]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1520 | Set Reviewed |
| 1521 | ~~~~~~~~~~~~ |
| 1522 | [verse] |
| 1523 | 'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#patch-id[\{patch-id\}]/reviewed' |
| 1524 | |
| Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 1525 | Marks a patch of a revision as reviewed by the calling user. |
| 1526 | |
| 1527 | .Request |
| 1528 | ---- |
| 1529 | PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 1530 | ---- |
| 1531 | |
| 1532 | .Response |
| 1533 | ---- |
| 1534 | HTTP/1.1 201 Created |
| 1535 | ---- |
| 1536 | |
| 1537 | If the patch was already marked as reviewed by the calling user the |
| 1538 | response is "`200 OK`". |
| 1539 | |
| 1540 | [[delete-reviewed]] |
| Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1541 | Delete Reviewed |
| 1542 | ~~~~~~~~~~~~~~~ |
| 1543 | [verse] |
| 1544 | 'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#patch-id[\{patch-id\}]/reviewed' |
| 1545 | |
| Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 1546 | Deletes the reviewed flag of the calling user from a patch of a revision. |
| 1547 | |
| 1548 | .Request |
| 1549 | ---- |
| 1550 | DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0 |
| 1551 | ---- |
| 1552 | |
| 1553 | .Response |
| 1554 | ---- |
| 1555 | HTTP/1.1 204 No Content |
| 1556 | ---- |
| 1557 | |
| Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 1558 | |
| 1559 | [[ids]] |
| 1560 | IDs |
| 1561 | --- |
| 1562 | |
| Edwin Kempin | a3d02ef | 2013-02-22 16:31:53 +0100 | [diff] [blame] | 1563 | [[account-id]] |
| 1564 | link:rest-api-accounts.html#account-id[\{account-id\}] |
| 1565 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1566 | -- |
| 1567 | -- |
| 1568 | |
| Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 1569 | [[change-id]] |
| 1570 | \{change-id\} |
| 1571 | ~~~~~~~~~~~~~ |
| 1572 | Identifier that uniquely identifies one change. |
| 1573 | |
| 1574 | This can be: |
| 1575 | |
| 1576 | * an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'", |
| 1577 | where for the branch the `refs/heads/` prefix can be omitted |
| 1578 | ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$") |
| 1579 | * a Change-Id if it uniquely identifies one change |
| 1580 | ("I8473b95934b5732ac55d26311a706c9c2bde9940") |
| 1581 | * a legacy numeric change ID ("4247") |
| 1582 | |
| Edwin Kempin | 3ca5719 | 2013-02-27 07:44:01 +0100 | [diff] [blame] | 1583 | [[draft-id]] |
| 1584 | \{draft-id\} |
| 1585 | ~~~~~~~~~~~~ |
| 1586 | UUID of a draft comment. |
| Edwin Kempin | ff9e6e3 | 2013-02-21 13:07:11 +0100 | [diff] [blame] | 1587 | |
| Edwin Kempin | 9300e4c | 2013-02-27 08:42:06 +0100 | [diff] [blame] | 1588 | [[patch-id]] |
| 1589 | \{patch-id\} |
| 1590 | ~~~~~~~~~~~~ |
| 1591 | The file path of the patch. |
| 1592 | |
| Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1593 | [[revision-id]] |
| 1594 | \{revision-id\} |
| 1595 | ~~~~~~~~~~~~~~~ |
| 1596 | Identifier that uniquely identifies one revision of a change. |
| 1597 | |
| 1598 | This can be: |
| 1599 | |
| Shawn Pearce | 9c0722a | 2013-03-02 15:30:31 -0800 | [diff] [blame] | 1600 | * the literal `current` to name the current patch set/revision |
| Edwin Kempin | da6e5fa | 2013-02-25 14:48:12 +0100 | [diff] [blame] | 1601 | * a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1") |
| 1602 | * an abbreviated commit ID that uniquely identifies one revision of the |
| 1603 | change ("674ac754"), at least 4 digits are required |
| 1604 | * a legacy numeric patch number ("1" for first patch set of the change) |
| 1605 | |
| 1606 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1607 | [[json-entities]] |
| 1608 | JSON Entities |
| 1609 | ------------- |
| 1610 | |
| Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1611 | [[abandon-input]] |
| 1612 | AbandonInput |
| 1613 | ~~~~~~~~~~~~ |
| 1614 | The `AbandonInput` entity contains information for abandoning a change. |
| 1615 | |
| 1616 | [options="header",width="50%",cols="1,^1,5"] |
| 1617 | |=========================== |
| 1618 | |Field Name ||Description |
| 1619 | |`message` |optional| |
| 1620 | Message to be added as review comment to the change when abandoning the |
| 1621 | change. |
| 1622 | |=========================== |
| 1623 | |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 1624 | [[add-reviewer-result]] |
| 1625 | AddReviewerResult |
| 1626 | ~~~~~~~~~~~~~~~~~ |
| 1627 | The `AddReviewerResult` entity describes the result of adding a |
| 1628 | reviewer to a change. |
| 1629 | |
| 1630 | [options="header",width="50%",cols="1,^1,5"] |
| 1631 | |=========================== |
| 1632 | |Field Name ||Description |
| 1633 | |`reviewers` |optional| |
| 1634 | The newly added reviewers as a list of link:#reviewer-info[ |
| 1635 | ReviewerInfo] entities. |
| 1636 | |`error` |optional| |
| 1637 | Error message explaining why the reviewer could not be added. + |
| 1638 | If a group was specified in the input and an error is returned, it |
| 1639 | means that none of the members were added as reviewer. |
| 1640 | |`confirm` |`false` if not set| |
| 1641 | Whether adding the reviewer requires confirmation. |
| 1642 | |=========================== |
| 1643 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1644 | [[approval-info]] |
| 1645 | ApprovalInfo |
| 1646 | ~~~~~~~~~~~~ |
| 1647 | The `ApprovalInfo` entity contains information about an approval from a |
| 1648 | user for a label on a change. |
| 1649 | |
| Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 1650 | `ApprovalInfo` has the same fields as |
| 1651 | link:rest-api-accounts.html#account-info[AccountInfo]. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1652 | In addition `ApprovalInfo` has the following fields: |
| 1653 | |
| 1654 | [options="header",width="50%",cols="1,^1,5"] |
| 1655 | |=========================== |
| 1656 | |Field Name ||Description |
| 1657 | |`value` ||The vote that the user has given for the label. |
| 1658 | |=========================== |
| 1659 | |
| 1660 | [[change-info]] |
| 1661 | ChangeInfo |
| 1662 | ~~~~~~~~~~ |
| 1663 | The `ChangeInfo` entity contains information about a change. |
| 1664 | |
| 1665 | [options="header",width="50%",cols="1,^1,5"] |
| 1666 | |================================== |
| 1667 | |Field Name ||Description |
| 1668 | |`kind` ||`gerritcodereview#change` |
| 1669 | |`id` || |
| 1670 | The ID of the change in the format "'<project>\~<branch>~<Change-Id>'", |
| 1671 | where project, branch and Change-Id are URL encoded. For branch the |
| 1672 | `refs/heads/` prefix is omitted. |
| 1673 | |`project` ||The name of the project. |
| 1674 | |`branch` || |
| 1675 | The name of the target branch. + |
| 1676 | The `refs/heads/` prefix is omitted. |
| Edwin Kempin | cd6c01a1 | 2013-02-21 14:58:52 +0100 | [diff] [blame] | 1677 | |`topic` |optional|The topic to which this change belongs. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1678 | |`change_id` ||The Change-Id of the change. |
| 1679 | |`subject` || |
| 1680 | The subject of the change (header line of the commit message). |
| 1681 | |`status` || |
| 1682 | The status of the change (`NEW`, `SUBMITTED`, `MERGED`, `ABANDONED`, |
| 1683 | `DRAFT`). |
| 1684 | |`created` || |
| 1685 | The link:rest-api.html#timestamp[timestamp] of when the change was |
| 1686 | created. |
| 1687 | |`updated` || |
| 1688 | The link:rest-api.html#timestamp[timestamp] of when the change was last |
| 1689 | updated. |
| 1690 | |`starred` |not set if `false`| |
| 1691 | Whether the calling user has starred this change. |
| 1692 | |`reviewed` |not set if `false`| |
| 1693 | Whether the change was reviewed by the calling user. |
| Edwin Kempin | baf70e1 | 2013-02-27 10:36:13 +0100 | [diff] [blame] | 1694 | |`mergeable` |optional| |
| 1695 | Whether the change is mergeable. + |
| 1696 | Not set for merged changed. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1697 | |`_sortkey` ||The sortkey of the change. |
| 1698 | |`_number` ||The legacy numeric ID of the change. |
| 1699 | |`owner` || |
| Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 1700 | The owner of the change as an link:rest-api-accounts.html#account-info[ |
| 1701 | AccountInfo] entity. |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1702 | |`labels` |optional| |
| 1703 | The labels of the change as a map that maps the label names to |
| 1704 | link:#label-info[LabelInfo] entries. + |
| 1705 | Only set if link:#labels[labels] or link:#detailed-labels[detailed |
| 1706 | labels] are requested. |
| 1707 | |`permitted_labels` |optional| |
| 1708 | A map of the permitted labels that maps a label name to the list of |
| 1709 | values that are allowed for that label. + |
| 1710 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1711 | |`removable_reviewers`|optional| |
| 1712 | 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] | 1713 | link:rest-api-accounts.html#account-info[AccountInfo] entities. + |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1714 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1715 | |`current_revision` |optional| |
| 1716 | The commit ID of the current patch set of this change. + |
| 1717 | Only set if link:#current-revision[the current revision] is requested |
| 1718 | or if link:#all-revisions[all revisions] are requested. |
| 1719 | |`revisions` |optional| |
| 1720 | All patch sets of this changes as a map that maps the commit ID of the |
| 1721 | patch set to a link:#revision-info[RevisionInfo] entity. + |
| 1722 | Only set if link:#all-revisions[all revisions] are requested. |
| 1723 | |`_more_changes` |optional, not set if `false`| |
| 1724 | Whether the query would deliver more results if not limited. + |
| 1725 | Only set on either the last or the first change that is returned. |
| 1726 | |================================== |
| 1727 | |
| Edwin Kempin | cb6724a | 2013-02-26 16:58:51 +0100 | [diff] [blame] | 1728 | [[comment-info]] |
| 1729 | CommentInfo |
| 1730 | ~~~~~~~~~~~ |
| 1731 | The `CommitInfo` entity contains information about an inline comment. |
| 1732 | |
| 1733 | [options="header",width="50%",cols="1,^1,5"] |
| 1734 | |=========================== |
| 1735 | |Field Name ||Description |
| 1736 | |`kind` ||`gerritcodereview#comment` |
| 1737 | |`id` ||The URL encoded UUID of the draft comment. |
| 1738 | |`path` |optional| |
| 1739 | The path of the file for which the inline comment was done. + |
| 1740 | Not set if returned in a map where the key is the file path. |
| 1741 | |`side` |optional| |
| 1742 | The side on which the comment was added. + |
| 1743 | Allowed values are `REVISION` and `PARENT`. + |
| 1744 | If not set, the default is `REVISION`. |
| 1745 | |`line` |optional| |
| 1746 | The number of the line for which the comment was done. + |
| 1747 | If not set, it's a file comment. |
| 1748 | |`in_reply_to` |optional| |
| 1749 | The URL encoded UUID of the comment to which this comment is a reply. |
| 1750 | |`message` |optional|The comment message. |
| 1751 | |`updated` || |
| 1752 | The link:rest-api.html#timestamp[timestamp] of when this comment was |
| 1753 | written. |
| 1754 | |=========================== |
| 1755 | |
| Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1756 | [[comment-input]] |
| 1757 | CommentInput |
| 1758 | ~~~~~~~~~~~~ |
| 1759 | The `CommitInput` entity contains information for creating an inline |
| 1760 | comment. |
| 1761 | |
| 1762 | [options="header",width="50%",cols="1,^1,5"] |
| 1763 | |=========================== |
| 1764 | |Field Name ||Description |
| Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1765 | |`kind` |optional| |
| 1766 | Must be `gerritcodereview#comment` if provided. |
| Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1767 | |`id` |optional| |
| Edwin Kempin | c09826d7 | 2013-02-26 16:10:39 +0100 | [diff] [blame] | 1768 | The URL encoded UUID of the comment if an existing draft comment should |
| 1769 | be updated. |
| Edwin Kempin | 7faf41e | 2013-02-27 08:17:02 +0100 | [diff] [blame] | 1770 | |`path` |optional| |
| 1771 | The path of the file for which the inline comment should be added. + |
| 1772 | Doesn't need to be set if contained in a map where the key is the file |
| 1773 | path. |
| Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1774 | |`side` |optional| |
| 1775 | The side on which the comment should be added. + |
| 1776 | Allowed values are `REVISION` and `PARENT`. + |
| 1777 | If not set, the default is `REVISION`. |
| 1778 | |`line` |optional| |
| 1779 | The number of the line for which the comment should be added. + |
| 1780 | `0` if it is a file comment. + |
| 1781 | If not set, a file comment is added. |
| 1782 | |`in_reply_to` |optional| |
| 1783 | 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] | 1784 | |`updated` |optional| |
| 1785 | The link:rest-api.html#timestamp[timestamp] of this comment. + |
| 1786 | Accepted but ignored. |
| Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1787 | |`message` |optional| |
| 1788 | The comment message. + |
| 1789 | If not set and an existing draft comment is updated, the existing draft |
| 1790 | comment is deleted. |
| 1791 | |=========================== |
| 1792 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1793 | [[commit-info]] |
| 1794 | CommitInfo |
| 1795 | ~~~~~~~~~~ |
| 1796 | The `CommitInfo` entity contains information about a commit. |
| 1797 | |
| 1798 | [options="header",width="50%",cols="1,6"] |
| 1799 | |========================== |
| 1800 | |Field Name |Description |
| 1801 | |`commit` |The commit ID. |
| 1802 | |`parent` | |
| 1803 | The parent commits of this commit as a list of |
| 1804 | link:#commit-info[CommitInfo] entities. |
| 1805 | |`author` |The author of the commit as a |
| 1806 | link:#git-person-info[GitPersonInfo] entity. |
| 1807 | |`committer` |The committer of the commit as a |
| 1808 | link:#git-person-info[GitPersonInfo] entity. |
| 1809 | |`subject` | |
| 1810 | The subject of the commit (header line of the commit message). |
| 1811 | |`message` |The commit message. |
| 1812 | |========================== |
| 1813 | |
| 1814 | [[fetch-info]] |
| 1815 | FetchInfo |
| 1816 | ~~~~~~~~~ |
| 1817 | The `FetchInfo` entity contains information about how to fetch a patch |
| 1818 | set via a certain protocol. |
| 1819 | |
| 1820 | [options="header",width="50%",cols="1,6"] |
| 1821 | |========================== |
| 1822 | |Field Name |Description |
| 1823 | |`url` |The URL of the project. |
| 1824 | |`ref` |The ref of the patch set. |
| 1825 | |========================== |
| 1826 | |
| 1827 | [[file-info]] |
| 1828 | FileInfo |
| 1829 | ~~~~~~~~ |
| 1830 | The `FileInfo` entity contains information about a file in a patch set. |
| 1831 | |
| 1832 | [options="header",width="50%",cols="1,^1,5"] |
| 1833 | |============================= |
| 1834 | |Field Name ||Description |
| 1835 | |`status` |optional| |
| 1836 | The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed, |
| 1837 | "`C`"=Copied, "`W`"=Rewritten). + |
| 1838 | Not set if the file was Modified ("`M`"). |
| 1839 | |`binary` |not set if `false`|Whether the file is binary. |
| 1840 | |`old_path` |optional| |
| 1841 | The old file path. + |
| 1842 | Only set if file was renamed or copied. |
| 1843 | |`lines_inserted`|optional| |
| 1844 | Number of inserted lines. + |
| 1845 | Not set for binary files or if no lines were inserted. |
| 1846 | |`lines_deleted` |optional| |
| 1847 | Number of deleted lines. + |
| 1848 | Not set for binary files or if no lines were deleted. |
| 1849 | |============================= |
| 1850 | |
| 1851 | [[git-person-info]] |
| 1852 | GitPersonInfo |
| 1853 | ~~~~~~~~~~~~~ |
| 1854 | The `GitPersonInfo` entity contains information about the |
| 1855 | author/committer of a commit. |
| 1856 | |
| 1857 | [options="header",width="50%",cols="1,6"] |
| 1858 | |========================== |
| 1859 | |Field Name |Description |
| 1860 | |`name` |The name of the author/committer. |
| 1861 | |`email` |The email address of the author/committer. |
| 1862 | |`date` |The link:rest-api.html#timestamp[timestamp] of when |
| 1863 | this identity was constructed. |
| 1864 | |`tz` |The timezone offset from UTC of when this identity was |
| 1865 | constructed. |
| 1866 | |========================== |
| 1867 | |
| 1868 | [[label-info]] |
| 1869 | LabelInfo |
| 1870 | ~~~~~~~~~ |
| 1871 | The `LabelInfo` entity contains information about a label on a change. |
| 1872 | |
| 1873 | [options="header",width="50%",cols="1,^1,5"] |
| 1874 | |=========================== |
| 1875 | |Field Name ||Description |
| 1876 | |`approved` |optional|The user who approved this label on the change |
| Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 1877 | as a link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1878 | Only set if link:#labels[labels] are requested. |
| 1879 | |`rejected` |optional|The user who rejected this label on the change |
| Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 1880 | as a link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1881 | Only set if link:#labels[labels] are requested. |
| 1882 | |`recommended` |optional|The user who recommended this label on the |
| Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 1883 | change as a link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1884 | Only set if link:#labels[labels] are requested. |
| 1885 | |`disliked` |optional|The user who disliked this label on the change |
| Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 1886 | as a link:rest-api-accounts.html#account-info[AccountInfo] entity. + |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 1887 | Only set if link:#labels[labels] are requested. |
| 1888 | |`value` |optional|The voting value of the user who |
| 1889 | recommended/disliked this label on the change if it is not |
| 1890 | "`+1`"/"`-1`". + |
| 1891 | Only set if link:#labels[labels] are requested. |
| 1892 | |`optional` |not set if `false`| |
| 1893 | Whether the label is optional. Optional means the label may be set, but |
| 1894 | it's neither necessary for submission nor does it block submission if |
| 1895 | set. |
| 1896 | |`all` |optional|List of all approvals for this label as a list |
| 1897 | of link:#approval-info[ApprovalInfo] entities. + |
| 1898 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1899 | |`values` |optional|A map of all values that are allowed for this |
| 1900 | label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`") |
| 1901 | to the value descriptions. + |
| 1902 | Only set if link:#detailed-labels[detailed labels] are requested. |
| 1903 | |=========================== |
| 1904 | |
| Edwin Kempin | ed5364b | 2013-02-22 10:39:33 +0100 | [diff] [blame] | 1905 | [[restore-input]] |
| 1906 | RestoreInput |
| 1907 | ~~~~~~~~~~~~ |
| 1908 | The `RestoreInput` entity contains information for restoring a change. |
| 1909 | |
| 1910 | [options="header",width="50%",cols="1,^1,5"] |
| 1911 | |=========================== |
| 1912 | |Field Name ||Description |
| 1913 | |`message` |optional| |
| 1914 | Message to be added as review comment to the change when restoring the |
| 1915 | change. |
| 1916 | |=========================== |
| 1917 | |
| Edwin Kempin | d2ec415 | 2013-02-22 12:17:19 +0100 | [diff] [blame] | 1918 | [[revert-input]] |
| 1919 | RevertInput |
| 1920 | ~~~~~~~~~~~ |
| 1921 | The `RevertInput` entity contains information for reverting a change. |
| 1922 | |
| 1923 | [options="header",width="50%",cols="1,^1,5"] |
| 1924 | |=========================== |
| 1925 | |Field Name ||Description |
| 1926 | |`message` |optional| |
| 1927 | Message to be added as review comment to the change when reverting the |
| 1928 | change. |
| 1929 | |=========================== |
| 1930 | |
| Edwin Kempin | 67498de | 2013-02-25 16:15:34 +0100 | [diff] [blame] | 1931 | [[review-info]] |
| 1932 | ReviewInfo |
| 1933 | ~~~~~~~~~~ |
| 1934 | The `ReviewInfo` entity contains information about a review. |
| 1935 | |
| 1936 | [options="header",width="50%",cols="1,6"] |
| 1937 | |=========================== |
| 1938 | |Field Name |Description |
| 1939 | |`labels` | |
| 1940 | The labels of the review as a map that maps the label names to the |
| 1941 | voting values. |
| 1942 | |=========================== |
| 1943 | |
| 1944 | [[review-input]] |
| 1945 | ReviewInput |
| 1946 | ~~~~~~~~~~~ |
| 1947 | The `ReviewInput` entity contains information for adding a review to a |
| 1948 | revision. |
| 1949 | |
| 1950 | [options="header",width="50%",cols="1,^1,5"] |
| 1951 | |============================ |
| 1952 | |Field Name ||Description |
| 1953 | |`message` |optional| |
| 1954 | The message to be added as review comment. |
| 1955 | |`labels` |optional| |
| 1956 | The votes that should be added to the revision as a map that maps the |
| 1957 | label names to the voting values. |
| 1958 | |`comments` |optional| |
| 1959 | The comments that should be added as a map that maps a file path to a |
| 1960 | list of link:#comment-input[CommentInput] entities. |
| 1961 | |`strict_labels`|`true` if not set| |
| 1962 | Whether all labels are rquired to be within the user's permitted ranges |
| 1963 | based on access controls. + |
| 1964 | If `true`, attempting to use a label not granted to the user will fail |
| 1965 | the entire modify operation early. + |
| 1966 | If `false`, the operation will execute anyway, but the proposed labels |
| 1967 | will be modified to be the "best" value allowed by the access controls. |
| 1968 | |`drafts` |optional| |
| 1969 | Draft handling that defines how draft comments are handled that are |
| 1970 | already in the database but that were not also described in this |
| 1971 | input. + |
| 1972 | Allowed values are `DELETE`, `PUBLISH` and `KEEP`. + |
| 1973 | If not set, the default is `DELETE`. |
| 1974 | |`notify` |optional| |
| 1975 | Notify handling that defines to whom email notifications should be sent |
| 1976 | after the review is stored. + |
| 1977 | Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. + |
| 1978 | If not set, the default is `ALL`. |
| 1979 | |============================ |
| 1980 | |
| Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 1981 | [[reviewer-info]] |
| 1982 | ReviewerInfo |
| 1983 | ~~~~~~~~~~~~ |
| 1984 | The `ReviewerInfo` entity contains information about a reviewer and its |
| 1985 | votes on a change. |
| 1986 | |
| Edwin Kempin | 963dfd0 | 2013-02-27 12:39:32 +0100 | [diff] [blame] | 1987 | `ReviewerInfo` has the same fields as |
| 1988 | link:rest-api-accounts.html#account-info[AccountInfo] and includes |
| 1989 | link:#detailed-accounts[detailed account information]. |
| Edwin Kempin | 1dbe19e | 2013-02-22 16:18:58 +0100 | [diff] [blame] | 1990 | In addition `ReviewerInfo` has the following fields: |
| 1991 | |
| 1992 | [options="header",width="50%",cols="1,6"] |
| 1993 | |========================== |
| 1994 | |Field Name |Description |
| 1995 | |`kind` |`gerritcodereview#reviewer` |
| 1996 | |`approvals` | |
| 1997 | The approvals of the reviewer as a map that maps the label names to the |
| 1998 | approval values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`"). |
| 1999 | |========================== |
| 2000 | |
| Edwin Kempin | 392328e | 2013-02-25 12:50:03 +0100 | [diff] [blame] | 2001 | [[reviewer-input]] |
| 2002 | ReviewerInput |
| 2003 | ~~~~~~~~~~~~~ |
| 2004 | The `ReviewerInput` entity contains information for adding a reviewer |
| 2005 | to a change. |
| 2006 | |
| 2007 | [options="header",width="50%",cols="1,^1,5"] |
| 2008 | |=========================== |
| 2009 | |Field Name ||Description |
| 2010 | |`reviewer` || |
| 2011 | The link:rest-api-accounts.html#account-id[ID] of one account that |
| 2012 | should be added as reviewer or the link:rest-api-groups.html#group-id[ |
| 2013 | ID] of one group for which all members should be added as reviewers. + |
| 2014 | If an ID identifies both an account and a group, only the account is |
| 2015 | added as reviewer to the change. |
| 2016 | |`confirmed` |optional| |
| 2017 | Whether adding the reviewer is confirmed. + |
| 2018 | The Gerrit server may be configured to |
| 2019 | link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a |
| 2020 | confirmation] when adding a group as reviewer that has many members. |
| 2021 | |=========================== |
| 2022 | |
| Edwin Kempin | e344629 | 2013-02-19 16:40:14 +0100 | [diff] [blame] | 2023 | [[revision-info]] |
| 2024 | RevisionInfo |
| 2025 | ~~~~~~~~~~~~ |
| 2026 | The `RevisionInfo` entity contains information about a patch set. |
| 2027 | |
| 2028 | [options="header",width="50%",cols="1,^1,5"] |
| 2029 | |=========================== |
| 2030 | |Field Name ||Description |
| 2031 | |`draft` |not set if `false`|Whether the patch set is a draft. |
| 2032 | |`_number` ||The patch set number. |
| 2033 | |`fetch` || |
| 2034 | Information about how to fetch this patch set. The fetch information is |
| 2035 | provided as a map that maps the protocol name ("`git`", "`http`", |
| 2036 | "`ssh`") to link:#fetch-info[FetchInfo] entities. |
| 2037 | |`commit` ||The commit of the patch set as |
| 2038 | link:#commit-info[CommitInfo] entity. |
| 2039 | |`files` || |
| 2040 | The files of the patch set as a map that maps the file names to |
| 2041 | link:#file-info[FileInfo] entities. |
| 2042 | |=========================== |
| 2043 | |
| Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2044 | [[rule-input]] |
| 2045 | RuleInput |
| 2046 | ~~~~~~~~~ |
| 2047 | The `RuleInput` entity contains information to test a Prolog rule. |
| 2048 | |
| 2049 | [options="header",width="50%",cols="1,^1,5"] |
| 2050 | |=========================== |
| 2051 | |Field Name ||Description |
| 2052 | |`rule`|| |
| 2053 | Prolog code to execute instead of the code in `refs/meta/config`. |
| 2054 | |`filters`|`RUN` if not set| |
| 2055 | When `RUN` filter rules in the parent projects are called to |
| 2056 | post-process the results of the project specific rule. This |
| 2057 | behavior matches how the rule will execute if installed. + |
| 2058 | If `SKIP` the parent filters are not called, allowing the test |
| 2059 | to return results from the input rule. |
| 2060 | |=========================== |
| 2061 | |
| Edwin Kempin | 14b5811 | 2013-02-26 16:30:19 +0100 | [diff] [blame] | 2062 | [[submit-info]] |
| 2063 | SubmitInfo |
| 2064 | ~~~~~~~~~~ |
| 2065 | The `SubmitInfo` entity contains information about the change status |
| 2066 | after submitting. |
| 2067 | |
| 2068 | [options="header",width="50%",cols="1,6"] |
| 2069 | |========================== |
| 2070 | |Field Name |Description |
| 2071 | |`status` | |
| 2072 | The status of the change after submitting, can be `MERGED` or |
| 2073 | `SUBMITTED`. + |
| 2074 | If `wait_for_merge` in the link:#submit-input[SubmitInput] was set to |
| 2075 | `false` the returned status is `SUBMITTED` and the caller can't know |
| 2076 | whether the change could be merged successfully. |
| 2077 | |========================== |
| 2078 | |
| Edwin Kempin | 0eddba0 | 2013-02-22 15:30:12 +0100 | [diff] [blame] | 2079 | [[submit-input]] |
| 2080 | SubmitInput |
| 2081 | ~~~~~~~~~~~ |
| 2082 | The `SubmitInput` entity contains information for submitting a change. |
| 2083 | |
| 2084 | [options="header",width="50%",cols="1,^1,5"] |
| 2085 | |=========================== |
| 2086 | |Field Name ||Description |
| 2087 | |`wait_for_merge`|`false` if not set| |
| 2088 | Whether the request should wait for the merge to complete. + |
| 2089 | If `false` the request returns immediately after the change has been |
| 2090 | added to the merge queue and the caller can't know whether the change |
| 2091 | could be merged successfully. |
| 2092 | |=========================== |
| 2093 | |
| Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2094 | [[submit-record]] |
| 2095 | SubmitRecord |
| 2096 | ~~~~~~~~~~~~ |
| 2097 | The `SubmitRecord` entity describes results from a submit_rule. |
| 2098 | |
| 2099 | [options="header",width="50%",cols="1,^1,5"] |
| 2100 | |=========================== |
| 2101 | |Field Name ||Description |
| 2102 | |`status`|| |
| 2103 | `OK`, the change can be submitted. + |
| 2104 | `NOT_READY`, additional labels are required before submit. + |
| 2105 | `CLOSED`, closed changes cannot be submitted. + |
| 2106 | `RULE_ERROR`, rule code failed with an error. |
| 2107 | |`ok`|optional| |
| Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 2108 | Map of labels that are approved; an |
| 2109 | link:rest-api-accounts.html#account-info[AccountInfo] identifies the |
| 2110 | voter chosen by the rule. |
| Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2111 | |`reject`|optional| |
| Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 2112 | Map of labels that are preventing submit; |
| 2113 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter. |
| Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2114 | |`need`|optional| |
| 2115 | Map of labels that need to be given to submit. The value is |
| 2116 | currently an empty object. |
| 2117 | |`may`|optional| |
| 2118 | Map of labels that can be used, but do not affect submit. |
| Edwin Kempin | fe29b81 | 2013-03-05 14:52:54 +0100 | [diff] [blame] | 2119 | link:rest-api-accounts.html#account-info[AccountInfo] identifies voter, |
| 2120 | if the label has been applied. |
| Shawn Pearce | b1f730b | 2013-03-04 07:54:09 -0800 | [diff] [blame] | 2121 | |`impossible`|optional| |
| 2122 | Map of labels that should have been in `need` but cannot be |
| 2123 | used by any user because of access restrictions. The value |
| 2124 | is currently an empty object. |
| 2125 | |`error_message`|optional| |
| 2126 | When status is RULE_ERROR this message provides some text describing |
| 2127 | the failure of the rule predicate. |
| 2128 | |=========================== |
| 2129 | |
| Edwin Kempin | 64006bb | 2013-02-22 08:17:04 +0100 | [diff] [blame] | 2130 | [[topic-input]] |
| 2131 | TopicInput |
| 2132 | ~~~~~~~~~~ |
| 2133 | The `TopicInput` entity contains information for setting a topic. |
| 2134 | |
| 2135 | [options="header",width="50%",cols="1,^1,5"] |
| 2136 | |=========================== |
| 2137 | |Field Name ||Description |
| 2138 | |`topic` |optional|The topic. + |
| 2139 | The topic will be deleted if not set. |
| 2140 | |`message` |optional| |
| 2141 | Message to be added as review comment to the change when setting the |
| 2142 | topic. |
| 2143 | |=========================== |
| 2144 | |
| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 2145 | |
| 2146 | GERRIT |
| 2147 | ------ |
| 2148 | Part of link:index.html[Gerrit Code Review] |