blob: 542c3c7844ea38e4247a6477d84da2c519ef4a1c [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",
439 "use_contributor_agreements": false,
440 "use_content_merge": true,
441 "use_signed_off_by": false,
Dave Borowitz20027892013-04-08 10:42:23 -0700442 "require_change_id": true,
443 "commentlinks": {}
Dave Borowitz237073a2013-04-04 16:52:27 -0700444 }
445----
446
Edwin Kempinef3542f2013-03-19 13:31:49 +0100447[[run-gc]]
448Run GC
449~~~~~~
450[verse]
451'POST /projects/link:#project-name[\{project-name\}]/gc'
452
453Run the Git garbage collection for the repository of a project.
454
455.Request
456----
457 POST /projects/plugins%2Freplication/gc HTTP/1.0
458----
459
460The response is the streamed output of the garbage collection.
461
462.Response
463----
464 HTTP/1.1 200 OK
465 Content-Disposition: attachment
466 Content-Type: text/plain;charset=UTF-8
467
468 collecting garbage for "plugins/replication":
469 Pack refs: 100% (21/21)
470 Counting objects: 20
471 Finding sources: 100% (20/20)
472 Getting sizes: 100% (13/13)
473 Compressing objects: 83% (5/6)
474 Writing objects: 100% (20/20)
475 Selecting commits: 100% (7/7)
476 Building bitmaps: 100% (7/7)
477 Finding sources: 100% (41/41)
478 Getting sizes: 100% (25/25)
479 Compressing objects: 52% (12/23)
480 Writing objects: 100% (41/41)
481 Prune loose objects also found in pack files: 100% (36/36)
482 Prune loose, unreferenced objects: 100% (36/36)
483 done.
484----
485
Edwin Kempin4425c742013-03-18 13:23:00 +0100486[[child-project-endpoints]]
487Child Project Endpoints
488-----------------------
489
490[[list-child-projects]]
491List Child Projects
492~~~~~~~~~~~~~~~~~~~
493[verse]
494'GET /projects/link:#project-name[\{project-name\}]/children/'
495
496List the direct child projects of a project.
497
498.Request
499----
500 GET /projects/Public-Plugins/children/ HTTP/1.0
501----
502
503As result a list of link:#project-info[ProjectInfo] entries is
504returned that describe the child projects.
505
506.Response
507----
508 HTTP/1.1 200 OK
509 Content-Disposition: attachment
510 Content-Type: application/json;charset=UTF-8
511
512 )]}'
513 [
514 {
515 "kind": "gerritcodereview#project",
516 "id": "plugins%2Freplication",
517 "name": "plugins/replication",
518 "parent": "Public-Plugins",
519 "description": "Copies to other servers using the Git protocol"
520 },
521 {
522 "kind": "gerritcodereview#project",
523 "id": "plugins%2Freviewnotes",
524 "name": "plugins/reviewnotes",
525 "parent": "Public-Plugins",
526 "description": "Annotates merged commits using notes on refs/notes/review."
527 },
528 {
529 "kind": "gerritcodereview#project",
530 "id": "plugins%2Fsingleusergroup",
531 "name": "plugins/singleusergroup",
532 "parent": "Public-Plugins",
533 "description": "GroupBackend enabling users to be directly added to access rules"
534 }
535 ]
536----
537
Edwin Kempin5b6c4062013-03-19 09:26:03 +0100538[[get-child-project]]
539Get Child Project
540~~~~~~~~~~~~~~~~~
541[verse]
542'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
543
544Retrieves a child project.
545
546.Request
547----
548 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
549----
550
551As response a link:#project-info[ProjectInfo] entity is returned that
552describes the child project.
553
554.Response
555----
556 HTTP/1.1 200 OK
557 Content-Disposition: attachment
558 Content-Type: application/json;charset=UTF-8
559
560 )]}'
561 {
562 "kind": "gerritcodereview#project",
563 "id": "plugins%2Freplication",
564 "name": "plugins/replication",
565 "parent": "Public-Plugins",
566 "description": "Copies to other servers using the Git protocol"
567 }
568----
569
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +0100570[[dashboard-endpoints]]
571Dashboard Endpoints
572-------------------
573
Edwin Kempin76202742013-02-15 13:51:50 +0100574[[list-dashboards]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100575List Dashboards
576~~~~~~~~~~~~~~~
577[verse]
578'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
579
Edwin Kempind0a63922013-01-23 16:32:59 +0100580List custom dashboards for a project.
581
Edwin Kempin55367622013-02-05 09:09:23 +0100582As result a list of link:#dashboard-info[DashboardInfo] entries is
583returned.
584
Edwin Kempind0a63922013-01-23 16:32:59 +0100585List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +0100586
587.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100588----
589 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100590----
Edwin Kempind0a63922013-01-23 16:32:59 +0100591
Edwin Kempin37440832013-02-06 11:36:00 +0100592.Response
593----
Edwin Kempind0a63922013-01-23 16:32:59 +0100594 HTTP/1.1 200 OK
595 Content-Disposition: attachment
596 Content-Type: application/json;charset=UTF-8
597
598 )]}'
599 [
600 {
601 "kind": "gerritcodereview#dashboard",
602 "id": "main:closed",
603 "ref": "main",
604 "path": "closed",
605 "description": "Merged and abandoned changes in last 7 weeks",
606 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
607 "default": true,
608 "title": "Closed changes",
609 "sections": [
610 {
611 "name": "Merged",
612 "query": "status:merged age:7w"
613 },
614 {
615 "name": "Abandoned",
616 "query": "status:abandoned age:7w"
617 }
618 ]
619 }
620 ]
621----
622
Edwin Kempina64c4b92013-01-23 11:30:40 +0100623.Get all dashboards of the 'All-Projects' project
624****
625get::/projects/All-Projects/dashboards/
626****
627
Edwin Kempin67e923c2013-02-14 13:57:12 +0100628[[get-dashboard]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100629Get Dashboard
630~~~~~~~~~~~~~
631[verse]
632'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
633
Edwin Kempin67e923c2013-02-14 13:57:12 +0100634Retrieves a project dashboard. The dashboard can be defined on that
635project or be inherited from a parent project.
636
637.Request
638----
639 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
640----
641
642As response a link:#dashboard-info[DashboardInfo] entity is returned
643that describes the dashboard.
644
645.Response
646----
647 HTTP/1.1 200 OK
648 Content-Disposition: attachment
649 Content-Type: application/json;charset=UTF-8
650
651 )]}'
652 {
653 "kind": "gerritcodereview#dashboard",
654 "id": "main:closed",
655 "ref": "main",
656 "path": "closed",
657 "description": "Merged and abandoned changes in last 7 weeks",
658 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
659 "default": true,
660 "title": "Closed changes",
661 "sections": [
662 {
663 "name": "Merged",
664 "query": "status:merged age:7w"
665 },
666 {
667 "name": "Abandoned",
668 "query": "status:abandoned age:7w"
669 }
670 ]
671 }
672----
673
674To retrieve the default dashboard of a project use `default` as
675dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +0100676
677.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100678----
679 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100680----
Edwin Kempind0a63922013-01-23 16:32:59 +0100681
Edwin Kempin37440832013-02-06 11:36:00 +0100682.Response
683----
Edwin Kempind0a63922013-01-23 16:32:59 +0100684 HTTP/1.1 200 OK
685 Content-Disposition: attachment
686 Content-Type: application/json;charset=UTF-8
687
688 )]}'
689 {
690 "kind": "gerritcodereview#dashboard",
691 "id": "main:closed",
692 "ref": "main",
693 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +0100694 "description": "Merged and abandoned changes in last 7 weeks",
695 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
Edwin Kempind0a63922013-01-23 16:32:59 +0100696 "default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +0100697 "title": "Closed changes",
698 "sections": [
699 {
700 "name": "Merged",
701 "query": "status:merged age:7w"
702 },
703 {
704 "name": "Abandoned",
705 "query": "status:abandoned age:7w"
706 }
707 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100708 }
709----
710
Edwin Kempin67e923c2013-02-14 13:57:12 +0100711[[set-dashboard]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100712Set Dashboard
713~~~~~~~~~~~~~
714[verse]
715'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
716
Edwin Kempin67e923c2013-02-14 13:57:12 +0100717Updates/Creates a project dashboard.
718
719Currently only supported for the `default` dashboard.
720
721The creation/update information for the dashboard must be provided in
722the request body as a link:#dashboard-input[DashboardInput] entity.
723
724.Request
725----
726 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
727 Content-Type: application/json;charset=UTF-8
728
729 {
730 "id": "main:closed",
731 "commit_message": "Define the default dashboard"
732 }
733----
734
735As response the new/updated dashboard is returned as a
736link:#dashboard-info[DashboardInfo] entity.
737
738.Response
739----
740 HTTP/1.1 200 OK
741 Content-Disposition: attachment
742 Content-Type: application/json;charset=UTF-8
743
744 )]}'
745 {
746 "kind": "gerritcodereview#dashboard",
747 "id": "main:closed",
748 "ref": "main",
749 "path": "closed",
750 "description": "Merged and abandoned changes in last 7 weeks",
751 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
752 "default": true,
753 "title": "Closed changes",
754 "sections": [
755 {
756 "name": "Merged",
757 "query": "status:merged age:7w"
758 },
759 {
760 "name": "Abandoned",
761 "query": "status:abandoned age:7w"
762 }
763 ]
764 }
765----
766
767[[delete-dashboard]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100768Delete Dashboard
769~~~~~~~~~~~~~~~~
770[verse]
771'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
772
Edwin Kempin67e923c2013-02-14 13:57:12 +0100773Deletes a project dashboard.
774
775Currently only supported for the `default` dashboard.
776
Edwin Kempinefec4492013-02-22 10:09:23 +0100777The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -0500778DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +0100779
780Please note that some proxies prohibit request bodies for DELETE
781requests.
782
783.Request
784----
785 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
786----
787
788.Response
789----
790 HTTP/1.1 204 No Content
791----
792
Edwin Kempin34d83352013-02-06 10:40:17 +0100793
794[[ids]]
795IDs
796---
797
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100798[[dashboard-id]]
Edwin Kempin67e923c2013-02-14 13:57:12 +0100799\{dashboard-id\}
800~~~~~~~~~~~~~~~~
801The ID of a dashboard in the format '<ref>:<path>'.
802
803A special dashboard ID is `default` which represents the default
804dashboard of a project.
805
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100806[[project-name]]
Edwin Kempin34d83352013-02-06 10:40:17 +0100807\{project-name\}
808~~~~~~~~~~~~~~~~
809The name of the project.
810
811
Edwin Kempin51a6dc92013-02-04 15:43:59 +0100812[[json-entities]]
813JSON Entities
814-------------
815
Edwin Kempin55367622013-02-05 09:09:23 +0100816[[dashboard-info]]
817DashboardInfo
818~~~~~~~~~~~~~
819The `DashboardInfo` entity contains information about a project
820dashboard.
821
822[options="header",width="50%",cols="1,^2,4"]
823|===============================
824|Field Name ||Description
825|`kind` ||`gerritcodereview#dashboard`
826|`id` ||
827The ID of the dashboard. The ID has the format '<ref>:<path>',
828where ref and path are URL encoded.
829|`project` ||
830The name of the project for which this dashboard is returned.
831|`defining_project`||
832The name of the project in which this dashboard is defined.
833This is different from `project` if the dashboard is inherited from a
834parent project.
835|`ref` ||
836The name of the ref in which the dashboard is defined, without the
837`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
838|`path` ||
839The path of the file in which the dashboard is defined.
840|`description` |optional|The description of the dashboard.
841|`foreach` |optional|
842Subquery that applies to all sections in the dashboard. +
843Tokens such as `${project}` are not resolved.
844|`url` ||
845The URL under which the dashboard can be opened in the Gerrit WebUI. +
846The URL is relative to the canonical web URL. +
847Tokens in the queries such as `${project}` are resolved.
848|`default` |not set if `false`|
849Whether this is the default dashboard of the project.
850|`title` |optional|The title of the dashboard.
851|`sections` ||
852The list of link:#dashboard-section-info[sections] in the dashboard.
853|===============================
854
Edwin Kempin67e923c2013-02-14 13:57:12 +0100855[[dashboard-input]]
856DashboardInput
857~~~~~~~~~~~~~~
858The `DashboardInput` entity contains information to create/update a
859project dashboard.
860
861[options="header",width="50%",cols="1,^2,4"]
862|=============================
863|Field Name ||Description
864|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +0100865URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +0100866|`commit_message`|optional|
867Message that should be used to commit the change of the dashboard.
868|=============================
869
Edwin Kempin55367622013-02-05 09:09:23 +0100870[[dashboard-section-info]]
871DashboardSectionInfo
872~~~~~~~~~~~~~~~~~~~~
873The `DashboardSectionInfo` entity contains information about a section
874in a dashboard.
875
876[options="header",width="50%",cols="1,6"]
877|===========================
878|Field Name |Description
879|`name` |The title of the section.
880|`query` |The query of the section. +
881Tokens such as `${project}` are not resolved.
882|===========================
883
Edwin Kempin6b813372013-03-13 17:07:33 +0100884[[head-input]]
885HeadInput
886~~~~~~~~~
887The `HeadInput` entity contains information for setting `HEAD` for a
888project.
889
890[options="header",width="50%",cols="1,6"]
891|============================
892|Field Name |Description
893|`ref` |
894The ref to which `HEAD` should be set, the `refs/heads` prefix can be
895omitted.
896|============================
897
Edwin Kempin57f303c2013-02-13 15:52:22 +0100898[[project-description-input]]
899ProjectDescriptionInput
900~~~~~~~~~~~~~~~~~~~~~~~
901The `ProjectDescriptionInput` entity contains information for setting a
902project description.
903
904[options="header",width="50%",cols="1,^2,4"]
905|=============================
906|Field Name ||Description
907|`description` |optional|The project description. +
908The project description will be deleted if not set.
909|`commit_message`|optional|
910Message that should be used to commit the change of the project
911description in the `project.config` file to the `refs/meta/config`
912branch.
913|=============================
914
Edwin Kempin51a6dc92013-02-04 15:43:59 +0100915[[project-info]]
916ProjectInfo
917~~~~~~~~~~~
918The `ProjectInfo` entity contains information about a project.
919
920[options="header",width="50%",cols="1,^2,4"]
921|===========================
922|Field Name ||Description
923|`kind` ||`gerritcodereview#project`
924|`id` ||The URL encoded project name.
925|`name` |
926not set if returned in a map where the project name is used as map key|
927The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +0100928|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +0100929The name of the parent project. +
930`?-<n>` if the parent project is not visible (`<n>` is a number which
931is increased for each non-visible project).
932|`description` |optional|The description of the project.
933|`branches` |optional|Map of branch names to HEAD revisions.
934|===========================
935
Bruce Zu798ea122013-02-18 16:55:43 +0800936[[project-input]]
937ProjectInput
938~~~~~~~~~~~~
939The `ProjectInput` entity contains information for the creation of
940a new project.
941
942[options="header",width="50%",cols="1,^2,4"]
943|=========================================
944|Field Name ||Description
945|`name` |optional|
946The name of the project (not encoded). +
947If set, must match the project name in the URL.
948|`parent` |optional|
949The name of the parent project. +
950If not set, the `All-Projects` project will be the parent project.
951|`description` |optional|The description of the project.
952|`permissions_only` |`false` if not set|
953Whether a permission-only project should be created.
954|`create_empty_commit` |`false` if not set|
955Whether an empty initial commit should be created.
956|`submit_type` |optional|
957The submit type that should be set for the project
958(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
959`MERGE_ALWAYS`, `CHERRY_PICK`). +
960If not set, `MERGE_IF_NECESSARY` is set as submit type.
961|`branches` |optional|
962A list of branches that should be initially created. +
963For the branch names the `refs/heads/` prefix can be omitted.
964|`owners` |optional|
965A list of groups that should be assigned as project owner. +
966Each group in the list must be specified as
967link:rest-api-groups.html#group-id[group-id]. +
968If not set, the link:config-gerrit.html#repository.name.ownerGroup[
969groups that are configured as default owners] are set as project
970owners.
971|`use_contributor_agreements`|`INHERIT` if not set|
972Whether contributor agreements should be used for the project (`TRUE`,
973`FALSE`, `INHERIT`).
974|`use_signed_off_by` |`INHERIT` if not set|
975Whether the usage of 'Signed-Off-By' footers is required for the
976project (`TRUE`, `FALSE`, `INHERIT`).
977|`use_content_merge` |`INHERIT` if not set|
978Whether content merge should be enabled for the project (`TRUE`,
979`FALSE`, `INHERIT`). +
980`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
981|`require_change_id` |`INHERIT` if not set|
982Whether the usage of Change-Ids is required for the project (`TRUE`,
983`FALSE`, `INHERIT`).
984|=========================================
985
Edwin Kempinecad88c2013-02-14 12:09:44 +0100986[[project-parent-input]]
987ProjectParentInput
988~~~~~~~~~~~~~~~~~~
989The `ProjectParentInput` entity contains information for setting a
990project parent.
991
992[options="header",width="50%",cols="1,^2,4"]
993|=============================
994|Field Name ||Description
995|`parent` ||The name of the parent project.
996|`commit_message`|optional|
997Message that should be used to commit the change of the project parent
998in the `project.config` file to the `refs/meta/config` branch.
999|=============================
1000
Edwin Kempin19ea9b92013-03-20 13:20:26 +01001001[[repository-statistics-info]]
1002RepositoryStatisticsInfo
1003~~~~~~~~~~~~~~~~~~~~~~~~
1004The `RepositoryStatisticsInfo` entity contains information about
1005statistics of a Git repository.
1006
1007[options="header",width="50%",cols="1,6"]
1008|======================================
1009|Field Name |Description
1010|`number_of_loose_objects` |Number of loose objects.
1011|`number_of_loose_refs` |Number of loose refs.
1012|`number_of_pack_files` |Number of pack files.
1013|`number_of_packed_objects`|Number of packed objects.
1014|`number_of_packed_refs` |Number of packed refs.
1015|`size_of_loose_objects` |Size of loose objects in bytes.
1016|`size_of_packed_objects` |Size of packed objects in bytes.
1017|======================================
1018
Dave Borowitz237073a2013-04-04 16:52:27 -07001019[[config-info]]
1020ConfigInfo
1021~~~~~~~~~~
1022The `ConfigInfo` entity contains information about the effective project
1023configuration.
1024
1025Fields marked with * are only visible to users who have read access to
1026`refs/meta/config`.
1027
1028[options="header",width="50%",cols="1,6"]
1029|======================================
1030|Field Name |Description
1031|`use_contributor_agreements*`|
1032If set, authors must complete a contributor agreement on the site
1033before pushing any commits or changes to this project.
1034|`use_content_merge*`|
1035If set, Gerrit will try to perform a 3-way merge of text file content
1036when a file has been modified by both the destination branch and the
1037change being submitted. This option only takes effect if submit type is
1038not FAST_FORWARD_ONLY.
1039|`use_signed_off_by*`|
1040If set, each change must contain a Signed-off-by line from either the
1041author or the uploader in the commit message.
1042|`require_change_id*`|
1043If set, require a valid link:user-changeid.html[Change-Id] footer in any
1044commit uploaded for review. This does not apply to commits pushed
1045directly to a branch or tag.
Dave Borowitz20027892013-04-08 10:42:23 -07001046|`commentlinks`|
1047Comment link configuration for the project. Has the same format as the
1048link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[commentlink section]
1049of `gerrit.config`.
Dave Borowitz237073a2013-04-04 16:52:27 -07001050|======================================
1051
Edwin Kempind0a63922013-01-23 16:32:59 +01001052
1053GERRIT
1054------
1055Part of link:index.html[Gerrit Code Review]