blob: ccc50edfc0749b08eacb7afd30e492c6b41aee06 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - /projects/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01002
3This page describes the project related REST endpoints.
4Please also take note of the general information on the
5link:rest-api.html[REST API].
6
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01007[[project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008== Project Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01009
Edwin Kempin76202742013-02-15 13:51:50 +010010[[list-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080011=== List Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080012--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010013'GET /projects/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080014--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010015
Edwin Kempind0a63922013-01-23 16:32:59 +010016Lists the projects accessible by the caller. This is the same as
17using the link:cmd-ls-projects.html[ls-projects] command over SSH,
18and accepts the same options as query parameters.
19
Edwin Kempin51a6dc92013-02-04 15:43:59 +010020As result a map is returned that maps the project names to
21link:#project-info[ProjectInfo] entries. The entries in the map are sorted
22by project name.
23
Edwin Kempin37440832013-02-06 11:36:00 +010024.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010025----
26 GET /projects/?d HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010027----
Edwin Kempind0a63922013-01-23 16:32:59 +010028
Edwin Kempin37440832013-02-06 11:36:00 +010029.Response
30----
Edwin Kempind0a63922013-01-23 16:32:59 +010031 HTTP/1.1 200 OK
32 Content-Disposition: attachment
33 Content-Type: application/json;charset=UTF-8
34
35 )]}'
36 {
37 "external/bison": {
Edwin Kempind0a63922013-01-23 16:32:59 +010038 "id": "external%2Fbison",
39 "description": "GNU parser generator"
40 },
41 "external/gcc": {
Edwin Kempind0a63922013-01-23 16:32:59 +010042 "id": "external%2Fgcc",
43 },
44 "external/openssl": {
Edwin Kempind0a63922013-01-23 16:32:59 +010045 "id": "external%2Fopenssl",
46 "description": "encryption\ncrypto routines"
47 },
48 "test": {
Edwin Kempind0a63922013-01-23 16:32:59 +010049 "id": "test",
50 "description": "\u003chtml\u003e is escaped"
51 }
52 }
53----
54
Hugo Arèsbdd7f682014-07-08 10:57:52 -040055[[project-options]]
56==== Project Options
57
58Branch(b)::
59Limit the results to the projects having the specified branch and
60include the sha1 of the branch in the results.
61+
62Get projects that have a 'master' branch:
63+
64.Request
65----
66GET /projects/?b=master HTTP/1.0
67----
68+
69.Response
70----
71 HTTP/1.1 200 OK
72 Content-Disposition: attachment
73 Content-Type: application/json;charset=UTF-8
74
75 )]}'
76 {
77 "some-project": {
78 "id": "some-project",
79 "branches": {
80 "master": "c5ed9dfcbf002ca0e432d788dab6ca2387829ca7"
81 }
82 },
83 "some-other-project": {
84 "id": "some-other-project",
85 "branches": {
86 "master": "ef1c270142f9581ecf768f4193fc8f8a81102ec2"
87 }
88 },
89 }
90----
91
92Description(d)::
93Include project description in the results.
94+
95Get all the projects with their description:
96+
97.Request
98----
99GET /projects/?d HTTP/1.0
100----
101+
102.Response
103----
104 HTTP/1.1 200 OK
105 Content-Disposition: attachment
106 Content-Type: application/json;charset=UTF-8
107
108 )]}'
109 {
110 "some-project": {
111 "id": "some-project",
112 "description": "Description of some project."
113 },
114 "some-other-project": {
115 "id": "some-other-project",
116 "description": "Description of some other project."
117 }
118 },
119 }
120----
121
122Limit(n)::
123Limit the number of projects to be included in the results.
124+
125Query the first project in the project list:
126+
127.Request
128----
129 GET /projects/?n=1 HTTP/1.0
130----
131+
132.Response
133----
134 HTTP/1.1 200 OK
135 Content-Disposition: attachment
136 Content-Type: application/json;charset=UTF-8
137
138 )]}'
139 {
140 "some-project": {
141 "id": "some-project"
142 }
143 }
144----
145
Edwin Kempina64c4b92013-01-23 11:30:40 +0100146
Edwin Kempind0a63922013-01-23 16:32:59 +0100147[[suggest-projects]]
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400148Prefix(p)::
149Limit the results to those projects that start with the specified
Edwin Kempind0a63922013-01-23 16:32:59 +0100150prefix.
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400151+
Edwin Kempind0a63922013-01-23 16:32:59 +0100152List all projects that start with `platform/`:
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400153+
Edwin Kempin37440832013-02-06 11:36:00 +0100154.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100155----
156 GET /projects/?p=platform%2F HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100157----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400158+
Edwin Kempin37440832013-02-06 11:36:00 +0100159.Response
160----
Edwin Kempind0a63922013-01-23 16:32:59 +0100161 HTTP/1.1 200 OK
162 Content-Disposition: attachment
163 Content-Type: application/json;charset=UTF-8
164
165 )]}'
166 {
167 "platform/drivers": {
Edwin Kempind0a63922013-01-23 16:32:59 +0100168 "id": "platform%2Fdrivers",
169 },
170 "platform/tools": {
Edwin Kempind0a63922013-01-23 16:32:59 +0100171 "id": "platform%2Ftools",
172 }
173 }
174----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400175+
Edwin Kempind0a63922013-01-23 16:32:59 +0100176E.g. this feature can be used by suggestion client UI's to limit results.
177
Hugo Arèsb8aae412014-07-08 11:04:43 -0400178Regex(r)::
179Limit the results to those projects that match the specified regex.
180+
181Boundary matchers '^' and '$' are implicit. For example: the regex 'test.*' will
182match any projects that start with 'test' and regex '.*test' will match any
183project that end with 'test'.
184+
185List all projects that match regex `test.*project`:
186+
187.Request
188----
189 GET /projects/?r=test.*project HTTP/1.0
190----
191+
192.Response
193----
194 HTTP/1.1 200 OK
195 Content-Disposition: attachment
196 Content-Type: application/json;charset=UTF-8
197
198 )]}'
199 {
200 "test/some-project": {
201 "id": "test%2Fsome-project",
202 },
203 "test/some-other-project": {
204 "id": "test%2Fsome-other-project",
205 }
206 }
207
208----
209
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400210Skip(S)::
211Skip the given number of projects from the beginning of the list.
212+
213Query the second project in the project list:
214+
215.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400216----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400217 GET /projects/?n=1&S=1 HTTP/1.0
218----
219+
220.Response
221----
222 HTTP/1.1 200 OK
223 Content-Disposition: attachment
224 Content-Type: application/json;charset=UTF-8
225
226 )]}'
227 {
228 "some-other-project": {
229 "id": "some-other-project"
230 }
231 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400232----
233
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400234Substring(m)::
235Limit the results to those projects that match the specified substring.
236+
237List all projects that match substring `test/`:
238+
239.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400240----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400241 GET /projects/?m=test%2F HTTP/1.0
242----
243+
244.Response
245----
246 HTTP/1.1 200 OK
247 Content-Disposition: attachment
248 Content-Type: application/json;charset=UTF-8
249
250 )]}'
251 {
252 "test/some-project": {
253 "id": "test%2Fsome-project",
254 },
255 "some-path/test/some-other-project": {
256 "id": "some-path%2Ftest%2Fsome-other-project",
257 }
258 }
259----
260
261Tree(t)::
262Get projects inheritance in a tree-like format. This option does
263not work together with the branch option.
264+
265Get all the projects with tree option:
266+
267.Request
268----
269GET /projects/?t HTTP/1.0
270----
271+
272.Response
273----
274 HTTP/1.1 200 OK
275 Content-Disposition: attachment
276 Content-Type: application/json;charset=UTF-8
277
278 )]}'
279 {
280 "All-Projects" {
281 "id": "All-Projects"
282 },
283 "child-project": {
284 "id": "child-project",
285 "parent":"parent-project"
286 },
287 "parent-project": {
288 "id": "parent-project",
289 "parent":"All-Projects"
290 }
291 }
292----
293
294Type(type)::
295Get projects with specified type: ALL, CODE, PERMISSIONS.
296+
297Get all the projects of type 'PERMISSIONS':
298+
299.Request
300----
301GET /projects/?type=PERMISSIONS HTTP/1.0
302----
303+
304.Response
305----
306 HTTP/1.1 200 OK
307 Content-Disposition: attachment
308 Content-Type: application/json;charset=UTF-8
309
310 )]}'
311 {
312 "All-Projects" {
313 "id": "All-Projects"
314 },
315 "some-parent-project": {
316 "id": "some-parent-project"
317 }
318 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400319----
320
Edwin Kempin5c544e22013-03-06 13:35:45 +0100321[[get-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800322=== Get Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800323--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100324'GET /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800325--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100326
327Retrieves a project.
328
329.Request
330----
331 GET /projects/plugins%2Freplication HTTP/1.0
332----
333
334As response a link:#project-info[ProjectInfo] entity is returned that
335describes the project.
336
337.Response
338----
339 HTTP/1.1 200 OK
340 Content-Disposition: attachment
341 Content-Type: application/json;charset=UTF-8
342
343 )]}'
344 {
Edwin Kempin5c544e22013-03-06 13:35:45 +0100345 "id": "plugins%2Freplication",
346 "name": "plugins/replication",
347 "parent": "Public-Plugins",
Shawn Pearce21a6c212014-04-23 12:35:10 -0700348 "description": "Copies to other servers using the Git protocol",
349 "state": "ACTIVE"
Edwin Kempin5c544e22013-03-06 13:35:45 +0100350 }
351----
352
Bruce Zu798ea122013-02-18 16:55:43 +0800353[[create-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800354=== Create Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800355--
Bruce Zu798ea122013-02-18 16:55:43 +0800356'PUT /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800357--
Bruce Zu798ea122013-02-18 16:55:43 +0800358
359Creates a new project.
360
361In the request body additional data for the project can be provided as
362link:#project-input[ProjectInput].
363
364.Request
365----
366 PUT /projects/MyProject HTTP/1.0
367 Content-Type: application/json;charset=UTF-8
368
369 {
370 "description": "This is a demo project.",
371 "submit_type": "CHERRY_PICK",
372 "owners": [
373 "MyProject-Owners"
374 ]
375 }
376----
377
378As response the link:#project-info[ProjectInfo] entity is returned that
379describes the created project.
380
381.Response
382----
383 HTTP/1.1 201 Created
384 Content-Disposition: attachment
385 Content-Type: application/json;charset=UTF-8
386
387 )]}'
388 {
Bruce Zu798ea122013-02-18 16:55:43 +0800389 "id": "MyProject",
390 "name": "MyProject",
391 "parent": "All-Projects",
392 "description": "This is a demo project."
393 }
394----
395
Edwin Kempin57f303c2013-02-13 15:52:22 +0100396[[get-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800397=== Get Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800398--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100399'GET /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800400--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100401
Edwin Kempin57f303c2013-02-13 15:52:22 +0100402Retrieves the description of a project.
403
404.Request
405----
406 GET /projects/plugins%2Freplication/description HTTP/1.0
407----
408
409.Response
410----
411 HTTP/1.1 200 OK
412 Content-Disposition: attachment
413 Content-Type: application/json;charset=UTF-8
414
415 )]}'
416 "Copies to other servers using the Git protocol"
417----
418
Edwin Kempinefec4492013-02-22 10:09:23 +0100419If the project does not have a description an empty string is returned.
420
Edwin Kempin57f303c2013-02-13 15:52:22 +0100421[[set-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800422=== Set Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800423--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100424'PUT /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800425--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100426
Edwin Kempin57f303c2013-02-13 15:52:22 +0100427Sets the description of a project.
428
429The new project description must be provided in the request body inside
430a link:#project-description-input[ProjectDescriptionInput] entity.
431
432.Request
433----
434 PUT /projects/plugins%2Freplication/description HTTP/1.0
435 Content-Type: application/json;charset=UTF-8
436
437 {
438 "description": "Plugin for Gerrit that handles the replication.",
439 "commit_message": "Update the project description"
440 }
441----
442
443As response the new project description is returned.
444
445.Response
446----
447 HTTP/1.1 200 OK
448 Content-Disposition: attachment
449 Content-Type: application/json;charset=UTF-8
450
451 )]}'
452 "Plugin for Gerrit that handles the replication."
453----
454
Edwin Kempin114ab162013-02-28 09:25:37 +0100455If the description was deleted the response is "`204 No Content`".
456
Edwin Kempin57f303c2013-02-13 15:52:22 +0100457[[delete-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800458=== Delete Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800459--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100460'DELETE /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800461--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100462
Edwin Kempin57f303c2013-02-13 15:52:22 +0100463Deletes the description of a project.
464
Edwin Kempinefec4492013-02-22 10:09:23 +0100465The request body does not need to include a
466link:#project-description-input[ProjectDescriptionInput] entity if no
467commit message is specified.
Edwin Kempin57f303c2013-02-13 15:52:22 +0100468
Edwin Kempinefec4492013-02-22 10:09:23 +0100469Please note that some proxies prohibit request bodies for DELETE
Edwin Kempin57f303c2013-02-13 15:52:22 +0100470requests. In this case, if you want to specify a commit message, use
471link:#set-project-description[PUT] to delete the description.
472
473.Request
474----
475 DELETE /projects/plugins%2Freplication/description HTTP/1.0
476----
477
478.Response
479----
480 HTTP/1.1 204 No Content
481----
482
Edwin Kempinecad88c2013-02-14 12:09:44 +0100483[[get-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800484=== Get Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800485--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100486'GET /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800487--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100488
Edwin Kempinecad88c2013-02-14 12:09:44 +0100489Retrieves the name of a project's parent project. For the
490`All-Projects` root project an empty string is returned.
491
492.Request
493----
494 GET /projects/plugins%2Freplication/parent HTTP/1.0
495----
496
497.Response
498----
499 HTTP/1.1 200 OK
500 Content-Disposition: attachment
501 Content-Type: application/json;charset=UTF-8
502
503 )]}'
504 "All-Projects"
505----
506
507[[set-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800508=== Set Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800509--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100510'PUT /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800511--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100512
Edwin Kempinecad88c2013-02-14 12:09:44 +0100513Sets the parent project for a project.
514
515The new name of the parent project must be provided in the request body
516inside a link:#project-parent-input[ProjectParentInput] entity.
517
518.Request
519----
520 PUT /projects/plugins%2Freplication/parent HTTP/1.0
521 Content-Type: application/json;charset=UTF-8
522
523 {
524 "parent": "Public-Plugins",
525 "commit_message": "Update the project parent"
526 }
527----
528
529As response the new parent project name is returned.
530
531.Response
532----
533 HTTP/1.1 200 OK
534 Content-Disposition: attachment
535 Content-Type: application/json;charset=UTF-8
536
537 )]}'
538 "Public-Plugins"
539----
540
Edwin Kempin6b813372013-03-13 17:07:33 +0100541[[get-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800542=== Get HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800543--
Edwin Kempin6b813372013-03-13 17:07:33 +0100544'GET /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800545--
Edwin Kempin6b813372013-03-13 17:07:33 +0100546
547Retrieves for a project the name of the branch to which `HEAD` points.
548
549.Request
550----
551 GET /projects/plugins%2Freplication/HEAD HTTP/1.0
552----
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 "refs/heads/master"
562----
563
564[[set-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800565=== Set HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800566--
Edwin Kempin6b813372013-03-13 17:07:33 +0100567'PUT /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800568--
Edwin Kempin6b813372013-03-13 17:07:33 +0100569
570Sets `HEAD` for a project.
571
572The new ref to which `HEAD` should point must be provided in the
573request body inside a link:#head-input[HeadInput] entity.
574
575.Request
576----
577 PUT /projects/plugins%2Freplication/HEAD HTTP/1.0
578 Content-Type: application/json;charset=UTF-8
579
580 {
581 "ref": "refs/heads/stable"
582 }
583----
584
585As response the new ref to which `HEAD` points is returned.
586
587.Response
588----
589 HTTP/1.1 200 OK
590 Content-Disposition: attachment
591 Content-Type: application/json;charset=UTF-8
592
593 )]}'
594 "refs/heads/stable"
595----
596
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100597[[get-repository-statistics]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800598=== Get Repository Statistics
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800599--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100600'GET /projects/link:#project-name[\{project-name\}]/statistics.git'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800601--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100602
603Return statistics for the repository of a project.
604
605.Request
606----
607 GET /projects/plugins%2Freplication/statistics.git HTTP/1.0
608----
609
610The repository statistics are returned as a
611link:#repository-statistics-info[RepositoryStatisticsInfo] entity.
612
613.Response
614----
615 HTTP/1.1 200 OK
616 Content-Disposition: attachment
617 Content-Type: application/json;charset=UTF-8
618
619 )]}'
620 {
621 "number_of_loose_objects": 127,
622 "number_of_loose_refs": 15,
623 "number_of_pack_files": 15,
624 "number_of_packed_objects": 67,
625 "number_of_packed_refs": 0,
626 "size_of_loose_objects": 29466,
627 "size_of_packed_objects": 9646
628 }
629----
630
Dave Borowitz237073a2013-04-04 16:52:27 -0700631[[get-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800632=== Get Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800633--
Dave Borowitz237073a2013-04-04 16:52:27 -0700634'GET /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800635--
Dave Borowitz237073a2013-04-04 16:52:27 -0700636
637Gets some configuration information about a project. Note that this
638config info is not simply the contents of `project.config`; it generally
639contains fields that may have been inherited from parent projects.
640
641.Request
642----
643 GET /projects/myproject/config
644----
645
646A link:#config-info[ConfigInfo] entity is returned that describes the
647project configuration. Some fields are only visible to users that have
648read access to `refs/meta/config`.
649
650.Response
651----
652 HTTP/1.1 200 OK
653 Content-Disposition: attachment
654 Content-Type: application/json;charset=UTF-8
655
656 )]}'
657 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200658 "description": "demo project",
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200659 "use_contributor_agreements": {
660 "value": true,
661 "configured_value": "TRUE",
662 "inherited_value": false
663 },
664 "use_content_merge": {
665 "value": true,
666 "configured_value": "INHERIT",
667 "inherited_value": true
668 },
669 "use_signed_off_by": {
670 "value": false,
671 "configured_value": "INHERIT",
672 "inherited_value": false
673 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200674 "create_new_change_for_all_not_in_target": {
675 "value": false,
676 "configured_value": "INHERIT",
677 "inherited_value": false
678 },
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200679 "require_change_id": {
680 "value": false,
681 "configured_value": "FALSE",
682 "inherited_value": true
Edwin Kempin3c99f592013-07-15 10:12:27 +0200683 },
684 "max_object_size_limit": {
685 "value": "15m",
686 "configured_value": "15m",
687 "inherited_value": "20m"
688 },
689 "submit_type": "MERGE_IF_NECESSARY",
690 "state": "ACTIVE",
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200691 "commentlinks": {},
Edwin Kempin9ce4f552013-11-15 16:00:00 +0100692 "plugin_config": {
693 "helloworld": {
694 "language": {
695 "display_name": "Preferred Language",
696 "type": "STRING",
697 "value": "en"
698 }
699 }
700 },
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200701 "actions": {
702 "cookbook~hello-project": {
703 "method": "POST",
704 "label": "Say hello",
705 "title": "Say hello in different languages",
706 "enabled": true
707 }
708 }
Dave Borowitz237073a2013-04-04 16:52:27 -0700709 }
710----
711
Edwin Kempina23eb102013-07-17 09:10:54 +0200712[[set-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800713=== Set Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800714--
Edwin Kempina23eb102013-07-17 09:10:54 +0200715'PUT /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800716--
Edwin Kempina23eb102013-07-17 09:10:54 +0200717
718Sets the configuration of a project.
719
720The new configuration must be provided in the request body as a
721link:#config-input[ConfigInput] entity.
722
723.Request
724----
725 PUT /projects/myproject/config HTTP/1.0
726 Content-Type: application/json;charset=UTF-8
727
728 {
729 "description": "demo project",
730 "use_contributor_agreements": "FALSE",
731 "use_content_merge": "INHERIT",
732 "use_signed_off_by": "INHERIT",
Deniz Türkoglu52777272014-09-08 17:02:48 +0200733 "create_new_change_for_all_not_in_target": "INHERIT",
Edwin Kempina23eb102013-07-17 09:10:54 +0200734 "require_change_id": "TRUE",
735 "max_object_size_limit": "10m",
736 "submit_type": "REBASE_IF_NECESSARY",
737 "state": "ACTIVE"
738 }
739----
740
741As response the new configuration is returned as a link:#config-info[
742ConfigInfo] entity.
743
744.Response
745----
746 HTTP/1.1 200 OK
747 Content-Disposition: attachment
748 Content-Type: application/json;charset=UTF-8
749
750 )]}'
751 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200752 "use_contributor_agreements": {
753 "value": false,
754 "configured_value": "FALSE",
755 "inherited_value": false
756 },
757 "use_content_merge": {
758 "value": true,
759 "configured_value": "INHERIT",
760 "inherited_value": true
761 },
762 "use_signed_off_by": {
763 "value": false,
764 "configured_value": "INHERIT",
765 "inherited_value": false
766 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200767 "create_new_change_for_all_not_in_target": {
768 "value": true,
769 "configured_value": "INHERIT",
770 "inherited_value": false
771 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200772 "require_change_id": {
773 "value": true,
774 "configured_value": "TRUE",
775 "inherited_value": true
776 },
777 "max_object_size_limit": {
778 "value": "10m",
779 "configured_value": "10m",
780 "inherited_value": "20m"
781 },
782 "submit_type": "REBASE_IF_NECESSARY",
783 "state": "ACTIVE",
784 "commentlinks": {}
785 }
786----
787
Edwin Kempinef3542f2013-03-19 13:31:49 +0100788[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800789=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800790--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100791'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800792--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100793
794Run the Git garbage collection for the repository of a project.
795
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100796Options for the Git garbage collection can be specified in the
797request body as a link:#gc-input[GCInput] entity.
798
Edwin Kempinef3542f2013-03-19 13:31:49 +0100799.Request
800----
801 POST /projects/plugins%2Freplication/gc HTTP/1.0
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100802 Content-Type: application/json;charset=UTF-8
803
804 {
805 "show_progress": true
806 }
Edwin Kempinef3542f2013-03-19 13:31:49 +0100807----
808
809The response is the streamed output of the garbage collection.
810
811.Response
812----
813 HTTP/1.1 200 OK
814 Content-Disposition: attachment
815 Content-Type: text/plain;charset=UTF-8
816
817 collecting garbage for "plugins/replication":
818 Pack refs: 100% (21/21)
819 Counting objects: 20
820 Finding sources: 100% (20/20)
821 Getting sizes: 100% (13/13)
822 Compressing objects: 83% (5/6)
823 Writing objects: 100% (20/20)
824 Selecting commits: 100% (7/7)
825 Building bitmaps: 100% (7/7)
826 Finding sources: 100% (41/41)
827 Getting sizes: 100% (25/25)
828 Compressing objects: 52% (12/23)
829 Writing objects: 100% (41/41)
830 Prune loose objects also found in pack files: 100% (36/36)
831 Prune loose, unreferenced objects: 100% (36/36)
832 done.
833----
834
Edwin Kempin62946742014-07-09 11:17:58 +0200835[[ban-commit]]
836=== Ban Commit
837--
838'PUT /projects/link:#project-name[\{project-name\}]/ban'
839--
840
841Marks commits as banned for the project. If a commit is banned Gerrit
842rejects every push that includes this commit with
843link:error-contains-banned-commit.html[contains banned commit ...].
844
845[NOTE]
846This REST endpoint only marks the commits as banned, but it does not
847remove the commits from the history of any central branch. This needs
848to be done manually.
849
850The commits to be banned must be specified in the request body as a
851link:#ban-input[BanInput] entity.
852
853The caller must be project owner.
854
855.Request
856----
857 PUT /projects/plugins%2Freplication/ban HTTP/1.0
858 Content-Type: application/json;charset=UTF-8
859
860 {
861 "commits": [
862 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
863 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
864 ],
865 "reason": "Violates IP"
866 }
867----
868
869As response a link:#ban-result-info[BanResultInfo] entity is returned.
870
871.Response
872----
873 HTTP/1.1 200 OK
874 Content-Disposition: attachment
875 Content-Type: application/json;charset=UTF-8
876
877 )]}'
878 {
879 "newly_banned": [
880 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
881 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
882 ]
883 }
884----
885
Edwin Kempina686de92013-05-09 15:12:34 +0200886[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800887== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +0200888
889[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800890=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800891--
Edwin Kempina686de92013-05-09 15:12:34 +0200892'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800893--
Edwin Kempina686de92013-05-09 15:12:34 +0200894
895List the branches of a project.
896
897As result a list of link:#branch-info[BranchInfo] entries is
898returned.
899
900.Request
901----
902 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
903----
904
905.Response
906----
907 HTTP/1.1 200 OK
908 Content-Disposition: attachment
909 Content-Type: application/json;charset=UTF-8
910
911 )]}'
912 [
913 {
914 "ref": "HEAD",
915 "revision": "master"
916 },
917 {
918 "ref": "refs/meta/config",
919 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
920 },
921 {
922 "ref": "refs/heads/master",
923 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
924 },
925 {
926 "ref": "refs/heads/stable",
927 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
928 "can_delete": true
929 }
930 ]
931----
932
Edwin Kempin196e1732013-05-09 15:12:34 +0200933[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800934=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800935--
Edwin Kempin196e1732013-05-09 15:12:34 +0200936'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800937--
Edwin Kempin196e1732013-05-09 15:12:34 +0200938
939Retrieves a branch of a project.
940
941.Request
942----
943 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
944----
945
946As response a link:#branch-info[BranchInfo] entity is returned that
947describes the branch.
948
949.Response
950----
951 HTTP/1.1 200 OK
952 Content-Disposition: attachment
953 Content-Type: application/json;charset=UTF-8
954
955 )]}'
956 {
957 "ref": "refs/heads/master",
958 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
959 }
960----
961
Edwin Kempin5c0d6b32013-05-09 19:54:37 +0200962[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800963=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800964--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +0200965'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800966--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +0200967
968Creates a new branch.
969
970In the request body additional data for the branch can be provided as
971link:#branch-input[BranchInput].
972
973.Request
974----
975 PUT /projects/MyProject/branches/stable HTTP/1.0
976 Content-Type: application/json;charset=UTF-8
977
978 {
979 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
980 }
981----
982
983As response a link:#branch-info[BranchInfo] entity is returned that
984describes the created branch.
985
986.Response
987----
988 HTTP/1.1 201 Created
989 Content-Disposition: attachment
990 Content-Type: application/json;charset=UTF-8
991
992 )]}'
993 {
994 "ref": "refs/heads/stable",
995 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
996 "can_delete": true
997 }
998----
999
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001000[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001001=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001002--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001003'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001004--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001005
1006Deletes a branch.
1007
1008.Request
1009----
1010 DELETE /projects/MyProject/branches/stable HTTP/1.0
1011----
1012
1013.Response
1014----
1015 HTTP/1.1 204 No Content
1016----
1017
Edwin Kempind31e5582013-11-30 12:07:08 +01001018[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001019=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001020--
1021'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1022--
1023
1024Gets the content of a file from the HEAD revision of a certain branch.
1025
1026.Request
1027----
1028 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1029----
1030
1031The content is returned as base64 encoded string.
1032
1033.Response
1034----
1035 HTTP/1.1 200 OK
1036 Content-Disposition: attachment
1037 Content-Type: text/plain;charset=UTF-8
1038
1039 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1040----
1041
Edwin Kempin87504d92014-07-04 12:59:19 +02001042[[get-reflog]]
1043=== Get Reflog
1044--
1045'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
1046--
1047
1048Gets the reflog of a certain branch.
1049
1050The caller must be project owner.
1051
1052.Request
1053----
1054 GET /projects/gerrit/branches/master/reflog HTTP/1.0
1055----
1056
1057As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
1058is returned that describe the reflog entries. The reflog entries are
1059returned in reverse order.
1060
1061.Response
1062----
1063 HTTP/1.1 200 OK
1064 Content-Disposition: attachment
1065 Content-Type: application/json;charset=UTF-8
1066
1067 )]}'
1068 [
1069 {
1070 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1071 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
1072 "who": {
1073 "name": "Jane Roe",
1074 "email": "jane.roe@example.com",
1075 "date": "2014-06-30 11:53:43.000000000",
1076 "tz": 120
1077 },
1078 "comment": "merged: fast forward"
1079 },
1080 {
1081 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1082 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1083 "who": {
1084 "name": "John Doe",
1085 "email": "john.doe@example.com",
1086 "date": "2013-10-02 10:45:26.000000000",
1087 "tz": 120
1088 },
1089 "comment": "merged: fast forward"
1090 },
1091 {
1092 "old_id": "0000000000000000000000000000000000000000",
1093 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1094 "who": {
1095 "name": "John Doe",
1096 "email": "john.doe@example.com",
1097 "date": "2013-09-30 19:08:44.000000000",
1098 "tz": 120
1099 },
1100 "comment": ""
1101 }
1102 ]
1103----
1104
1105The get reflog endpoint also accepts a limit integer in the `n`
1106parameter. This limits the results to show the last `n` reflog entries.
1107
1108Query the last 25 reflog entries.
1109----
1110 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
1111----
1112
Edwin Kempin2a581fd2014-07-04 14:04:54 +02001113The reflog can also be filtered by timestamp by specifying the `from`
1114and `to` parameters. The timestamp for `from` and `to` must be given as
1115UTC in the following format: `yyyyMMdd_HHmm`.
1116
1117----
1118 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
1119----
1120
Edwin Kempin4425c742013-03-18 13:23:00 +01001121[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001122== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01001123
1124[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001125=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001126--
Edwin Kempin4425c742013-03-18 13:23:00 +01001127'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001128--
Edwin Kempin4425c742013-03-18 13:23:00 +01001129
1130List the direct child projects of a project.
1131
1132.Request
1133----
1134 GET /projects/Public-Plugins/children/ HTTP/1.0
1135----
1136
1137As result a list of link:#project-info[ProjectInfo] entries is
1138returned that describe the child projects.
1139
1140.Response
1141----
1142 HTTP/1.1 200 OK
1143 Content-Disposition: attachment
1144 Content-Type: application/json;charset=UTF-8
1145
1146 )]}'
1147 [
1148 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001149 "id": "plugins%2Freplication",
1150 "name": "plugins/replication",
1151 "parent": "Public-Plugins",
1152 "description": "Copies to other servers using the Git protocol"
1153 },
1154 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001155 "id": "plugins%2Freviewnotes",
1156 "name": "plugins/reviewnotes",
1157 "parent": "Public-Plugins",
1158 "description": "Annotates merged commits using notes on refs/notes/review."
1159 },
1160 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001161 "id": "plugins%2Fsingleusergroup",
1162 "name": "plugins/singleusergroup",
1163 "parent": "Public-Plugins",
1164 "description": "GroupBackend enabling users to be directly added to access rules"
1165 }
1166 ]
1167----
1168
Edwin Kempinf95bd172013-03-19 11:10:57 +01001169To resolve the child projects of a project recursively the parameter
1170`recursive` can be set.
1171
1172Child projects that are not visible to the calling user are ignored and
1173are not resolved further.
1174
1175.Request
1176----
1177 GET /projects/Public-Projects/children/?recursive HTTP/1.0
1178----
1179
1180.Response
1181----
1182 HTTP/1.1 200 OK
1183 Content-Disposition: attachment
1184 Content-Type: application/json;charset=UTF-8
1185
1186 )]}'
1187 [
1188 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001189 "id": "gerrit",
1190 "name": "gerrit",
1191 "parent": "Public-Projects",
1192 "description": "Gerrit Code Review"
1193 },
1194 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001195 "id": "plugins%2Freplication",
1196 "name": "plugins/replication",
1197 "parent": "Public-Plugins",
1198 "description": "Copies to other servers using the Git protocol"
1199 },
1200 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001201 "id": "plugins%2Freviewnotes",
1202 "name": "plugins/reviewnotes",
1203 "parent": "Public-Plugins",
1204 "description": "Annotates merged commits using notes on refs/notes/review."
1205 },
1206 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001207 "id": "plugins%2Fsingleusergroup",
1208 "name": "plugins/singleusergroup",
1209 "parent": "Public-Plugins",
1210 "description": "GroupBackend enabling users to be directly added to access rules"
1211 },
1212 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001213 "id": "Public-Plugins",
1214 "name": "Public-Plugins",
1215 "parent": "Public-Projects",
1216 "description": "Parent project for plugins/*"
1217 }
1218 ]
1219----
1220
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001221[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001222=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001223--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001224'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001225--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001226
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01001227Retrieves a child project. If a non-direct child project should be
1228retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001229
1230.Request
1231----
1232 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
1233----
1234
1235As response a link:#project-info[ProjectInfo] entity is returned that
1236describes the child project.
1237
1238.Response
1239----
1240 HTTP/1.1 200 OK
1241 Content-Disposition: attachment
1242 Content-Type: application/json;charset=UTF-8
1243
1244 )]}'
1245 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001246 "id": "plugins%2Freplication",
1247 "name": "plugins/replication",
1248 "parent": "Public-Plugins",
1249 "description": "Copies to other servers using the Git protocol"
1250 }
1251----
1252
Edwin Kempin1b993602014-07-08 16:18:45 +02001253[[commit-endpoints]]
1254== Commit Endpoints
1255
1256[[get-commit]]
1257=== Get Commit
1258--
1259'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
1260--
1261
1262Retrieves a commit of a project.
1263
1264The commit must be visible to the caller.
1265
1266.Request
1267----
1268 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
1269----
1270
1271As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
1272is returned that describes the commit.
1273
1274.Response
1275----
1276 HTTP/1.1 200 OK
1277 Content-Disposition: attachment
1278 Content-Type: application/json;charset=UTF-8
1279
1280 )]}'
1281 {
1282 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
1283 "parents": [
1284 {
1285 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
1286 "subject": "Migrate contributor agreements to All-Projects."
1287 }
1288 ],
1289 "author": {
1290 "name": "Shawn O. Pearce",
1291 "email": "sop@google.com",
1292 "date": "2012-04-24 18:08:08.000000000",
1293 "tz": -420
1294 },
1295 "committer": {
1296 "name": "Shawn O. Pearce",
1297 "email": "sop@google.com",
1298 "date": "2012-04-24 18:08:08.000000000",
1299 "tz": -420
1300 },
1301 "subject": "Use an EventBus to manage star icons",
1302 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
1303 }
1304----
1305
Edwin Kempin6f7410a2014-07-09 15:46:22 +02001306[[get-content]]
1307=== Get Content
1308--
1309'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1310--
1311
1312Gets the content of a file from a certain commit.
1313
1314.Request
1315----
1316 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1317----
1318
1319The content is returned as base64 encoded string.
1320
1321.Response
1322----
1323 HTTP/1.1 200 OK
1324 Content-Disposition: attachment
1325 Content-Type: text/plain;charset=UTF-8
1326
1327 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1328----
1329
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01001330[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001331== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01001332
Edwin Kempin76202742013-02-15 13:51:50 +01001333[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001334=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001335--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001336'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001337--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001338
Edwin Kempind0a63922013-01-23 16:32:59 +01001339List custom dashboards for a project.
1340
Edwin Kempin55367622013-02-05 09:09:23 +01001341As result a list of link:#dashboard-info[DashboardInfo] entries is
1342returned.
1343
Edwin Kempind0a63922013-01-23 16:32:59 +01001344List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01001345
1346.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01001347----
1348 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01001349----
Edwin Kempind0a63922013-01-23 16:32:59 +01001350
Edwin Kempin37440832013-02-06 11:36:00 +01001351.Response
1352----
Edwin Kempind0a63922013-01-23 16:32:59 +01001353 HTTP/1.1 200 OK
1354 Content-Disposition: attachment
1355 Content-Type: application/json;charset=UTF-8
1356
1357 )]}'
1358 [
1359 {
Edwin Kempind0a63922013-01-23 16:32:59 +01001360 "id": "main:closed",
1361 "ref": "main",
1362 "path": "closed",
1363 "description": "Merged and abandoned changes in last 7 weeks",
1364 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1365 "default": true,
1366 "title": "Closed changes",
1367 "sections": [
1368 {
1369 "name": "Merged",
1370 "query": "status:merged age:7w"
1371 },
1372 {
1373 "name": "Abandoned",
1374 "query": "status:abandoned age:7w"
1375 }
1376 ]
1377 }
1378 ]
1379----
1380
Edwin Kempina64c4b92013-01-23 11:30:40 +01001381.Get all dashboards of the 'All-Projects' project
1382****
1383get::/projects/All-Projects/dashboards/
1384****
1385
Edwin Kempin67e923c2013-02-14 13:57:12 +01001386[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001387=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001388--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001389'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001390--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001391
Edwin Kempin67e923c2013-02-14 13:57:12 +01001392Retrieves a project dashboard. The dashboard can be defined on that
1393project or be inherited from a parent project.
1394
1395.Request
1396----
1397 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
1398----
1399
1400As response a link:#dashboard-info[DashboardInfo] entity is returned
1401that describes the dashboard.
1402
1403.Response
1404----
1405 HTTP/1.1 200 OK
1406 Content-Disposition: attachment
1407 Content-Type: application/json;charset=UTF-8
1408
1409 )]}'
1410 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01001411 "id": "main:closed",
1412 "ref": "main",
1413 "path": "closed",
1414 "description": "Merged and abandoned changes in last 7 weeks",
1415 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1416 "default": true,
1417 "title": "Closed changes",
1418 "sections": [
1419 {
1420 "name": "Merged",
1421 "query": "status:merged age:7w"
1422 },
1423 {
1424 "name": "Abandoned",
1425 "query": "status:abandoned age:7w"
1426 }
1427 ]
1428 }
1429----
1430
1431To retrieve the default dashboard of a project use `default` as
1432dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01001433
1434.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01001435----
1436 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01001437----
Edwin Kempind0a63922013-01-23 16:32:59 +01001438
Edwin Kempin37440832013-02-06 11:36:00 +01001439.Response
1440----
Edwin Kempind0a63922013-01-23 16:32:59 +01001441 HTTP/1.1 200 OK
1442 Content-Disposition: attachment
1443 Content-Type: application/json;charset=UTF-8
1444
1445 )]}'
1446 {
Edwin Kempind0a63922013-01-23 16:32:59 +01001447 "id": "main:closed",
1448 "ref": "main",
1449 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01001450 "description": "Merged and abandoned changes in last 7 weeks",
1451 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
Edwin Kempind0a63922013-01-23 16:32:59 +01001452 "default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01001453 "title": "Closed changes",
1454 "sections": [
1455 {
1456 "name": "Merged",
1457 "query": "status:merged age:7w"
1458 },
1459 {
1460 "name": "Abandoned",
1461 "query": "status:abandoned age:7w"
1462 }
1463 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01001464 }
1465----
1466
Edwin Kempin67e923c2013-02-14 13:57:12 +01001467[[set-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001468=== Set Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001469--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001470'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001471--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001472
Edwin Kempin67e923c2013-02-14 13:57:12 +01001473Updates/Creates a project dashboard.
1474
1475Currently only supported for the `default` dashboard.
1476
1477The creation/update information for the dashboard must be provided in
1478the request body as a link:#dashboard-input[DashboardInput] entity.
1479
1480.Request
1481----
1482 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
1483 Content-Type: application/json;charset=UTF-8
1484
1485 {
1486 "id": "main:closed",
1487 "commit_message": "Define the default dashboard"
1488 }
1489----
1490
1491As response the new/updated dashboard is returned as a
1492link:#dashboard-info[DashboardInfo] entity.
1493
1494.Response
1495----
1496 HTTP/1.1 200 OK
1497 Content-Disposition: attachment
1498 Content-Type: application/json;charset=UTF-8
1499
1500 )]}'
1501 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01001502 "id": "main:closed",
1503 "ref": "main",
1504 "path": "closed",
1505 "description": "Merged and abandoned changes in last 7 weeks",
1506 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1507 "default": true,
1508 "title": "Closed changes",
1509 "sections": [
1510 {
1511 "name": "Merged",
1512 "query": "status:merged age:7w"
1513 },
1514 {
1515 "name": "Abandoned",
1516 "query": "status:abandoned age:7w"
1517 }
1518 ]
1519 }
1520----
1521
1522[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001523=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001524--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001525'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001526--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001527
Edwin Kempin67e923c2013-02-14 13:57:12 +01001528Deletes a project dashboard.
1529
1530Currently only supported for the `default` dashboard.
1531
Edwin Kempinefec4492013-02-22 10:09:23 +01001532The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05001533DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01001534
1535Please note that some proxies prohibit request bodies for DELETE
1536requests.
1537
1538.Request
1539----
1540 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
1541----
1542
1543.Response
1544----
1545 HTTP/1.1 204 No Content
1546----
1547
Edwin Kempin34d83352013-02-06 10:40:17 +01001548
1549[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001550== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01001551
Edwin Kempin196e1732013-05-09 15:12:34 +02001552[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001553=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02001554The name of a branch or `HEAD`. The prefix `refs/heads/` can be
1555omitted.
1556
Edwin Kempin1b993602014-07-08 16:18:45 +02001557[[commit-id]]
1558=== \{commit-id\}
1559Commit ID.
1560
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001561[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001562=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01001563The ID of a dashboard in the format '<ref>:<path>'.
1564
1565A special dashboard ID is `default` which represents the default
1566dashboard of a project.
1567
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001568[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001569=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01001570The name of the project.
1571
1572
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001573[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001574== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001575
Edwin Kempina686de92013-05-09 15:12:34 +02001576[[branch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001577=== BranchInfo
Edwin Kempina686de92013-05-09 15:12:34 +02001578The `BranchInfo` entity contains information about a branch.
1579
1580[options="header",width="50%",cols="1,^2,4"]
1581|=========================
1582|Field Name ||Description
1583|`ref` ||The ref of the branch.
1584|`revision` ||The revision to which the branch points.
1585|`can_delete`|`false` if not set|
1586Whether the calling user can delete this branch.
1587|=========================
1588
Edwin Kempin62946742014-07-09 11:17:58 +02001589[[ban-input]]
1590=== BanInput
1591The `BanInput` entity contains information for banning commits in a
1592project.
1593
1594[options="header",width="50%",cols="1,^2,4"]
1595|=======================
1596|Field Name||Description
1597|`commits` ||List of commits to be banned.
1598|`reason` |optional|Reason for banning the commits.
1599|=======================
1600
1601[[ban-result-info]]
1602=== BanResultInfo
1603The `BanResultInfo` entity describes the result of banning commits.
1604
1605[options="header",width="50%",cols="1,^2,4"]
1606|=============================
1607|Field Name ||Description
1608|`newly_banned` |optional|List of newly banned commits.
1609|`already_banned`|optional|List of commits that were already banned.
1610|`ignored` |optional|List of object IDs that were ignored.
1611|=============================
1612
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001613[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001614=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001615The `BranchInput` entity contains information for the creation of
1616a new branch.
1617
1618[options="header",width="50%",cols="1,^2,4"]
1619|=======================
1620|Field Name||Description
1621|`ref` |optional|
1622The name of the branch. The prefix `refs/heads/` can be
1623omitted. +
1624If set, must match the branch ID in the URL.
1625|`revision`|optional|
1626The base revision of the new branch. +
1627If not set, `HEAD` will be used as base revision.
1628|=======================
1629
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001630[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001631=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001632The `ConfigInfo` entity contains information about the effective project
1633configuration.
1634
Edwin Kempin81e1d1f2013-07-15 10:13:46 +02001635[options="header",width="50%",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02001636|=======================================================
1637|Field Name ||Description
1638|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001639The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001640|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001641link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1642authors must complete a contributor agreement on the site before
1643pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001644|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001645link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1646Gerrit will try to perform a 3-way merge of text file content when a
1647file has been modified by both the destination branch and the change
1648being submitted. This option only takes effect if submit type is not
1649FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001650|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001651link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1652each change must contain a Signed-off-by line from either the author or
1653the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001654|`create_new_change_for_all_not_in_target` |optional|
1655link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1656a new change is created for every commit not in target branch.
1657|`require_change_id` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001658link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
1659valid link:user-changeid.html[Change-Id] footer in any commit uploaded
1660for review is required. This does not apply to commits pushed directly
1661to a branch or tag.
Edwin Kempin3c99f592013-07-15 10:12:27 +02001662|`max_object_size_limit` ||
1663The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
1664limit] of this project as a link:#max-object-size-limit-info[
1665MaxObjectSizeLimitInfo] entity.
1666|`submit_type` ||
1667The default submit type of the project, can be `MERGE_IF_NECESSARY`,
1668`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
1669`CHERRY_PICK`.
1670|`state` |optional|
1671The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
1672Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02001673|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02001674Map with the comment link configurations of the project. The name of
1675the comment link configuration is mapped to the comment link
1676configuration, which has the same format as the
1677link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[
1678commentlink section] of `gerrit.config`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001679|`theme` |optional|
Edwin Kempin272402e2013-07-15 11:17:36 +02001680The theme that is configured for the project as a link:#theme-info[
1681ThemeInfo] entity.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001682|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01001683Plugin configuration as map which maps the plugin name to a map of
1684parameter names to link:#config-parameter-info[ConfigParameterInfo]
1685entities.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001686|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02001687Actions the caller might be able to perform on this project. The
1688information is a map of view names to
1689link:rest-api-changes.html#action-info[ActionInfo] entities.
Edwin Kempin3660c132013-07-16 08:03:11 +02001690|=========================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001691
Edwin Kempina23eb102013-07-17 09:10:54 +02001692[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001693=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02001694The `ConfigInput` entity describes a new project configuration.
1695
1696[options="header",width="50%",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02001697|======================================================
1698|Field Name ||Description
1699|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001700The new description of the project. +
1701If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001702|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001703Whether authors must complete a contributor agreement on the site
1704before pushing any commits or changes to this project. +
1705Can be `TRUE`, `FALSE` or `INHERIT`. +
1706If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001707|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001708Whether Gerrit will try to perform a 3-way merge of text file content
1709when a file has been modified by both the destination branch and the
1710change being submitted. This option only takes effect if submit type is
1711not FAST_FORWARD_ONLY. +
1712Can be `TRUE`, `FALSE` or `INHERIT`. +
1713If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001714|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001715Whether each change must contain a Signed-off-by line from either the
1716author or the uploader in the commit message. +
1717Can be `TRUE`, `FALSE` or `INHERIT`. +
1718If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001719|`create_new_change_for_all_not_in_target` |optional|
1720Whether a new change will be created for every commit not in target
1721branch. +
1722Can be `TRUE`, `FALSE` or `INHERIT`. +
1723If not set, this setting is not updated.
1724|`require_change_id` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001725Whether a valid link:user-changeid.html[Change-Id] footer in any commit
1726uploaded for review is required. This does not apply to commits pushed
1727directly to a branch or tag. +
1728Can be `TRUE`, `FALSE` or `INHERIT`. +
1729If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001730|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001731The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
1732limit] of this project as a link:#max-object-size-limit-info[
1733MaxObjectSizeLimitInfo] entity. +
1734If set to `0`, the max object size limit is removed. +
1735If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001736|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001737The default submit type of the project, can be `MERGE_IF_NECESSARY`,
1738`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
1739`CHERRY_PICK`. +
1740If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001741|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001742The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
1743Not set if the project state is `ACTIVE`. +
1744If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001745|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01001746Plugin configuration values as map which maps the plugin name to a map
1747of parameter names to values.
Edwin Kempina23eb102013-07-17 09:10:54 +02001748|=========================================
1749
Edwin Kempin9ce4f552013-11-15 16:00:00 +01001750[[config-parameter-info]]
1751ConfigParameterInfo
1752~~~~~~~~~~~~~~~~~~~
1753The `ConfigParameterInfo` entity describes a project configuration
1754parameter.
1755
1756[options="header",width="50%",cols="1,^2,4"]
1757|===============================
1758|Field Name ||Description
1759|`display_name` |optional|
1760The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01001761|`description` |optional|
1762The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01001763|`warning` |optional|
1764Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01001765|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01001766The type of the configuration parameter. Can be `STRING`, `INT`,
1767`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01001768|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01001769The value of the configuration parameter as string. If the parameter
1770is inheritable this is the effective value which is deduced from
1771`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01001772|`values` |optional|
1773The list of values. Only set if the `type` is `ARRAY`.
Edwin Kempin0d485232013-11-17 18:55:48 +01001774`editable` |`false` if not set|
1775Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01001776|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01001777The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01001778|`inheritable` |`false` if not set|
1779Whether the configuration parameter can be inherited.
1780|`configured_value`|optional|
1781The value of the configuration parameter that is configured on this
1782project, only set if `inheritable` is true.
1783|`inherited_value` |optional|
1784The inherited value of the configuration parameter, only set if
1785`inheritable` is true.
1786|`permitted_values` |optional|
1787The list of permitted values, only set if the `type` is `LIST`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01001788|===============================
1789
Edwin Kempin55367622013-02-05 09:09:23 +01001790[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001791=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01001792The `DashboardInfo` entity contains information about a project
1793dashboard.
1794
1795[options="header",width="50%",cols="1,^2,4"]
1796|===============================
1797|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01001798|`id` ||
1799The ID of the dashboard. The ID has the format '<ref>:<path>',
1800where ref and path are URL encoded.
1801|`project` ||
1802The name of the project for which this dashboard is returned.
1803|`defining_project`||
1804The name of the project in which this dashboard is defined.
1805This is different from `project` if the dashboard is inherited from a
1806parent project.
1807|`ref` ||
1808The name of the ref in which the dashboard is defined, without the
1809`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
1810|`path` ||
1811The path of the file in which the dashboard is defined.
1812|`description` |optional|The description of the dashboard.
1813|`foreach` |optional|
1814Subquery that applies to all sections in the dashboard. +
1815Tokens such as `${project}` are not resolved.
1816|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09001817The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01001818The URL is relative to the canonical web URL. +
1819Tokens in the queries such as `${project}` are resolved.
1820|`default` |not set if `false`|
1821Whether this is the default dashboard of the project.
1822|`title` |optional|The title of the dashboard.
1823|`sections` ||
1824The list of link:#dashboard-section-info[sections] in the dashboard.
1825|===============================
1826
Edwin Kempin67e923c2013-02-14 13:57:12 +01001827[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001828=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01001829The `DashboardInput` entity contains information to create/update a
1830project dashboard.
1831
1832[options="header",width="50%",cols="1,^2,4"]
1833|=============================
1834|Field Name ||Description
1835|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01001836URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01001837|`commit_message`|optional|
1838Message that should be used to commit the change of the dashboard.
1839|=============================
1840
Edwin Kempin55367622013-02-05 09:09:23 +01001841[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001842=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01001843The `DashboardSectionInfo` entity contains information about a section
1844in a dashboard.
1845
1846[options="header",width="50%",cols="1,6"]
1847|===========================
1848|Field Name |Description
1849|`name` |The title of the section.
1850|`query` |The query of the section. +
1851Tokens such as `${project}` are not resolved.
1852|===========================
1853
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01001854[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001855=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01001856The `GCInput` entity contains information to run the Git garbage
1857collection.
1858
1859[options="header",width="50%",cols="1,^2,4"]
1860|=============================
1861|Field Name ||Description
1862|`show_progress` |`false` if not set|
1863Whether progress information should be shown.
1864|=============================
1865
Edwin Kempin6b813372013-03-13 17:07:33 +01001866[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001867=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01001868The `HeadInput` entity contains information for setting `HEAD` for a
1869project.
1870
1871[options="header",width="50%",cols="1,6"]
1872|============================
1873|Field Name |Description
1874|`ref` |
1875The ref to which `HEAD` should be set, the `refs/heads` prefix can be
1876omitted.
1877|============================
1878
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001879[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001880=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001881A boolean value that can also be inherited.
1882
1883[options="header",width="50%",cols="1,^2,4"]
1884|================================
1885|Field Name ||Description
1886|`value` ||
1887The effective boolean value.
1888|`configured_value` ||
1889The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
1890|`inherited_value` |optional|
1891The boolean value inherited from the parent. +
1892Not set if there is no parent.
1893|================================
1894
Edwin Kempin3c99f592013-07-15 10:12:27 +02001895[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001896=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02001897The `MaxObjectSizeLimitInfo` entity contains information about the
1898link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
1899limit] of a project.
1900
1901[options="header",width="50%",cols="1,^2,4"]
1902|===============================
1903|Field Name ||Description
1904|`value` |optional|
1905The effective value of the max object size limit as a formatted string. +
1906Not set if there is no limit for the object size.
1907|`configured_value`|optional|
1908The max object size limit that is configured on the project as a
1909formatted string. +
1910Not set if there is no limit for the object size configured on project
1911level.
1912|`inherited_value` |optional|
1913The max object size limit that is inherited as a formatted string. +
1914Not set if there is no global limit for the object size.
1915|===============================
1916
Edwin Kempin57f303c2013-02-13 15:52:22 +01001917[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001918=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01001919The `ProjectDescriptionInput` entity contains information for setting a
1920project description.
1921
1922[options="header",width="50%",cols="1,^2,4"]
1923|=============================
1924|Field Name ||Description
1925|`description` |optional|The project description. +
1926The project description will be deleted if not set.
1927|`commit_message`|optional|
1928Message that should be used to commit the change of the project
1929description in the `project.config` file to the `refs/meta/config`
1930branch.
1931|=============================
1932
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001933[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001934=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001935The `ProjectInfo` entity contains information about a project.
1936
1937[options="header",width="50%",cols="1,^2,4"]
1938|===========================
1939|Field Name ||Description
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001940|`id` ||The URL encoded project name.
1941|`name` |
1942not set if returned in a map where the project name is used as map key|
1943The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01001944|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001945The name of the parent project. +
1946`?-<n>` if the parent project is not visible (`<n>` is a number which
1947is increased for each non-visible project).
1948|`description` |optional|The description of the project.
Shawn Pearce21a6c212014-04-23 12:35:10 -07001949|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001950|`branches` |optional|Map of branch names to HEAD revisions.
Edwin Kempinea004752014-04-11 15:56:02 +02001951|'web_links' |optional|
1952Links to the project in external sites as a list of
1953link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001954|===========================
1955
Bruce Zu798ea122013-02-18 16:55:43 +08001956[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001957=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08001958The `ProjectInput` entity contains information for the creation of
1959a new project.
1960
1961[options="header",width="50%",cols="1,^2,4"]
1962|=========================================
1963|Field Name ||Description
1964|`name` |optional|
1965The name of the project (not encoded). +
1966If set, must match the project name in the URL.
1967|`parent` |optional|
1968The name of the parent project. +
1969If not set, the `All-Projects` project will be the parent project.
1970|`description` |optional|The description of the project.
1971|`permissions_only` |`false` if not set|
1972Whether a permission-only project should be created.
1973|`create_empty_commit` |`false` if not set|
1974Whether an empty initial commit should be created.
1975|`submit_type` |optional|
1976The submit type that should be set for the project
1977(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
1978`MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01001979If not set, `MERGE_IF_NECESSARY` is set as submit type unless
1980link:config-gerrit.html#repository.name.defaultSubmitType[
1981repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08001982|`branches` |optional|
1983A list of branches that should be initially created. +
1984For the branch names the `refs/heads/` prefix can be omitted.
1985|`owners` |optional|
1986A list of groups that should be assigned as project owner. +
1987Each group in the list must be specified as
1988link:rest-api-groups.html#group-id[group-id]. +
1989If not set, the link:config-gerrit.html#repository.name.ownerGroup[
1990groups that are configured as default owners] are set as project
1991owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001992|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08001993Whether contributor agreements should be used for the project (`TRUE`,
1994`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02001995|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08001996Whether the usage of 'Signed-Off-By' footers is required for the
1997project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02001998|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
1999Whether a new change is created for every commit not in target branch
2000for the project (`TRUE`, `FALSE`, `INHERIT`).
2001|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002002Whether content merge should be enabled for the project (`TRUE`,
2003`FALSE`, `INHERIT`). +
2004`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002005|`require_change_id` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002006Whether the usage of Change-Ids is required for the project (`TRUE`,
2007`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02002008|`max_object_size_limit` |optional|
2009Max allowed Git object size for this project.
2010Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01002011|`plugin_config_values` |optional|
2012Plugin configuration values as map which maps the plugin name to a map
2013of parameter names to values.
Bruce Zu798ea122013-02-18 16:55:43 +08002014|=========================================
2015
Edwin Kempinecad88c2013-02-14 12:09:44 +01002016[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002017=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01002018The `ProjectParentInput` entity contains information for setting a
2019project parent.
2020
2021[options="header",width="50%",cols="1,^2,4"]
2022|=============================
2023|Field Name ||Description
2024|`parent` ||The name of the parent project.
2025|`commit_message`|optional|
2026Message that should be used to commit the change of the project parent
2027in the `project.config` file to the `refs/meta/config` branch.
2028|=============================
2029
Edwin Kempin87504d92014-07-04 12:59:19 +02002030[[reflog-entry-info]]
2031=== ReflogEntryInfo
2032The `ReflogEntryInfo` entity describes an entry in a reflog.
2033
2034[options="header",width="50%",cols="1,6"]
2035|============================
2036|Field Name |Description
2037|`old_id` |The old commit ID.
2038|`new_id` |The new commit ID.
2039|`who` |
2040The user performing the change as a
2041link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
2042|`comment` |Comment of the reflog entry.
2043|============================
2044
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002045[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002046=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002047The `RepositoryStatisticsInfo` entity contains information about
2048statistics of a Git repository.
2049
2050[options="header",width="50%",cols="1,6"]
2051|======================================
2052|Field Name |Description
2053|`number_of_loose_objects` |Number of loose objects.
2054|`number_of_loose_refs` |Number of loose refs.
2055|`number_of_pack_files` |Number of pack files.
2056|`number_of_packed_objects`|Number of packed objects.
2057|`number_of_packed_refs` |Number of packed refs.
2058|`size_of_loose_objects` |Size of loose objects in bytes.
2059|`size_of_packed_objects` |Size of packed objects in bytes.
2060|======================================
2061
Edwin Kempin272402e2013-07-15 11:17:36 +02002062[[theme-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002063=== ThemeInfo
Edwin Kempin272402e2013-07-15 11:17:36 +02002064The `ThemeInfo` entity describes a theme.
2065
2066[options="header",width="50%",cols="1,^2,4"]
2067|=============================
2068|Field Name ||Description
2069|`css` |optional|
2070The path to the `GerritSite.css` file.
2071|`header` |optional|
2072The path to the `GerritSiteHeader.html` file.
2073|`footer` |optional|
2074The path to the `GerritSiteFooter.html` file.
2075|=============================
2076
Edwin Kempind0a63922013-01-23 16:32:59 +01002077
2078GERRIT
2079------
2080Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07002081
2082SEARCHBOX
2083---------