blob: cbba2f27e3f222171903c8d06defa14e34decc47 [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
David Pursehouse56bf1cb2015-01-06 15:44:00 +090033 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010034
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 Kempin068511b2015-01-20 09:17:12 +010042 "id": "external%2Fgcc"
Edwin Kempind0a63922013-01-23 16:32:59 +010043 },
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +090073 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -040074
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900106 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400107
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900136 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400137
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900163 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100164
165 )]}'
166 {
167 "platform/drivers": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100168 "id": "platform%2Fdrivers"
Edwin Kempind0a63922013-01-23 16:32:59 +0100169 },
170 "platform/tools": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100171 "id": "platform%2Ftools"
Edwin Kempind0a63922013-01-23 16:32:59 +0100172 }
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900196 Content-Type: application/json; charset=UTF-8
Hugo Arèsb8aae412014-07-08 11:04:43 -0400197
198 )]}'
199 {
200 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100201 "id": "test%2Fsome-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400202 },
203 "test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100204 "id": "test%2Fsome-other-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400205 }
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900224 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400225
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900248 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400249
250 )]}'
251 {
252 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100253 "id": "test%2Fsome-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400254 },
255 "some-path/test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100256 "id": "some-path%2Ftest%2Fsome-other-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400257 }
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900276 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400277
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900308 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400309
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900341 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c544e22013-03-06 13:35:45 +0100342
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900367 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800368
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900385 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800386
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900413 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100414
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900435 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100436
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900449 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100450
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900501 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100502
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900521 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100522
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900535 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100536
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900558 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100559
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900578 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100579
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900591 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100592
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900617 Content-Type: application/json; charset=UTF-8
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100618
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900654 Content-Type: application/json; charset=UTF-8
Dave Borowitz237073a2013-04-04 16:52:27 -0700655
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
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900726 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200727
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",
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400734 "enable_signed_push": "INHERIT",
Dave Borowitz0543c732015-10-20 10:35:26 -0400735 "require_signed_push": "INHERIT",
Edwin Kempina23eb102013-07-17 09:10:54 +0200736 "require_change_id": "TRUE",
737 "max_object_size_limit": "10m",
738 "submit_type": "REBASE_IF_NECESSARY",
739 "state": "ACTIVE"
740 }
741----
742
743As response the new configuration is returned as a link:#config-info[
744ConfigInfo] entity.
745
746.Response
747----
748 HTTP/1.1 200 OK
749 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900750 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200751
752 )]}'
753 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200754 "use_contributor_agreements": {
755 "value": false,
756 "configured_value": "FALSE",
757 "inherited_value": false
758 },
759 "use_content_merge": {
760 "value": true,
761 "configured_value": "INHERIT",
762 "inherited_value": true
763 },
764 "use_signed_off_by": {
765 "value": false,
766 "configured_value": "INHERIT",
767 "inherited_value": false
768 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200769 "create_new_change_for_all_not_in_target": {
770 "value": true,
771 "configured_value": "INHERIT",
772 "inherited_value": false
773 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200774 "require_change_id": {
775 "value": true,
776 "configured_value": "TRUE",
777 "inherited_value": true
778 },
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400779 "enable_signed_push": {
780 "value": true,
781 "configured_value": "INHERIT",
782 "inherited_value": false
783 },
Dave Borowitz0543c732015-10-20 10:35:26 -0400784 "require_signed_push": {
785 "value": false,
786 "configured_value": "INHERIT",
787 "inherited_value": false
788 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200789 "max_object_size_limit": {
790 "value": "10m",
791 "configured_value": "10m",
792 "inherited_value": "20m"
793 },
794 "submit_type": "REBASE_IF_NECESSARY",
795 "state": "ACTIVE",
796 "commentlinks": {}
797 }
798----
799
Edwin Kempinef3542f2013-03-19 13:31:49 +0100800[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800801=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800802--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100803'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800804--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100805
806Run the Git garbage collection for the repository of a project.
807
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100808Options for the Git garbage collection can be specified in the
809request body as a link:#gc-input[GCInput] entity.
810
Edwin Kempinef3542f2013-03-19 13:31:49 +0100811.Request
812----
813 POST /projects/plugins%2Freplication/gc HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900814 Content-Type: application/json; charset=UTF-8
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100815
816 {
817 "show_progress": true
818 }
Edwin Kempinef3542f2013-03-19 13:31:49 +0100819----
820
821The response is the streamed output of the garbage collection.
822
823.Response
824----
825 HTTP/1.1 200 OK
826 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900827 Content-Type: text/plain; charset=UTF-8
Edwin Kempinef3542f2013-03-19 13:31:49 +0100828
829 collecting garbage for "plugins/replication":
830 Pack refs: 100% (21/21)
831 Counting objects: 20
832 Finding sources: 100% (20/20)
833 Getting sizes: 100% (13/13)
834 Compressing objects: 83% (5/6)
835 Writing objects: 100% (20/20)
836 Selecting commits: 100% (7/7)
837 Building bitmaps: 100% (7/7)
838 Finding sources: 100% (41/41)
839 Getting sizes: 100% (25/25)
840 Compressing objects: 52% (12/23)
841 Writing objects: 100% (41/41)
842 Prune loose objects also found in pack files: 100% (36/36)
843 Prune loose, unreferenced objects: 100% (36/36)
844 done.
845----
846
Adrian Görler92410a12015-11-03 16:20:56 +0100847==== Asynchronous Execution
848
849The option `async` allows to schedule a background task that asynchronously
850executes a Git garbage collection.
851
852The `Location` header of the response refers to the link:rest-api-config.html#get-task[background task]
853which allows to inspect the progress of its execution. In case of asynchronous
854execution the `show_progress` option is ignored.
855
856.Request
857----
858 POST /projects/plugins%2Freplication/gc HTTP/1.0
859 Content-Type: application/json;charset=UTF-8
860
861 {
862 "async": true
863 }
864----
865
866The response is empty.
867
868.Response
869----
870 HTTP/1.1 202 Accepted
871 Content-Disposition: attachment
872 Location: https:<host>/a/config/server/tasks/383a0602
873----
874
Edwin Kempin62946742014-07-09 11:17:58 +0200875[[ban-commit]]
876=== Ban Commit
877--
878'PUT /projects/link:#project-name[\{project-name\}]/ban'
879--
880
881Marks commits as banned for the project. If a commit is banned Gerrit
882rejects every push that includes this commit with
883link:error-contains-banned-commit.html[contains banned commit ...].
884
885[NOTE]
886This REST endpoint only marks the commits as banned, but it does not
887remove the commits from the history of any central branch. This needs
888to be done manually.
889
890The commits to be banned must be specified in the request body as a
891link:#ban-input[BanInput] entity.
892
893The caller must be project owner.
894
895.Request
896----
897 PUT /projects/plugins%2Freplication/ban HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900898 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +0200899
900 {
901 "commits": [
902 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
903 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
904 ],
905 "reason": "Violates IP"
906 }
907----
908
909As response a link:#ban-result-info[BanResultInfo] entity is returned.
910
911.Response
912----
913 HTTP/1.1 200 OK
914 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900915 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +0200916
917 )]}'
918 {
919 "newly_banned": [
920 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
921 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
922 ]
923 }
924----
925
Edwin Kempina686de92013-05-09 15:12:34 +0200926[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800927== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +0200928
929[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800930=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800931--
Edwin Kempina686de92013-05-09 15:12:34 +0200932'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800933--
Edwin Kempina686de92013-05-09 15:12:34 +0200934
935List the branches of a project.
936
937As result a list of link:#branch-info[BranchInfo] entries is
938returned.
939
940.Request
941----
942 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
943----
944
945.Response
946----
947 HTTP/1.1 200 OK
948 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900949 Content-Type: application/json; charset=UTF-8
Edwin Kempina686de92013-05-09 15:12:34 +0200950
951 )]}'
952 [
953 {
954 "ref": "HEAD",
955 "revision": "master"
956 },
957 {
958 "ref": "refs/meta/config",
959 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
960 },
961 {
962 "ref": "refs/heads/master",
963 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
964 },
965 {
966 "ref": "refs/heads/stable",
967 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
968 "can_delete": true
969 }
970 ]
971----
972
Hugo Arès3133b4b2014-10-14 14:05:10 -0400973[[branch-options]]
974==== Branch Options
975
Hugo Arès15856622014-10-14 14:19:01 -0400976Limit(n)::
977Limit the number of branches to be included in the results.
978+
979.Request
980----
981 GET /projects/testproject/branches?n=1 HTTP/1.0
982----
983+
984.Response
985----
986 HTTP/1.1 200 OK
987 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900988 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -0400989
990 )]}'
991 [
992 {
993 "ref": "HEAD",
994 "revision": "master",
995 "can_delete": false
996 }
997 ]
998----
999
1000Skip(s)::
1001Skip the given number of branches from the beginning of the list.
1002+
1003.Request
1004----
1005 GET /projects/testproject/branches?n=1&s=0 HTTP/1.0
1006----
1007+
1008.Response
1009----
1010 HTTP/1.1 200 OK
1011 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001012 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001013
1014 )]}'
1015 [
1016 {
1017 "ref": "HEAD",
1018 "revision": "master",
1019 "can_delete": false
1020 }
1021 ]
1022----
1023
Hugo Arès3133b4b2014-10-14 14:05:10 -04001024Substring(m)::
1025Limit the results to those projects that match the specified substring.
1026+
1027List all projects that match substring `test`:
1028+
1029.Request
1030----
1031 GET /projects/testproject/branches?m=test HTTP/1.0
1032----
1033+
1034.Response
1035----
1036 HTTP/1.1 200 OK
1037 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001038 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001039
1040 )]}'
1041 [
1042 {
1043 "ref": "refs/heads/test1",
1044 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1045 "can_delete": true
1046 }
1047 ]
1048----
1049
1050Regex(r)::
1051Limit the results to those branches that match the specified regex.
1052Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
1053match any branches that start with 'test' and regex '*t' will match any
1054branches that end with 'test'.
1055+
1056List all branches that match regex `t.*1`:
1057+
1058.Request
1059----
1060 GET /projects/testproject/branches?r=t.*1 HTTP/1.0
1061----
1062+
1063.Response
1064----
1065 HTTP/1.1 200 OK
1066 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001067 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001068
1069 )]}'
1070 [
1071 {
1072 "ref": "refs/heads/test1",
1073 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1074 "can_delete": true
1075 }
1076 ]
1077----
1078
Edwin Kempin196e1732013-05-09 15:12:34 +02001079[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001080=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001081--
Edwin Kempin196e1732013-05-09 15:12:34 +02001082'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001083--
Edwin Kempin196e1732013-05-09 15:12:34 +02001084
1085Retrieves a branch of a project.
1086
1087.Request
1088----
1089 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
1090----
1091
1092As response a link:#branch-info[BranchInfo] entity is returned that
1093describes the branch.
1094
1095.Response
1096----
1097 HTTP/1.1 200 OK
1098 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001099 Content-Type: application/json; charset=UTF-8
Edwin Kempin196e1732013-05-09 15:12:34 +02001100
1101 )]}'
1102 {
1103 "ref": "refs/heads/master",
1104 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1105 }
1106----
1107
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001108[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001109=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001110--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001111'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001112--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001113
1114Creates a new branch.
1115
1116In the request body additional data for the branch can be provided as
1117link:#branch-input[BranchInput].
1118
1119.Request
1120----
1121 PUT /projects/MyProject/branches/stable HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001122 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001123
1124 {
1125 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1126 }
1127----
1128
1129As response a link:#branch-info[BranchInfo] entity is returned that
1130describes the created branch.
1131
1132.Response
1133----
1134 HTTP/1.1 201 Created
1135 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001136 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001137
1138 )]}'
1139 {
1140 "ref": "refs/heads/stable",
1141 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
1142 "can_delete": true
1143 }
1144----
1145
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001146[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001147=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001148--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001149'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001150--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001151
1152Deletes a branch.
1153
1154.Request
1155----
1156 DELETE /projects/MyProject/branches/stable HTTP/1.0
1157----
1158
1159.Response
1160----
1161 HTTP/1.1 204 No Content
1162----
1163
Hugo Arèsef8e3202015-01-12 15:09:06 -05001164[[delete-branches]]
1165=== Delete Branches
1166--
1167'POST /projects/link:#project-name[\{project-name\}]/branches:delete'
1168--
1169
1170Delete one or more branches.
1171
1172The branches to be deleted must be provided in the request body as a
1173link:#delete-branches-input[DeleteBranchesInput] entity.
1174
1175.Request
1176----
1177 POST /projects/MyProject/branches:delete HTTP/1.0
1178 Content-Type: application/json;charset=UTF-8
1179
1180 {
1181 "branches": [
1182 "stable-1.0",
1183 "stable-2.0"
1184 ]
1185 }
1186----
1187
1188.Response
1189----
1190 HTTP/1.1 204 No Content
1191----
1192
1193If some branches could not be deleted, the response is "`409 Conflict`" and the
1194error message is contained in the response body.
1195
Edwin Kempind31e5582013-11-30 12:07:08 +01001196[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001197=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001198--
1199'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1200--
1201
1202Gets the content of a file from the HEAD revision of a certain branch.
1203
1204.Request
1205----
1206 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1207----
1208
1209The content is returned as base64 encoded string.
1210
1211.Response
1212----
1213 HTTP/1.1 200 OK
1214 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001215 Content-Type: text/plain; charset=UTF-8
Edwin Kempind31e5582013-11-30 12:07:08 +01001216
1217 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1218----
1219
Edwin Kempin87504d92014-07-04 12:59:19 +02001220[[get-reflog]]
1221=== Get Reflog
1222--
1223'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
1224--
1225
1226Gets the reflog of a certain branch.
1227
1228The caller must be project owner.
1229
1230.Request
1231----
1232 GET /projects/gerrit/branches/master/reflog HTTP/1.0
1233----
1234
1235As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
1236is returned that describe the reflog entries. The reflog entries are
1237returned in reverse order.
1238
1239.Response
1240----
1241 HTTP/1.1 200 OK
1242 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001243 Content-Type: application/json; charset=UTF-8
Edwin Kempin87504d92014-07-04 12:59:19 +02001244
1245 )]}'
1246 [
1247 {
1248 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1249 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
1250 "who": {
1251 "name": "Jane Roe",
1252 "email": "jane.roe@example.com",
1253 "date": "2014-06-30 11:53:43.000000000",
1254 "tz": 120
1255 },
1256 "comment": "merged: fast forward"
1257 },
1258 {
1259 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1260 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1261 "who": {
1262 "name": "John Doe",
1263 "email": "john.doe@example.com",
1264 "date": "2013-10-02 10:45:26.000000000",
1265 "tz": 120
1266 },
1267 "comment": "merged: fast forward"
1268 },
1269 {
1270 "old_id": "0000000000000000000000000000000000000000",
1271 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1272 "who": {
1273 "name": "John Doe",
1274 "email": "john.doe@example.com",
1275 "date": "2013-09-30 19:08:44.000000000",
1276 "tz": 120
1277 },
1278 "comment": ""
1279 }
1280 ]
1281----
1282
1283The get reflog endpoint also accepts a limit integer in the `n`
1284parameter. This limits the results to show the last `n` reflog entries.
1285
1286Query the last 25 reflog entries.
1287----
1288 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
1289----
1290
Edwin Kempin2a581fd2014-07-04 14:04:54 +02001291The reflog can also be filtered by timestamp by specifying the `from`
1292and `to` parameters. The timestamp for `from` and `to` must be given as
1293UTC in the following format: `yyyyMMdd_HHmm`.
1294
1295----
1296 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
1297----
1298
Edwin Kempin4425c742013-03-18 13:23:00 +01001299[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001300== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01001301
1302[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001303=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001304--
Edwin Kempin4425c742013-03-18 13:23:00 +01001305'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001306--
Edwin Kempin4425c742013-03-18 13:23:00 +01001307
1308List the direct child projects of a project.
1309
1310.Request
1311----
1312 GET /projects/Public-Plugins/children/ HTTP/1.0
1313----
1314
1315As result a list of link:#project-info[ProjectInfo] entries is
1316returned that describe the child projects.
1317
1318.Response
1319----
1320 HTTP/1.1 200 OK
1321 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001322 Content-Type: application/json; charset=UTF-8
Edwin Kempin4425c742013-03-18 13:23:00 +01001323
1324 )]}'
1325 [
1326 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001327 "id": "plugins%2Freplication",
1328 "name": "plugins/replication",
1329 "parent": "Public-Plugins",
1330 "description": "Copies to other servers using the Git protocol"
1331 },
1332 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001333 "id": "plugins%2Freviewnotes",
1334 "name": "plugins/reviewnotes",
1335 "parent": "Public-Plugins",
1336 "description": "Annotates merged commits using notes on refs/notes/review."
1337 },
1338 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001339 "id": "plugins%2Fsingleusergroup",
1340 "name": "plugins/singleusergroup",
1341 "parent": "Public-Plugins",
1342 "description": "GroupBackend enabling users to be directly added to access rules"
1343 }
1344 ]
1345----
1346
Edwin Kempinf95bd172013-03-19 11:10:57 +01001347To resolve the child projects of a project recursively the parameter
1348`recursive` can be set.
1349
1350Child projects that are not visible to the calling user are ignored and
1351are not resolved further.
1352
1353.Request
1354----
1355 GET /projects/Public-Projects/children/?recursive HTTP/1.0
1356----
1357
1358.Response
1359----
1360 HTTP/1.1 200 OK
1361 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001362 Content-Type: application/json; charset=UTF-8
Edwin Kempinf95bd172013-03-19 11:10:57 +01001363
1364 )]}'
1365 [
1366 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001367 "id": "gerrit",
1368 "name": "gerrit",
1369 "parent": "Public-Projects",
1370 "description": "Gerrit Code Review"
1371 },
1372 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001373 "id": "plugins%2Freplication",
1374 "name": "plugins/replication",
1375 "parent": "Public-Plugins",
1376 "description": "Copies to other servers using the Git protocol"
1377 },
1378 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001379 "id": "plugins%2Freviewnotes",
1380 "name": "plugins/reviewnotes",
1381 "parent": "Public-Plugins",
1382 "description": "Annotates merged commits using notes on refs/notes/review."
1383 },
1384 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001385 "id": "plugins%2Fsingleusergroup",
1386 "name": "plugins/singleusergroup",
1387 "parent": "Public-Plugins",
1388 "description": "GroupBackend enabling users to be directly added to access rules"
1389 },
1390 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001391 "id": "Public-Plugins",
1392 "name": "Public-Plugins",
1393 "parent": "Public-Projects",
1394 "description": "Parent project for plugins/*"
1395 }
1396 ]
1397----
1398
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001399[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001400=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001401--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001402'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001403--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001404
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01001405Retrieves a child project. If a non-direct child project should be
1406retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001407
1408.Request
1409----
1410 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
1411----
1412
1413As response a link:#project-info[ProjectInfo] entity is returned that
1414describes the child project.
1415
1416.Response
1417----
1418 HTTP/1.1 200 OK
1419 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001420 Content-Type: application/json; charset=UTF-8
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001421
1422 )]}'
1423 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001424 "id": "plugins%2Freplication",
1425 "name": "plugins/replication",
1426 "parent": "Public-Plugins",
1427 "description": "Copies to other servers using the Git protocol"
1428 }
1429----
1430
David Pursehouse8cc68902014-10-06 18:17:16 +09001431[[tag-endpoints]]
1432== Tag Endpoints
1433
1434[[list-tags]]
1435=== List Tags
1436--
1437'GET /projects/link:#project-name[\{project-name\}]/tags/'
1438--
1439
1440List the tags of a project.
1441
1442As result a list of link:#tag-info[TagInfo] entries is returned.
1443
1444Only includes tags under the `refs/tags/` namespace.
1445
1446.Request
1447----
1448 GET /projects/work%2Fmy-project/tags/ HTTP/1.0
1449----
1450
1451.Response
1452----
1453 HTTP/1.1 200 OK
1454 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001455 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09001456
1457 )]}'
1458 [
1459 {
1460 "ref": "refs/tags/v1.0",
1461 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1462 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1463 "message": "Annotated tag",
1464 "tagger": {
1465 "name": "David Pursehouse",
1466 "email": "david.pursehouse@sonymobile.com",
1467 "date": "2014-10-06 07:35:03.000000000",
1468 "tz": 540
1469 }
1470 },
1471 {
1472 "ref": "refs/tags/v2.0",
1473 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1474 },
1475 {
1476 "ref": "refs/tags/v3.0",
1477 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
1478 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1479 "message": "Signed tag\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.11 (GNU/Linux)\n\niQEcBAABAgAGBQJUMlqYAAoJEPI2qVPgglptp7MH/j+KFcittFbxfSnZjUl8n5IZ\nveZo7wE+syjD9sUbMH4EGv0WYeVjphNTyViBof+stGTNkB0VQzLWI8+uWmOeiJ4a\nzj0LsbDOxodOEMI5tifo02L7r4Lzj++EbqtKv8IUq2kzYoQ2xjhKfFiGjeYOn008\n9PGnhNblEHZgCHguGR6GsfN8bfA2XNl9B5Ysl5ybX1kAVs/TuLZR4oDMZ/pW2S75\nhuyNnSgcgq7vl2gLGefuPs9lxkg5Fj3GZr7XPZk4pt/x1oiH7yXxV4UzrUwg2CC1\nfHrBlNbQ4uJNY8TFcwof52Z0cagM5Qb/ZSLglHbqEDGA68HPqbwf5z2hQyU2/U4\u003d\n\u003dZtUX\n-----END PGP SIGNATURE-----",
1480 "tagger": {
1481 "name": "David Pursehouse",
1482 "email": "david.pursehouse@sonymobile.com",
1483 "date": "2014-10-06 09:02:16.000000000",
1484 "tz": 540
1485 }
1486 }
1487 ]
1488----
1489
David Pursehouseb0ba1512015-09-10 14:17:05 +09001490[[tag-options]]
1491==== Tag Options
1492
1493Limit(n)::
1494Limit the number of tags to be included in the results.
1495+
1496.Request
1497----
1498 GET /projects/work%2Fmy-project/tags?n=2 HTTP/1.0
1499----
1500+
1501.Response
1502----
1503 HTTP/1.1 200 OK
1504 Content-Disposition: attachment
1505 Content-Type: application/json; charset=UTF-8
1506
1507 )]}'
1508 [
1509 {
1510 "ref": "refs/tags/v1.0",
1511 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1512 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1513 "message": "Annotated tag",
1514 "tagger": {
1515 "name": "David Pursehouse",
1516 "email": "david.pursehouse@sonymobile.com",
1517 "date": "2014-10-06 07:35:03.000000000",
1518 "tz": 540
1519 }
1520 },
1521 {
1522 "ref": "refs/tags/v2.0",
1523 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1524 }
1525 ]
1526----
1527
1528Skip(s)::
1529Skip the given number of tags from the beginning of the list.
1530+
1531.Request
1532----
1533 GET /projects/work%2Fmy-project/tags?n=2&s=1 HTTP/1.0
1534----
1535+
1536.Response
1537----
1538 HTTP/1.1 200 OK
1539 Content-Disposition: attachment
1540 Content-Type: application/json; charset=UTF-8
1541
1542 )]}'
1543 [
1544 {
1545 "ref": "refs/tags/v2.0",
1546 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1547 },
1548 {
1549 "ref": "refs/tags/v3.0",
1550 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
1551 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1552 "message": "Signed tag\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.11 (GNU/Linux)\n\niQEcBAABAgAGBQJUMlqYAAoJEPI2qVPgglptp7MH/j+KFcittFbxfSnZjUl8n5IZ\nveZo7wE+syjD9sUbMH4EGv0WYeVjphNTyViBof+stGTNkB0VQzLWI8+uWmOeiJ4a\nzj0LsbDOxodOEMI5tifo02L7r4Lzj++EbqtKv8IUq2kzYoQ2xjhKfFiGjeYOn008\n9PGnhNblEHZgCHguGR6GsfN8bfA2XNl9B5Ysl5ybX1kAVs/TuLZR4oDMZ/pW2S75\nhuyNnSgcgq7vl2gLGefuPs9lxkg5Fj3GZr7XPZk4pt/x1oiH7yXxV4UzrUwg2CC1\nfHrBlNbQ4uJNY8TFcwof52Z0cagM5Qb/ZSLglHbqEDGA68HPqbwf5z2hQyU2/U4\u003d\n\u003dZtUX\n-----END PGP SIGNATURE-----",
1553 "tagger": {
1554 "name": "David Pursehouse",
1555 "email": "david.pursehouse@sonymobile.com",
1556 "date": "2014-10-06 09:02:16.000000000",
1557 "tz": 540
1558 }
1559 }
1560 ]
1561----
1562
1563
David Pursehouse8cc68902014-10-06 18:17:16 +09001564[[get-tag]]
1565=== Get Tag
1566--
1567'GET /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
1568--
1569
1570Retrieves a tag of a project.
1571
1572.Request
1573----
1574 GET /projects/work%2Fmy-project/tags/v1.0 HTTP/1.0
1575----
1576
1577As response a link:#tag-info[TagInfo] entity is returned that describes the tag.
1578
1579.Response
1580----
1581 HTTP/1.1 200 OK
1582 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001583 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09001584
1585 )]}'
1586 {
1587 "ref": "refs/tags/v1.0",
1588 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1589 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1590 "message": "Annotated tag",
1591 "tagger": {
1592 "name": "David Pursehouse",
1593 "email": "david.pursehouse@sonymobile.com",
1594 "date": "2014-10-06 07:35:03.000000000",
1595 "tz": 540
1596 }
1597 }
1598----
1599
1600
Edwin Kempin1b993602014-07-08 16:18:45 +02001601[[commit-endpoints]]
1602== Commit Endpoints
1603
1604[[get-commit]]
1605=== Get Commit
1606--
1607'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
1608--
1609
1610Retrieves a commit of a project.
1611
1612The commit must be visible to the caller.
1613
1614.Request
1615----
1616 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
1617----
1618
1619As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
1620is returned that describes the commit.
1621
1622.Response
1623----
1624 HTTP/1.1 200 OK
1625 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001626 Content-Type: application/json; charset=UTF-8
Edwin Kempin1b993602014-07-08 16:18:45 +02001627
1628 )]}'
1629 {
1630 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
1631 "parents": [
1632 {
1633 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
1634 "subject": "Migrate contributor agreements to All-Projects."
1635 }
1636 ],
1637 "author": {
1638 "name": "Shawn O. Pearce",
1639 "email": "sop@google.com",
1640 "date": "2012-04-24 18:08:08.000000000",
1641 "tz": -420
1642 },
1643 "committer": {
1644 "name": "Shawn O. Pearce",
1645 "email": "sop@google.com",
1646 "date": "2012-04-24 18:08:08.000000000",
1647 "tz": -420
1648 },
1649 "subject": "Use an EventBus to manage star icons",
1650 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
1651 }
1652----
1653
Edwin Kempin6f7410a2014-07-09 15:46:22 +02001654[[get-content]]
1655=== Get Content
1656--
1657'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1658--
1659
1660Gets the content of a file from a certain commit.
1661
1662.Request
1663----
1664 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1665----
1666
1667The content is returned as base64 encoded string.
1668
1669.Response
1670----
1671 HTTP/1.1 200 OK
1672 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001673 Content-Type: text/plain; charset=UTF-8
Edwin Kempin6f7410a2014-07-09 15:46:22 +02001674
1675 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1676----
1677
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01001678[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001679== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01001680
Edwin Kempin76202742013-02-15 13:51:50 +01001681[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001682=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001683--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001684'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001685--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001686
Edwin Kempind0a63922013-01-23 16:32:59 +01001687List custom dashboards for a project.
1688
Edwin Kempin55367622013-02-05 09:09:23 +01001689As result a list of link:#dashboard-info[DashboardInfo] entries is
1690returned.
1691
Edwin Kempind0a63922013-01-23 16:32:59 +01001692List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01001693
1694.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01001695----
1696 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01001697----
Edwin Kempind0a63922013-01-23 16:32:59 +01001698
Edwin Kempin37440832013-02-06 11:36:00 +01001699.Response
1700----
Edwin Kempind0a63922013-01-23 16:32:59 +01001701 HTTP/1.1 200 OK
1702 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001703 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01001704
1705 )]}'
1706 [
1707 {
Edwin Kempind0a63922013-01-23 16:32:59 +01001708 "id": "main:closed",
1709 "ref": "main",
1710 "path": "closed",
1711 "description": "Merged and abandoned changes in last 7 weeks",
1712 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1713 "default": true,
1714 "title": "Closed changes",
1715 "sections": [
1716 {
1717 "name": "Merged",
1718 "query": "status:merged age:7w"
1719 },
1720 {
1721 "name": "Abandoned",
1722 "query": "status:abandoned age:7w"
1723 }
1724 ]
1725 }
1726 ]
1727----
1728
Edwin Kempina64c4b92013-01-23 11:30:40 +01001729.Get all dashboards of the 'All-Projects' project
1730****
1731get::/projects/All-Projects/dashboards/
1732****
1733
Edwin Kempin67e923c2013-02-14 13:57:12 +01001734[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001735=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001736--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001737'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001738--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001739
Edwin Kempin67e923c2013-02-14 13:57:12 +01001740Retrieves a project dashboard. The dashboard can be defined on that
1741project or be inherited from a parent project.
1742
1743.Request
1744----
1745 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
1746----
1747
1748As response a link:#dashboard-info[DashboardInfo] entity is returned
1749that describes the dashboard.
1750
1751.Response
1752----
1753 HTTP/1.1 200 OK
1754 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001755 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01001756
1757 )]}'
1758 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01001759 "id": "main:closed",
1760 "ref": "main",
1761 "path": "closed",
1762 "description": "Merged and abandoned changes in last 7 weeks",
1763 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1764 "default": true,
1765 "title": "Closed changes",
1766 "sections": [
1767 {
1768 "name": "Merged",
1769 "query": "status:merged age:7w"
1770 },
1771 {
1772 "name": "Abandoned",
1773 "query": "status:abandoned age:7w"
1774 }
1775 ]
1776 }
1777----
1778
1779To retrieve the default dashboard of a project use `default` as
1780dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01001781
1782.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01001783----
1784 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01001785----
Edwin Kempind0a63922013-01-23 16:32:59 +01001786
Edwin Kempin37440832013-02-06 11:36:00 +01001787.Response
1788----
Edwin Kempind0a63922013-01-23 16:32:59 +01001789 HTTP/1.1 200 OK
1790 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001791 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01001792
1793 )]}'
1794 {
Edwin Kempind0a63922013-01-23 16:32:59 +01001795 "id": "main:closed",
1796 "ref": "main",
1797 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01001798 "description": "Merged and abandoned changes in last 7 weeks",
1799 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
Edwin Kempind0a63922013-01-23 16:32:59 +01001800 "default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01001801 "title": "Closed changes",
1802 "sections": [
1803 {
1804 "name": "Merged",
1805 "query": "status:merged age:7w"
1806 },
1807 {
1808 "name": "Abandoned",
1809 "query": "status:abandoned age:7w"
1810 }
1811 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01001812 }
1813----
1814
Edwin Kempin67e923c2013-02-14 13:57:12 +01001815[[set-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001816=== Set Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001817--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001818'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001819--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001820
Edwin Kempin67e923c2013-02-14 13:57:12 +01001821Updates/Creates a project dashboard.
1822
1823Currently only supported for the `default` dashboard.
1824
1825The creation/update information for the dashboard must be provided in
1826the request body as a link:#dashboard-input[DashboardInput] entity.
1827
1828.Request
1829----
1830 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001831 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01001832
1833 {
1834 "id": "main:closed",
1835 "commit_message": "Define the default dashboard"
1836 }
1837----
1838
1839As response the new/updated dashboard is returned as a
1840link:#dashboard-info[DashboardInfo] entity.
1841
1842.Response
1843----
1844 HTTP/1.1 200 OK
1845 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001846 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01001847
1848 )]}'
1849 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01001850 "id": "main:closed",
1851 "ref": "main",
1852 "path": "closed",
1853 "description": "Merged and abandoned changes in last 7 weeks",
1854 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1855 "default": true,
1856 "title": "Closed changes",
1857 "sections": [
1858 {
1859 "name": "Merged",
1860 "query": "status:merged age:7w"
1861 },
1862 {
1863 "name": "Abandoned",
1864 "query": "status:abandoned age:7w"
1865 }
1866 ]
1867 }
1868----
1869
1870[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001871=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001872--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001873'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001874--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001875
Edwin Kempin67e923c2013-02-14 13:57:12 +01001876Deletes a project dashboard.
1877
1878Currently only supported for the `default` dashboard.
1879
Edwin Kempinefec4492013-02-22 10:09:23 +01001880The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05001881DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01001882
1883Please note that some proxies prohibit request bodies for DELETE
1884requests.
1885
1886.Request
1887----
1888 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
1889----
1890
1891.Response
1892----
1893 HTTP/1.1 204 No Content
1894----
1895
Edwin Kempin34d83352013-02-06 10:40:17 +01001896
1897[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001898== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01001899
Edwin Kempin196e1732013-05-09 15:12:34 +02001900[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001901=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02001902The name of a branch or `HEAD`. The prefix `refs/heads/` can be
1903omitted.
1904
Edwin Kempin1b993602014-07-08 16:18:45 +02001905[[commit-id]]
1906=== \{commit-id\}
1907Commit ID.
1908
David Pursehouse8cc68902014-10-06 18:17:16 +09001909[[tag-id]]
1910=== \{tag-id\}
1911The name of a tag. The prefix `refs/tags/` can be omitted.
1912
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001913[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001914=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01001915The ID of a dashboard in the format '<ref>:<path>'.
1916
1917A special dashboard ID is `default` which represents the default
1918dashboard of a project.
1919
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001920[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001921=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01001922The name of the project.
1923
Edwin Kempina9e94ab2015-03-06 10:35:39 +01001924If the name ends with `.git`, the suffix will be automatically removed.
1925
Edwin Kempin34d83352013-02-06 10:40:17 +01001926
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001927[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001928== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001929
Edwin Kempin62946742014-07-09 11:17:58 +02001930[[ban-input]]
1931=== BanInput
1932The `BanInput` entity contains information for banning commits in a
1933project.
1934
David Pursehouseae367192014-11-25 17:24:47 +09001935[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02001936|=======================
1937|Field Name||Description
1938|`commits` ||List of commits to be banned.
1939|`reason` |optional|Reason for banning the commits.
1940|=======================
1941
1942[[ban-result-info]]
1943=== BanResultInfo
1944The `BanResultInfo` entity describes the result of banning commits.
1945
David Pursehouseae367192014-11-25 17:24:47 +09001946[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02001947|=============================
1948|Field Name ||Description
1949|`newly_banned` |optional|List of newly banned commits.
1950|`already_banned`|optional|List of commits that were already banned.
1951|`ignored` |optional|List of object IDs that were ignored.
1952|=============================
1953
Edwin Kempin521c1242015-01-23 12:44:44 +01001954[[branch-info]]
1955=== BranchInfo
1956The `BranchInfo` entity contains information about a branch.
1957
1958[options="header",cols="1,^2,4"]
1959|=========================
1960|Field Name ||Description
1961|`ref` ||The ref of the branch.
1962|`revision` ||The revision to which the branch points.
1963|`can_delete`|`false` if not set|
1964Whether the calling user can delete this branch.
1965|`web_links` |optional|
1966Links to the branch in external sites as a list of
1967link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
1968|=========================
1969
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001970[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001971=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001972The `BranchInput` entity contains information for the creation of
1973a new branch.
1974
David Pursehouseae367192014-11-25 17:24:47 +09001975[options="header",cols="1,^2,4"]
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001976|=======================
1977|Field Name||Description
1978|`ref` |optional|
1979The name of the branch. The prefix `refs/heads/` can be
1980omitted. +
1981If set, must match the branch ID in the URL.
1982|`revision`|optional|
1983The base revision of the new branch. +
1984If not set, `HEAD` will be used as base revision.
1985|=======================
1986
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001987[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001988=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001989The `ConfigInfo` entity contains information about the effective project
1990configuration.
1991
David Pursehouseae367192014-11-25 17:24:47 +09001992[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02001993|=======================================================
1994|Field Name ||Description
1995|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001996The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001997|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001998link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1999authors must complete a contributor agreement on the site before
2000pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002001|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002002link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2003Gerrit will try to perform a 3-way merge of text file content when a
2004file has been modified by both the destination branch and the change
2005being submitted. This option only takes effect if submit type is not
2006FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002007|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002008link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2009each change must contain a Signed-off-by line from either the author or
2010the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002011|`create_new_change_for_all_not_in_target` |optional|
2012link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2013a new change is created for every commit not in target branch.
2014|`require_change_id` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002015link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
2016valid link:user-changeid.html[Change-Id] footer in any commit uploaded
2017for review is required. This does not apply to commits pushed directly
2018to a branch or tag.
Doug Claar1b0f76252016-03-23 13:34:55 -07002019|`enable_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz5170e0f2015-06-18 21:05:29 -04002020link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2021signed push validation is enabled on the project.
Doug Claar1b0f76252016-03-23 13:34:55 -07002022|`require_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz0543c732015-10-20 10:35:26 -04002023link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2024signed push validation is required on the project.
Edwin Kempin3c99f592013-07-15 10:12:27 +02002025|`max_object_size_limit` ||
2026The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2027limit] of this project as a link:#max-object-size-limit-info[
2028MaxObjectSizeLimitInfo] entity.
2029|`submit_type` ||
2030The default submit type of the project, can be `MERGE_IF_NECESSARY`,
2031`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
2032`CHERRY_PICK`.
2033|`state` |optional|
2034The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
2035Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02002036|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02002037Map with the comment link configurations of the project. The name of
2038the comment link configuration is mapped to the comment link
2039configuration, which has the same format as the
2040link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[
2041commentlink section] of `gerrit.config`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002042|`theme` |optional|
Edwin Kempin272402e2013-07-15 11:17:36 +02002043The theme that is configured for the project as a link:#theme-info[
2044ThemeInfo] entity.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002045|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002046Plugin configuration as map which maps the plugin name to a map of
2047parameter names to link:#config-parameter-info[ConfigParameterInfo]
2048entities.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002049|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02002050Actions the caller might be able to perform on this project. The
2051information is a map of view names to
2052link:rest-api-changes.html#action-info[ActionInfo] entities.
David Pursehouse510b87d2014-11-25 16:46:28 +09002053|=======================================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002054
Edwin Kempina23eb102013-07-17 09:10:54 +02002055[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002056=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02002057The `ConfigInput` entity describes a new project configuration.
2058
David Pursehouseae367192014-11-25 17:24:47 +09002059[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02002060|======================================================
2061|Field Name ||Description
2062|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002063The new description of the project. +
2064If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002065|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002066Whether authors must complete a contributor agreement on the site
2067before pushing any commits or changes to this project. +
2068Can be `TRUE`, `FALSE` or `INHERIT`. +
2069If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002070|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002071Whether Gerrit will try to perform a 3-way merge of text file content
2072when a file has been modified by both the destination branch and the
2073change being submitted. This option only takes effect if submit type is
2074not FAST_FORWARD_ONLY. +
2075Can be `TRUE`, `FALSE` or `INHERIT`. +
2076If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002077|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002078Whether each change must contain a Signed-off-by line from either the
2079author or the uploader in the commit message. +
2080Can be `TRUE`, `FALSE` or `INHERIT`. +
2081If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002082|`create_new_change_for_all_not_in_target` |optional|
2083Whether a new change will be created for every commit not in target
2084branch. +
2085Can be `TRUE`, `FALSE` or `INHERIT`. +
2086If not set, this setting is not updated.
2087|`require_change_id` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002088Whether a valid link:user-changeid.html[Change-Id] footer in any commit
2089uploaded for review is required. This does not apply to commits pushed
2090directly to a branch or tag. +
2091Can be `TRUE`, `FALSE` or `INHERIT`. +
2092If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002093|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002094The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2095limit] of this project as a link:#max-object-size-limit-info[
2096MaxObjectSizeLimitInfo] entity. +
2097If set to `0`, the max object size limit is removed. +
2098If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002099|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002100The default submit type of the project, can be `MERGE_IF_NECESSARY`,
2101`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
2102`CHERRY_PICK`. +
2103If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002104|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002105The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
2106Not set if the project state is `ACTIVE`. +
2107If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002108|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002109Plugin configuration values as map which maps the plugin name to a map
2110of parameter names to values.
David Pursehouse510b87d2014-11-25 16:46:28 +09002111|======================================================
Edwin Kempina23eb102013-07-17 09:10:54 +02002112
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002113[[config-parameter-info]]
2114ConfigParameterInfo
2115~~~~~~~~~~~~~~~~~~~
2116The `ConfigParameterInfo` entity describes a project configuration
2117parameter.
2118
David Pursehouseae367192014-11-25 17:24:47 +09002119[options="header",cols="1,^2,4"]
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002120|===============================
2121|Field Name ||Description
2122|`display_name` |optional|
2123The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01002124|`description` |optional|
2125The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01002126|`warning` |optional|
2127Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002128|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002129The type of the configuration parameter. Can be `STRING`, `INT`,
2130`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002131|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01002132The value of the configuration parameter as string. If the parameter
2133is inheritable this is the effective value which is deduced from
2134`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002135|`values` |optional|
2136The list of values. Only set if the `type` is `ARRAY`.
Doug Claar1b0f76252016-03-23 13:34:55 -07002137|`editable` |`false` if not set|
Edwin Kempin0d485232013-11-17 18:55:48 +01002138Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01002139|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002140The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01002141|`inheritable` |`false` if not set|
2142Whether the configuration parameter can be inherited.
2143|`configured_value`|optional|
2144The value of the configuration parameter that is configured on this
2145project, only set if `inheritable` is true.
2146|`inherited_value` |optional|
2147The inherited value of the configuration parameter, only set if
2148`inheritable` is true.
2149|`permitted_values` |optional|
2150The list of permitted values, only set if the `type` is `LIST`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002151|===============================
2152
Edwin Kempin55367622013-02-05 09:09:23 +01002153[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002154=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002155The `DashboardInfo` entity contains information about a project
2156dashboard.
2157
David Pursehouseae367192014-11-25 17:24:47 +09002158[options="header",cols="1,^2,4"]
Edwin Kempin55367622013-02-05 09:09:23 +01002159|===============================
2160|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01002161|`id` ||
2162The ID of the dashboard. The ID has the format '<ref>:<path>',
2163where ref and path are URL encoded.
2164|`project` ||
2165The name of the project for which this dashboard is returned.
2166|`defining_project`||
2167The name of the project in which this dashboard is defined.
2168This is different from `project` if the dashboard is inherited from a
2169parent project.
2170|`ref` ||
2171The name of the ref in which the dashboard is defined, without the
2172`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
2173|`path` ||
2174The path of the file in which the dashboard is defined.
2175|`description` |optional|The description of the dashboard.
2176|`foreach` |optional|
2177Subquery that applies to all sections in the dashboard. +
2178Tokens such as `${project}` are not resolved.
2179|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09002180The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01002181The URL is relative to the canonical web URL. +
2182Tokens in the queries such as `${project}` are resolved.
2183|`default` |not set if `false`|
2184Whether this is the default dashboard of the project.
2185|`title` |optional|The title of the dashboard.
2186|`sections` ||
2187The list of link:#dashboard-section-info[sections] in the dashboard.
2188|===============================
2189
Edwin Kempin67e923c2013-02-14 13:57:12 +01002190[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002191=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01002192The `DashboardInput` entity contains information to create/update a
2193project dashboard.
2194
David Pursehouseae367192014-11-25 17:24:47 +09002195[options="header",cols="1,^2,4"]
Edwin Kempin67e923c2013-02-14 13:57:12 +01002196|=============================
2197|Field Name ||Description
2198|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01002199URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002200|`commit_message`|optional|
2201Message that should be used to commit the change of the dashboard.
2202|=============================
2203
Edwin Kempin55367622013-02-05 09:09:23 +01002204[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002205=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002206The `DashboardSectionInfo` entity contains information about a section
2207in a dashboard.
2208
David Pursehouseae367192014-11-25 17:24:47 +09002209[options="header",cols="1,6"]
Edwin Kempin55367622013-02-05 09:09:23 +01002210|===========================
2211|Field Name |Description
2212|`name` |The title of the section.
2213|`query` |The query of the section. +
2214Tokens such as `${project}` are not resolved.
2215|===========================
2216
Hugo Arèsef8e3202015-01-12 15:09:06 -05002217[[delete-branches-input]]
2218=== DeleteBranchesInput
2219The `DeleteBranchesInput` entity contains information about branches that should
2220be deleted.
2221
2222[options="header",width="50%",cols="1,6"]
2223|==========================
2224|Field Name |Description
2225|`branches` |A list of branch names that identify the branches that should be
2226deleted.
2227|==========================
2228
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002229[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002230=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002231The `GCInput` entity contains information to run the Git garbage
2232collection.
2233
David Pursehouseae367192014-11-25 17:24:47 +09002234[options="header",cols="1,^2,4"]
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002235|=============================
2236|Field Name ||Description
2237|`show_progress` |`false` if not set|
2238Whether progress information should be shown.
Christian Halstrick2f94e2e2015-03-11 15:13:31 +01002239|`aggressive` |`false` if not set|
2240Whether an aggressive garbage collection should be done.
Adrian Görler92410a12015-11-03 16:20:56 +01002241|`async` |`false` if not set|
2242Whether the garbage collection should run asynchronously.
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002243|=============================
2244
Edwin Kempin6b813372013-03-13 17:07:33 +01002245[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002246=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01002247The `HeadInput` entity contains information for setting `HEAD` for a
2248project.
2249
David Pursehouseae367192014-11-25 17:24:47 +09002250[options="header",cols="1,6"]
Edwin Kempin6b813372013-03-13 17:07:33 +01002251|============================
2252|Field Name |Description
2253|`ref` |
2254The ref to which `HEAD` should be set, the `refs/heads` prefix can be
2255omitted.
2256|============================
2257
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002258[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002259=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002260A boolean value that can also be inherited.
2261
David Pursehouseae367192014-11-25 17:24:47 +09002262[options="header",cols="1,^2,4"]
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002263|================================
2264|Field Name ||Description
2265|`value` ||
2266The effective boolean value.
2267|`configured_value` ||
2268The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
2269|`inherited_value` |optional|
2270The boolean value inherited from the parent. +
2271Not set if there is no parent.
2272|================================
2273
Edwin Kempin3c99f592013-07-15 10:12:27 +02002274[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002275=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02002276The `MaxObjectSizeLimitInfo` entity contains information about the
2277link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2278limit] of a project.
2279
David Pursehouseae367192014-11-25 17:24:47 +09002280[options="header",cols="1,^2,4"]
Edwin Kempin3c99f592013-07-15 10:12:27 +02002281|===============================
2282|Field Name ||Description
2283|`value` |optional|
2284The effective value of the max object size limit as a formatted string. +
2285Not set if there is no limit for the object size.
2286|`configured_value`|optional|
2287The max object size limit that is configured on the project as a
2288formatted string. +
2289Not set if there is no limit for the object size configured on project
2290level.
2291|`inherited_value` |optional|
2292The max object size limit that is inherited as a formatted string. +
2293Not set if there is no global limit for the object size.
2294|===============================
2295
Edwin Kempin57f303c2013-02-13 15:52:22 +01002296[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002297=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01002298The `ProjectDescriptionInput` entity contains information for setting a
2299project description.
2300
David Pursehouseae367192014-11-25 17:24:47 +09002301[options="header",cols="1,^2,4"]
Edwin Kempin57f303c2013-02-13 15:52:22 +01002302|=============================
2303|Field Name ||Description
2304|`description` |optional|The project description. +
2305The project description will be deleted if not set.
2306|`commit_message`|optional|
2307Message that should be used to commit the change of the project
2308description in the `project.config` file to the `refs/meta/config`
2309branch.
2310|=============================
2311
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002312[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002313=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002314The `ProjectInfo` entity contains information about a project.
2315
David Pursehouseae367192014-11-25 17:24:47 +09002316[options="header",cols="1,^2,4"]
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002317|===========================
2318|Field Name ||Description
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002319|`id` ||The URL encoded project name.
2320|`name` |
2321not set if returned in a map where the project name is used as map key|
2322The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01002323|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002324The name of the parent project. +
2325`?-<n>` if the parent project is not visible (`<n>` is a number which
2326is increased for each non-visible project).
2327|`description` |optional|The description of the project.
Shawn Pearce21a6c212014-04-23 12:35:10 -07002328|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002329|`branches` |optional|Map of branch names to HEAD revisions.
Edwin Kempin26c95a42014-11-25 16:29:47 +01002330|`web_links` |optional|
Edwin Kempinea004752014-04-11 15:56:02 +02002331Links to the project in external sites as a list of
2332link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002333|===========================
2334
Bruce Zu798ea122013-02-18 16:55:43 +08002335[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002336=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08002337The `ProjectInput` entity contains information for the creation of
2338a new project.
2339
David Pursehouseae367192014-11-25 17:24:47 +09002340[options="header",cols="1,^2,4"]
Bruce Zu798ea122013-02-18 16:55:43 +08002341|=========================================
2342|Field Name ||Description
2343|`name` |optional|
2344The name of the project (not encoded). +
David Pursehouse8c5ad412015-02-03 14:19:09 +09002345If set, must match the project name in the URL. +
2346If name ends with `.git` the suffix will be automatically removed.
Bruce Zu798ea122013-02-18 16:55:43 +08002347|`parent` |optional|
2348The name of the parent project. +
2349If not set, the `All-Projects` project will be the parent project.
2350|`description` |optional|The description of the project.
2351|`permissions_only` |`false` if not set|
2352Whether a permission-only project should be created.
2353|`create_empty_commit` |`false` if not set|
2354Whether an empty initial commit should be created.
2355|`submit_type` |optional|
2356The submit type that should be set for the project
2357(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
2358`MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01002359If not set, `MERGE_IF_NECESSARY` is set as submit type unless
2360link:config-gerrit.html#repository.name.defaultSubmitType[
2361repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08002362|`branches` |optional|
2363A list of branches that should be initially created. +
2364For the branch names the `refs/heads/` prefix can be omitted.
2365|`owners` |optional|
2366A list of groups that should be assigned as project owner. +
2367Each group in the list must be specified as
2368link:rest-api-groups.html#group-id[group-id]. +
2369If not set, the link:config-gerrit.html#repository.name.ownerGroup[
2370groups that are configured as default owners] are set as project
2371owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002372|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002373Whether contributor agreements should be used for the project (`TRUE`,
2374`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02002375|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002376Whether the usage of 'Signed-Off-By' footers is required for the
2377project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02002378|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
2379Whether a new change is created for every commit not in target branch
2380for the project (`TRUE`, `FALSE`, `INHERIT`).
2381|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002382Whether content merge should be enabled for the project (`TRUE`,
2383`FALSE`, `INHERIT`). +
2384`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002385|`require_change_id` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002386Whether the usage of Change-Ids is required for the project (`TRUE`,
2387`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02002388|`max_object_size_limit` |optional|
2389Max allowed Git object size for this project.
2390Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01002391|`plugin_config_values` |optional|
2392Plugin configuration values as map which maps the plugin name to a map
2393of parameter names to values.
Bruce Zu798ea122013-02-18 16:55:43 +08002394|=========================================
2395
Edwin Kempinecad88c2013-02-14 12:09:44 +01002396[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002397=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01002398The `ProjectParentInput` entity contains information for setting a
2399project parent.
2400
David Pursehouseae367192014-11-25 17:24:47 +09002401[options="header",cols="1,^2,4"]
Edwin Kempinecad88c2013-02-14 12:09:44 +01002402|=============================
2403|Field Name ||Description
2404|`parent` ||The name of the parent project.
2405|`commit_message`|optional|
2406Message that should be used to commit the change of the project parent
2407in the `project.config` file to the `refs/meta/config` branch.
2408|=============================
2409
Edwin Kempin87504d92014-07-04 12:59:19 +02002410[[reflog-entry-info]]
2411=== ReflogEntryInfo
2412The `ReflogEntryInfo` entity describes an entry in a reflog.
2413
David Pursehouseae367192014-11-25 17:24:47 +09002414[options="header",cols="1,6"]
Edwin Kempin87504d92014-07-04 12:59:19 +02002415|============================
2416|Field Name |Description
2417|`old_id` |The old commit ID.
2418|`new_id` |The new commit ID.
2419|`who` |
2420The user performing the change as a
2421link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
2422|`comment` |Comment of the reflog entry.
2423|============================
2424
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002425[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002426=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002427The `RepositoryStatisticsInfo` entity contains information about
2428statistics of a Git repository.
2429
David Pursehouseae367192014-11-25 17:24:47 +09002430[options="header",cols="1,6"]
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002431|======================================
2432|Field Name |Description
2433|`number_of_loose_objects` |Number of loose objects.
2434|`number_of_loose_refs` |Number of loose refs.
2435|`number_of_pack_files` |Number of pack files.
2436|`number_of_packed_objects`|Number of packed objects.
2437|`number_of_packed_refs` |Number of packed refs.
2438|`size_of_loose_objects` |Size of loose objects in bytes.
2439|`size_of_packed_objects` |Size of packed objects in bytes.
2440|======================================
2441
David Pursehouse8cc68902014-10-06 18:17:16 +09002442[[tag-info]]
2443=== TagInfo
2444The `TagInfo` entity contains information about a tag.
2445
David Pursehouseae367192014-11-25 17:24:47 +09002446[options="header",cols="1,^2,4"]
David Pursehouse8cc68902014-10-06 18:17:16 +09002447|=========================
2448|Field Name ||Description
2449|`ref` ||The ref of the tag.
2450|`revision` ||For lightweight tags, the revision of the commit to which the tag
2451points. For annotated tags, the revision of the tag object.
2452|`object`|Only set for annotated tags.|The revision of the object to which the
2453tag points.
2454|`message`|Only set for annotated tags.|The tag message. For signed tags, includes
2455the signature.
David Pursehousec9f5a5a2015-12-07 19:13:16 +09002456|`tagger`|Only set for annotated tags, if present in the tag.|The tagger as a
David Pursehouse8cc68902014-10-06 18:17:16 +09002457link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
2458|=========================
2459
Edwin Kempin272402e2013-07-15 11:17:36 +02002460[[theme-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002461=== ThemeInfo
Edwin Kempin272402e2013-07-15 11:17:36 +02002462The `ThemeInfo` entity describes a theme.
2463
David Pursehouseae367192014-11-25 17:24:47 +09002464[options="header",cols="1,^2,4"]
Edwin Kempin272402e2013-07-15 11:17:36 +02002465|=============================
2466|Field Name ||Description
2467|`css` |optional|
2468The path to the `GerritSite.css` file.
2469|`header` |optional|
2470The path to the `GerritSiteHeader.html` file.
2471|`footer` |optional|
2472The path to the `GerritSiteFooter.html` file.
2473|=============================
2474
Patrick Hiesel5a3475f2016-04-21 11:44:29 +02002475[[get-access]]
2476=== List Access Rights for Project
2477--
2478'GET //projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
2479--
2480
2481Lists the access rights for a single project.
2482
2483As result a link:#project-access-info[ProjectAccessInfo] entity is returned.
2484
2485.Request
2486----
2487 GET /projects/MyProject/access HTTP/1.0
2488----
2489
2490.Response
2491----
2492 HTTP/1.1 200 OK
2493 Content-Type: application/json; charset=UTF-8
2494
2495 )]}'
2496 {
2497 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
2498 "inherits_from": {
2499 "id": "All-Projects",
2500 "name": "All-Projects",
2501 "description": "Access inherited by all other projects."
2502 },
2503 "local": {
2504 "refs/*": {
2505 "permissions": {
2506 "read": {
2507 "rules": {
2508 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
2509 "action": "ALLOW",
2510 "force": false
2511 },
2512 "global:Anonymous-Users": {
2513 "action": "ALLOW",
2514 "force": false
2515 }
2516 }
2517 }
2518 }
2519 }
2520 },
2521 "is_owner": true,
2522 "owner_of": [
2523 "refs/*"
2524 ],
2525 "can_upload": true,
2526 "can_add": true,
2527 "config_visible": true
2528 }
2529----
Edwin Kempind0a63922013-01-23 16:32:59 +01002530
2531GERRIT
2532------
2533Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07002534
2535SEARCHBOX
2536---------