blob: 72c6a39b6477d3b8cc6993f02012daab0cf76ae9 [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",
Saša Živkov225b7a72015-11-17 17:37:43 +0100736 "reject_implicit_merges": "INHERIT",
Edwin Kempina23eb102013-07-17 09:10:54 +0200737 "require_change_id": "TRUE",
738 "max_object_size_limit": "10m",
739 "submit_type": "REBASE_IF_NECESSARY",
740 "state": "ACTIVE"
741 }
742----
743
744As response the new configuration is returned as a link:#config-info[
745ConfigInfo] entity.
746
747.Response
748----
749 HTTP/1.1 200 OK
750 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900751 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200752
753 )]}'
754 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200755 "use_contributor_agreements": {
756 "value": false,
757 "configured_value": "FALSE",
758 "inherited_value": false
759 },
760 "use_content_merge": {
761 "value": true,
762 "configured_value": "INHERIT",
763 "inherited_value": true
764 },
765 "use_signed_off_by": {
766 "value": false,
767 "configured_value": "INHERIT",
768 "inherited_value": false
769 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200770 "create_new_change_for_all_not_in_target": {
771 "value": true,
772 "configured_value": "INHERIT",
773 "inherited_value": false
774 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200775 "require_change_id": {
776 "value": true,
777 "configured_value": "TRUE",
778 "inherited_value": true
779 },
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400780 "enable_signed_push": {
781 "value": true,
782 "configured_value": "INHERIT",
783 "inherited_value": false
784 },
Dave Borowitz0543c732015-10-20 10:35:26 -0400785 "require_signed_push": {
786 "value": false,
787 "configured_value": "INHERIT",
788 "inherited_value": false
789 },
Saša Živkov225b7a72015-11-17 17:37:43 +0100790 "reject_implicit_merges": {
791 "value": false,
792 "configured_value": "INHERIT",
793 "inherited_value": false
794 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200795 "max_object_size_limit": {
796 "value": "10m",
797 "configured_value": "10m",
798 "inherited_value": "20m"
799 },
800 "submit_type": "REBASE_IF_NECESSARY",
801 "state": "ACTIVE",
802 "commentlinks": {}
803 }
804----
805
Edwin Kempinef3542f2013-03-19 13:31:49 +0100806[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800807=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800808--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100809'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800810--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100811
812Run the Git garbage collection for the repository of a project.
813
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100814Options for the Git garbage collection can be specified in the
815request body as a link:#gc-input[GCInput] entity.
816
Edwin Kempinef3542f2013-03-19 13:31:49 +0100817.Request
818----
819 POST /projects/plugins%2Freplication/gc HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900820 Content-Type: application/json; charset=UTF-8
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100821
822 {
823 "show_progress": true
824 }
Edwin Kempinef3542f2013-03-19 13:31:49 +0100825----
826
827The response is the streamed output of the garbage collection.
828
829.Response
830----
831 HTTP/1.1 200 OK
832 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900833 Content-Type: text/plain; charset=UTF-8
Edwin Kempinef3542f2013-03-19 13:31:49 +0100834
835 collecting garbage for "plugins/replication":
836 Pack refs: 100% (21/21)
837 Counting objects: 20
838 Finding sources: 100% (20/20)
839 Getting sizes: 100% (13/13)
840 Compressing objects: 83% (5/6)
841 Writing objects: 100% (20/20)
842 Selecting commits: 100% (7/7)
843 Building bitmaps: 100% (7/7)
844 Finding sources: 100% (41/41)
845 Getting sizes: 100% (25/25)
846 Compressing objects: 52% (12/23)
847 Writing objects: 100% (41/41)
848 Prune loose objects also found in pack files: 100% (36/36)
849 Prune loose, unreferenced objects: 100% (36/36)
850 done.
851----
852
Adrian Görler92410a12015-11-03 16:20:56 +0100853==== Asynchronous Execution
854
855The option `async` allows to schedule a background task that asynchronously
856executes a Git garbage collection.
857
858The `Location` header of the response refers to the link:rest-api-config.html#get-task[background task]
859which allows to inspect the progress of its execution. In case of asynchronous
860execution the `show_progress` option is ignored.
861
862.Request
863----
864 POST /projects/plugins%2Freplication/gc HTTP/1.0
865 Content-Type: application/json;charset=UTF-8
866
867 {
868 "async": true
869 }
870----
871
872The response is empty.
873
874.Response
875----
876 HTTP/1.1 202 Accepted
877 Content-Disposition: attachment
878 Location: https:<host>/a/config/server/tasks/383a0602
879----
880
Edwin Kempin62946742014-07-09 11:17:58 +0200881[[ban-commit]]
882=== Ban Commit
883--
884'PUT /projects/link:#project-name[\{project-name\}]/ban'
885--
886
887Marks commits as banned for the project. If a commit is banned Gerrit
888rejects every push that includes this commit with
889link:error-contains-banned-commit.html[contains banned commit ...].
890
891[NOTE]
892This REST endpoint only marks the commits as banned, but it does not
893remove the commits from the history of any central branch. This needs
894to be done manually.
895
896The commits to be banned must be specified in the request body as a
897link:#ban-input[BanInput] entity.
898
899The caller must be project owner.
900
901.Request
902----
903 PUT /projects/plugins%2Freplication/ban HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900904 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +0200905
906 {
907 "commits": [
908 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
909 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
910 ],
911 "reason": "Violates IP"
912 }
913----
914
915As response a link:#ban-result-info[BanResultInfo] entity is returned.
916
917.Response
918----
919 HTTP/1.1 200 OK
920 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900921 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +0200922
923 )]}'
924 {
925 "newly_banned": [
926 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
927 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
928 ]
929 }
930----
931
Patrick Hiesel21816f12016-04-22 08:53:06 +0200932[[get-access]]
933=== List Access Rights for Project
934--
935'GET /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
936--
937
938Lists the access rights for a single project.
939
940As result a link:#project-access-info[ProjectAccessInfo] entity is returned.
941
942.Request
943----
944 GET /projects/MyProject/access HTTP/1.0
945----
946
947.Response
948----
949 HTTP/1.1 200 OK
950 Content-Type: application/json; charset=UTF-8
951
952 )]}'
953 {
954 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
955 "inherits_from": {
956 "id": "All-Projects",
957 "name": "All-Projects",
958 "description": "Access inherited by all other projects."
959 },
960 "local": {
961 "refs/*": {
962 "permissions": {
963 "read": {
964 "rules": {
965 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
966 "action": "ALLOW",
967 "force": false
968 },
969 "global:Anonymous-Users": {
970 "action": "ALLOW",
971 "force": false
972 }
973 }
974 }
975 }
976 }
977 },
978 "is_owner": true,
979 "owner_of": [
980 "refs/*"
981 ],
982 "can_upload": true,
983 "can_add": true,
984 "config_visible": true
985 }
986----
987
988[[set-access]]
989=== Add, Update and Delete Access Rights for Project
990--
991'POST /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
992--
993
994Sets access rights for the project using the diff schema provided by
995link:#project-access-input[ProjectAccessInput]. Deductions are used to
996remove access sections, permissions or permission rules. The backend will remove
997the entity with the finest granularity in the request, meaning that if an
998access section without permissions is posted, the access section will be
999removed; if an access section with a permission but no permission rules is
1000posted, the permission will be removed; if an access section with a permission
1001and a permission rule is posted, the permission rule will be removed.
1002
1003Additionally, access sections and permissions will be cleaned up after applying
1004the deductions by removing items that have no child elements.
1005
1006After removals have been applied, additions will be applied.
1007
1008As result a link:#project-access-info[ProjectAccessInfo] entity is returned.
1009
1010.Request
1011----
1012 POST /projects/MyProject/access HTTP/1.0
1013 Content-Type: application/json; charset=UTF-8
1014
1015 {
1016 "remove": [
1017 "refs/*": {
1018 "permissions": {
1019 "read": {
1020 "rules": {
1021 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1022 "action": "ALLOW"
1023 }
1024 }
1025 }
1026 }
1027 }
1028 ]
1029 }
1030----
1031
1032.Response
1033----
1034 HTTP/1.1 200 OK
1035 Content-Type: application/json; charset=UTF-8
1036
1037 )]}'
1038 {
1039 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1040 "inherits_from": {
1041 "id": "All-Projects",
1042 "name": "All-Projects",
1043 "description": "Access inherited by all other projects."
1044 },
1045 "local": {
1046 "refs/*": {
1047 "permissions": {
1048 "read": {
1049 "rules": {
1050 "global:Anonymous-Users": {
1051 "action": "ALLOW",
1052 "force": false
1053 }
1054 }
1055 }
1056 }
1057 }
1058 },
1059 "is_owner": true,
1060 "owner_of": [
1061 "refs/*"
1062 ],
1063 "can_upload": true,
1064 "can_add": true,
1065 "config_visible": true
1066 }
1067----
1068
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001069[[index]]
1070=== Index all changes in a project
1071
1072Adds or updates all the changes belonging to a project in the secondary index.
1073The indexing task is executed asynchronously in background, so this command
1074returns immediately.
1075
1076.Request
1077----
1078 POST /projects/MyProject/index HTTP/1.0
1079----
1080
1081.Response
1082----
1083HTTP/1.1 202 Accepted
1084Content-Disposition: attachment
1085----
1086
Edwin Kempina686de92013-05-09 15:12:34 +02001087[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001088== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +02001089
1090[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001091=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001092--
Edwin Kempina686de92013-05-09 15:12:34 +02001093'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001094--
Edwin Kempina686de92013-05-09 15:12:34 +02001095
1096List the branches of a project.
1097
1098As result a list of link:#branch-info[BranchInfo] entries is
1099returned.
1100
1101.Request
1102----
1103 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
1104----
1105
1106.Response
1107----
1108 HTTP/1.1 200 OK
1109 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001110 Content-Type: application/json; charset=UTF-8
Edwin Kempina686de92013-05-09 15:12:34 +02001111
1112 )]}'
1113 [
1114 {
1115 "ref": "HEAD",
1116 "revision": "master"
1117 },
1118 {
1119 "ref": "refs/meta/config",
1120 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1121 },
1122 {
1123 "ref": "refs/heads/master",
1124 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1125 },
1126 {
1127 "ref": "refs/heads/stable",
1128 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
1129 "can_delete": true
1130 }
1131 ]
1132----
1133
Hugo Arès3133b4b2014-10-14 14:05:10 -04001134[[branch-options]]
1135==== Branch Options
1136
Hugo Arès15856622014-10-14 14:19:01 -04001137Limit(n)::
1138Limit the number of branches to be included in the results.
1139+
1140.Request
1141----
1142 GET /projects/testproject/branches?n=1 HTTP/1.0
1143----
1144+
1145.Response
1146----
1147 HTTP/1.1 200 OK
1148 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001149 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001150
1151 )]}'
1152 [
1153 {
1154 "ref": "HEAD",
1155 "revision": "master",
1156 "can_delete": false
1157 }
1158 ]
1159----
1160
1161Skip(s)::
1162Skip the given number of branches from the beginning of the list.
1163+
1164.Request
1165----
1166 GET /projects/testproject/branches?n=1&s=0 HTTP/1.0
1167----
1168+
1169.Response
1170----
1171 HTTP/1.1 200 OK
1172 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001173 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001174
1175 )]}'
1176 [
1177 {
1178 "ref": "HEAD",
1179 "revision": "master",
1180 "can_delete": false
1181 }
1182 ]
1183----
1184
Hugo Arès3133b4b2014-10-14 14:05:10 -04001185Substring(m)::
1186Limit the results to those projects that match the specified substring.
1187+
1188List all projects that match substring `test`:
1189+
1190.Request
1191----
1192 GET /projects/testproject/branches?m=test HTTP/1.0
1193----
1194+
1195.Response
1196----
1197 HTTP/1.1 200 OK
1198 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001199 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001200
1201 )]}'
1202 [
1203 {
1204 "ref": "refs/heads/test1",
1205 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1206 "can_delete": true
1207 }
1208 ]
1209----
1210
1211Regex(r)::
1212Limit the results to those branches that match the specified regex.
1213Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
1214match any branches that start with 'test' and regex '*t' will match any
1215branches that end with 'test'.
1216+
1217List all branches that match regex `t.*1`:
1218+
1219.Request
1220----
1221 GET /projects/testproject/branches?r=t.*1 HTTP/1.0
1222----
1223+
1224.Response
1225----
1226 HTTP/1.1 200 OK
1227 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001228 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001229
1230 )]}'
1231 [
1232 {
1233 "ref": "refs/heads/test1",
1234 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1235 "can_delete": true
1236 }
1237 ]
1238----
1239
Edwin Kempin196e1732013-05-09 15:12:34 +02001240[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001241=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001242--
Edwin Kempin196e1732013-05-09 15:12:34 +02001243'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001244--
Edwin Kempin196e1732013-05-09 15:12:34 +02001245
1246Retrieves a branch of a project.
1247
1248.Request
1249----
1250 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
1251----
1252
1253As response a link:#branch-info[BranchInfo] entity is returned that
1254describes the branch.
1255
1256.Response
1257----
1258 HTTP/1.1 200 OK
1259 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001260 Content-Type: application/json; charset=UTF-8
Edwin Kempin196e1732013-05-09 15:12:34 +02001261
1262 )]}'
1263 {
1264 "ref": "refs/heads/master",
1265 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1266 }
1267----
1268
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001269[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001270=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001271--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001272'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001273--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001274
1275Creates a new branch.
1276
1277In the request body additional data for the branch can be provided as
1278link:#branch-input[BranchInput].
1279
1280.Request
1281----
1282 PUT /projects/MyProject/branches/stable HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001283 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001284
1285 {
1286 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1287 }
1288----
1289
1290As response a link:#branch-info[BranchInfo] entity is returned that
1291describes the created branch.
1292
1293.Response
1294----
1295 HTTP/1.1 201 Created
1296 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001297 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001298
1299 )]}'
1300 {
1301 "ref": "refs/heads/stable",
1302 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
1303 "can_delete": true
1304 }
1305----
1306
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001307[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001308=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001309--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001310'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001311--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001312
1313Deletes a branch.
1314
1315.Request
1316----
1317 DELETE /projects/MyProject/branches/stable HTTP/1.0
1318----
1319
1320.Response
1321----
1322 HTTP/1.1 204 No Content
1323----
1324
Hugo Arèsef8e3202015-01-12 15:09:06 -05001325[[delete-branches]]
1326=== Delete Branches
1327--
1328'POST /projects/link:#project-name[\{project-name\}]/branches:delete'
1329--
1330
1331Delete one or more branches.
1332
1333The branches to be deleted must be provided in the request body as a
1334link:#delete-branches-input[DeleteBranchesInput] entity.
1335
1336.Request
1337----
1338 POST /projects/MyProject/branches:delete HTTP/1.0
1339 Content-Type: application/json;charset=UTF-8
1340
1341 {
1342 "branches": [
1343 "stable-1.0",
1344 "stable-2.0"
1345 ]
1346 }
1347----
1348
1349.Response
1350----
1351 HTTP/1.1 204 No Content
1352----
1353
1354If some branches could not be deleted, the response is "`409 Conflict`" and the
1355error message is contained in the response body.
1356
Edwin Kempind31e5582013-11-30 12:07:08 +01001357[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001358=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001359--
1360'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1361--
1362
1363Gets the content of a file from the HEAD revision of a certain branch.
1364
1365.Request
1366----
1367 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1368----
1369
1370The content is returned as base64 encoded string.
1371
1372.Response
1373----
1374 HTTP/1.1 200 OK
1375 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001376 Content-Type: text/plain; charset=UTF-8
Edwin Kempind31e5582013-11-30 12:07:08 +01001377
1378 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1379----
1380
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001381
1382[[get-mergeable-info]]
1383=== Get Mergeable Information
1384--
1385'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/mergeable'
1386--
1387
1388Gets whether the source is mergeable with the target branch.
1389
Zhen Chen8f00d552016-07-26 16:54:59 -07001390The `source` query parameter is required, which can be anything that could be
1391resolved to a commit, see examples of the `source` attribute in
1392link:rest-api-changes.html#merge-input[MergeInput].
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001393
1394Also takes an optional parameter `strategy`, which can be `recursive`, `resolve`,
1395`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
1396
1397.Request
1398----
1399 GET /projects/test/branches/master/mergeable?source=testbranch&strategy=recursive HTTP/1.0
1400----
1401
Zhen Chen8f00d552016-07-26 16:54:59 -07001402As response a link:rest-api-changes.html#mergeable-info[MergeableInfo] entity is returned.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001403
1404.Response
1405----
1406 HTTP/1.1 200 OK
1407 Content-Disposition: attachment
1408 Content-Type: application/json; charset=UTF-8
1409
1410 )]}'
1411 {
Zhen Chen8f00d552016-07-26 16:54:59 -07001412 "submit_type": "MERGE_IF_NECESSARY",
1413 "strategy": "recursive",
1414 "mergeable": true,
1415 "commit_merged": false,
1416 "content_merged": false
1417 }
1418----
1419
1420or when there were conflicts.
1421
1422.Response
1423----
1424 HTTP/1.1 200 OK
1425 Content-Disposition: attachment
1426 Content-Type: application/json; charset=UTF-8
1427
1428 )]}'
1429 {
1430 "submit_type": "MERGE_IF_NECESSARY",
1431 "strategy": "recursive",
1432 "mergeable": false,
1433 "conflicts": [
1434 "common.txt",
1435 "shared.txt"
1436 ]
1437 }
1438----
1439
1440or when the 'testbranch' has been already merged.
1441
1442.Response
1443----
1444 HTTP/1.1 200 OK
1445 Content-Disposition: attachment
1446 Content-Type: application/json; charset=UTF-8
1447
1448 )]}'
1449 {
1450 "submit_type": "MERGE_IF_NECESSARY",
1451 "strategy": "recursive",
1452 "mergeable": true,
1453 "commit_merged": true,
1454 "content_merged": true
1455 }
1456----
1457
1458or when only the content of 'testbranch' has been merged.
1459
1460.Response
1461----
1462 HTTP/1.1 200 OK
1463 Content-Disposition: attachment
1464 Content-Type: application/json; charset=UTF-8
1465
1466 )]}'
1467 {
1468 "submit_type": "MERGE_IF_NECESSARY",
1469 "strategy": "recursive",
1470 "mergeable": true,
1471 "commit_merged": false,
1472 "content_merged": true
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001473 }
1474----
1475
Edwin Kempin87504d92014-07-04 12:59:19 +02001476[[get-reflog]]
1477=== Get Reflog
1478--
1479'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
1480--
1481
1482Gets the reflog of a certain branch.
1483
1484The caller must be project owner.
1485
1486.Request
1487----
1488 GET /projects/gerrit/branches/master/reflog HTTP/1.0
1489----
1490
1491As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
1492is returned that describe the reflog entries. The reflog entries are
1493returned in reverse order.
1494
1495.Response
1496----
1497 HTTP/1.1 200 OK
1498 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001499 Content-Type: application/json; charset=UTF-8
Edwin Kempin87504d92014-07-04 12:59:19 +02001500
1501 )]}'
1502 [
1503 {
1504 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1505 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
1506 "who": {
1507 "name": "Jane Roe",
1508 "email": "jane.roe@example.com",
1509 "date": "2014-06-30 11:53:43.000000000",
1510 "tz": 120
1511 },
1512 "comment": "merged: fast forward"
1513 },
1514 {
1515 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1516 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1517 "who": {
1518 "name": "John Doe",
1519 "email": "john.doe@example.com",
1520 "date": "2013-10-02 10:45:26.000000000",
1521 "tz": 120
1522 },
1523 "comment": "merged: fast forward"
1524 },
1525 {
1526 "old_id": "0000000000000000000000000000000000000000",
1527 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1528 "who": {
1529 "name": "John Doe",
1530 "email": "john.doe@example.com",
1531 "date": "2013-09-30 19:08:44.000000000",
1532 "tz": 120
1533 },
1534 "comment": ""
1535 }
1536 ]
1537----
1538
1539The get reflog endpoint also accepts a limit integer in the `n`
1540parameter. This limits the results to show the last `n` reflog entries.
1541
1542Query the last 25 reflog entries.
1543----
1544 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
1545----
1546
Edwin Kempin2a581fd2014-07-04 14:04:54 +02001547The reflog can also be filtered by timestamp by specifying the `from`
1548and `to` parameters. The timestamp for `from` and `to` must be given as
1549UTC in the following format: `yyyyMMdd_HHmm`.
1550
1551----
1552 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
1553----
1554
Edwin Kempin4425c742013-03-18 13:23:00 +01001555[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001556== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01001557
1558[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001559=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001560--
Edwin Kempin4425c742013-03-18 13:23:00 +01001561'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001562--
Edwin Kempin4425c742013-03-18 13:23:00 +01001563
1564List the direct child projects of a project.
1565
1566.Request
1567----
1568 GET /projects/Public-Plugins/children/ HTTP/1.0
1569----
1570
1571As result a list of link:#project-info[ProjectInfo] entries is
1572returned that describe the child projects.
1573
1574.Response
1575----
1576 HTTP/1.1 200 OK
1577 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001578 Content-Type: application/json; charset=UTF-8
Edwin Kempin4425c742013-03-18 13:23:00 +01001579
1580 )]}'
1581 [
1582 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001583 "id": "plugins%2Freplication",
1584 "name": "plugins/replication",
1585 "parent": "Public-Plugins",
1586 "description": "Copies to other servers using the Git protocol"
1587 },
1588 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001589 "id": "plugins%2Freviewnotes",
1590 "name": "plugins/reviewnotes",
1591 "parent": "Public-Plugins",
1592 "description": "Annotates merged commits using notes on refs/notes/review."
1593 },
1594 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001595 "id": "plugins%2Fsingleusergroup",
1596 "name": "plugins/singleusergroup",
1597 "parent": "Public-Plugins",
1598 "description": "GroupBackend enabling users to be directly added to access rules"
1599 }
1600 ]
1601----
1602
Edwin Kempinf95bd172013-03-19 11:10:57 +01001603To resolve the child projects of a project recursively the parameter
1604`recursive` can be set.
1605
1606Child projects that are not visible to the calling user are ignored and
1607are not resolved further.
1608
1609.Request
1610----
1611 GET /projects/Public-Projects/children/?recursive HTTP/1.0
1612----
1613
1614.Response
1615----
1616 HTTP/1.1 200 OK
1617 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001618 Content-Type: application/json; charset=UTF-8
Edwin Kempinf95bd172013-03-19 11:10:57 +01001619
1620 )]}'
1621 [
1622 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001623 "id": "gerrit",
1624 "name": "gerrit",
1625 "parent": "Public-Projects",
1626 "description": "Gerrit Code Review"
1627 },
1628 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001629 "id": "plugins%2Freplication",
1630 "name": "plugins/replication",
1631 "parent": "Public-Plugins",
1632 "description": "Copies to other servers using the Git protocol"
1633 },
1634 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001635 "id": "plugins%2Freviewnotes",
1636 "name": "plugins/reviewnotes",
1637 "parent": "Public-Plugins",
1638 "description": "Annotates merged commits using notes on refs/notes/review."
1639 },
1640 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001641 "id": "plugins%2Fsingleusergroup",
1642 "name": "plugins/singleusergroup",
1643 "parent": "Public-Plugins",
1644 "description": "GroupBackend enabling users to be directly added to access rules"
1645 },
1646 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001647 "id": "Public-Plugins",
1648 "name": "Public-Plugins",
1649 "parent": "Public-Projects",
1650 "description": "Parent project for plugins/*"
1651 }
1652 ]
1653----
1654
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001655[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001656=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001657--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001658'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001659--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001660
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01001661Retrieves a child project. If a non-direct child project should be
1662retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001663
1664.Request
1665----
1666 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
1667----
1668
1669As response a link:#project-info[ProjectInfo] entity is returned that
1670describes the child project.
1671
1672.Response
1673----
1674 HTTP/1.1 200 OK
1675 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001676 Content-Type: application/json; charset=UTF-8
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001677
1678 )]}'
1679 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001680 "id": "plugins%2Freplication",
1681 "name": "plugins/replication",
1682 "parent": "Public-Plugins",
1683 "description": "Copies to other servers using the Git protocol"
1684 }
1685----
1686
David Pursehouse8cc68902014-10-06 18:17:16 +09001687[[tag-endpoints]]
1688== Tag Endpoints
1689
David Pursehouse6a446192016-06-03 10:00:34 +09001690[[create-tag]]
1691=== Create Tag
1692
1693--
1694'PUT /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
1695--
1696
1697Create a new tag on the project.
1698
1699In the request body additional data for the tag can be provided as
1700link:#tag-input[TagInput].
1701
1702If a message is provided in the input, the tag is created as an
1703annotated tag with the current user as tagger. Signed tags are not
1704supported.
1705
1706.Request
1707----
1708 PUT /projects/MyProject/tags/v1.0 HTTP/1.0
1709 Content-Type: application/json; charset=UTF-8
1710
1711 {
1712 "message": "annotation",
1713 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
1714 }
1715----
1716
1717As response a link:#tag-info[TagInfo] entity is returned that describes
1718the created tag.
1719
1720.Response
1721----
1722 HTTP/1.1 201 Created
1723 Content-Disposition: attachment
1724 Content-Type: application/json; charset=UTF-8
1725
1726 )]}'
1727
1728 "object": "d48d304adc4b6674e11dc2c018ea05fcbdda32fd",
1729 "message": "annotation",
1730 "tagger": {
1731 "name": "David Pursehouse",
1732 "email": "dpursehouse@collab.net",
1733 "date": "2016-06-06 01:22:03.000000000",
1734 "tz": 540
1735 },
1736 "ref": "refs/tags/v1.0",
1737 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
1738 }
1739----
1740
David Pursehouse8cc68902014-10-06 18:17:16 +09001741[[list-tags]]
1742=== List Tags
1743--
1744'GET /projects/link:#project-name[\{project-name\}]/tags/'
1745--
1746
1747List the tags of a project.
1748
1749As result a list of link:#tag-info[TagInfo] entries is returned.
1750
1751Only includes tags under the `refs/tags/` namespace.
1752
1753.Request
1754----
1755 GET /projects/work%2Fmy-project/tags/ HTTP/1.0
1756----
1757
1758.Response
1759----
1760 HTTP/1.1 200 OK
1761 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001762 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09001763
1764 )]}'
1765 [
1766 {
1767 "ref": "refs/tags/v1.0",
1768 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1769 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1770 "message": "Annotated tag",
1771 "tagger": {
1772 "name": "David Pursehouse",
1773 "email": "david.pursehouse@sonymobile.com",
1774 "date": "2014-10-06 07:35:03.000000000",
1775 "tz": 540
1776 }
1777 },
1778 {
1779 "ref": "refs/tags/v2.0",
1780 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1781 },
1782 {
1783 "ref": "refs/tags/v3.0",
1784 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
1785 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1786 "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-----",
1787 "tagger": {
1788 "name": "David Pursehouse",
1789 "email": "david.pursehouse@sonymobile.com",
1790 "date": "2014-10-06 09:02:16.000000000",
1791 "tz": 540
1792 }
1793 }
1794 ]
1795----
1796
David Pursehouseb0ba1512015-09-10 14:17:05 +09001797[[tag-options]]
1798==== Tag Options
1799
1800Limit(n)::
1801Limit the number of tags to be included in the results.
1802+
1803.Request
1804----
1805 GET /projects/work%2Fmy-project/tags?n=2 HTTP/1.0
1806----
1807+
1808.Response
1809----
1810 HTTP/1.1 200 OK
1811 Content-Disposition: attachment
1812 Content-Type: application/json; charset=UTF-8
1813
1814 )]}'
1815 [
1816 {
1817 "ref": "refs/tags/v1.0",
1818 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1819 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1820 "message": "Annotated tag",
1821 "tagger": {
1822 "name": "David Pursehouse",
1823 "email": "david.pursehouse@sonymobile.com",
1824 "date": "2014-10-06 07:35:03.000000000",
1825 "tz": 540
1826 }
1827 },
1828 {
1829 "ref": "refs/tags/v2.0",
1830 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1831 }
1832 ]
1833----
1834
1835Skip(s)::
1836Skip the given number of tags from the beginning of the list.
1837+
1838.Request
1839----
1840 GET /projects/work%2Fmy-project/tags?n=2&s=1 HTTP/1.0
1841----
1842+
1843.Response
1844----
1845 HTTP/1.1 200 OK
1846 Content-Disposition: attachment
1847 Content-Type: application/json; charset=UTF-8
1848
1849 )]}'
1850 [
1851 {
1852 "ref": "refs/tags/v2.0",
1853 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1854 },
1855 {
1856 "ref": "refs/tags/v3.0",
1857 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
1858 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1859 "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-----",
1860 "tagger": {
1861 "name": "David Pursehouse",
1862 "email": "david.pursehouse@sonymobile.com",
1863 "date": "2014-10-06 09:02:16.000000000",
1864 "tz": 540
1865 }
1866 }
1867 ]
1868----
1869
1870
David Pursehouse8cc68902014-10-06 18:17:16 +09001871[[get-tag]]
1872=== Get Tag
1873--
1874'GET /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
1875--
1876
1877Retrieves a tag of a project.
1878
1879.Request
1880----
1881 GET /projects/work%2Fmy-project/tags/v1.0 HTTP/1.0
1882----
1883
1884As response a link:#tag-info[TagInfo] entity is returned that describes the tag.
1885
1886.Response
1887----
1888 HTTP/1.1 200 OK
1889 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001890 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09001891
1892 )]}'
1893 {
1894 "ref": "refs/tags/v1.0",
1895 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1896 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1897 "message": "Annotated tag",
1898 "tagger": {
1899 "name": "David Pursehouse",
1900 "email": "david.pursehouse@sonymobile.com",
1901 "date": "2014-10-06 07:35:03.000000000",
1902 "tz": 540
1903 }
1904 }
1905----
1906
David Pursehousee1132162016-11-30 20:42:33 +09001907[[delete-tag]]
1908=== Delete Tag
1909--
1910'DELETE /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
1911--
1912
1913Deletes a tag.
1914
1915.Request
1916----
1917 DELETE /projects/MyProject/tags/v1.0 HTTP/1.0
1918----
1919
1920.Response
1921----
1922 HTTP/1.1 204 No Content
1923----
David Pursehouse8cc68902014-10-06 18:17:16 +09001924
David Pursehouse467aecb2016-12-02 14:18:42 +09001925[[delete-tags]]
1926=== Delete Tags
1927--
1928'POST /projects/link:#project-name[\{project-name\}]/tags:delete'
1929--
1930
1931Delete one or more tags.
1932
1933The tags to be deleted must be provided in the request body as a
1934link:#delete-tags-input[DeleteTagsInput] entity.
1935
1936.Request
1937----
1938 POST /projects/MyProject/tags:delete HTTP/1.0
1939 Content-Type: application/json;charset=UTF-8
1940
1941 {
1942 "tags": [
1943 "v1.0",
1944 "v2.0"
1945 ]
1946 }
1947----
1948
1949.Response
1950----
1951 HTTP/1.1 204 No Content
1952----
1953
1954If some tags could not be deleted, the response is "`409 Conflict`" and the
1955error message is contained in the response body.
1956
Edwin Kempin1b993602014-07-08 16:18:45 +02001957[[commit-endpoints]]
1958== Commit Endpoints
1959
1960[[get-commit]]
1961=== Get Commit
1962--
1963'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
1964--
1965
1966Retrieves a commit of a project.
1967
1968The commit must be visible to the caller.
1969
1970.Request
1971----
1972 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
1973----
1974
1975As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
1976is returned that describes the commit.
1977
1978.Response
1979----
1980 HTTP/1.1 200 OK
1981 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001982 Content-Type: application/json; charset=UTF-8
Edwin Kempin1b993602014-07-08 16:18:45 +02001983
1984 )]}'
1985 {
1986 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
1987 "parents": [
1988 {
1989 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
1990 "subject": "Migrate contributor agreements to All-Projects."
1991 }
1992 ],
1993 "author": {
1994 "name": "Shawn O. Pearce",
1995 "email": "sop@google.com",
1996 "date": "2012-04-24 18:08:08.000000000",
1997 "tz": -420
1998 },
1999 "committer": {
2000 "name": "Shawn O. Pearce",
2001 "email": "sop@google.com",
2002 "date": "2012-04-24 18:08:08.000000000",
2003 "tz": -420
2004 },
2005 "subject": "Use an EventBus to manage star icons",
2006 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2007 }
2008----
2009
Gustaf Lundh1386d592016-10-19 23:19:08 +02002010[[get-included-in]]
2011=== Get Included In
2012--
2013'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/in'
2014--
2015
2016Retrieves the branches and tags in which a change is included. As result
2017an link:rest-api-changes.html#included-in-info[IncludedInInfo] entity is returned.
2018
2019.Request
2020----
2021 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/in HTTP/1.0
2022----
2023
2024.Response
2025----
2026 HTTP/1.1 200 OK
2027 Content-Disposition: attachment
2028 Content-Type: application/json;charset=UTF-8
2029
2030 )]}'
2031 {
2032 "branches": [
2033 "master"
2034 ],
2035 "tags": []
2036 }
2037----
2038
Zhen Chend1462d82016-05-12 13:55:37 -07002039[[get-content-from-commit]]
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002040=== Get Content
2041--
2042'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
2043--
2044
2045Gets the content of a file from a certain commit.
2046
2047.Request
2048----
2049 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
2050----
2051
2052The content is returned as base64 encoded string.
2053
2054.Response
2055----
2056 HTTP/1.1 200 OK
2057 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002058 Content-Type: text/plain; charset=UTF-8
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002059
2060 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
2061----
2062
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002063[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002064== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002065
Edwin Kempin76202742013-02-15 13:51:50 +01002066[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002067=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002068--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002069'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002070--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002071
Edwin Kempind0a63922013-01-23 16:32:59 +01002072List custom dashboards for a project.
2073
Edwin Kempin55367622013-02-05 09:09:23 +01002074As result a list of link:#dashboard-info[DashboardInfo] entries is
2075returned.
2076
Edwin Kempind0a63922013-01-23 16:32:59 +01002077List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01002078
2079.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002080----
2081 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002082----
Edwin Kempind0a63922013-01-23 16:32:59 +01002083
Edwin Kempin37440832013-02-06 11:36:00 +01002084.Response
2085----
Edwin Kempind0a63922013-01-23 16:32:59 +01002086 HTTP/1.1 200 OK
2087 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002088 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002089
2090 )]}'
2091 [
2092 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002093 "id": "main:closed",
2094 "ref": "main",
2095 "path": "closed",
2096 "description": "Merged and abandoned changes in last 7 weeks",
2097 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
2098 "default": true,
2099 "title": "Closed changes",
2100 "sections": [
2101 {
2102 "name": "Merged",
2103 "query": "status:merged age:7w"
2104 },
2105 {
2106 "name": "Abandoned",
2107 "query": "status:abandoned age:7w"
2108 }
2109 ]
2110 }
2111 ]
2112----
2113
Edwin Kempina64c4b92013-01-23 11:30:40 +01002114.Get all dashboards of the 'All-Projects' project
2115****
2116get::/projects/All-Projects/dashboards/
2117****
2118
Edwin Kempin67e923c2013-02-14 13:57:12 +01002119[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002120=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002121--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002122'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002123--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002124
Edwin Kempin67e923c2013-02-14 13:57:12 +01002125Retrieves a project dashboard. The dashboard can be defined on that
2126project or be inherited from a parent project.
2127
2128.Request
2129----
2130 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
2131----
2132
2133As response a link:#dashboard-info[DashboardInfo] entity is returned
2134that describes the dashboard.
2135
2136.Response
2137----
2138 HTTP/1.1 200 OK
2139 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002140 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002141
2142 )]}'
2143 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002144 "id": "main:closed",
2145 "ref": "main",
2146 "path": "closed",
2147 "description": "Merged and abandoned changes in last 7 weeks",
2148 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
2149 "default": true,
2150 "title": "Closed changes",
2151 "sections": [
2152 {
2153 "name": "Merged",
2154 "query": "status:merged age:7w"
2155 },
2156 {
2157 "name": "Abandoned",
2158 "query": "status:abandoned age:7w"
2159 }
2160 ]
2161 }
2162----
2163
2164To retrieve the default dashboard of a project use `default` as
2165dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01002166
2167.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002168----
2169 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002170----
Edwin Kempind0a63922013-01-23 16:32:59 +01002171
Edwin Kempin37440832013-02-06 11:36:00 +01002172.Response
2173----
Edwin Kempind0a63922013-01-23 16:32:59 +01002174 HTTP/1.1 200 OK
2175 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002176 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002177
2178 )]}'
2179 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002180 "id": "main:closed",
2181 "ref": "main",
2182 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01002183 "description": "Merged and abandoned changes in last 7 weeks",
2184 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
Edwin Kempind0a63922013-01-23 16:32:59 +01002185 "default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002186 "title": "Closed changes",
2187 "sections": [
2188 {
2189 "name": "Merged",
2190 "query": "status:merged age:7w"
2191 },
2192 {
2193 "name": "Abandoned",
2194 "query": "status:abandoned age:7w"
2195 }
2196 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01002197 }
2198----
2199
Edwin Kempin67e923c2013-02-14 13:57:12 +01002200[[set-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002201=== Set Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002202--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002203'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002204--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002205
Edwin Kempin67e923c2013-02-14 13:57:12 +01002206Updates/Creates a project dashboard.
2207
2208Currently only supported for the `default` dashboard.
2209
2210The creation/update information for the dashboard must be provided in
2211the request body as a link:#dashboard-input[DashboardInput] entity.
2212
2213.Request
2214----
2215 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002216 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002217
2218 {
2219 "id": "main:closed",
2220 "commit_message": "Define the default dashboard"
2221 }
2222----
2223
2224As response the new/updated dashboard is returned as a
2225link:#dashboard-info[DashboardInfo] entity.
2226
2227.Response
2228----
2229 HTTP/1.1 200 OK
2230 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002231 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002232
2233 )]}'
2234 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002235 "id": "main:closed",
2236 "ref": "main",
2237 "path": "closed",
2238 "description": "Merged and abandoned changes in last 7 weeks",
2239 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
2240 "default": true,
2241 "title": "Closed changes",
2242 "sections": [
2243 {
2244 "name": "Merged",
2245 "query": "status:merged age:7w"
2246 },
2247 {
2248 "name": "Abandoned",
2249 "query": "status:abandoned age:7w"
2250 }
2251 ]
2252 }
2253----
2254
2255[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002256=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002257--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002258'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002259--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002260
Edwin Kempin67e923c2013-02-14 13:57:12 +01002261Deletes a project dashboard.
2262
2263Currently only supported for the `default` dashboard.
2264
Edwin Kempinefec4492013-02-22 10:09:23 +01002265The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05002266DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002267
2268Please note that some proxies prohibit request bodies for DELETE
2269requests.
2270
2271.Request
2272----
2273 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
2274----
2275
2276.Response
2277----
2278 HTTP/1.1 204 No Content
2279----
2280
Edwin Kempin34d83352013-02-06 10:40:17 +01002281
2282[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002283== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01002284
Edwin Kempin196e1732013-05-09 15:12:34 +02002285[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002286=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02002287The name of a branch or `HEAD`. The prefix `refs/heads/` can be
2288omitted.
2289
Edwin Kempin1b993602014-07-08 16:18:45 +02002290[[commit-id]]
2291=== \{commit-id\}
2292Commit ID.
2293
David Pursehouse8cc68902014-10-06 18:17:16 +09002294[[tag-id]]
2295=== \{tag-id\}
2296The name of a tag. The prefix `refs/tags/` can be omitted.
2297
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002298[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002299=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01002300The ID of a dashboard in the format '<ref>:<path>'.
2301
2302A special dashboard ID is `default` which represents the default
2303dashboard of a project.
2304
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002305[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002306=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01002307The name of the project.
2308
Edwin Kempina9e94ab2015-03-06 10:35:39 +01002309If the name ends with `.git`, the suffix will be automatically removed.
2310
Edwin Kempin34d83352013-02-06 10:40:17 +01002311
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002312[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002313== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002314
Edwin Kempin62946742014-07-09 11:17:58 +02002315[[ban-input]]
2316=== BanInput
2317The `BanInput` entity contains information for banning commits in a
2318project.
2319
David Pursehouseae367192014-11-25 17:24:47 +09002320[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02002321|=======================
2322|Field Name||Description
2323|`commits` ||List of commits to be banned.
2324|`reason` |optional|Reason for banning the commits.
2325|=======================
2326
2327[[ban-result-info]]
2328=== BanResultInfo
2329The `BanResultInfo` entity describes the result of banning commits.
2330
David Pursehouseae367192014-11-25 17:24:47 +09002331[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02002332|=============================
2333|Field Name ||Description
2334|`newly_banned` |optional|List of newly banned commits.
2335|`already_banned`|optional|List of commits that were already banned.
2336|`ignored` |optional|List of object IDs that were ignored.
2337|=============================
2338
Edwin Kempin521c1242015-01-23 12:44:44 +01002339[[branch-info]]
2340=== BranchInfo
2341The `BranchInfo` entity contains information about a branch.
2342
2343[options="header",cols="1,^2,4"]
2344|=========================
2345|Field Name ||Description
2346|`ref` ||The ref of the branch.
2347|`revision` ||The revision to which the branch points.
2348|`can_delete`|`false` if not set|
2349Whether the calling user can delete this branch.
2350|`web_links` |optional|
2351Links to the branch in external sites as a list of
2352link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
2353|=========================
2354
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002355[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002356=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002357The `BranchInput` entity contains information for the creation of
2358a new branch.
2359
David Pursehouseae367192014-11-25 17:24:47 +09002360[options="header",cols="1,^2,4"]
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002361|=======================
2362|Field Name||Description
2363|`ref` |optional|
2364The name of the branch. The prefix `refs/heads/` can be
2365omitted. +
2366If set, must match the branch ID in the URL.
2367|`revision`|optional|
2368The base revision of the new branch. +
2369If not set, `HEAD` will be used as base revision.
2370|=======================
2371
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002372[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002373=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002374The `ConfigInfo` entity contains information about the effective project
2375configuration.
2376
David Pursehouseae367192014-11-25 17:24:47 +09002377[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02002378|=======================================================
2379|Field Name ||Description
2380|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002381The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002382|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002383link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2384authors must complete a contributor agreement on the site before
2385pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002386|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002387link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2388Gerrit will try to perform a 3-way merge of text file content when a
2389file has been modified by both the destination branch and the change
2390being submitted. This option only takes effect if submit type is not
2391FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002392|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002393link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2394each change must contain a Signed-off-by line from either the author or
2395the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002396|`create_new_change_for_all_not_in_target` |optional|
2397link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2398a new change is created for every commit not in target branch.
2399|`require_change_id` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002400link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
2401valid link:user-changeid.html[Change-Id] footer in any commit uploaded
2402for review is required. This does not apply to commits pushed directly
2403to a branch or tag.
Doug Claar1b0f76252016-03-23 13:34:55 -07002404|`enable_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz5170e0f2015-06-18 21:05:29 -04002405link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2406signed push validation is enabled on the project.
Doug Claar1b0f76252016-03-23 13:34:55 -07002407|`require_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz0543c732015-10-20 10:35:26 -04002408link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2409signed push validation is required on the project.
Saša Živkov225b7a72015-11-17 17:37:43 +01002410|`reject_implicit_merges`|optional|
2411link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2412implicit merges should be rejected on changes pushed to the project.
Edwin Kempin3c99f592013-07-15 10:12:27 +02002413|`max_object_size_limit` ||
2414The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2415limit] of this project as a link:#max-object-size-limit-info[
2416MaxObjectSizeLimitInfo] entity.
2417|`submit_type` ||
2418The default submit type of the project, can be `MERGE_IF_NECESSARY`,
2419`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
2420`CHERRY_PICK`.
2421|`state` |optional|
2422The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
2423Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02002424|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02002425Map with the comment link configurations of the project. The name of
2426the comment link configuration is mapped to the comment link
2427configuration, which has the same format as the
2428link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[
2429commentlink section] of `gerrit.config`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002430|`theme` |optional|
Edwin Kempin272402e2013-07-15 11:17:36 +02002431The theme that is configured for the project as a link:#theme-info[
2432ThemeInfo] entity.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002433|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002434Plugin configuration as map which maps the plugin name to a map of
2435parameter names to link:#config-parameter-info[ConfigParameterInfo]
2436entities.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002437|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02002438Actions the caller might be able to perform on this project. The
2439information is a map of view names to
2440link:rest-api-changes.html#action-info[ActionInfo] entities.
David Pursehouse510b87d2014-11-25 16:46:28 +09002441|=======================================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002442
Edwin Kempina23eb102013-07-17 09:10:54 +02002443[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002444=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02002445The `ConfigInput` entity describes a new project configuration.
2446
David Pursehouseae367192014-11-25 17:24:47 +09002447[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02002448|======================================================
2449|Field Name ||Description
2450|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002451The new description of the project. +
2452If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002453|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002454Whether authors must complete a contributor agreement on the site
2455before pushing any commits or changes to this project. +
2456Can be `TRUE`, `FALSE` or `INHERIT`. +
2457If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002458|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002459Whether Gerrit will try to perform a 3-way merge of text file content
2460when a file has been modified by both the destination branch and the
2461change being submitted. This option only takes effect if submit type is
2462not FAST_FORWARD_ONLY. +
2463Can be `TRUE`, `FALSE` or `INHERIT`. +
2464If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002465|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002466Whether each change must contain a Signed-off-by line from either the
2467author or the uploader in the commit message. +
2468Can be `TRUE`, `FALSE` or `INHERIT`. +
2469If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002470|`create_new_change_for_all_not_in_target` |optional|
2471Whether a new change will be created for every commit not in target
2472branch. +
2473Can be `TRUE`, `FALSE` or `INHERIT`. +
2474If not set, this setting is not updated.
2475|`require_change_id` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002476Whether a valid link:user-changeid.html[Change-Id] footer in any commit
2477uploaded for review is required. This does not apply to commits pushed
2478directly to a branch or tag. +
2479Can be `TRUE`, `FALSE` or `INHERIT`. +
2480If not set, this setting is not updated.
Saša Živkov225b7a72015-11-17 17:37:43 +01002481|`reject_implicit_merges` |optional|
2482Whether a check for implicit merges will be performed when changes
2483are pushed for review. +
2484Can be `TRUE`, `FALSE` or `INHERIT`. +
2485If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002486|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002487The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2488limit] of this project as a link:#max-object-size-limit-info[
2489MaxObjectSizeLimitInfo] entity. +
2490If set to `0`, the max object size limit is removed. +
2491If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002492|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002493The default submit type of the project, can be `MERGE_IF_NECESSARY`,
2494`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
2495`CHERRY_PICK`. +
2496If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002497|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002498The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
2499Not set if the project state is `ACTIVE`. +
2500If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002501|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002502Plugin configuration values as map which maps the plugin name to a map
2503of parameter names to values.
David Pursehouse510b87d2014-11-25 16:46:28 +09002504|======================================================
Edwin Kempina23eb102013-07-17 09:10:54 +02002505
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002506[[config-parameter-info]]
David Pursehouseb10c2662016-12-06 08:41:33 +09002507=== ConfigParameterInfo
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002508The `ConfigParameterInfo` entity describes a project configuration
2509parameter.
2510
David Pursehouseae367192014-11-25 17:24:47 +09002511[options="header",cols="1,^2,4"]
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002512|===============================
2513|Field Name ||Description
2514|`display_name` |optional|
2515The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01002516|`description` |optional|
2517The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01002518|`warning` |optional|
2519Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002520|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002521The type of the configuration parameter. Can be `STRING`, `INT`,
2522`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002523|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01002524The value of the configuration parameter as string. If the parameter
2525is inheritable this is the effective value which is deduced from
2526`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002527|`values` |optional|
2528The list of values. Only set if the `type` is `ARRAY`.
Doug Claar1b0f76252016-03-23 13:34:55 -07002529|`editable` |`false` if not set|
Edwin Kempin0d485232013-11-17 18:55:48 +01002530Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01002531|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002532The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01002533|`inheritable` |`false` if not set|
2534Whether the configuration parameter can be inherited.
2535|`configured_value`|optional|
2536The value of the configuration parameter that is configured on this
2537project, only set if `inheritable` is true.
2538|`inherited_value` |optional|
2539The inherited value of the configuration parameter, only set if
2540`inheritable` is true.
2541|`permitted_values` |optional|
2542The list of permitted values, only set if the `type` is `LIST`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002543|===============================
2544
Edwin Kempin55367622013-02-05 09:09:23 +01002545[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002546=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002547The `DashboardInfo` entity contains information about a project
2548dashboard.
2549
David Pursehouseae367192014-11-25 17:24:47 +09002550[options="header",cols="1,^2,4"]
Edwin Kempin55367622013-02-05 09:09:23 +01002551|===============================
2552|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01002553|`id` ||
2554The ID of the dashboard. The ID has the format '<ref>:<path>',
2555where ref and path are URL encoded.
2556|`project` ||
2557The name of the project for which this dashboard is returned.
2558|`defining_project`||
2559The name of the project in which this dashboard is defined.
2560This is different from `project` if the dashboard is inherited from a
2561parent project.
2562|`ref` ||
2563The name of the ref in which the dashboard is defined, without the
2564`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
2565|`path` ||
2566The path of the file in which the dashboard is defined.
2567|`description` |optional|The description of the dashboard.
2568|`foreach` |optional|
2569Subquery that applies to all sections in the dashboard. +
2570Tokens such as `${project}` are not resolved.
2571|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09002572The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01002573The URL is relative to the canonical web URL. +
2574Tokens in the queries such as `${project}` are resolved.
2575|`default` |not set if `false`|
2576Whether this is the default dashboard of the project.
2577|`title` |optional|The title of the dashboard.
2578|`sections` ||
2579The list of link:#dashboard-section-info[sections] in the dashboard.
2580|===============================
2581
Edwin Kempin67e923c2013-02-14 13:57:12 +01002582[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002583=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01002584The `DashboardInput` entity contains information to create/update a
2585project dashboard.
2586
David Pursehouseae367192014-11-25 17:24:47 +09002587[options="header",cols="1,^2,4"]
Edwin Kempin67e923c2013-02-14 13:57:12 +01002588|=============================
2589|Field Name ||Description
2590|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01002591URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002592|`commit_message`|optional|
2593Message that should be used to commit the change of the dashboard.
2594|=============================
2595
Edwin Kempin55367622013-02-05 09:09:23 +01002596[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002597=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002598The `DashboardSectionInfo` entity contains information about a section
2599in a dashboard.
2600
David Pursehouseae367192014-11-25 17:24:47 +09002601[options="header",cols="1,6"]
Edwin Kempin55367622013-02-05 09:09:23 +01002602|===========================
2603|Field Name |Description
2604|`name` |The title of the section.
2605|`query` |The query of the section. +
2606Tokens such as `${project}` are not resolved.
2607|===========================
2608
Hugo Arèsef8e3202015-01-12 15:09:06 -05002609[[delete-branches-input]]
2610=== DeleteBranchesInput
2611The `DeleteBranchesInput` entity contains information about branches that should
2612be deleted.
2613
2614[options="header",width="50%",cols="1,6"]
2615|==========================
2616|Field Name |Description
2617|`branches` |A list of branch names that identify the branches that should be
2618deleted.
2619|==========================
2620
David Pursehouse467aecb2016-12-02 14:18:42 +09002621[[delete-tags-input]]
2622=== DeleteTagsInput
2623The `DeleteTagsInput` entity contains information about tags that should
2624be deleted.
2625
2626[options="header",width="50%",cols="1,6"]
2627|==========================
2628|Field Name |Description
2629|`tags` |A list of tag names that identify the tags that should be
2630deleted.
2631|==========================
2632
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002633[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002634=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002635The `GCInput` entity contains information to run the Git garbage
2636collection.
2637
David Pursehouseae367192014-11-25 17:24:47 +09002638[options="header",cols="1,^2,4"]
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002639|=============================
2640|Field Name ||Description
2641|`show_progress` |`false` if not set|
2642Whether progress information should be shown.
Christian Halstrick2f94e2e2015-03-11 15:13:31 +01002643|`aggressive` |`false` if not set|
2644Whether an aggressive garbage collection should be done.
Adrian Görler92410a12015-11-03 16:20:56 +01002645|`async` |`false` if not set|
2646Whether the garbage collection should run asynchronously.
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002647|=============================
2648
Edwin Kempin6b813372013-03-13 17:07:33 +01002649[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002650=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01002651The `HeadInput` entity contains information for setting `HEAD` for a
2652project.
2653
David Pursehouseae367192014-11-25 17:24:47 +09002654[options="header",cols="1,6"]
Edwin Kempin6b813372013-03-13 17:07:33 +01002655|============================
2656|Field Name |Description
2657|`ref` |
2658The ref to which `HEAD` should be set, the `refs/heads` prefix can be
2659omitted.
2660|============================
2661
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002662[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002663=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002664A boolean value that can also be inherited.
2665
David Pursehouseae367192014-11-25 17:24:47 +09002666[options="header",cols="1,^2,4"]
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002667|================================
2668|Field Name ||Description
2669|`value` ||
2670The effective boolean value.
2671|`configured_value` ||
2672The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
2673|`inherited_value` |optional|
2674The boolean value inherited from the parent. +
2675Not set if there is no parent.
2676|================================
2677
Edwin Kempin3c99f592013-07-15 10:12:27 +02002678[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002679=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02002680The `MaxObjectSizeLimitInfo` entity contains information about the
2681link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2682limit] of a project.
2683
David Pursehouseae367192014-11-25 17:24:47 +09002684[options="header",cols="1,^2,4"]
Edwin Kempin3c99f592013-07-15 10:12:27 +02002685|===============================
2686|Field Name ||Description
2687|`value` |optional|
2688The effective value of the max object size limit as a formatted string. +
2689Not set if there is no limit for the object size.
2690|`configured_value`|optional|
2691The max object size limit that is configured on the project as a
2692formatted string. +
2693Not set if there is no limit for the object size configured on project
2694level.
2695|`inherited_value` |optional|
2696The max object size limit that is inherited as a formatted string. +
2697Not set if there is no global limit for the object size.
2698|===============================
2699
Patrick Hiesel21816f12016-04-22 08:53:06 +02002700[[project-access-input]]
2701=== ProjectAccessInput
2702The `ProjectAccessInput` describes changes that should be applied to a project
2703access config.
2704
2705[options="header",cols="1,^2,4"]
2706|=============================
2707|Field Name | |Description
2708|`remove` |optional|
2709A list of deductions to be applied to the project access as
2710link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
2711|`add` |optional|
2712A list of additions to be applied to the project access as
2713link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
2714|`message` |optional|
2715A commit message for this change.
2716|`parent` |optional|
2717A new parent for the project to inherit from. Changing the parent project
2718requires administrative privileges.
2719|=============================
2720
Edwin Kempin57f303c2013-02-13 15:52:22 +01002721[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002722=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01002723The `ProjectDescriptionInput` entity contains information for setting a
2724project description.
2725
David Pursehouseae367192014-11-25 17:24:47 +09002726[options="header",cols="1,^2,4"]
Edwin Kempin57f303c2013-02-13 15:52:22 +01002727|=============================
2728|Field Name ||Description
2729|`description` |optional|The project description. +
2730The project description will be deleted if not set.
2731|`commit_message`|optional|
2732Message that should be used to commit the change of the project
2733description in the `project.config` file to the `refs/meta/config`
2734branch.
2735|=============================
2736
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002737[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002738=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002739The `ProjectInfo` entity contains information about a project.
2740
David Pursehouseae367192014-11-25 17:24:47 +09002741[options="header",cols="1,^2,4"]
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002742|===========================
2743|Field Name ||Description
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002744|`id` ||The URL encoded project name.
2745|`name` |
2746not set if returned in a map where the project name is used as map key|
2747The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01002748|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002749The name of the parent project. +
2750`?-<n>` if the parent project is not visible (`<n>` is a number which
2751is increased for each non-visible project).
2752|`description` |optional|The description of the project.
Shawn Pearce21a6c212014-04-23 12:35:10 -07002753|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002754|`branches` |optional|Map of branch names to HEAD revisions.
Edwin Kempin26c95a42014-11-25 16:29:47 +01002755|`web_links` |optional|
Edwin Kempinea004752014-04-11 15:56:02 +02002756Links to the project in external sites as a list of
2757link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002758|===========================
2759
Bruce Zu798ea122013-02-18 16:55:43 +08002760[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002761=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08002762The `ProjectInput` entity contains information for the creation of
2763a new project.
2764
David Pursehouseae367192014-11-25 17:24:47 +09002765[options="header",cols="1,^2,4"]
Bruce Zu798ea122013-02-18 16:55:43 +08002766|=========================================
2767|Field Name ||Description
2768|`name` |optional|
2769The name of the project (not encoded). +
David Pursehouse8c5ad412015-02-03 14:19:09 +09002770If set, must match the project name in the URL. +
2771If name ends with `.git` the suffix will be automatically removed.
Bruce Zu798ea122013-02-18 16:55:43 +08002772|`parent` |optional|
2773The name of the parent project. +
2774If not set, the `All-Projects` project will be the parent project.
2775|`description` |optional|The description of the project.
2776|`permissions_only` |`false` if not set|
2777Whether a permission-only project should be created.
2778|`create_empty_commit` |`false` if not set|
2779Whether an empty initial commit should be created.
2780|`submit_type` |optional|
2781The submit type that should be set for the project
2782(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
2783`MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01002784If not set, `MERGE_IF_NECESSARY` is set as submit type unless
2785link:config-gerrit.html#repository.name.defaultSubmitType[
2786repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08002787|`branches` |optional|
2788A list of branches that should be initially created. +
2789For the branch names the `refs/heads/` prefix can be omitted.
2790|`owners` |optional|
2791A list of groups that should be assigned as project owner. +
2792Each group in the list must be specified as
2793link:rest-api-groups.html#group-id[group-id]. +
2794If not set, the link:config-gerrit.html#repository.name.ownerGroup[
2795groups that are configured as default owners] are set as project
2796owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002797|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002798Whether contributor agreements should be used for the project (`TRUE`,
2799`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02002800|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002801Whether the usage of 'Signed-Off-By' footers is required for the
2802project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02002803|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
2804Whether a new change is created for every commit not in target branch
2805for the project (`TRUE`, `FALSE`, `INHERIT`).
2806|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002807Whether content merge should be enabled for the project (`TRUE`,
2808`FALSE`, `INHERIT`). +
2809`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002810|`require_change_id` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002811Whether the usage of Change-Ids is required for the project (`TRUE`,
2812`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02002813|`max_object_size_limit` |optional|
2814Max allowed Git object size for this project.
2815Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01002816|`plugin_config_values` |optional|
2817Plugin configuration values as map which maps the plugin name to a map
2818of parameter names to values.
Bruce Zu798ea122013-02-18 16:55:43 +08002819|=========================================
2820
Edwin Kempinecad88c2013-02-14 12:09:44 +01002821[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002822=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01002823The `ProjectParentInput` entity contains information for setting a
2824project parent.
2825
David Pursehouseae367192014-11-25 17:24:47 +09002826[options="header",cols="1,^2,4"]
Edwin Kempinecad88c2013-02-14 12:09:44 +01002827|=============================
2828|Field Name ||Description
2829|`parent` ||The name of the parent project.
2830|`commit_message`|optional|
2831Message that should be used to commit the change of the project parent
2832in the `project.config` file to the `refs/meta/config` branch.
2833|=============================
2834
Edwin Kempin87504d92014-07-04 12:59:19 +02002835[[reflog-entry-info]]
2836=== ReflogEntryInfo
2837The `ReflogEntryInfo` entity describes an entry in a reflog.
2838
David Pursehouseae367192014-11-25 17:24:47 +09002839[options="header",cols="1,6"]
Edwin Kempin87504d92014-07-04 12:59:19 +02002840|============================
2841|Field Name |Description
2842|`old_id` |The old commit ID.
2843|`new_id` |The new commit ID.
2844|`who` |
2845The user performing the change as a
2846link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
2847|`comment` |Comment of the reflog entry.
2848|============================
2849
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002850[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002851=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002852The `RepositoryStatisticsInfo` entity contains information about
2853statistics of a Git repository.
2854
David Pursehouseae367192014-11-25 17:24:47 +09002855[options="header",cols="1,6"]
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002856|======================================
2857|Field Name |Description
2858|`number_of_loose_objects` |Number of loose objects.
2859|`number_of_loose_refs` |Number of loose refs.
2860|`number_of_pack_files` |Number of pack files.
2861|`number_of_packed_objects`|Number of packed objects.
2862|`number_of_packed_refs` |Number of packed refs.
2863|`size_of_loose_objects` |Size of loose objects in bytes.
2864|`size_of_packed_objects` |Size of packed objects in bytes.
2865|======================================
2866
David Pursehouse8cc68902014-10-06 18:17:16 +09002867[[tag-info]]
2868=== TagInfo
2869The `TagInfo` entity contains information about a tag.
2870
David Pursehouseae367192014-11-25 17:24:47 +09002871[options="header",cols="1,^2,4"]
David Pursehouse8cc68902014-10-06 18:17:16 +09002872|=========================
2873|Field Name ||Description
2874|`ref` ||The ref of the tag.
2875|`revision` ||For lightweight tags, the revision of the commit to which the tag
2876points. For annotated tags, the revision of the tag object.
2877|`object`|Only set for annotated tags.|The revision of the object to which the
2878tag points.
2879|`message`|Only set for annotated tags.|The tag message. For signed tags, includes
2880the signature.
David Pursehousec9f5a5a2015-12-07 19:13:16 +09002881|`tagger`|Only set for annotated tags, if present in the tag.|The tagger as a
David Pursehouse8cc68902014-10-06 18:17:16 +09002882link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
David Pursehouse23669da2017-02-23 13:43:57 +09002883|`can_delete`|`false` if not set|
2884Whether the calling user can delete this tag.
David Pursehouse8cc68902014-10-06 18:17:16 +09002885|=========================
2886
David Pursehouse6a446192016-06-03 10:00:34 +09002887[[tag-input]]
2888=== TagInput
2889
2890The `TagInput` entity contains information for creating a tag.
2891
2892[options="header",cols="1,^2,4"]
2893|=========================
2894|Field Name ||Description
2895|`ref` ||The name of the tag. The leading `refs/tags/` is optional.
2896|`revision` |optional|The revision to which the tag should point. If not
2897specified, the project's `HEAD` will be used.
2898|`message` |optional|The tag message. When set, the tag will be created
2899as an annotated tag.
2900|=========================
2901
2902
Edwin Kempin272402e2013-07-15 11:17:36 +02002903[[theme-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002904=== ThemeInfo
Edwin Kempin272402e2013-07-15 11:17:36 +02002905The `ThemeInfo` entity describes a theme.
2906
David Pursehouseae367192014-11-25 17:24:47 +09002907[options="header",cols="1,^2,4"]
Edwin Kempin272402e2013-07-15 11:17:36 +02002908|=============================
2909|Field Name ||Description
2910|`css` |optional|
2911The path to the `GerritSite.css` file.
2912|`header` |optional|
2913The path to the `GerritSiteHeader.html` file.
2914|`footer` |optional|
2915The path to the `GerritSiteFooter.html` file.
2916|=============================
2917
Patrick Hiesel5a3475f2016-04-21 11:44:29 +02002918----
Edwin Kempind0a63922013-01-23 16:32:59 +01002919
2920GERRIT
2921------
2922Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07002923
2924SEARCHBOX
2925---------