Edwin Kempin | 2eebd14 | 2013-03-06 15:28:34 +0100 | [diff] [blame] | 1 | Gerrit Code Review - /projects/ REST API |
| 2 | ======================================== |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 3 | |
| 4 | This page describes the project related REST endpoints. |
| 5 | Please also take note of the general information on the |
| 6 | link:rest-api.html[REST API]. |
| 7 | |
| 8 | Endpoints |
| 9 | --------- |
| 10 | |
Edwin Kempin | c3fe3cb | 2013-02-13 15:09:23 +0100 | [diff] [blame] | 11 | [[project-endpoints]] |
| 12 | Project Endpoints |
| 13 | ----------------- |
| 14 | |
Edwin Kempin | 7620274 | 2013-02-15 13:51:50 +0100 | [diff] [blame] | 15 | [[list-projects]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 16 | List Projects |
| 17 | ~~~~~~~~~~~~~ |
| 18 | [verse] |
| 19 | 'GET /projects/' |
| 20 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 21 | Lists the projects accessible by the caller. This is the same as |
| 22 | using the link:cmd-ls-projects.html[ls-projects] command over SSH, |
| 23 | and accepts the same options as query parameters. |
| 24 | |
Edwin Kempin | 51a6dc9 | 2013-02-04 15:43:59 +0100 | [diff] [blame] | 25 | As result a map is returned that maps the project names to |
| 26 | link:#project-info[ProjectInfo] entries. The entries in the map are sorted |
| 27 | by project name. |
| 28 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 29 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 30 | ---- |
| 31 | GET /projects/?d HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 32 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 33 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 34 | .Response |
| 35 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 36 | HTTP/1.1 200 OK |
| 37 | Content-Disposition: attachment |
| 38 | Content-Type: application/json;charset=UTF-8 |
| 39 | |
| 40 | )]}' |
| 41 | { |
| 42 | "external/bison": { |
| 43 | "kind": "gerritcodereview#project", |
| 44 | "id": "external%2Fbison", |
| 45 | "description": "GNU parser generator" |
| 46 | }, |
| 47 | "external/gcc": { |
| 48 | "kind": "gerritcodereview#project", |
| 49 | "id": "external%2Fgcc", |
| 50 | }, |
| 51 | "external/openssl": { |
| 52 | "kind": "gerritcodereview#project", |
| 53 | "id": "external%2Fopenssl", |
| 54 | "description": "encryption\ncrypto routines" |
| 55 | }, |
| 56 | "test": { |
| 57 | "kind": "gerritcodereview#project", |
| 58 | "id": "test", |
| 59 | "description": "\u003chtml\u003e is escaped" |
| 60 | } |
| 61 | } |
| 62 | ---- |
| 63 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 64 | .Get all projects with their description |
| 65 | **** |
| 66 | get::/projects/?d |
| 67 | **** |
| 68 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 69 | [[suggest-projects]] |
| 70 | The `/projects/` URL also accepts a prefix string in the `p` parameter. |
| 71 | This limits the results to those projects that start with the specified |
| 72 | prefix. |
| 73 | List all projects that start with `platform/`: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 74 | |
| 75 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 76 | ---- |
| 77 | GET /projects/?p=platform%2F HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 78 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 79 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 80 | .Response |
| 81 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 82 | HTTP/1.1 200 OK |
| 83 | Content-Disposition: attachment |
| 84 | Content-Type: application/json;charset=UTF-8 |
| 85 | |
| 86 | )]}' |
| 87 | { |
| 88 | "platform/drivers": { |
| 89 | "kind": "gerritcodereview#project", |
| 90 | "id": "platform%2Fdrivers", |
| 91 | }, |
| 92 | "platform/tools": { |
| 93 | "kind": "gerritcodereview#project", |
| 94 | "id": "platform%2Ftools", |
| 95 | } |
| 96 | } |
| 97 | ---- |
| 98 | E.g. this feature can be used by suggestion client UI's to limit results. |
| 99 | |
Edwin Kempin | 5c544e2 | 2013-03-06 13:35:45 +0100 | [diff] [blame] | 100 | [[get-project]] |
| 101 | Get Project |
| 102 | ~~~~~~~~~~~ |
| 103 | [verse] |
| 104 | 'GET /projects/link:#project-name[\{project-name\}]' |
| 105 | |
| 106 | Retrieves a project. |
| 107 | |
| 108 | .Request |
| 109 | ---- |
| 110 | GET /projects/plugins%2Freplication HTTP/1.0 |
| 111 | ---- |
| 112 | |
| 113 | As response a link:#project-info[ProjectInfo] entity is returned that |
| 114 | describes the project. |
| 115 | |
| 116 | .Response |
| 117 | ---- |
| 118 | HTTP/1.1 200 OK |
| 119 | Content-Disposition: attachment |
| 120 | Content-Type: application/json;charset=UTF-8 |
| 121 | |
| 122 | )]}' |
| 123 | { |
| 124 | "kind": "gerritcodereview#project", |
| 125 | "id": "plugins%2Freplication", |
| 126 | "name": "plugins/replication", |
| 127 | "parent": "Public-Plugins", |
| 128 | "description": "Copies to other servers using the Git protocol" |
| 129 | } |
| 130 | ---- |
| 131 | |
Bruce Zu | 798ea12 | 2013-02-18 16:55:43 +0800 | [diff] [blame] | 132 | [[create-project]] |
| 133 | Create Project |
| 134 | ~~~~~~~~~~~~~~ |
| 135 | [verse] |
| 136 | 'PUT /projects/link:#project-name[\{project-name\}]' |
| 137 | |
| 138 | Creates a new project. |
| 139 | |
| 140 | In the request body additional data for the project can be provided as |
| 141 | link:#project-input[ProjectInput]. |
| 142 | |
| 143 | .Request |
| 144 | ---- |
| 145 | PUT /projects/MyProject HTTP/1.0 |
| 146 | Content-Type: application/json;charset=UTF-8 |
| 147 | |
| 148 | { |
| 149 | "description": "This is a demo project.", |
| 150 | "submit_type": "CHERRY_PICK", |
| 151 | "owners": [ |
| 152 | "MyProject-Owners" |
| 153 | ] |
| 154 | } |
| 155 | ---- |
| 156 | |
| 157 | As response the link:#project-info[ProjectInfo] entity is returned that |
| 158 | describes the created project. |
| 159 | |
| 160 | .Response |
| 161 | ---- |
| 162 | HTTP/1.1 201 Created |
| 163 | Content-Disposition: attachment |
| 164 | Content-Type: application/json;charset=UTF-8 |
| 165 | |
| 166 | )]}' |
| 167 | { |
| 168 | "kind": "gerritcodereview#project", |
| 169 | "id": "MyProject", |
| 170 | "name": "MyProject", |
| 171 | "parent": "All-Projects", |
| 172 | "description": "This is a demo project." |
| 173 | } |
| 174 | ---- |
| 175 | |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 176 | [[get-project-description]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 177 | Get Project Description |
| 178 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 179 | [verse] |
| 180 | 'GET /projects/link:#project-name[\{project-name\}]/description' |
| 181 | |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 182 | Retrieves the description of a project. |
| 183 | |
| 184 | .Request |
| 185 | ---- |
| 186 | GET /projects/plugins%2Freplication/description HTTP/1.0 |
| 187 | ---- |
| 188 | |
| 189 | .Response |
| 190 | ---- |
| 191 | HTTP/1.1 200 OK |
| 192 | Content-Disposition: attachment |
| 193 | Content-Type: application/json;charset=UTF-8 |
| 194 | |
| 195 | )]}' |
| 196 | "Copies to other servers using the Git protocol" |
| 197 | ---- |
| 198 | |
Edwin Kempin | efec449 | 2013-02-22 10:09:23 +0100 | [diff] [blame] | 199 | If the project does not have a description an empty string is returned. |
| 200 | |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 201 | [[set-project-description]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 202 | Set Project Description |
| 203 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 204 | [verse] |
| 205 | 'PUT /projects/link:#project-name[\{project-name\}]/description' |
| 206 | |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 207 | Sets the description of a project. |
| 208 | |
| 209 | The new project description must be provided in the request body inside |
| 210 | a link:#project-description-input[ProjectDescriptionInput] entity. |
| 211 | |
| 212 | .Request |
| 213 | ---- |
| 214 | PUT /projects/plugins%2Freplication/description HTTP/1.0 |
| 215 | Content-Type: application/json;charset=UTF-8 |
| 216 | |
| 217 | { |
| 218 | "description": "Plugin for Gerrit that handles the replication.", |
| 219 | "commit_message": "Update the project description" |
| 220 | } |
| 221 | ---- |
| 222 | |
| 223 | As response the new project description is returned. |
| 224 | |
| 225 | .Response |
| 226 | ---- |
| 227 | HTTP/1.1 200 OK |
| 228 | Content-Disposition: attachment |
| 229 | Content-Type: application/json;charset=UTF-8 |
| 230 | |
| 231 | )]}' |
| 232 | "Plugin for Gerrit that handles the replication." |
| 233 | ---- |
| 234 | |
Edwin Kempin | 114ab16 | 2013-02-28 09:25:37 +0100 | [diff] [blame] | 235 | If the description was deleted the response is "`204 No Content`". |
| 236 | |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 237 | [[delete-project-description]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 238 | Delete Project Description |
| 239 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 240 | [verse] |
| 241 | 'DELETE /projects/link:#project-name[\{project-name\}]/description' |
| 242 | |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 243 | Deletes the description of a project. |
| 244 | |
Edwin Kempin | efec449 | 2013-02-22 10:09:23 +0100 | [diff] [blame] | 245 | The request body does not need to include a |
| 246 | link:#project-description-input[ProjectDescriptionInput] entity if no |
| 247 | commit message is specified. |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 248 | |
Edwin Kempin | efec449 | 2013-02-22 10:09:23 +0100 | [diff] [blame] | 249 | Please note that some proxies prohibit request bodies for DELETE |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 250 | requests. In this case, if you want to specify a commit message, use |
| 251 | link:#set-project-description[PUT] to delete the description. |
| 252 | |
| 253 | .Request |
| 254 | ---- |
| 255 | DELETE /projects/plugins%2Freplication/description HTTP/1.0 |
| 256 | ---- |
| 257 | |
| 258 | .Response |
| 259 | ---- |
| 260 | HTTP/1.1 204 No Content |
| 261 | ---- |
| 262 | |
Edwin Kempin | ecad88c | 2013-02-14 12:09:44 +0100 | [diff] [blame] | 263 | [[get-project-parent]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 264 | Get Project Parent |
| 265 | ~~~~~~~~~~~~~~~~~~ |
| 266 | [verse] |
| 267 | 'GET /projects/link:#project-name[\{project-name\}]/parent' |
| 268 | |
Edwin Kempin | ecad88c | 2013-02-14 12:09:44 +0100 | [diff] [blame] | 269 | Retrieves the name of a project's parent project. For the |
| 270 | `All-Projects` root project an empty string is returned. |
| 271 | |
| 272 | .Request |
| 273 | ---- |
| 274 | GET /projects/plugins%2Freplication/parent HTTP/1.0 |
| 275 | ---- |
| 276 | |
| 277 | .Response |
| 278 | ---- |
| 279 | HTTP/1.1 200 OK |
| 280 | Content-Disposition: attachment |
| 281 | Content-Type: application/json;charset=UTF-8 |
| 282 | |
| 283 | )]}' |
| 284 | "All-Projects" |
| 285 | ---- |
| 286 | |
| 287 | [[set-project-parent]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 288 | Set Project Parent |
| 289 | ~~~~~~~~~~~~~~~~~~ |
| 290 | [verse] |
| 291 | 'PUT /projects/link:#project-name[\{project-name\}]/parent' |
| 292 | |
Edwin Kempin | ecad88c | 2013-02-14 12:09:44 +0100 | [diff] [blame] | 293 | Sets the parent project for a project. |
| 294 | |
| 295 | The new name of the parent project must be provided in the request body |
| 296 | inside a link:#project-parent-input[ProjectParentInput] entity. |
| 297 | |
| 298 | .Request |
| 299 | ---- |
| 300 | PUT /projects/plugins%2Freplication/parent HTTP/1.0 |
| 301 | Content-Type: application/json;charset=UTF-8 |
| 302 | |
| 303 | { |
| 304 | "parent": "Public-Plugins", |
| 305 | "commit_message": "Update the project parent" |
| 306 | } |
| 307 | ---- |
| 308 | |
| 309 | As response the new parent project name is returned. |
| 310 | |
| 311 | .Response |
| 312 | ---- |
| 313 | HTTP/1.1 200 OK |
| 314 | Content-Disposition: attachment |
| 315 | Content-Type: application/json;charset=UTF-8 |
| 316 | |
| 317 | )]}' |
| 318 | "Public-Plugins" |
| 319 | ---- |
| 320 | |
Edwin Kempin | 6b81337 | 2013-03-13 17:07:33 +0100 | [diff] [blame] | 321 | [[get-head]] |
| 322 | Get HEAD |
| 323 | ~~~~~~~~ |
| 324 | [verse] |
| 325 | 'GET /projects/link:#project-name[\{project-name\}]/HEAD' |
| 326 | |
| 327 | Retrieves for a project the name of the branch to which `HEAD` points. |
| 328 | |
| 329 | .Request |
| 330 | ---- |
| 331 | GET /projects/plugins%2Freplication/HEAD HTTP/1.0 |
| 332 | ---- |
| 333 | |
| 334 | .Response |
| 335 | ---- |
| 336 | HTTP/1.1 200 OK |
| 337 | Content-Disposition: attachment |
| 338 | Content-Type: application/json;charset=UTF-8 |
| 339 | |
| 340 | )]}' |
| 341 | "refs/heads/master" |
| 342 | ---- |
| 343 | |
| 344 | [[set-head]] |
| 345 | Set HEAD |
| 346 | ~~~~~~~~ |
| 347 | [verse] |
| 348 | 'PUT /projects/link:#project-name[\{project-name\}]/HEAD' |
| 349 | |
| 350 | Sets `HEAD` for a project. |
| 351 | |
| 352 | The new ref to which `HEAD` should point must be provided in the |
| 353 | request body inside a link:#head-input[HeadInput] entity. |
| 354 | |
| 355 | .Request |
| 356 | ---- |
| 357 | PUT /projects/plugins%2Freplication/HEAD HTTP/1.0 |
| 358 | Content-Type: application/json;charset=UTF-8 |
| 359 | |
| 360 | { |
| 361 | "ref": "refs/heads/stable" |
| 362 | } |
| 363 | ---- |
| 364 | |
| 365 | As response the new ref to which `HEAD` points is returned. |
| 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 | "refs/heads/stable" |
| 375 | ---- |
| 376 | |
Edwin Kempin | 19ea9b9 | 2013-03-20 13:20:26 +0100 | [diff] [blame] | 377 | [[get-repository-statistics]] |
| 378 | Get Repository Statistics |
| 379 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 380 | [verse] |
| 381 | 'GET /projects/link:#project-name[\{project-name\}]/statistics.git' |
| 382 | |
| 383 | Return statistics for the repository of a project. |
| 384 | |
| 385 | .Request |
| 386 | ---- |
| 387 | GET /projects/plugins%2Freplication/statistics.git HTTP/1.0 |
| 388 | ---- |
| 389 | |
| 390 | The repository statistics are returned as a |
| 391 | link:#repository-statistics-info[RepositoryStatisticsInfo] entity. |
| 392 | |
| 393 | .Response |
| 394 | ---- |
| 395 | HTTP/1.1 200 OK |
| 396 | Content-Disposition: attachment |
| 397 | Content-Type: application/json;charset=UTF-8 |
| 398 | |
| 399 | )]}' |
| 400 | { |
| 401 | "number_of_loose_objects": 127, |
| 402 | "number_of_loose_refs": 15, |
| 403 | "number_of_pack_files": 15, |
| 404 | "number_of_packed_objects": 67, |
| 405 | "number_of_packed_refs": 0, |
| 406 | "size_of_loose_objects": 29466, |
| 407 | "size_of_packed_objects": 9646 |
| 408 | } |
| 409 | ---- |
| 410 | |
Dave Borowitz | 237073a | 2013-04-04 16:52:27 -0700 | [diff] [blame] | 411 | [[get-config]] |
| 412 | Get Config |
| 413 | ~~~~~~~~~~ |
| 414 | [verse] |
| 415 | 'GET /projects/link:#project-name[\{project-name\}]/config' |
| 416 | |
| 417 | Gets some configuration information about a project. Note that this |
| 418 | config info is not simply the contents of `project.config`; it generally |
| 419 | contains fields that may have been inherited from parent projects. |
| 420 | |
| 421 | .Request |
| 422 | ---- |
| 423 | GET /projects/myproject/config |
| 424 | ---- |
| 425 | |
| 426 | A link:#config-info[ConfigInfo] entity is returned that describes the |
| 427 | project configuration. Some fields are only visible to users that have |
| 428 | read access to `refs/meta/config`. |
| 429 | |
| 430 | .Response |
| 431 | ---- |
| 432 | HTTP/1.1 200 OK |
| 433 | Content-Disposition: attachment |
| 434 | Content-Type: application/json;charset=UTF-8 |
| 435 | |
| 436 | )]}' |
| 437 | { |
| 438 | "kind": "gerritcodereview#project_config", |
Edwin Kempin | 0cb5a56 | 2013-07-12 15:41:04 +0200 | [diff] [blame] | 439 | "use_contributor_agreements": { |
| 440 | "value": true, |
| 441 | "configured_value": "TRUE", |
| 442 | "inherited_value": false |
| 443 | }, |
| 444 | "use_content_merge": { |
| 445 | "value": true, |
| 446 | "configured_value": "INHERIT", |
| 447 | "inherited_value": true |
| 448 | }, |
| 449 | "use_signed_off_by": { |
| 450 | "value": false, |
| 451 | "configured_value": "INHERIT", |
| 452 | "inherited_value": false |
| 453 | }, |
| 454 | "require_change_id": { |
| 455 | "value": false, |
| 456 | "configured_value": "FALSE", |
| 457 | "inherited_value": true |
| 458 | } |
Dave Borowitz | 2002789 | 2013-04-08 10:42:23 -0700 | [diff] [blame] | 459 | "commentlinks": {} |
Dave Borowitz | 237073a | 2013-04-04 16:52:27 -0700 | [diff] [blame] | 460 | } |
| 461 | ---- |
| 462 | |
Edwin Kempin | ef3542f | 2013-03-19 13:31:49 +0100 | [diff] [blame] | 463 | [[run-gc]] |
| 464 | Run GC |
| 465 | ~~~~~~ |
| 466 | [verse] |
| 467 | 'POST /projects/link:#project-name[\{project-name\}]/gc' |
| 468 | |
| 469 | Run the Git garbage collection for the repository of a project. |
| 470 | |
| 471 | .Request |
| 472 | ---- |
| 473 | POST /projects/plugins%2Freplication/gc HTTP/1.0 |
| 474 | ---- |
| 475 | |
| 476 | The response is the streamed output of the garbage collection. |
| 477 | |
| 478 | .Response |
| 479 | ---- |
| 480 | HTTP/1.1 200 OK |
| 481 | Content-Disposition: attachment |
| 482 | Content-Type: text/plain;charset=UTF-8 |
| 483 | |
| 484 | collecting garbage for "plugins/replication": |
| 485 | Pack refs: 100% (21/21) |
| 486 | Counting objects: 20 |
| 487 | Finding sources: 100% (20/20) |
| 488 | Getting sizes: 100% (13/13) |
| 489 | Compressing objects: 83% (5/6) |
| 490 | Writing objects: 100% (20/20) |
| 491 | Selecting commits: 100% (7/7) |
| 492 | Building bitmaps: 100% (7/7) |
| 493 | Finding sources: 100% (41/41) |
| 494 | Getting sizes: 100% (25/25) |
| 495 | Compressing objects: 52% (12/23) |
| 496 | Writing objects: 100% (41/41) |
| 497 | Prune loose objects also found in pack files: 100% (36/36) |
| 498 | Prune loose, unreferenced objects: 100% (36/36) |
| 499 | done. |
| 500 | ---- |
| 501 | |
Edwin Kempin | a686de9 | 2013-05-09 15:12:34 +0200 | [diff] [blame] | 502 | [[branch-endpoints]] |
| 503 | Branch Endpoints |
| 504 | ---------------- |
| 505 | |
| 506 | [[list-branches]] |
| 507 | List Branches |
| 508 | ~~~~~~~~~~~~~ |
| 509 | [verse] |
| 510 | 'GET /projects/link:#project-name[\{project-name\}]/branches/' |
| 511 | |
| 512 | List the branches of a project. |
| 513 | |
| 514 | As result a list of link:#branch-info[BranchInfo] entries is |
| 515 | returned. |
| 516 | |
| 517 | .Request |
| 518 | ---- |
| 519 | GET /projects/work%2Fmy-project/branches/ HTTP/1.0 |
| 520 | ---- |
| 521 | |
| 522 | .Response |
| 523 | ---- |
| 524 | HTTP/1.1 200 OK |
| 525 | Content-Disposition: attachment |
| 526 | Content-Type: application/json;charset=UTF-8 |
| 527 | |
| 528 | )]}' |
| 529 | [ |
| 530 | { |
| 531 | "ref": "HEAD", |
| 532 | "revision": "master" |
| 533 | }, |
| 534 | { |
| 535 | "ref": "refs/meta/config", |
| 536 | "revision": "76016386a0d8ecc7b6be212424978bb45959d668" |
| 537 | }, |
| 538 | { |
| 539 | "ref": "refs/heads/master", |
| 540 | "revision": "67ebf73496383c6777035e374d2d664009e2aa5c" |
| 541 | }, |
| 542 | { |
| 543 | "ref": "refs/heads/stable", |
| 544 | "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674", |
| 545 | "can_delete": true |
| 546 | } |
| 547 | ] |
| 548 | ---- |
| 549 | |
Edwin Kempin | 196e173 | 2013-05-09 15:12:34 +0200 | [diff] [blame] | 550 | [[get-branch]] |
| 551 | Get Branch |
| 552 | ~~~~~~~~~~ |
| 553 | [verse] |
| 554 | 'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]' |
| 555 | |
| 556 | Retrieves a branch of a project. |
| 557 | |
| 558 | .Request |
| 559 | ---- |
| 560 | GET /projects/work%2Fmy-project/branches/master HTTP/1.0 |
| 561 | ---- |
| 562 | |
| 563 | As response a link:#branch-info[BranchInfo] entity is returned that |
| 564 | describes the branch. |
| 565 | |
| 566 | .Response |
| 567 | ---- |
| 568 | HTTP/1.1 200 OK |
| 569 | Content-Disposition: attachment |
| 570 | Content-Type: application/json;charset=UTF-8 |
| 571 | |
| 572 | )]}' |
| 573 | { |
| 574 | "ref": "refs/heads/master", |
| 575 | "revision": "67ebf73496383c6777035e374d2d664009e2aa5c" |
| 576 | } |
| 577 | ---- |
| 578 | |
Edwin Kempin | 5c0d6b3 | 2013-05-09 19:54:37 +0200 | [diff] [blame] | 579 | [[create-branch]] |
| 580 | Create Branch |
| 581 | ~~~~~~~~~~~~~ |
| 582 | [verse] |
| 583 | 'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]' |
| 584 | |
| 585 | Creates a new branch. |
| 586 | |
| 587 | In the request body additional data for the branch can be provided as |
| 588 | link:#branch-input[BranchInput]. |
| 589 | |
| 590 | .Request |
| 591 | ---- |
| 592 | PUT /projects/MyProject/branches/stable HTTP/1.0 |
| 593 | Content-Type: application/json;charset=UTF-8 |
| 594 | |
| 595 | { |
| 596 | "revision": "76016386a0d8ecc7b6be212424978bb45959d668" |
| 597 | } |
| 598 | ---- |
| 599 | |
| 600 | As response a link:#branch-info[BranchInfo] entity is returned that |
| 601 | describes the created branch. |
| 602 | |
| 603 | .Response |
| 604 | ---- |
| 605 | HTTP/1.1 201 Created |
| 606 | Content-Disposition: attachment |
| 607 | Content-Type: application/json;charset=UTF-8 |
| 608 | |
| 609 | )]}' |
| 610 | { |
| 611 | "ref": "refs/heads/stable", |
| 612 | "revision": "76016386a0d8ecc7b6be212424978bb45959d668", |
| 613 | "can_delete": true |
| 614 | } |
| 615 | ---- |
| 616 | |
Edwin Kempin | 6ce96a1 | 2013-06-06 13:20:01 +0200 | [diff] [blame] | 617 | [[delete-branch]] |
| 618 | Delete Branch |
| 619 | ~~~~~~~~~~~~~ |
| 620 | [verse] |
| 621 | 'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]' |
| 622 | |
| 623 | Deletes a branch. |
| 624 | |
| 625 | .Request |
| 626 | ---- |
| 627 | DELETE /projects/MyProject/branches/stable HTTP/1.0 |
| 628 | ---- |
| 629 | |
| 630 | .Response |
| 631 | ---- |
| 632 | HTTP/1.1 204 No Content |
| 633 | ---- |
| 634 | |
Edwin Kempin | 4425c74 | 2013-03-18 13:23:00 +0100 | [diff] [blame] | 635 | [[child-project-endpoints]] |
| 636 | Child Project Endpoints |
| 637 | ----------------------- |
| 638 | |
| 639 | [[list-child-projects]] |
| 640 | List Child Projects |
| 641 | ~~~~~~~~~~~~~~~~~~~ |
| 642 | [verse] |
| 643 | 'GET /projects/link:#project-name[\{project-name\}]/children/' |
| 644 | |
| 645 | List the direct child projects of a project. |
| 646 | |
| 647 | .Request |
| 648 | ---- |
| 649 | GET /projects/Public-Plugins/children/ HTTP/1.0 |
| 650 | ---- |
| 651 | |
| 652 | As result a list of link:#project-info[ProjectInfo] entries is |
| 653 | returned that describe the child projects. |
| 654 | |
| 655 | .Response |
| 656 | ---- |
| 657 | HTTP/1.1 200 OK |
| 658 | Content-Disposition: attachment |
| 659 | Content-Type: application/json;charset=UTF-8 |
| 660 | |
| 661 | )]}' |
| 662 | [ |
| 663 | { |
| 664 | "kind": "gerritcodereview#project", |
| 665 | "id": "plugins%2Freplication", |
| 666 | "name": "plugins/replication", |
| 667 | "parent": "Public-Plugins", |
| 668 | "description": "Copies to other servers using the Git protocol" |
| 669 | }, |
| 670 | { |
| 671 | "kind": "gerritcodereview#project", |
| 672 | "id": "plugins%2Freviewnotes", |
| 673 | "name": "plugins/reviewnotes", |
| 674 | "parent": "Public-Plugins", |
| 675 | "description": "Annotates merged commits using notes on refs/notes/review." |
| 676 | }, |
| 677 | { |
| 678 | "kind": "gerritcodereview#project", |
| 679 | "id": "plugins%2Fsingleusergroup", |
| 680 | "name": "plugins/singleusergroup", |
| 681 | "parent": "Public-Plugins", |
| 682 | "description": "GroupBackend enabling users to be directly added to access rules" |
| 683 | } |
| 684 | ] |
| 685 | ---- |
| 686 | |
Edwin Kempin | f95bd17 | 2013-03-19 11:10:57 +0100 | [diff] [blame] | 687 | To resolve the child projects of a project recursively the parameter |
| 688 | `recursive` can be set. |
| 689 | |
| 690 | Child projects that are not visible to the calling user are ignored and |
| 691 | are not resolved further. |
| 692 | |
| 693 | .Request |
| 694 | ---- |
| 695 | GET /projects/Public-Projects/children/?recursive HTTP/1.0 |
| 696 | ---- |
| 697 | |
| 698 | .Response |
| 699 | ---- |
| 700 | HTTP/1.1 200 OK |
| 701 | Content-Disposition: attachment |
| 702 | Content-Type: application/json;charset=UTF-8 |
| 703 | |
| 704 | )]}' |
| 705 | [ |
| 706 | { |
| 707 | "kind": "gerritcodereview#project", |
| 708 | "id": "gerrit", |
| 709 | "name": "gerrit", |
| 710 | "parent": "Public-Projects", |
| 711 | "description": "Gerrit Code Review" |
| 712 | }, |
| 713 | { |
| 714 | "kind": "gerritcodereview#project", |
| 715 | "id": "plugins%2Freplication", |
| 716 | "name": "plugins/replication", |
| 717 | "parent": "Public-Plugins", |
| 718 | "description": "Copies to other servers using the Git protocol" |
| 719 | }, |
| 720 | { |
| 721 | "kind": "gerritcodereview#project", |
| 722 | "id": "plugins%2Freviewnotes", |
| 723 | "name": "plugins/reviewnotes", |
| 724 | "parent": "Public-Plugins", |
| 725 | "description": "Annotates merged commits using notes on refs/notes/review." |
| 726 | }, |
| 727 | { |
| 728 | "kind": "gerritcodereview#project", |
| 729 | "id": "plugins%2Fsingleusergroup", |
| 730 | "name": "plugins/singleusergroup", |
| 731 | "parent": "Public-Plugins", |
| 732 | "description": "GroupBackend enabling users to be directly added to access rules" |
| 733 | }, |
| 734 | { |
| 735 | "kind": "gerritcodereview#project", |
| 736 | "id": "Public-Plugins", |
| 737 | "name": "Public-Plugins", |
| 738 | "parent": "Public-Projects", |
| 739 | "description": "Parent project for plugins/*" |
| 740 | } |
| 741 | ] |
| 742 | ---- |
| 743 | |
Edwin Kempin | 5b6c406 | 2013-03-19 09:26:03 +0100 | [diff] [blame] | 744 | [[get-child-project]] |
| 745 | Get Child Project |
| 746 | ~~~~~~~~~~~~~~~~~ |
| 747 | [verse] |
| 748 | 'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]' |
| 749 | |
Edwin Kempin | 8a3fb5b | 2013-03-21 15:02:22 +0100 | [diff] [blame] | 750 | Retrieves a child project. If a non-direct child project should be |
| 751 | retrieved the parameter `recursive` must be set. |
Edwin Kempin | 5b6c406 | 2013-03-19 09:26:03 +0100 | [diff] [blame] | 752 | |
| 753 | .Request |
| 754 | ---- |
| 755 | GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0 |
| 756 | ---- |
| 757 | |
| 758 | As response a link:#project-info[ProjectInfo] entity is returned that |
| 759 | describes the child project. |
| 760 | |
| 761 | .Response |
| 762 | ---- |
| 763 | HTTP/1.1 200 OK |
| 764 | Content-Disposition: attachment |
| 765 | Content-Type: application/json;charset=UTF-8 |
| 766 | |
| 767 | )]}' |
| 768 | { |
| 769 | "kind": "gerritcodereview#project", |
| 770 | "id": "plugins%2Freplication", |
| 771 | "name": "plugins/replication", |
| 772 | "parent": "Public-Plugins", |
| 773 | "description": "Copies to other servers using the Git protocol" |
| 774 | } |
| 775 | ---- |
| 776 | |
Edwin Kempin | c3fe3cb | 2013-02-13 15:09:23 +0100 | [diff] [blame] | 777 | [[dashboard-endpoints]] |
| 778 | Dashboard Endpoints |
| 779 | ------------------- |
| 780 | |
Edwin Kempin | 7620274 | 2013-02-15 13:51:50 +0100 | [diff] [blame] | 781 | [[list-dashboards]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 782 | List Dashboards |
| 783 | ~~~~~~~~~~~~~~~ |
| 784 | [verse] |
| 785 | 'GET /projects/link:#project-name[\{project-name\}]/dashboards/' |
| 786 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 787 | List custom dashboards for a project. |
| 788 | |
Edwin Kempin | 5536762 | 2013-02-05 09:09:23 +0100 | [diff] [blame] | 789 | As result a list of link:#dashboard-info[DashboardInfo] entries is |
| 790 | returned. |
| 791 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 792 | List all dashboards for the `work/my-project` project: |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 793 | |
| 794 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 795 | ---- |
| 796 | GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 797 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 798 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 799 | .Response |
| 800 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 801 | HTTP/1.1 200 OK |
| 802 | Content-Disposition: attachment |
| 803 | Content-Type: application/json;charset=UTF-8 |
| 804 | |
| 805 | )]}' |
| 806 | [ |
| 807 | { |
| 808 | "kind": "gerritcodereview#dashboard", |
| 809 | "id": "main:closed", |
| 810 | "ref": "main", |
| 811 | "path": "closed", |
| 812 | "description": "Merged and abandoned changes in last 7 weeks", |
| 813 | "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w", |
| 814 | "default": true, |
| 815 | "title": "Closed changes", |
| 816 | "sections": [ |
| 817 | { |
| 818 | "name": "Merged", |
| 819 | "query": "status:merged age:7w" |
| 820 | }, |
| 821 | { |
| 822 | "name": "Abandoned", |
| 823 | "query": "status:abandoned age:7w" |
| 824 | } |
| 825 | ] |
| 826 | } |
| 827 | ] |
| 828 | ---- |
| 829 | |
Edwin Kempin | a64c4b9 | 2013-01-23 11:30:40 +0100 | [diff] [blame] | 830 | .Get all dashboards of the 'All-Projects' project |
| 831 | **** |
| 832 | get::/projects/All-Projects/dashboards/ |
| 833 | **** |
| 834 | |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 835 | [[get-dashboard]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 836 | Get Dashboard |
| 837 | ~~~~~~~~~~~~~ |
| 838 | [verse] |
| 839 | 'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]' |
| 840 | |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 841 | Retrieves a project dashboard. The dashboard can be defined on that |
| 842 | project or be inherited from a parent project. |
| 843 | |
| 844 | .Request |
| 845 | ---- |
| 846 | GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0 |
| 847 | ---- |
| 848 | |
| 849 | As response a link:#dashboard-info[DashboardInfo] entity is returned |
| 850 | that describes the dashboard. |
| 851 | |
| 852 | .Response |
| 853 | ---- |
| 854 | HTTP/1.1 200 OK |
| 855 | Content-Disposition: attachment |
| 856 | Content-Type: application/json;charset=UTF-8 |
| 857 | |
| 858 | )]}' |
| 859 | { |
| 860 | "kind": "gerritcodereview#dashboard", |
| 861 | "id": "main:closed", |
| 862 | "ref": "main", |
| 863 | "path": "closed", |
| 864 | "description": "Merged and abandoned changes in last 7 weeks", |
| 865 | "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w", |
| 866 | "default": true, |
| 867 | "title": "Closed changes", |
| 868 | "sections": [ |
| 869 | { |
| 870 | "name": "Merged", |
| 871 | "query": "status:merged age:7w" |
| 872 | }, |
| 873 | { |
| 874 | "name": "Abandoned", |
| 875 | "query": "status:abandoned age:7w" |
| 876 | } |
| 877 | ] |
| 878 | } |
| 879 | ---- |
| 880 | |
| 881 | To retrieve the default dashboard of a project use `default` as |
| 882 | dashboard-id. |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 883 | |
| 884 | .Request |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 885 | ---- |
| 886 | GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0 |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 887 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 888 | |
Edwin Kempin | 3744083 | 2013-02-06 11:36:00 +0100 | [diff] [blame] | 889 | .Response |
| 890 | ---- |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 891 | HTTP/1.1 200 OK |
| 892 | Content-Disposition: attachment |
| 893 | Content-Type: application/json;charset=UTF-8 |
| 894 | |
| 895 | )]}' |
| 896 | { |
| 897 | "kind": "gerritcodereview#dashboard", |
| 898 | "id": "main:closed", |
| 899 | "ref": "main", |
| 900 | "path": "closed", |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 901 | "description": "Merged and abandoned changes in last 7 weeks", |
| 902 | "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w", |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 903 | "default": true, |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 904 | "title": "Closed changes", |
| 905 | "sections": [ |
| 906 | { |
| 907 | "name": "Merged", |
| 908 | "query": "status:merged age:7w" |
| 909 | }, |
| 910 | { |
| 911 | "name": "Abandoned", |
| 912 | "query": "status:abandoned age:7w" |
| 913 | } |
| 914 | ] |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 915 | } |
| 916 | ---- |
| 917 | |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 918 | [[set-dashboard]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 919 | Set Dashboard |
| 920 | ~~~~~~~~~~~~~ |
| 921 | [verse] |
| 922 | 'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]' |
| 923 | |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 924 | Updates/Creates a project dashboard. |
| 925 | |
| 926 | Currently only supported for the `default` dashboard. |
| 927 | |
| 928 | The creation/update information for the dashboard must be provided in |
| 929 | the request body as a link:#dashboard-input[DashboardInput] entity. |
| 930 | |
| 931 | .Request |
| 932 | ---- |
| 933 | PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0 |
| 934 | Content-Type: application/json;charset=UTF-8 |
| 935 | |
| 936 | { |
| 937 | "id": "main:closed", |
| 938 | "commit_message": "Define the default dashboard" |
| 939 | } |
| 940 | ---- |
| 941 | |
| 942 | As response the new/updated dashboard is returned as a |
| 943 | link:#dashboard-info[DashboardInfo] entity. |
| 944 | |
| 945 | .Response |
| 946 | ---- |
| 947 | HTTP/1.1 200 OK |
| 948 | Content-Disposition: attachment |
| 949 | Content-Type: application/json;charset=UTF-8 |
| 950 | |
| 951 | )]}' |
| 952 | { |
| 953 | "kind": "gerritcodereview#dashboard", |
| 954 | "id": "main:closed", |
| 955 | "ref": "main", |
| 956 | "path": "closed", |
| 957 | "description": "Merged and abandoned changes in last 7 weeks", |
| 958 | "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w", |
| 959 | "default": true, |
| 960 | "title": "Closed changes", |
| 961 | "sections": [ |
| 962 | { |
| 963 | "name": "Merged", |
| 964 | "query": "status:merged age:7w" |
| 965 | }, |
| 966 | { |
| 967 | "name": "Abandoned", |
| 968 | "query": "status:abandoned age:7w" |
| 969 | } |
| 970 | ] |
| 971 | } |
| 972 | ---- |
| 973 | |
| 974 | [[delete-dashboard]] |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 975 | Delete Dashboard |
| 976 | ~~~~~~~~~~~~~~~~ |
| 977 | [verse] |
| 978 | 'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]' |
| 979 | |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 980 | Deletes a project dashboard. |
| 981 | |
| 982 | Currently only supported for the `default` dashboard. |
| 983 | |
Edwin Kempin | efec449 | 2013-02-22 10:09:23 +0100 | [diff] [blame] | 984 | The request body does not need to include a link:#dashboard-input[ |
John Spurlock | d25fad1 | 2013-03-09 11:48:49 -0500 | [diff] [blame] | 985 | DashboardInput] entity if no commit message is specified. |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 986 | |
| 987 | Please note that some proxies prohibit request bodies for DELETE |
| 988 | requests. |
| 989 | |
| 990 | .Request |
| 991 | ---- |
| 992 | DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0 |
| 993 | ---- |
| 994 | |
| 995 | .Response |
| 996 | ---- |
| 997 | HTTP/1.1 204 No Content |
| 998 | ---- |
| 999 | |
Edwin Kempin | 34d8335 | 2013-02-06 10:40:17 +0100 | [diff] [blame] | 1000 | |
| 1001 | [[ids]] |
| 1002 | IDs |
| 1003 | --- |
| 1004 | |
Edwin Kempin | 196e173 | 2013-05-09 15:12:34 +0200 | [diff] [blame] | 1005 | [[branch-id]] |
| 1006 | \{branch-id\} |
| 1007 | ~~~~~~~~~~~~~ |
| 1008 | The name of a branch or `HEAD`. The prefix `refs/heads/` can be |
| 1009 | omitted. |
| 1010 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1011 | [[dashboard-id]] |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 1012 | \{dashboard-id\} |
| 1013 | ~~~~~~~~~~~~~~~~ |
| 1014 | The ID of a dashboard in the format '<ref>:<path>'. |
| 1015 | |
| 1016 | A special dashboard ID is `default` which represents the default |
| 1017 | dashboard of a project. |
| 1018 | |
Edwin Kempin | 50d3d9b | 2013-03-06 16:38:26 +0100 | [diff] [blame] | 1019 | [[project-name]] |
Edwin Kempin | 34d8335 | 2013-02-06 10:40:17 +0100 | [diff] [blame] | 1020 | \{project-name\} |
| 1021 | ~~~~~~~~~~~~~~~~ |
| 1022 | The name of the project. |
| 1023 | |
| 1024 | |
Edwin Kempin | 51a6dc9 | 2013-02-04 15:43:59 +0100 | [diff] [blame] | 1025 | [[json-entities]] |
| 1026 | JSON Entities |
| 1027 | ------------- |
| 1028 | |
Edwin Kempin | a686de9 | 2013-05-09 15:12:34 +0200 | [diff] [blame] | 1029 | [[branch-info]] |
| 1030 | BranchInfo |
| 1031 | ~~~~~~~~~~ |
| 1032 | The `BranchInfo` entity contains information about a branch. |
| 1033 | |
| 1034 | [options="header",width="50%",cols="1,^2,4"] |
| 1035 | |========================= |
| 1036 | |Field Name ||Description |
| 1037 | |`ref` ||The ref of the branch. |
| 1038 | |`revision` ||The revision to which the branch points. |
| 1039 | |`can_delete`|`false` if not set| |
| 1040 | Whether the calling user can delete this branch. |
| 1041 | |========================= |
| 1042 | |
Edwin Kempin | 5c0d6b3 | 2013-05-09 19:54:37 +0200 | [diff] [blame] | 1043 | [[branch-input]] |
| 1044 | BranchInput |
| 1045 | ~~~~~~~~~~~ |
| 1046 | The `BranchInput` entity contains information for the creation of |
| 1047 | a new branch. |
| 1048 | |
| 1049 | [options="header",width="50%",cols="1,^2,4"] |
| 1050 | |======================= |
| 1051 | |Field Name||Description |
| 1052 | |`ref` |optional| |
| 1053 | The name of the branch. The prefix `refs/heads/` can be |
| 1054 | omitted. + |
| 1055 | If set, must match the branch ID in the URL. |
| 1056 | |`revision`|optional| |
| 1057 | The base revision of the new branch. + |
| 1058 | If not set, `HEAD` will be used as base revision. |
| 1059 | |======================= |
| 1060 | |
Edwin Kempin | 0cb5a56 | 2013-07-12 15:41:04 +0200 | [diff] [blame] | 1061 | [[config-info]] |
| 1062 | ConfigInfo |
| 1063 | ~~~~~~~~~~ |
| 1064 | The `ConfigInfo` entity contains information about the effective project |
| 1065 | configuration. |
| 1066 | |
Edwin Kempin | 81e1d1f | 2013-07-15 10:13:46 +0200 | [diff] [blame] | 1067 | [options="header",width="50%",cols="1,^2,4"] |
Edwin Kempin | 3660c13 | 2013-07-16 08:03:11 +0200 | [diff] [blame^] | 1068 | |========================================= |
| 1069 | |Field Name ||Description |
| 1070 | |`use_contributor_agreements`|optional| |
Edwin Kempin | 0cb5a56 | 2013-07-12 15:41:04 +0200 | [diff] [blame] | 1071 | link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether |
| 1072 | authors must complete a contributor agreement on the site before |
| 1073 | pushing any commits or changes to this project. |
Edwin Kempin | 3660c13 | 2013-07-16 08:03:11 +0200 | [diff] [blame^] | 1074 | |`use_content_merge` |optional| |
Edwin Kempin | 0cb5a56 | 2013-07-12 15:41:04 +0200 | [diff] [blame] | 1075 | link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether |
| 1076 | Gerrit will try to perform a 3-way merge of text file content when a |
| 1077 | file has been modified by both the destination branch and the change |
| 1078 | being submitted. This option only takes effect if submit type is not |
| 1079 | FAST_FORWARD_ONLY. |
Edwin Kempin | 3660c13 | 2013-07-16 08:03:11 +0200 | [diff] [blame^] | 1080 | |`use_signed_off_by` |optional| |
Edwin Kempin | 0cb5a56 | 2013-07-12 15:41:04 +0200 | [diff] [blame] | 1081 | link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether |
| 1082 | each change must contain a Signed-off-by line from either the author or |
| 1083 | the uploader in the commit message. |
Edwin Kempin | 3660c13 | 2013-07-16 08:03:11 +0200 | [diff] [blame^] | 1084 | |`require_change_id` |optional| |
Edwin Kempin | 0cb5a56 | 2013-07-12 15:41:04 +0200 | [diff] [blame] | 1085 | link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a |
| 1086 | valid link:user-changeid.html[Change-Id] footer in any commit uploaded |
| 1087 | for review is required. This does not apply to commits pushed directly |
| 1088 | to a branch or tag. |
Edwin Kempin | 3660c13 | 2013-07-16 08:03:11 +0200 | [diff] [blame^] | 1089 | |`commentlinks` || |
Edwin Kempin | 8aa53af | 2013-07-15 10:43:15 +0200 | [diff] [blame] | 1090 | Map with the comment link configurations of the project. The name of |
| 1091 | the comment link configuration is mapped to the comment link |
| 1092 | configuration, which has the same format as the |
| 1093 | link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[ |
| 1094 | commentlink section] of `gerrit.config`. |
Edwin Kempin | 3660c13 | 2013-07-16 08:03:11 +0200 | [diff] [blame^] | 1095 | |`theme` |optional| |
Edwin Kempin | 272402e | 2013-07-15 11:17:36 +0200 | [diff] [blame] | 1096 | The theme that is configured for the project as a link:#theme-info[ |
| 1097 | ThemeInfo] entity. |
Edwin Kempin | 3660c13 | 2013-07-16 08:03:11 +0200 | [diff] [blame^] | 1098 | |========================================= |
Edwin Kempin | 0cb5a56 | 2013-07-12 15:41:04 +0200 | [diff] [blame] | 1099 | |
Edwin Kempin | 5536762 | 2013-02-05 09:09:23 +0100 | [diff] [blame] | 1100 | [[dashboard-info]] |
| 1101 | DashboardInfo |
| 1102 | ~~~~~~~~~~~~~ |
| 1103 | The `DashboardInfo` entity contains information about a project |
| 1104 | dashboard. |
| 1105 | |
| 1106 | [options="header",width="50%",cols="1,^2,4"] |
| 1107 | |=============================== |
| 1108 | |Field Name ||Description |
| 1109 | |`kind` ||`gerritcodereview#dashboard` |
| 1110 | |`id` || |
| 1111 | The ID of the dashboard. The ID has the format '<ref>:<path>', |
| 1112 | where ref and path are URL encoded. |
| 1113 | |`project` || |
| 1114 | The name of the project for which this dashboard is returned. |
| 1115 | |`defining_project`|| |
| 1116 | The name of the project in which this dashboard is defined. |
| 1117 | This is different from `project` if the dashboard is inherited from a |
| 1118 | parent project. |
| 1119 | |`ref` || |
| 1120 | The name of the ref in which the dashboard is defined, without the |
| 1121 | `refs/meta/dashboards/` prefix, which is common for all dashboard refs. |
| 1122 | |`path` || |
| 1123 | The path of the file in which the dashboard is defined. |
| 1124 | |`description` |optional|The description of the dashboard. |
| 1125 | |`foreach` |optional| |
| 1126 | Subquery that applies to all sections in the dashboard. + |
| 1127 | Tokens such as `${project}` are not resolved. |
| 1128 | |`url` || |
| 1129 | The URL under which the dashboard can be opened in the Gerrit WebUI. + |
| 1130 | The URL is relative to the canonical web URL. + |
| 1131 | Tokens in the queries such as `${project}` are resolved. |
| 1132 | |`default` |not set if `false`| |
| 1133 | Whether this is the default dashboard of the project. |
| 1134 | |`title` |optional|The title of the dashboard. |
| 1135 | |`sections` || |
| 1136 | The list of link:#dashboard-section-info[sections] in the dashboard. |
| 1137 | |=============================== |
| 1138 | |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 1139 | [[dashboard-input]] |
| 1140 | DashboardInput |
| 1141 | ~~~~~~~~~~~~~~ |
| 1142 | The `DashboardInput` entity contains information to create/update a |
| 1143 | project dashboard. |
| 1144 | |
| 1145 | [options="header",width="50%",cols="1,^2,4"] |
| 1146 | |============================= |
| 1147 | |Field Name ||Description |
| 1148 | |`id` |optional| |
Edwin Kempin | c95c508 | 2013-03-12 16:56:25 +0100 | [diff] [blame] | 1149 | URL encoded ID of a dashboard to which this dashboard should link to. |
Edwin Kempin | 67e923c | 2013-02-14 13:57:12 +0100 | [diff] [blame] | 1150 | |`commit_message`|optional| |
| 1151 | Message that should be used to commit the change of the dashboard. |
| 1152 | |============================= |
| 1153 | |
Edwin Kempin | 5536762 | 2013-02-05 09:09:23 +0100 | [diff] [blame] | 1154 | [[dashboard-section-info]] |
| 1155 | DashboardSectionInfo |
| 1156 | ~~~~~~~~~~~~~~~~~~~~ |
| 1157 | The `DashboardSectionInfo` entity contains information about a section |
| 1158 | in a dashboard. |
| 1159 | |
| 1160 | [options="header",width="50%",cols="1,6"] |
| 1161 | |=========================== |
| 1162 | |Field Name |Description |
| 1163 | |`name` |The title of the section. |
| 1164 | |`query` |The query of the section. + |
| 1165 | Tokens such as `${project}` are not resolved. |
| 1166 | |=========================== |
| 1167 | |
Edwin Kempin | 6b81337 | 2013-03-13 17:07:33 +0100 | [diff] [blame] | 1168 | [[head-input]] |
| 1169 | HeadInput |
| 1170 | ~~~~~~~~~ |
| 1171 | The `HeadInput` entity contains information for setting `HEAD` for a |
| 1172 | project. |
| 1173 | |
| 1174 | [options="header",width="50%",cols="1,6"] |
| 1175 | |============================ |
| 1176 | |Field Name |Description |
| 1177 | |`ref` | |
| 1178 | The ref to which `HEAD` should be set, the `refs/heads` prefix can be |
| 1179 | omitted. |
| 1180 | |============================ |
| 1181 | |
Edwin Kempin | 0cb5a56 | 2013-07-12 15:41:04 +0200 | [diff] [blame] | 1182 | [[inherited-boolean-info]] |
| 1183 | InheritedBooleanInfo |
| 1184 | ~~~~~~~~~~~~~~~~~~~~ |
| 1185 | A boolean value that can also be inherited. |
| 1186 | |
| 1187 | [options="header",width="50%",cols="1,^2,4"] |
| 1188 | |================================ |
| 1189 | |Field Name ||Description |
| 1190 | |`value` || |
| 1191 | The effective boolean value. |
| 1192 | |`configured_value` || |
| 1193 | The configured value, can be `TRUE`, `FALSE` or `INHERITED`. |
| 1194 | |`inherited_value` |optional| |
| 1195 | The boolean value inherited from the parent. + |
| 1196 | Not set if there is no parent. |
| 1197 | |================================ |
| 1198 | |
Edwin Kempin | 57f303c | 2013-02-13 15:52:22 +0100 | [diff] [blame] | 1199 | [[project-description-input]] |
| 1200 | ProjectDescriptionInput |
| 1201 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 1202 | The `ProjectDescriptionInput` entity contains information for setting a |
| 1203 | project description. |
| 1204 | |
| 1205 | [options="header",width="50%",cols="1,^2,4"] |
| 1206 | |============================= |
| 1207 | |Field Name ||Description |
| 1208 | |`description` |optional|The project description. + |
| 1209 | The project description will be deleted if not set. |
| 1210 | |`commit_message`|optional| |
| 1211 | Message that should be used to commit the change of the project |
| 1212 | description in the `project.config` file to the `refs/meta/config` |
| 1213 | branch. |
| 1214 | |============================= |
| 1215 | |
Edwin Kempin | 51a6dc9 | 2013-02-04 15:43:59 +0100 | [diff] [blame] | 1216 | [[project-info]] |
| 1217 | ProjectInfo |
| 1218 | ~~~~~~~~~~~ |
| 1219 | The `ProjectInfo` entity contains information about a project. |
| 1220 | |
| 1221 | [options="header",width="50%",cols="1,^2,4"] |
| 1222 | |=========================== |
| 1223 | |Field Name ||Description |
| 1224 | |`kind` ||`gerritcodereview#project` |
| 1225 | |`id` ||The URL encoded project name. |
| 1226 | |`name` | |
| 1227 | not set if returned in a map where the project name is used as map key| |
| 1228 | The name of the project. |
Edwin Kempin | f361182 | 2013-03-19 08:23:09 +0100 | [diff] [blame] | 1229 | |`parent` |optional| |
Edwin Kempin | 51a6dc9 | 2013-02-04 15:43:59 +0100 | [diff] [blame] | 1230 | The name of the parent project. + |
| 1231 | `?-<n>` if the parent project is not visible (`<n>` is a number which |
| 1232 | is increased for each non-visible project). |
| 1233 | |`description` |optional|The description of the project. |
| 1234 | |`branches` |optional|Map of branch names to HEAD revisions. |
| 1235 | |=========================== |
| 1236 | |
Bruce Zu | 798ea12 | 2013-02-18 16:55:43 +0800 | [diff] [blame] | 1237 | [[project-input]] |
| 1238 | ProjectInput |
| 1239 | ~~~~~~~~~~~~ |
| 1240 | The `ProjectInput` entity contains information for the creation of |
| 1241 | a new project. |
| 1242 | |
| 1243 | [options="header",width="50%",cols="1,^2,4"] |
| 1244 | |========================================= |
| 1245 | |Field Name ||Description |
| 1246 | |`name` |optional| |
| 1247 | The name of the project (not encoded). + |
| 1248 | If set, must match the project name in the URL. |
| 1249 | |`parent` |optional| |
| 1250 | The name of the parent project. + |
| 1251 | If not set, the `All-Projects` project will be the parent project. |
| 1252 | |`description` |optional|The description of the project. |
| 1253 | |`permissions_only` |`false` if not set| |
| 1254 | Whether a permission-only project should be created. |
| 1255 | |`create_empty_commit` |`false` if not set| |
| 1256 | Whether an empty initial commit should be created. |
| 1257 | |`submit_type` |optional| |
| 1258 | The submit type that should be set for the project |
| 1259 | (`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, |
| 1260 | `MERGE_ALWAYS`, `CHERRY_PICK`). + |
| 1261 | If not set, `MERGE_IF_NECESSARY` is set as submit type. |
| 1262 | |`branches` |optional| |
| 1263 | A list of branches that should be initially created. + |
| 1264 | For the branch names the `refs/heads/` prefix can be omitted. |
| 1265 | |`owners` |optional| |
| 1266 | A list of groups that should be assigned as project owner. + |
| 1267 | Each group in the list must be specified as |
| 1268 | link:rest-api-groups.html#group-id[group-id]. + |
| 1269 | If not set, the link:config-gerrit.html#repository.name.ownerGroup[ |
| 1270 | groups that are configured as default owners] are set as project |
| 1271 | owners. |
| 1272 | |`use_contributor_agreements`|`INHERIT` if not set| |
| 1273 | Whether contributor agreements should be used for the project (`TRUE`, |
| 1274 | `FALSE`, `INHERIT`). |
| 1275 | |`use_signed_off_by` |`INHERIT` if not set| |
| 1276 | Whether the usage of 'Signed-Off-By' footers is required for the |
| 1277 | project (`TRUE`, `FALSE`, `INHERIT`). |
| 1278 | |`use_content_merge` |`INHERIT` if not set| |
| 1279 | Whether content merge should be enabled for the project (`TRUE`, |
| 1280 | `FALSE`, `INHERIT`). + |
| 1281 | `FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`. |
| 1282 | |`require_change_id` |`INHERIT` if not set| |
| 1283 | Whether the usage of Change-Ids is required for the project (`TRUE`, |
| 1284 | `FALSE`, `INHERIT`). |
Sasa Zivkov | 6b40cb4 | 2013-07-01 15:28:22 +0200 | [diff] [blame] | 1285 | |`max_object_size_limit` |optional| |
| 1286 | Max allowed Git object size for this project. |
| 1287 | Common unit suffixes of 'k', 'm', or 'g' are supported. |
Bruce Zu | 798ea12 | 2013-02-18 16:55:43 +0800 | [diff] [blame] | 1288 | |========================================= |
| 1289 | |
Edwin Kempin | ecad88c | 2013-02-14 12:09:44 +0100 | [diff] [blame] | 1290 | [[project-parent-input]] |
| 1291 | ProjectParentInput |
| 1292 | ~~~~~~~~~~~~~~~~~~ |
| 1293 | The `ProjectParentInput` entity contains information for setting a |
| 1294 | project parent. |
| 1295 | |
| 1296 | [options="header",width="50%",cols="1,^2,4"] |
| 1297 | |============================= |
| 1298 | |Field Name ||Description |
| 1299 | |`parent` ||The name of the parent project. |
| 1300 | |`commit_message`|optional| |
| 1301 | Message that should be used to commit the change of the project parent |
| 1302 | in the `project.config` file to the `refs/meta/config` branch. |
| 1303 | |============================= |
| 1304 | |
Edwin Kempin | 19ea9b9 | 2013-03-20 13:20:26 +0100 | [diff] [blame] | 1305 | [[repository-statistics-info]] |
| 1306 | RepositoryStatisticsInfo |
| 1307 | ~~~~~~~~~~~~~~~~~~~~~~~~ |
| 1308 | The `RepositoryStatisticsInfo` entity contains information about |
| 1309 | statistics of a Git repository. |
| 1310 | |
| 1311 | [options="header",width="50%",cols="1,6"] |
| 1312 | |====================================== |
| 1313 | |Field Name |Description |
| 1314 | |`number_of_loose_objects` |Number of loose objects. |
| 1315 | |`number_of_loose_refs` |Number of loose refs. |
| 1316 | |`number_of_pack_files` |Number of pack files. |
| 1317 | |`number_of_packed_objects`|Number of packed objects. |
| 1318 | |`number_of_packed_refs` |Number of packed refs. |
| 1319 | |`size_of_loose_objects` |Size of loose objects in bytes. |
| 1320 | |`size_of_packed_objects` |Size of packed objects in bytes. |
| 1321 | |====================================== |
| 1322 | |
Edwin Kempin | 272402e | 2013-07-15 11:17:36 +0200 | [diff] [blame] | 1323 | [[theme-info]] |
| 1324 | ThemeInfo |
| 1325 | ~~~~~~~~~ |
| 1326 | The `ThemeInfo` entity describes a theme. |
| 1327 | |
| 1328 | [options="header",width="50%",cols="1,^2,4"] |
| 1329 | |============================= |
| 1330 | |Field Name ||Description |
| 1331 | |`css` |optional| |
| 1332 | The path to the `GerritSite.css` file. |
| 1333 | |`header` |optional| |
| 1334 | The path to the `GerritSiteHeader.html` file. |
| 1335 | |`footer` |optional| |
| 1336 | The path to the `GerritSiteFooter.html` file. |
| 1337 | |============================= |
| 1338 | |
Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame] | 1339 | |
| 1340 | GERRIT |
| 1341 | ------ |
| 1342 | Part of link:index.html[Gerrit Code Review] |