blob: 412b60f0bd2c0f30d8deae40e1d45055cfa80cda [file] [log] [blame]
Edwin Kempin2eebd142013-03-06 15:28:34 +01001Gerrit Code Review - /projects/ REST API
2========================================
Edwin Kempind0a63922013-01-23 16:32:59 +01003
4This page describes the project related REST endpoints.
5Please also take note of the general information on the
6link:rest-api.html[REST API].
7
8Endpoints
9---------
10
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +010011[[project-endpoints]]
12Project Endpoints
13-----------------
14
Edwin Kempin76202742013-02-15 13:51:50 +010015[[list-projects]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010016List Projects
17~~~~~~~~~~~~~
18[verse]
19'GET /projects/'
20
Edwin Kempind0a63922013-01-23 16:32:59 +010021Lists the projects accessible by the caller. This is the same as
22using the link:cmd-ls-projects.html[ls-projects] command over SSH,
23and accepts the same options as query parameters.
24
Edwin Kempin51a6dc92013-02-04 15:43:59 +010025As result a map is returned that maps the project names to
26link:#project-info[ProjectInfo] entries. The entries in the map are sorted
27by project name.
28
Edwin Kempin37440832013-02-06 11:36:00 +010029.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010030----
31 GET /projects/?d HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010032----
Edwin Kempind0a63922013-01-23 16:32:59 +010033
Edwin Kempin37440832013-02-06 11:36:00 +010034.Response
35----
Edwin Kempind0a63922013-01-23 16:32:59 +010036 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 Kempina64c4b92013-01-23 11:30:40 +010064.Get all projects with their description
65****
66get::/projects/?d
67****
68
Edwin Kempind0a63922013-01-23 16:32:59 +010069[[suggest-projects]]
70The `/projects/` URL also accepts a prefix string in the `p` parameter.
71This limits the results to those projects that start with the specified
72prefix.
73List all projects that start with `platform/`:
Edwin Kempin37440832013-02-06 11:36:00 +010074
75.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010076----
77 GET /projects/?p=platform%2F HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010078----
Edwin Kempind0a63922013-01-23 16:32:59 +010079
Edwin Kempin37440832013-02-06 11:36:00 +010080.Response
81----
Edwin Kempind0a63922013-01-23 16:32:59 +010082 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----
98E.g. this feature can be used by suggestion client UI's to limit results.
99
Edwin Kempin5c544e22013-03-06 13:35:45 +0100100[[get-project]]
101Get Project
102~~~~~~~~~~~
103[verse]
104'GET /projects/link:#project-name[\{project-name\}]'
105
106Retrieves a project.
107
108.Request
109----
110 GET /projects/plugins%2Freplication HTTP/1.0
111----
112
113As response a link:#project-info[ProjectInfo] entity is returned that
114describes 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 Zu798ea122013-02-18 16:55:43 +0800132[[create-project]]
133Create Project
134~~~~~~~~~~~~~~
135[verse]
136'PUT /projects/link:#project-name[\{project-name\}]'
137
138Creates a new project.
139
140In the request body additional data for the project can be provided as
141link:#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
157As response the link:#project-info[ProjectInfo] entity is returned that
158describes 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 Kempin57f303c2013-02-13 15:52:22 +0100176[[get-project-description]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100177Get Project Description
178~~~~~~~~~~~~~~~~~~~~~~~
179[verse]
180'GET /projects/link:#project-name[\{project-name\}]/description'
181
Edwin Kempin57f303c2013-02-13 15:52:22 +0100182Retrieves 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 Kempinefec4492013-02-22 10:09:23 +0100199If the project does not have a description an empty string is returned.
200
Edwin Kempin57f303c2013-02-13 15:52:22 +0100201[[set-project-description]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100202Set Project Description
203~~~~~~~~~~~~~~~~~~~~~~~
204[verse]
205'PUT /projects/link:#project-name[\{project-name\}]/description'
206
Edwin Kempin57f303c2013-02-13 15:52:22 +0100207Sets the description of a project.
208
209The new project description must be provided in the request body inside
210a 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
223As 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 Kempin114ab162013-02-28 09:25:37 +0100235If the description was deleted the response is "`204 No Content`".
236
Edwin Kempin57f303c2013-02-13 15:52:22 +0100237[[delete-project-description]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100238Delete Project Description
239~~~~~~~~~~~~~~~~~~~~~~~~~~
240[verse]
241'DELETE /projects/link:#project-name[\{project-name\}]/description'
242
Edwin Kempin57f303c2013-02-13 15:52:22 +0100243Deletes the description of a project.
244
Edwin Kempinefec4492013-02-22 10:09:23 +0100245The request body does not need to include a
246link:#project-description-input[ProjectDescriptionInput] entity if no
247commit message is specified.
Edwin Kempin57f303c2013-02-13 15:52:22 +0100248
Edwin Kempinefec4492013-02-22 10:09:23 +0100249Please note that some proxies prohibit request bodies for DELETE
Edwin Kempin57f303c2013-02-13 15:52:22 +0100250requests. In this case, if you want to specify a commit message, use
251link:#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 Kempinecad88c2013-02-14 12:09:44 +0100263[[get-project-parent]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100264Get Project Parent
265~~~~~~~~~~~~~~~~~~
266[verse]
267'GET /projects/link:#project-name[\{project-name\}]/parent'
268
Edwin Kempinecad88c2013-02-14 12:09:44 +0100269Retrieves 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 Kempin50d3d9b2013-03-06 16:38:26 +0100288Set Project Parent
289~~~~~~~~~~~~~~~~~~
290[verse]
291'PUT /projects/link:#project-name[\{project-name\}]/parent'
292
Edwin Kempinecad88c2013-02-14 12:09:44 +0100293Sets the parent project for a project.
294
295The new name of the parent project must be provided in the request body
296inside 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
309As 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 Kempin6b813372013-03-13 17:07:33 +0100321[[get-head]]
322Get HEAD
323~~~~~~~~
324[verse]
325'GET /projects/link:#project-name[\{project-name\}]/HEAD'
326
327Retrieves 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]]
345Set HEAD
346~~~~~~~~
347[verse]
348'PUT /projects/link:#project-name[\{project-name\}]/HEAD'
349
350Sets `HEAD` for a project.
351
352The new ref to which `HEAD` should point must be provided in the
353request 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
365As 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 Kempin19ea9b92013-03-20 13:20:26 +0100377[[get-repository-statistics]]
378Get Repository Statistics
379~~~~~~~~~~~~~~~~~~~~~~~~~
380[verse]
381'GET /projects/link:#project-name[\{project-name\}]/statistics.git'
382
383Return statistics for the repository of a project.
384
385.Request
386----
387 GET /projects/plugins%2Freplication/statistics.git HTTP/1.0
388----
389
390The repository statistics are returned as a
391link:#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 Borowitz237073a2013-04-04 16:52:27 -0700411[[get-config]]
412Get Config
413~~~~~~~~~~
414[verse]
415'GET /projects/link:#project-name[\{project-name\}]/config'
416
417Gets some configuration information about a project. Note that this
418config info is not simply the contents of `project.config`; it generally
419contains fields that may have been inherited from parent projects.
420
421.Request
422----
423 GET /projects/myproject/config
424----
425
426A link:#config-info[ConfigInfo] entity is returned that describes the
427project configuration. Some fields are only visible to users that have
428read 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 Kempin0cb5a562013-07-12 15:41:04 +0200439 "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 Borowitz20027892013-04-08 10:42:23 -0700459 "commentlinks": {}
Dave Borowitz237073a2013-04-04 16:52:27 -0700460 }
461----
462
Edwin Kempinef3542f2013-03-19 13:31:49 +0100463[[run-gc]]
464Run GC
465~~~~~~
466[verse]
467'POST /projects/link:#project-name[\{project-name\}]/gc'
468
469Run 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
476The 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 Kempina686de92013-05-09 15:12:34 +0200502[[branch-endpoints]]
503Branch Endpoints
504----------------
505
506[[list-branches]]
507List Branches
508~~~~~~~~~~~~~
509[verse]
510'GET /projects/link:#project-name[\{project-name\}]/branches/'
511
512List the branches of a project.
513
514As result a list of link:#branch-info[BranchInfo] entries is
515returned.
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 Kempin196e1732013-05-09 15:12:34 +0200550[[get-branch]]
551Get Branch
552~~~~~~~~~~
553[verse]
554'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
555
556Retrieves a branch of a project.
557
558.Request
559----
560 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
561----
562
563As response a link:#branch-info[BranchInfo] entity is returned that
564describes 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 Kempin5c0d6b32013-05-09 19:54:37 +0200579[[create-branch]]
580Create Branch
581~~~~~~~~~~~~~
582[verse]
583'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
584
585Creates a new branch.
586
587In the request body additional data for the branch can be provided as
588link:#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
600As response a link:#branch-info[BranchInfo] entity is returned that
601describes 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 Kempin6ce96a12013-06-06 13:20:01 +0200617[[delete-branch]]
618Delete Branch
619~~~~~~~~~~~~~
620[verse]
621'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
622
623Deletes 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 Kempin4425c742013-03-18 13:23:00 +0100635[[child-project-endpoints]]
636Child Project Endpoints
637-----------------------
638
639[[list-child-projects]]
640List Child Projects
641~~~~~~~~~~~~~~~~~~~
642[verse]
643'GET /projects/link:#project-name[\{project-name\}]/children/'
644
645List the direct child projects of a project.
646
647.Request
648----
649 GET /projects/Public-Plugins/children/ HTTP/1.0
650----
651
652As result a list of link:#project-info[ProjectInfo] entries is
653returned 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 Kempinf95bd172013-03-19 11:10:57 +0100687To resolve the child projects of a project recursively the parameter
688`recursive` can be set.
689
690Child projects that are not visible to the calling user are ignored and
691are 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 Kempin5b6c4062013-03-19 09:26:03 +0100744[[get-child-project]]
745Get Child Project
746~~~~~~~~~~~~~~~~~
747[verse]
748'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
749
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +0100750Retrieves a child project. If a non-direct child project should be
751retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +0100752
753.Request
754----
755 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
756----
757
758As response a link:#project-info[ProjectInfo] entity is returned that
759describes 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 Kempinc3fe3cb2013-02-13 15:09:23 +0100777[[dashboard-endpoints]]
778Dashboard Endpoints
779-------------------
780
Edwin Kempin76202742013-02-15 13:51:50 +0100781[[list-dashboards]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100782List Dashboards
783~~~~~~~~~~~~~~~
784[verse]
785'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
786
Edwin Kempind0a63922013-01-23 16:32:59 +0100787List custom dashboards for a project.
788
Edwin Kempin55367622013-02-05 09:09:23 +0100789As result a list of link:#dashboard-info[DashboardInfo] entries is
790returned.
791
Edwin Kempind0a63922013-01-23 16:32:59 +0100792List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +0100793
794.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100795----
796 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100797----
Edwin Kempind0a63922013-01-23 16:32:59 +0100798
Edwin Kempin37440832013-02-06 11:36:00 +0100799.Response
800----
Edwin Kempind0a63922013-01-23 16:32:59 +0100801 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 Kempina64c4b92013-01-23 11:30:40 +0100830.Get all dashboards of the 'All-Projects' project
831****
832get::/projects/All-Projects/dashboards/
833****
834
Edwin Kempin67e923c2013-02-14 13:57:12 +0100835[[get-dashboard]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100836Get Dashboard
837~~~~~~~~~~~~~
838[verse]
839'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
840
Edwin Kempin67e923c2013-02-14 13:57:12 +0100841Retrieves a project dashboard. The dashboard can be defined on that
842project 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
849As response a link:#dashboard-info[DashboardInfo] entity is returned
850that 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
881To retrieve the default dashboard of a project use `default` as
882dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +0100883
884.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100885----
886 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100887----
Edwin Kempind0a63922013-01-23 16:32:59 +0100888
Edwin Kempin37440832013-02-06 11:36:00 +0100889.Response
890----
Edwin Kempind0a63922013-01-23 16:32:59 +0100891 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 Kempin67e923c2013-02-14 13:57:12 +0100901 "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 Kempind0a63922013-01-23 16:32:59 +0100903 "default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +0100904 "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 Kempind0a63922013-01-23 16:32:59 +0100915 }
916----
917
Edwin Kempin67e923c2013-02-14 13:57:12 +0100918[[set-dashboard]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100919Set Dashboard
920~~~~~~~~~~~~~
921[verse]
922'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
923
Edwin Kempin67e923c2013-02-14 13:57:12 +0100924Updates/Creates a project dashboard.
925
926Currently only supported for the `default` dashboard.
927
928The creation/update information for the dashboard must be provided in
929the 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
942As response the new/updated dashboard is returned as a
943link:#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 Kempin50d3d9b2013-03-06 16:38:26 +0100975Delete Dashboard
976~~~~~~~~~~~~~~~~
977[verse]
978'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
979
Edwin Kempin67e923c2013-02-14 13:57:12 +0100980Deletes a project dashboard.
981
982Currently only supported for the `default` dashboard.
983
Edwin Kempinefec4492013-02-22 10:09:23 +0100984The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -0500985DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +0100986
987Please note that some proxies prohibit request bodies for DELETE
988requests.
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 Kempin34d83352013-02-06 10:40:17 +01001000
1001[[ids]]
1002IDs
1003---
1004
Edwin Kempin196e1732013-05-09 15:12:34 +02001005[[branch-id]]
1006\{branch-id\}
1007~~~~~~~~~~~~~
1008The name of a branch or `HEAD`. The prefix `refs/heads/` can be
1009omitted.
1010
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001011[[dashboard-id]]
Edwin Kempin67e923c2013-02-14 13:57:12 +01001012\{dashboard-id\}
1013~~~~~~~~~~~~~~~~
1014The ID of a dashboard in the format '<ref>:<path>'.
1015
1016A special dashboard ID is `default` which represents the default
1017dashboard of a project.
1018
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001019[[project-name]]
Edwin Kempin34d83352013-02-06 10:40:17 +01001020\{project-name\}
1021~~~~~~~~~~~~~~~~
1022The name of the project.
1023
1024
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001025[[json-entities]]
1026JSON Entities
1027-------------
1028
Edwin Kempina686de92013-05-09 15:12:34 +02001029[[branch-info]]
1030BranchInfo
1031~~~~~~~~~~
1032The `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|
1040Whether the calling user can delete this branch.
1041|=========================
1042
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001043[[branch-input]]
1044BranchInput
1045~~~~~~~~~~~
1046The `BranchInput` entity contains information for the creation of
1047a new branch.
1048
1049[options="header",width="50%",cols="1,^2,4"]
1050|=======================
1051|Field Name||Description
1052|`ref` |optional|
1053The name of the branch. The prefix `refs/heads/` can be
1054omitted. +
1055If set, must match the branch ID in the URL.
1056|`revision`|optional|
1057The base revision of the new branch. +
1058If not set, `HEAD` will be used as base revision.
1059|=======================
1060
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001061[[config-info]]
1062ConfigInfo
1063~~~~~~~~~~
1064The `ConfigInfo` entity contains information about the effective project
1065configuration.
1066
Edwin Kempin81e1d1f2013-07-15 10:13:46 +02001067[options="header",width="50%",cols="1,^2,4"]
Edwin Kempin3660c132013-07-16 08:03:11 +02001068|=========================================
1069|Field Name ||Description
1070|`use_contributor_agreements`|optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001071link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1072authors must complete a contributor agreement on the site before
1073pushing any commits or changes to this project.
Edwin Kempin3660c132013-07-16 08:03:11 +02001074|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001075link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1076Gerrit will try to perform a 3-way merge of text file content when a
1077file has been modified by both the destination branch and the change
1078being submitted. This option only takes effect if submit type is not
1079FAST_FORWARD_ONLY.
Edwin Kempin3660c132013-07-16 08:03:11 +02001080|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001081link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1082each change must contain a Signed-off-by line from either the author or
1083the uploader in the commit message.
Edwin Kempin3660c132013-07-16 08:03:11 +02001084|`require_change_id` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001085link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
1086valid link:user-changeid.html[Change-Id] footer in any commit uploaded
1087for review is required. This does not apply to commits pushed directly
1088to a branch or tag.
Edwin Kempin3660c132013-07-16 08:03:11 +02001089|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02001090Map with the comment link configurations of the project. The name of
1091the comment link configuration is mapped to the comment link
1092configuration, which has the same format as the
1093link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[
1094commentlink section] of `gerrit.config`.
Edwin Kempin3660c132013-07-16 08:03:11 +02001095|`theme` |optional|
Edwin Kempin272402e2013-07-15 11:17:36 +02001096The theme that is configured for the project as a link:#theme-info[
1097ThemeInfo] entity.
Edwin Kempin3660c132013-07-16 08:03:11 +02001098|=========================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001099
Edwin Kempin55367622013-02-05 09:09:23 +01001100[[dashboard-info]]
1101DashboardInfo
1102~~~~~~~~~~~~~
1103The `DashboardInfo` entity contains information about a project
1104dashboard.
1105
1106[options="header",width="50%",cols="1,^2,4"]
1107|===============================
1108|Field Name ||Description
1109|`kind` ||`gerritcodereview#dashboard`
1110|`id` ||
1111The ID of the dashboard. The ID has the format '<ref>:<path>',
1112where ref and path are URL encoded.
1113|`project` ||
1114The name of the project for which this dashboard is returned.
1115|`defining_project`||
1116The name of the project in which this dashboard is defined.
1117This is different from `project` if the dashboard is inherited from a
1118parent project.
1119|`ref` ||
1120The 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` ||
1123The path of the file in which the dashboard is defined.
1124|`description` |optional|The description of the dashboard.
1125|`foreach` |optional|
1126Subquery that applies to all sections in the dashboard. +
1127Tokens such as `${project}` are not resolved.
1128|`url` ||
1129The URL under which the dashboard can be opened in the Gerrit WebUI. +
1130The URL is relative to the canonical web URL. +
1131Tokens in the queries such as `${project}` are resolved.
1132|`default` |not set if `false`|
1133Whether this is the default dashboard of the project.
1134|`title` |optional|The title of the dashboard.
1135|`sections` ||
1136The list of link:#dashboard-section-info[sections] in the dashboard.
1137|===============================
1138
Edwin Kempin67e923c2013-02-14 13:57:12 +01001139[[dashboard-input]]
1140DashboardInput
1141~~~~~~~~~~~~~~
1142The `DashboardInput` entity contains information to create/update a
1143project dashboard.
1144
1145[options="header",width="50%",cols="1,^2,4"]
1146|=============================
1147|Field Name ||Description
1148|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01001149URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01001150|`commit_message`|optional|
1151Message that should be used to commit the change of the dashboard.
1152|=============================
1153
Edwin Kempin55367622013-02-05 09:09:23 +01001154[[dashboard-section-info]]
1155DashboardSectionInfo
1156~~~~~~~~~~~~~~~~~~~~
1157The `DashboardSectionInfo` entity contains information about a section
1158in 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. +
1165Tokens such as `${project}` are not resolved.
1166|===========================
1167
Edwin Kempin6b813372013-03-13 17:07:33 +01001168[[head-input]]
1169HeadInput
1170~~~~~~~~~
1171The `HeadInput` entity contains information for setting `HEAD` for a
1172project.
1173
1174[options="header",width="50%",cols="1,6"]
1175|============================
1176|Field Name |Description
1177|`ref` |
1178The ref to which `HEAD` should be set, the `refs/heads` prefix can be
1179omitted.
1180|============================
1181
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001182[[inherited-boolean-info]]
1183InheritedBooleanInfo
1184~~~~~~~~~~~~~~~~~~~~
1185A boolean value that can also be inherited.
1186
1187[options="header",width="50%",cols="1,^2,4"]
1188|================================
1189|Field Name ||Description
1190|`value` ||
1191The effective boolean value.
1192|`configured_value` ||
1193The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
1194|`inherited_value` |optional|
1195The boolean value inherited from the parent. +
1196Not set if there is no parent.
1197|================================
1198
Edwin Kempin57f303c2013-02-13 15:52:22 +01001199[[project-description-input]]
1200ProjectDescriptionInput
1201~~~~~~~~~~~~~~~~~~~~~~~
1202The `ProjectDescriptionInput` entity contains information for setting a
1203project description.
1204
1205[options="header",width="50%",cols="1,^2,4"]
1206|=============================
1207|Field Name ||Description
1208|`description` |optional|The project description. +
1209The project description will be deleted if not set.
1210|`commit_message`|optional|
1211Message that should be used to commit the change of the project
1212description in the `project.config` file to the `refs/meta/config`
1213branch.
1214|=============================
1215
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001216[[project-info]]
1217ProjectInfo
1218~~~~~~~~~~~
1219The `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` |
1227not set if returned in a map where the project name is used as map key|
1228The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01001229|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001230The name of the parent project. +
1231`?-<n>` if the parent project is not visible (`<n>` is a number which
1232is 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 Zu798ea122013-02-18 16:55:43 +08001237[[project-input]]
1238ProjectInput
1239~~~~~~~~~~~~
1240The `ProjectInput` entity contains information for the creation of
1241a new project.
1242
1243[options="header",width="50%",cols="1,^2,4"]
1244|=========================================
1245|Field Name ||Description
1246|`name` |optional|
1247The name of the project (not encoded). +
1248If set, must match the project name in the URL.
1249|`parent` |optional|
1250The name of the parent project. +
1251If 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|
1254Whether a permission-only project should be created.
1255|`create_empty_commit` |`false` if not set|
1256Whether an empty initial commit should be created.
1257|`submit_type` |optional|
1258The submit type that should be set for the project
1259(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
1260`MERGE_ALWAYS`, `CHERRY_PICK`). +
1261If not set, `MERGE_IF_NECESSARY` is set as submit type.
1262|`branches` |optional|
1263A list of branches that should be initially created. +
1264For the branch names the `refs/heads/` prefix can be omitted.
1265|`owners` |optional|
1266A list of groups that should be assigned as project owner. +
1267Each group in the list must be specified as
1268link:rest-api-groups.html#group-id[group-id]. +
1269If not set, the link:config-gerrit.html#repository.name.ownerGroup[
1270groups that are configured as default owners] are set as project
1271owners.
1272|`use_contributor_agreements`|`INHERIT` if not set|
1273Whether contributor agreements should be used for the project (`TRUE`,
1274`FALSE`, `INHERIT`).
1275|`use_signed_off_by` |`INHERIT` if not set|
1276Whether the usage of 'Signed-Off-By' footers is required for the
1277project (`TRUE`, `FALSE`, `INHERIT`).
1278|`use_content_merge` |`INHERIT` if not set|
1279Whether 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|
1283Whether the usage of Change-Ids is required for the project (`TRUE`,
1284`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02001285|`max_object_size_limit` |optional|
1286Max allowed Git object size for this project.
1287Common unit suffixes of 'k', 'm', or 'g' are supported.
Bruce Zu798ea122013-02-18 16:55:43 +08001288|=========================================
1289
Edwin Kempinecad88c2013-02-14 12:09:44 +01001290[[project-parent-input]]
1291ProjectParentInput
1292~~~~~~~~~~~~~~~~~~
1293The `ProjectParentInput` entity contains information for setting a
1294project 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|
1301Message that should be used to commit the change of the project parent
1302in the `project.config` file to the `refs/meta/config` branch.
1303|=============================
1304
Edwin Kempin19ea9b92013-03-20 13:20:26 +01001305[[repository-statistics-info]]
1306RepositoryStatisticsInfo
1307~~~~~~~~~~~~~~~~~~~~~~~~
1308The `RepositoryStatisticsInfo` entity contains information about
1309statistics 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 Kempin272402e2013-07-15 11:17:36 +02001323[[theme-info]]
1324ThemeInfo
1325~~~~~~~~~
1326The `ThemeInfo` entity describes a theme.
1327
1328[options="header",width="50%",cols="1,^2,4"]
1329|=============================
1330|Field Name ||Description
1331|`css` |optional|
1332The path to the `GerritSite.css` file.
1333|`header` |optional|
1334The path to the `GerritSiteHeader.html` file.
1335|`footer` |optional|
1336The path to the `GerritSiteFooter.html` file.
1337|=============================
1338
Edwin Kempind0a63922013-01-23 16:32:59 +01001339
1340GERRIT
1341------
1342Part of link:index.html[Gerrit Code Review]