blob: 7d4b92f0c4b4127f2e94640ad94f9acd474164f2 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - /projects/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01002
3This page describes the project related REST endpoints.
4Please also take note of the general information on the
5link:rest-api.html[REST API].
6
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01007[[project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008== Project Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01009
Edwin Kempin76202742013-02-15 13:51:50 +010010[[list-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080011=== List Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080012--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010013'GET /projects/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080014--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010015
Edwin Kempind0a63922013-01-23 16:32:59 +010016Lists the projects accessible by the caller. This is the same as
17using the link:cmd-ls-projects.html[ls-projects] command over SSH,
18and accepts the same options as query parameters.
19
Edwin Kempin51a6dc92013-02-04 15:43:59 +010020As result a map is returned that maps the project names to
21link:#project-info[ProjectInfo] entries. The entries in the map are sorted
22by project name.
23
Edwin Kempin37440832013-02-06 11:36:00 +010024.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010025----
26 GET /projects/?d HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010027----
Edwin Kempind0a63922013-01-23 16:32:59 +010028
Edwin Kempin37440832013-02-06 11:36:00 +010029.Response
30----
Edwin Kempind0a63922013-01-23 16:32:59 +010031 HTTP/1.1 200 OK
32 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090033 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010034
35 )]}'
36 {
37 "external/bison": {
Edwin Kempind0a63922013-01-23 16:32:59 +010038 "id": "external%2Fbison",
39 "description": "GNU parser generator"
40 },
41 "external/gcc": {
Edwin Kempin068511b2015-01-20 09:17:12 +010042 "id": "external%2Fgcc"
Edwin Kempind0a63922013-01-23 16:32:59 +010043 },
44 "external/openssl": {
Edwin Kempind0a63922013-01-23 16:32:59 +010045 "id": "external%2Fopenssl",
46 "description": "encryption\ncrypto routines"
47 },
48 "test": {
Edwin Kempind0a63922013-01-23 16:32:59 +010049 "id": "test",
50 "description": "\u003chtml\u003e is escaped"
51 }
52 }
53----
54
Hugo Arèsbdd7f682014-07-08 10:57:52 -040055[[project-options]]
56==== Project Options
57
58Branch(b)::
59Limit the results to the projects having the specified branch and
60include the sha1 of the branch in the results.
61+
62Get projects that have a 'master' branch:
63+
64.Request
65----
66GET /projects/?b=master HTTP/1.0
67----
68+
69.Response
70----
71 HTTP/1.1 200 OK
72 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090073 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -040074
75 )]}'
76 {
77 "some-project": {
78 "id": "some-project",
79 "branches": {
80 "master": "c5ed9dfcbf002ca0e432d788dab6ca2387829ca7"
81 }
82 },
83 "some-other-project": {
84 "id": "some-other-project",
85 "branches": {
86 "master": "ef1c270142f9581ecf768f4193fc8f8a81102ec2"
87 }
88 },
89 }
90----
91
92Description(d)::
93Include project description in the results.
94+
95Get all the projects with their description:
96+
97.Request
98----
99GET /projects/?d HTTP/1.0
100----
101+
102.Response
103----
104 HTTP/1.1 200 OK
105 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900106 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400107
108 )]}'
109 {
110 "some-project": {
111 "id": "some-project",
112 "description": "Description of some project."
113 },
114 "some-other-project": {
115 "id": "some-other-project",
116 "description": "Description of some other project."
117 }
118 },
119 }
120----
121
122Limit(n)::
123Limit the number of projects to be included in the results.
124+
125Query the first project in the project list:
126+
127.Request
128----
129 GET /projects/?n=1 HTTP/1.0
130----
131+
132.Response
133----
134 HTTP/1.1 200 OK
135 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900136 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400137
138 )]}'
139 {
140 "some-project": {
141 "id": "some-project"
142 }
143 }
144----
145
Edwin Kempina64c4b92013-01-23 11:30:40 +0100146
Edwin Kempind0a63922013-01-23 16:32:59 +0100147[[suggest-projects]]
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400148Prefix(p)::
149Limit the results to those projects that start with the specified
Edwin Kempind0a63922013-01-23 16:32:59 +0100150prefix.
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400151+
Edwin Kempind0a63922013-01-23 16:32:59 +0100152List all projects that start with `platform/`:
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400153+
Edwin Kempin37440832013-02-06 11:36:00 +0100154.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100155----
156 GET /projects/?p=platform%2F HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100157----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400158+
Edwin Kempin37440832013-02-06 11:36:00 +0100159.Response
160----
Edwin Kempind0a63922013-01-23 16:32:59 +0100161 HTTP/1.1 200 OK
162 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900163 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100164
165 )]}'
166 {
167 "platform/drivers": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100168 "id": "platform%2Fdrivers"
Edwin Kempind0a63922013-01-23 16:32:59 +0100169 },
170 "platform/tools": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100171 "id": "platform%2Ftools"
Edwin Kempind0a63922013-01-23 16:32:59 +0100172 }
173 }
174----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400175+
Edwin Kempind0a63922013-01-23 16:32:59 +0100176E.g. this feature can be used by suggestion client UI's to limit results.
177
Hugo Arèsb8aae412014-07-08 11:04:43 -0400178Regex(r)::
179Limit the results to those projects that match the specified regex.
180+
181Boundary matchers '^' and '$' are implicit. For example: the regex 'test.*' will
182match any projects that start with 'test' and regex '.*test' will match any
183project that end with 'test'.
184+
185List all projects that match regex `test.*project`:
186+
187.Request
188----
189 GET /projects/?r=test.*project HTTP/1.0
190----
191+
192.Response
193----
194 HTTP/1.1 200 OK
195 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900196 Content-Type: application/json; charset=UTF-8
Hugo Arèsb8aae412014-07-08 11:04:43 -0400197
198 )]}'
199 {
200 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100201 "id": "test%2Fsome-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400202 },
203 "test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100204 "id": "test%2Fsome-other-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400205 }
206 }
207
208----
209
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400210Skip(S)::
211Skip the given number of projects from the beginning of the list.
212+
213Query the second project in the project list:
214+
215.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400216----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400217 GET /projects/?n=1&S=1 HTTP/1.0
218----
219+
220.Response
221----
222 HTTP/1.1 200 OK
223 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900224 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400225
226 )]}'
227 {
228 "some-other-project": {
229 "id": "some-other-project"
230 }
231 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400232----
233
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400234Substring(m)::
235Limit the results to those projects that match the specified substring.
236+
237List all projects that match substring `test/`:
238+
239.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400240----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400241 GET /projects/?m=test%2F HTTP/1.0
242----
243+
244.Response
245----
246 HTTP/1.1 200 OK
247 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900248 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400249
250 )]}'
251 {
252 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100253 "id": "test%2Fsome-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400254 },
255 "some-path/test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100256 "id": "some-path%2Ftest%2Fsome-other-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400257 }
258 }
259----
260
261Tree(t)::
262Get projects inheritance in a tree-like format. This option does
263not work together with the branch option.
264+
265Get all the projects with tree option:
266+
267.Request
268----
269GET /projects/?t HTTP/1.0
270----
271+
272.Response
273----
274 HTTP/1.1 200 OK
275 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900276 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400277
278 )]}'
279 {
280 "All-Projects" {
281 "id": "All-Projects"
282 },
283 "child-project": {
284 "id": "child-project",
285 "parent":"parent-project"
286 },
287 "parent-project": {
288 "id": "parent-project",
289 "parent":"All-Projects"
290 }
291 }
292----
293
294Type(type)::
295Get projects with specified type: ALL, CODE, PERMISSIONS.
296+
297Get all the projects of type 'PERMISSIONS':
298+
299.Request
300----
301GET /projects/?type=PERMISSIONS HTTP/1.0
302----
303+
304.Response
305----
306 HTTP/1.1 200 OK
307 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900308 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400309
310 )]}'
311 {
312 "All-Projects" {
313 "id": "All-Projects"
314 },
315 "some-parent-project": {
316 "id": "some-parent-project"
317 }
318 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400319----
320
Edwin Kempin5c544e22013-03-06 13:35:45 +0100321[[get-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800322=== Get Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800323--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100324'GET /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800325--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100326
327Retrieves a project.
328
329.Request
330----
331 GET /projects/plugins%2Freplication HTTP/1.0
332----
333
334As response a link:#project-info[ProjectInfo] entity is returned that
335describes the project.
336
337.Response
338----
339 HTTP/1.1 200 OK
340 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900341 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c544e22013-03-06 13:35:45 +0100342
343 )]}'
344 {
Edwin Kempin5c544e22013-03-06 13:35:45 +0100345 "id": "plugins%2Freplication",
346 "name": "plugins/replication",
347 "parent": "Public-Plugins",
Shawn Pearce21a6c212014-04-23 12:35:10 -0700348 "description": "Copies to other servers using the Git protocol",
349 "state": "ACTIVE"
Edwin Kempin5c544e22013-03-06 13:35:45 +0100350 }
351----
352
Bruce Zu798ea122013-02-18 16:55:43 +0800353[[create-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800354=== Create Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800355--
Bruce Zu798ea122013-02-18 16:55:43 +0800356'PUT /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800357--
Bruce Zu798ea122013-02-18 16:55:43 +0800358
359Creates a new project.
360
361In the request body additional data for the project can be provided as
362link:#project-input[ProjectInput].
363
364.Request
365----
366 PUT /projects/MyProject HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900367 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800368
369 {
370 "description": "This is a demo project.",
371 "submit_type": "CHERRY_PICK",
372 "owners": [
373 "MyProject-Owners"
374 ]
375 }
376----
377
378As response the link:#project-info[ProjectInfo] entity is returned that
379describes the created project.
380
381.Response
382----
383 HTTP/1.1 201 Created
384 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900385 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800386
387 )]}'
388 {
Bruce Zu798ea122013-02-18 16:55:43 +0800389 "id": "MyProject",
390 "name": "MyProject",
391 "parent": "All-Projects",
392 "description": "This is a demo project."
393 }
394----
395
Edwin Kempin57f303c2013-02-13 15:52:22 +0100396[[get-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800397=== Get Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800398--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100399'GET /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800400--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100401
Edwin Kempin57f303c2013-02-13 15:52:22 +0100402Retrieves the description of a project.
403
404.Request
405----
406 GET /projects/plugins%2Freplication/description HTTP/1.0
407----
408
409.Response
410----
411 HTTP/1.1 200 OK
412 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900413 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100414
415 )]}'
416 "Copies to other servers using the Git protocol"
417----
418
Edwin Kempinefec4492013-02-22 10:09:23 +0100419If the project does not have a description an empty string is returned.
420
Edwin Kempin57f303c2013-02-13 15:52:22 +0100421[[set-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800422=== Set Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800423--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100424'PUT /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800425--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100426
Edwin Kempin57f303c2013-02-13 15:52:22 +0100427Sets the description of a project.
428
429The new project description must be provided in the request body inside
430a link:#project-description-input[ProjectDescriptionInput] entity.
431
432.Request
433----
434 PUT /projects/plugins%2Freplication/description HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900435 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100436
437 {
438 "description": "Plugin for Gerrit that handles the replication.",
439 "commit_message": "Update the project description"
440 }
441----
442
443As response the new project description is returned.
444
445.Response
446----
447 HTTP/1.1 200 OK
448 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900449 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100450
451 )]}'
452 "Plugin for Gerrit that handles the replication."
453----
454
Edwin Kempin114ab162013-02-28 09:25:37 +0100455If the description was deleted the response is "`204 No Content`".
456
Edwin Kempin57f303c2013-02-13 15:52:22 +0100457[[delete-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800458=== Delete Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800459--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100460'DELETE /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800461--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100462
Edwin Kempin57f303c2013-02-13 15:52:22 +0100463Deletes the description of a project.
464
Edwin Kempinefec4492013-02-22 10:09:23 +0100465The request body does not need to include a
466link:#project-description-input[ProjectDescriptionInput] entity if no
467commit message is specified.
Edwin Kempin57f303c2013-02-13 15:52:22 +0100468
Edwin Kempinefec4492013-02-22 10:09:23 +0100469Please note that some proxies prohibit request bodies for DELETE
Edwin Kempin57f303c2013-02-13 15:52:22 +0100470requests. In this case, if you want to specify a commit message, use
471link:#set-project-description[PUT] to delete the description.
472
473.Request
474----
475 DELETE /projects/plugins%2Freplication/description HTTP/1.0
476----
477
478.Response
479----
480 HTTP/1.1 204 No Content
481----
482
Edwin Kempinecad88c2013-02-14 12:09:44 +0100483[[get-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800484=== Get Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800485--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100486'GET /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800487--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100488
Edwin Kempinecad88c2013-02-14 12:09:44 +0100489Retrieves the name of a project's parent project. For the
490`All-Projects` root project an empty string is returned.
491
492.Request
493----
494 GET /projects/plugins%2Freplication/parent HTTP/1.0
495----
496
497.Response
498----
499 HTTP/1.1 200 OK
500 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900501 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100502
503 )]}'
504 "All-Projects"
505----
506
507[[set-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800508=== Set Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800509--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100510'PUT /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800511--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100512
Edwin Kempinecad88c2013-02-14 12:09:44 +0100513Sets the parent project for a project.
514
515The new name of the parent project must be provided in the request body
516inside a link:#project-parent-input[ProjectParentInput] entity.
517
518.Request
519----
520 PUT /projects/plugins%2Freplication/parent HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900521 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100522
523 {
524 "parent": "Public-Plugins",
525 "commit_message": "Update the project parent"
526 }
527----
528
529As response the new parent project name is returned.
530
531.Response
532----
533 HTTP/1.1 200 OK
534 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900535 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100536
537 )]}'
538 "Public-Plugins"
539----
540
Edwin Kempin6b813372013-03-13 17:07:33 +0100541[[get-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800542=== Get HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800543--
Edwin Kempin6b813372013-03-13 17:07:33 +0100544'GET /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800545--
Edwin Kempin6b813372013-03-13 17:07:33 +0100546
547Retrieves for a project the name of the branch to which `HEAD` points.
548
549.Request
550----
551 GET /projects/plugins%2Freplication/HEAD HTTP/1.0
552----
553
554.Response
555----
556 HTTP/1.1 200 OK
557 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900558 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100559
560 )]}'
561 "refs/heads/master"
562----
563
564[[set-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800565=== Set HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800566--
Edwin Kempin6b813372013-03-13 17:07:33 +0100567'PUT /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800568--
Edwin Kempin6b813372013-03-13 17:07:33 +0100569
570Sets `HEAD` for a project.
571
572The new ref to which `HEAD` should point must be provided in the
573request body inside a link:#head-input[HeadInput] entity.
574
575.Request
576----
577 PUT /projects/plugins%2Freplication/HEAD HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900578 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100579
580 {
581 "ref": "refs/heads/stable"
582 }
583----
584
585As response the new ref to which `HEAD` points is returned.
586
587.Response
588----
589 HTTP/1.1 200 OK
590 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900591 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100592
593 )]}'
594 "refs/heads/stable"
595----
596
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100597[[get-repository-statistics]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800598=== Get Repository Statistics
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800599--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100600'GET /projects/link:#project-name[\{project-name\}]/statistics.git'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800601--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100602
603Return statistics for the repository of a project.
604
605.Request
606----
607 GET /projects/plugins%2Freplication/statistics.git HTTP/1.0
608----
609
610The repository statistics are returned as a
611link:#repository-statistics-info[RepositoryStatisticsInfo] entity.
612
613.Response
614----
615 HTTP/1.1 200 OK
616 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900617 Content-Type: application/json; charset=UTF-8
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100618
619 )]}'
620 {
621 "number_of_loose_objects": 127,
622 "number_of_loose_refs": 15,
623 "number_of_pack_files": 15,
624 "number_of_packed_objects": 67,
625 "number_of_packed_refs": 0,
626 "size_of_loose_objects": 29466,
627 "size_of_packed_objects": 9646
628 }
629----
630
Dave Borowitz237073a2013-04-04 16:52:27 -0700631[[get-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800632=== Get Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800633--
Dave Borowitz237073a2013-04-04 16:52:27 -0700634'GET /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800635--
Dave Borowitz237073a2013-04-04 16:52:27 -0700636
637Gets some configuration information about a project. Note that this
638config info is not simply the contents of `project.config`; it generally
639contains fields that may have been inherited from parent projects.
640
641.Request
642----
643 GET /projects/myproject/config
644----
645
646A link:#config-info[ConfigInfo] entity is returned that describes the
647project configuration. Some fields are only visible to users that have
648read access to `refs/meta/config`.
649
650.Response
651----
652 HTTP/1.1 200 OK
653 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900654 Content-Type: application/json; charset=UTF-8
Dave Borowitz237073a2013-04-04 16:52:27 -0700655
656 )]}'
657 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200658 "description": "demo project",
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200659 "use_contributor_agreements": {
660 "value": true,
661 "configured_value": "TRUE",
662 "inherited_value": false
663 },
664 "use_content_merge": {
665 "value": true,
666 "configured_value": "INHERIT",
667 "inherited_value": true
668 },
669 "use_signed_off_by": {
670 "value": false,
671 "configured_value": "INHERIT",
672 "inherited_value": false
673 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200674 "create_new_change_for_all_not_in_target": {
675 "value": false,
676 "configured_value": "INHERIT",
677 "inherited_value": false
678 },
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200679 "require_change_id": {
680 "value": false,
681 "configured_value": "FALSE",
682 "inherited_value": true
Edwin Kempin3c99f592013-07-15 10:12:27 +0200683 },
684 "max_object_size_limit": {
685 "value": "15m",
686 "configured_value": "15m",
687 "inherited_value": "20m"
688 },
689 "submit_type": "MERGE_IF_NECESSARY",
690 "state": "ACTIVE",
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200691 "commentlinks": {},
Edwin Kempin9ce4f552013-11-15 16:00:00 +0100692 "plugin_config": {
693 "helloworld": {
694 "language": {
695 "display_name": "Preferred Language",
696 "type": "STRING",
697 "value": "en"
698 }
699 }
700 },
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200701 "actions": {
702 "cookbook~hello-project": {
703 "method": "POST",
704 "label": "Say hello",
705 "title": "Say hello in different languages",
706 "enabled": true
707 }
708 }
Dave Borowitz237073a2013-04-04 16:52:27 -0700709 }
710----
711
Edwin Kempina23eb102013-07-17 09:10:54 +0200712[[set-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800713=== Set Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800714--
Edwin Kempina23eb102013-07-17 09:10:54 +0200715'PUT /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800716--
Edwin Kempina23eb102013-07-17 09:10:54 +0200717
718Sets the configuration of a project.
719
720The new configuration must be provided in the request body as a
721link:#config-input[ConfigInput] entity.
722
723.Request
724----
725 PUT /projects/myproject/config HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900726 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200727
728 {
729 "description": "demo project",
730 "use_contributor_agreements": "FALSE",
731 "use_content_merge": "INHERIT",
732 "use_signed_off_by": "INHERIT",
Deniz Türkoglu52777272014-09-08 17:02:48 +0200733 "create_new_change_for_all_not_in_target": "INHERIT",
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400734 "enable_signed_push": "INHERIT",
Dave Borowitz0543c732015-10-20 10:35:26 -0400735 "require_signed_push": "INHERIT",
Edwin Kempina23eb102013-07-17 09:10:54 +0200736 "require_change_id": "TRUE",
737 "max_object_size_limit": "10m",
738 "submit_type": "REBASE_IF_NECESSARY",
739 "state": "ACTIVE"
740 }
741----
742
743As response the new configuration is returned as a link:#config-info[
744ConfigInfo] entity.
745
746.Response
747----
748 HTTP/1.1 200 OK
749 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900750 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200751
752 )]}'
753 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200754 "use_contributor_agreements": {
755 "value": false,
756 "configured_value": "FALSE",
757 "inherited_value": false
758 },
759 "use_content_merge": {
760 "value": true,
761 "configured_value": "INHERIT",
762 "inherited_value": true
763 },
764 "use_signed_off_by": {
765 "value": false,
766 "configured_value": "INHERIT",
767 "inherited_value": false
768 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200769 "create_new_change_for_all_not_in_target": {
770 "value": true,
771 "configured_value": "INHERIT",
772 "inherited_value": false
773 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200774 "require_change_id": {
775 "value": true,
776 "configured_value": "TRUE",
777 "inherited_value": true
778 },
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400779 "enable_signed_push": {
780 "value": true,
781 "configured_value": "INHERIT",
782 "inherited_value": false
783 },
Dave Borowitz0543c732015-10-20 10:35:26 -0400784 "require_signed_push": {
785 "value": false,
786 "configured_value": "INHERIT",
787 "inherited_value": false
788 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200789 "max_object_size_limit": {
790 "value": "10m",
791 "configured_value": "10m",
792 "inherited_value": "20m"
793 },
794 "submit_type": "REBASE_IF_NECESSARY",
795 "state": "ACTIVE",
796 "commentlinks": {}
797 }
798----
799
Edwin Kempinef3542f2013-03-19 13:31:49 +0100800[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800801=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800802--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100803'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800804--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100805
806Run the Git garbage collection for the repository of a project.
807
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100808Options for the Git garbage collection can be specified in the
809request body as a link:#gc-input[GCInput] entity.
810
Edwin Kempinef3542f2013-03-19 13:31:49 +0100811.Request
812----
813 POST /projects/plugins%2Freplication/gc HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900814 Content-Type: application/json; charset=UTF-8
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100815
816 {
817 "show_progress": true
818 }
Edwin Kempinef3542f2013-03-19 13:31:49 +0100819----
820
821The response is the streamed output of the garbage collection.
822
823.Response
824----
825 HTTP/1.1 200 OK
826 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900827 Content-Type: text/plain; charset=UTF-8
Edwin Kempinef3542f2013-03-19 13:31:49 +0100828
829 collecting garbage for "plugins/replication":
830 Pack refs: 100% (21/21)
831 Counting objects: 20
832 Finding sources: 100% (20/20)
833 Getting sizes: 100% (13/13)
834 Compressing objects: 83% (5/6)
835 Writing objects: 100% (20/20)
836 Selecting commits: 100% (7/7)
837 Building bitmaps: 100% (7/7)
838 Finding sources: 100% (41/41)
839 Getting sizes: 100% (25/25)
840 Compressing objects: 52% (12/23)
841 Writing objects: 100% (41/41)
842 Prune loose objects also found in pack files: 100% (36/36)
843 Prune loose, unreferenced objects: 100% (36/36)
844 done.
845----
846
Adrian Görler92410a12015-11-03 16:20:56 +0100847==== Asynchronous Execution
848
849The option `async` allows to schedule a background task that asynchronously
850executes a Git garbage collection.
851
852The `Location` header of the response refers to the link:rest-api-config.html#get-task[background task]
853which allows to inspect the progress of its execution. In case of asynchronous
854execution the `show_progress` option is ignored.
855
856.Request
857----
858 POST /projects/plugins%2Freplication/gc HTTP/1.0
859 Content-Type: application/json;charset=UTF-8
860
861 {
862 "async": true
863 }
864----
865
866The response is empty.
867
868.Response
869----
870 HTTP/1.1 202 Accepted
871 Content-Disposition: attachment
872 Location: https:<host>/a/config/server/tasks/383a0602
873----
874
Edwin Kempin62946742014-07-09 11:17:58 +0200875[[ban-commit]]
876=== Ban Commit
877--
878'PUT /projects/link:#project-name[\{project-name\}]/ban'
879--
880
881Marks commits as banned for the project. If a commit is banned Gerrit
882rejects every push that includes this commit with
883link:error-contains-banned-commit.html[contains banned commit ...].
884
885[NOTE]
886This REST endpoint only marks the commits as banned, but it does not
887remove the commits from the history of any central branch. This needs
888to be done manually.
889
890The commits to be banned must be specified in the request body as a
891link:#ban-input[BanInput] entity.
892
893The caller must be project owner.
894
895.Request
896----
897 PUT /projects/plugins%2Freplication/ban HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900898 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +0200899
900 {
901 "commits": [
902 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
903 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
904 ],
905 "reason": "Violates IP"
906 }
907----
908
909As response a link:#ban-result-info[BanResultInfo] entity is returned.
910
911.Response
912----
913 HTTP/1.1 200 OK
914 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900915 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +0200916
917 )]}'
918 {
919 "newly_banned": [
920 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
921 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
922 ]
923 }
924----
925
Patrick Hiesel21816f12016-04-22 08:53:06 +0200926[[get-access]]
927=== List Access Rights for Project
928--
929'GET /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
930--
931
932Lists the access rights for a single project.
933
934As result a link:#project-access-info[ProjectAccessInfo] entity is returned.
935
936.Request
937----
938 GET /projects/MyProject/access HTTP/1.0
939----
940
941.Response
942----
943 HTTP/1.1 200 OK
944 Content-Type: application/json; charset=UTF-8
945
946 )]}'
947 {
948 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
949 "inherits_from": {
950 "id": "All-Projects",
951 "name": "All-Projects",
952 "description": "Access inherited by all other projects."
953 },
954 "local": {
955 "refs/*": {
956 "permissions": {
957 "read": {
958 "rules": {
959 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
960 "action": "ALLOW",
961 "force": false
962 },
963 "global:Anonymous-Users": {
964 "action": "ALLOW",
965 "force": false
966 }
967 }
968 }
969 }
970 }
971 },
972 "is_owner": true,
973 "owner_of": [
974 "refs/*"
975 ],
976 "can_upload": true,
977 "can_add": true,
978 "config_visible": true
979 }
980----
981
982[[set-access]]
983=== Add, Update and Delete Access Rights for Project
984--
985'POST /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
986--
987
988Sets access rights for the project using the diff schema provided by
989link:#project-access-input[ProjectAccessInput]. Deductions are used to
990remove access sections, permissions or permission rules. The backend will remove
991the entity with the finest granularity in the request, meaning that if an
992access section without permissions is posted, the access section will be
993removed; if an access section with a permission but no permission rules is
994posted, the permission will be removed; if an access section with a permission
995and a permission rule is posted, the permission rule will be removed.
996
997Additionally, access sections and permissions will be cleaned up after applying
998the deductions by removing items that have no child elements.
999
1000After removals have been applied, additions will be applied.
1001
1002As result a link:#project-access-info[ProjectAccessInfo] entity is returned.
1003
1004.Request
1005----
1006 POST /projects/MyProject/access HTTP/1.0
1007 Content-Type: application/json; charset=UTF-8
1008
1009 {
1010 "remove": [
1011 "refs/*": {
1012 "permissions": {
1013 "read": {
1014 "rules": {
1015 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1016 "action": "ALLOW"
1017 }
1018 }
1019 }
1020 }
1021 }
1022 ]
1023 }
1024----
1025
1026.Response
1027----
1028 HTTP/1.1 200 OK
1029 Content-Type: application/json; charset=UTF-8
1030
1031 )]}'
1032 {
1033 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1034 "inherits_from": {
1035 "id": "All-Projects",
1036 "name": "All-Projects",
1037 "description": "Access inherited by all other projects."
1038 },
1039 "local": {
1040 "refs/*": {
1041 "permissions": {
1042 "read": {
1043 "rules": {
1044 "global:Anonymous-Users": {
1045 "action": "ALLOW",
1046 "force": false
1047 }
1048 }
1049 }
1050 }
1051 }
1052 },
1053 "is_owner": true,
1054 "owner_of": [
1055 "refs/*"
1056 ],
1057 "can_upload": true,
1058 "can_add": true,
1059 "config_visible": true
1060 }
1061----
1062
Edwin Kempina686de92013-05-09 15:12:34 +02001063[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001064== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +02001065
1066[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001067=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001068--
Edwin Kempina686de92013-05-09 15:12:34 +02001069'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001070--
Edwin Kempina686de92013-05-09 15:12:34 +02001071
1072List the branches of a project.
1073
1074As result a list of link:#branch-info[BranchInfo] entries is
1075returned.
1076
1077.Request
1078----
1079 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
1080----
1081
1082.Response
1083----
1084 HTTP/1.1 200 OK
1085 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001086 Content-Type: application/json; charset=UTF-8
Edwin Kempina686de92013-05-09 15:12:34 +02001087
1088 )]}'
1089 [
1090 {
1091 "ref": "HEAD",
1092 "revision": "master"
1093 },
1094 {
1095 "ref": "refs/meta/config",
1096 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1097 },
1098 {
1099 "ref": "refs/heads/master",
1100 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1101 },
1102 {
1103 "ref": "refs/heads/stable",
1104 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
1105 "can_delete": true
1106 }
1107 ]
1108----
1109
Hugo Arès3133b4b2014-10-14 14:05:10 -04001110[[branch-options]]
1111==== Branch Options
1112
Hugo Arès15856622014-10-14 14:19:01 -04001113Limit(n)::
1114Limit the number of branches to be included in the results.
1115+
1116.Request
1117----
1118 GET /projects/testproject/branches?n=1 HTTP/1.0
1119----
1120+
1121.Response
1122----
1123 HTTP/1.1 200 OK
1124 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001125 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001126
1127 )]}'
1128 [
1129 {
1130 "ref": "HEAD",
1131 "revision": "master",
1132 "can_delete": false
1133 }
1134 ]
1135----
1136
1137Skip(s)::
1138Skip the given number of branches from the beginning of the list.
1139+
1140.Request
1141----
1142 GET /projects/testproject/branches?n=1&s=0 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
Hugo Arès3133b4b2014-10-14 14:05:10 -04001161Substring(m)::
1162Limit the results to those projects that match the specified substring.
1163+
1164List all projects that match substring `test`:
1165+
1166.Request
1167----
1168 GET /projects/testproject/branches?m=test HTTP/1.0
1169----
1170+
1171.Response
1172----
1173 HTTP/1.1 200 OK
1174 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001175 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001176
1177 )]}'
1178 [
1179 {
1180 "ref": "refs/heads/test1",
1181 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1182 "can_delete": true
1183 }
1184 ]
1185----
1186
1187Regex(r)::
1188Limit the results to those branches that match the specified regex.
1189Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
1190match any branches that start with 'test' and regex '*t' will match any
1191branches that end with 'test'.
1192+
1193List all branches that match regex `t.*1`:
1194+
1195.Request
1196----
1197 GET /projects/testproject/branches?r=t.*1 HTTP/1.0
1198----
1199+
1200.Response
1201----
1202 HTTP/1.1 200 OK
1203 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001204 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001205
1206 )]}'
1207 [
1208 {
1209 "ref": "refs/heads/test1",
1210 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1211 "can_delete": true
1212 }
1213 ]
1214----
1215
Edwin Kempin196e1732013-05-09 15:12:34 +02001216[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001217=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001218--
Edwin Kempin196e1732013-05-09 15:12:34 +02001219'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001220--
Edwin Kempin196e1732013-05-09 15:12:34 +02001221
1222Retrieves a branch of a project.
1223
1224.Request
1225----
1226 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
1227----
1228
1229As response a link:#branch-info[BranchInfo] entity is returned that
1230describes the branch.
1231
1232.Response
1233----
1234 HTTP/1.1 200 OK
1235 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001236 Content-Type: application/json; charset=UTF-8
Edwin Kempin196e1732013-05-09 15:12:34 +02001237
1238 )]}'
1239 {
1240 "ref": "refs/heads/master",
1241 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1242 }
1243----
1244
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001245[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001246=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001247--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001248'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001249--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001250
1251Creates a new branch.
1252
1253In the request body additional data for the branch can be provided as
1254link:#branch-input[BranchInput].
1255
1256.Request
1257----
1258 PUT /projects/MyProject/branches/stable HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001259 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001260
1261 {
1262 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1263 }
1264----
1265
1266As response a link:#branch-info[BranchInfo] entity is returned that
1267describes the created branch.
1268
1269.Response
1270----
1271 HTTP/1.1 201 Created
1272 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001273 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001274
1275 )]}'
1276 {
1277 "ref": "refs/heads/stable",
1278 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
1279 "can_delete": true
1280 }
1281----
1282
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001283[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001284=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001285--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001286'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001287--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001288
1289Deletes a branch.
1290
1291.Request
1292----
1293 DELETE /projects/MyProject/branches/stable HTTP/1.0
1294----
1295
1296.Response
1297----
1298 HTTP/1.1 204 No Content
1299----
1300
Hugo Arèsef8e3202015-01-12 15:09:06 -05001301[[delete-branches]]
1302=== Delete Branches
1303--
1304'POST /projects/link:#project-name[\{project-name\}]/branches:delete'
1305--
1306
1307Delete one or more branches.
1308
1309The branches to be deleted must be provided in the request body as a
1310link:#delete-branches-input[DeleteBranchesInput] entity.
1311
1312.Request
1313----
1314 POST /projects/MyProject/branches:delete HTTP/1.0
1315 Content-Type: application/json;charset=UTF-8
1316
1317 {
1318 "branches": [
1319 "stable-1.0",
1320 "stable-2.0"
1321 ]
1322 }
1323----
1324
1325.Response
1326----
1327 HTTP/1.1 204 No Content
1328----
1329
1330If some branches could not be deleted, the response is "`409 Conflict`" and the
1331error message is contained in the response body.
1332
Edwin Kempind31e5582013-11-30 12:07:08 +01001333[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001334=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001335--
1336'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1337--
1338
1339Gets the content of a file from the HEAD revision of a certain branch.
1340
1341.Request
1342----
1343 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1344----
1345
1346The content is returned as base64 encoded string.
1347
1348.Response
1349----
1350 HTTP/1.1 200 OK
1351 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001352 Content-Type: text/plain; charset=UTF-8
Edwin Kempind31e5582013-11-30 12:07:08 +01001353
1354 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1355----
1356
Edwin Kempin87504d92014-07-04 12:59:19 +02001357[[get-reflog]]
1358=== Get Reflog
1359--
1360'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
1361--
1362
1363Gets the reflog of a certain branch.
1364
1365The caller must be project owner.
1366
1367.Request
1368----
1369 GET /projects/gerrit/branches/master/reflog HTTP/1.0
1370----
1371
1372As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
1373is returned that describe the reflog entries. The reflog entries are
1374returned in reverse order.
1375
1376.Response
1377----
1378 HTTP/1.1 200 OK
1379 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001380 Content-Type: application/json; charset=UTF-8
Edwin Kempin87504d92014-07-04 12:59:19 +02001381
1382 )]}'
1383 [
1384 {
1385 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1386 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
1387 "who": {
1388 "name": "Jane Roe",
1389 "email": "jane.roe@example.com",
1390 "date": "2014-06-30 11:53:43.000000000",
1391 "tz": 120
1392 },
1393 "comment": "merged: fast forward"
1394 },
1395 {
1396 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1397 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1398 "who": {
1399 "name": "John Doe",
1400 "email": "john.doe@example.com",
1401 "date": "2013-10-02 10:45:26.000000000",
1402 "tz": 120
1403 },
1404 "comment": "merged: fast forward"
1405 },
1406 {
1407 "old_id": "0000000000000000000000000000000000000000",
1408 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1409 "who": {
1410 "name": "John Doe",
1411 "email": "john.doe@example.com",
1412 "date": "2013-09-30 19:08:44.000000000",
1413 "tz": 120
1414 },
1415 "comment": ""
1416 }
1417 ]
1418----
1419
1420The get reflog endpoint also accepts a limit integer in the `n`
1421parameter. This limits the results to show the last `n` reflog entries.
1422
1423Query the last 25 reflog entries.
1424----
1425 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
1426----
1427
Edwin Kempin2a581fd2014-07-04 14:04:54 +02001428The reflog can also be filtered by timestamp by specifying the `from`
1429and `to` parameters. The timestamp for `from` and `to` must be given as
1430UTC in the following format: `yyyyMMdd_HHmm`.
1431
1432----
1433 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
1434----
1435
Edwin Kempin4425c742013-03-18 13:23:00 +01001436[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001437== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01001438
1439[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001440=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001441--
Edwin Kempin4425c742013-03-18 13:23:00 +01001442'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001443--
Edwin Kempin4425c742013-03-18 13:23:00 +01001444
1445List the direct child projects of a project.
1446
1447.Request
1448----
1449 GET /projects/Public-Plugins/children/ HTTP/1.0
1450----
1451
1452As result a list of link:#project-info[ProjectInfo] entries is
1453returned that describe the child projects.
1454
1455.Response
1456----
1457 HTTP/1.1 200 OK
1458 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001459 Content-Type: application/json; charset=UTF-8
Edwin Kempin4425c742013-03-18 13:23:00 +01001460
1461 )]}'
1462 [
1463 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001464 "id": "plugins%2Freplication",
1465 "name": "plugins/replication",
1466 "parent": "Public-Plugins",
1467 "description": "Copies to other servers using the Git protocol"
1468 },
1469 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001470 "id": "plugins%2Freviewnotes",
1471 "name": "plugins/reviewnotes",
1472 "parent": "Public-Plugins",
1473 "description": "Annotates merged commits using notes on refs/notes/review."
1474 },
1475 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001476 "id": "plugins%2Fsingleusergroup",
1477 "name": "plugins/singleusergroup",
1478 "parent": "Public-Plugins",
1479 "description": "GroupBackend enabling users to be directly added to access rules"
1480 }
1481 ]
1482----
1483
Edwin Kempinf95bd172013-03-19 11:10:57 +01001484To resolve the child projects of a project recursively the parameter
1485`recursive` can be set.
1486
1487Child projects that are not visible to the calling user are ignored and
1488are not resolved further.
1489
1490.Request
1491----
1492 GET /projects/Public-Projects/children/?recursive HTTP/1.0
1493----
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 Kempinf95bd172013-03-19 11:10:57 +01001500
1501 )]}'
1502 [
1503 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001504 "id": "gerrit",
1505 "name": "gerrit",
1506 "parent": "Public-Projects",
1507 "description": "Gerrit Code Review"
1508 },
1509 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001510 "id": "plugins%2Freplication",
1511 "name": "plugins/replication",
1512 "parent": "Public-Plugins",
1513 "description": "Copies to other servers using the Git protocol"
1514 },
1515 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001516 "id": "plugins%2Freviewnotes",
1517 "name": "plugins/reviewnotes",
1518 "parent": "Public-Plugins",
1519 "description": "Annotates merged commits using notes on refs/notes/review."
1520 },
1521 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001522 "id": "plugins%2Fsingleusergroup",
1523 "name": "plugins/singleusergroup",
1524 "parent": "Public-Plugins",
1525 "description": "GroupBackend enabling users to be directly added to access rules"
1526 },
1527 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001528 "id": "Public-Plugins",
1529 "name": "Public-Plugins",
1530 "parent": "Public-Projects",
1531 "description": "Parent project for plugins/*"
1532 }
1533 ]
1534----
1535
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001536[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001537=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001538--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001539'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001540--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001541
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01001542Retrieves a child project. If a non-direct child project should be
1543retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001544
1545.Request
1546----
1547 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
1548----
1549
1550As response a link:#project-info[ProjectInfo] entity is returned that
1551describes the child project.
1552
1553.Response
1554----
1555 HTTP/1.1 200 OK
1556 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001557 Content-Type: application/json; charset=UTF-8
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001558
1559 )]}'
1560 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001561 "id": "plugins%2Freplication",
1562 "name": "plugins/replication",
1563 "parent": "Public-Plugins",
1564 "description": "Copies to other servers using the Git protocol"
1565 }
1566----
1567
David Pursehouse8cc68902014-10-06 18:17:16 +09001568[[tag-endpoints]]
1569== Tag Endpoints
1570
David Pursehouse6a446192016-06-03 10:00:34 +09001571[[create-tag]]
1572=== Create Tag
1573
1574--
1575'PUT /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
1576--
1577
1578Create a new tag on the project.
1579
1580In the request body additional data for the tag can be provided as
1581link:#tag-input[TagInput].
1582
1583If a message is provided in the input, the tag is created as an
1584annotated tag with the current user as tagger. Signed tags are not
1585supported.
1586
1587.Request
1588----
1589 PUT /projects/MyProject/tags/v1.0 HTTP/1.0
1590 Content-Type: application/json; charset=UTF-8
1591
1592 {
1593 "message": "annotation",
1594 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
1595 }
1596----
1597
1598As response a link:#tag-info[TagInfo] entity is returned that describes
1599the created tag.
1600
1601.Response
1602----
1603 HTTP/1.1 201 Created
1604 Content-Disposition: attachment
1605 Content-Type: application/json; charset=UTF-8
1606
1607 )]}'
1608
1609 "object": "d48d304adc4b6674e11dc2c018ea05fcbdda32fd",
1610 "message": "annotation",
1611 "tagger": {
1612 "name": "David Pursehouse",
1613 "email": "dpursehouse@collab.net",
1614 "date": "2016-06-06 01:22:03.000000000",
1615 "tz": 540
1616 },
1617 "ref": "refs/tags/v1.0",
1618 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
1619 }
1620----
1621
David Pursehouse8cc68902014-10-06 18:17:16 +09001622[[list-tags]]
1623=== List Tags
1624--
1625'GET /projects/link:#project-name[\{project-name\}]/tags/'
1626--
1627
1628List the tags of a project.
1629
1630As result a list of link:#tag-info[TagInfo] entries is returned.
1631
1632Only includes tags under the `refs/tags/` namespace.
1633
1634.Request
1635----
1636 GET /projects/work%2Fmy-project/tags/ HTTP/1.0
1637----
1638
1639.Response
1640----
1641 HTTP/1.1 200 OK
1642 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001643 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09001644
1645 )]}'
1646 [
1647 {
1648 "ref": "refs/tags/v1.0",
1649 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1650 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1651 "message": "Annotated tag",
1652 "tagger": {
1653 "name": "David Pursehouse",
1654 "email": "david.pursehouse@sonymobile.com",
1655 "date": "2014-10-06 07:35:03.000000000",
1656 "tz": 540
1657 }
1658 },
1659 {
1660 "ref": "refs/tags/v2.0",
1661 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1662 },
1663 {
1664 "ref": "refs/tags/v3.0",
1665 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
1666 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1667 "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-----",
1668 "tagger": {
1669 "name": "David Pursehouse",
1670 "email": "david.pursehouse@sonymobile.com",
1671 "date": "2014-10-06 09:02:16.000000000",
1672 "tz": 540
1673 }
1674 }
1675 ]
1676----
1677
David Pursehouseb0ba1512015-09-10 14:17:05 +09001678[[tag-options]]
1679==== Tag Options
1680
1681Limit(n)::
1682Limit the number of tags to be included in the results.
1683+
1684.Request
1685----
1686 GET /projects/work%2Fmy-project/tags?n=2 HTTP/1.0
1687----
1688+
1689.Response
1690----
1691 HTTP/1.1 200 OK
1692 Content-Disposition: attachment
1693 Content-Type: application/json; charset=UTF-8
1694
1695 )]}'
1696 [
1697 {
1698 "ref": "refs/tags/v1.0",
1699 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1700 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1701 "message": "Annotated tag",
1702 "tagger": {
1703 "name": "David Pursehouse",
1704 "email": "david.pursehouse@sonymobile.com",
1705 "date": "2014-10-06 07:35:03.000000000",
1706 "tz": 540
1707 }
1708 },
1709 {
1710 "ref": "refs/tags/v2.0",
1711 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1712 }
1713 ]
1714----
1715
1716Skip(s)::
1717Skip the given number of tags from the beginning of the list.
1718+
1719.Request
1720----
1721 GET /projects/work%2Fmy-project/tags?n=2&s=1 HTTP/1.0
1722----
1723+
1724.Response
1725----
1726 HTTP/1.1 200 OK
1727 Content-Disposition: attachment
1728 Content-Type: application/json; charset=UTF-8
1729
1730 )]}'
1731 [
1732 {
1733 "ref": "refs/tags/v2.0",
1734 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1735 },
1736 {
1737 "ref": "refs/tags/v3.0",
1738 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
1739 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1740 "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-----",
1741 "tagger": {
1742 "name": "David Pursehouse",
1743 "email": "david.pursehouse@sonymobile.com",
1744 "date": "2014-10-06 09:02:16.000000000",
1745 "tz": 540
1746 }
1747 }
1748 ]
1749----
1750
1751
David Pursehouse8cc68902014-10-06 18:17:16 +09001752[[get-tag]]
1753=== Get Tag
1754--
1755'GET /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
1756--
1757
1758Retrieves a tag of a project.
1759
1760.Request
1761----
1762 GET /projects/work%2Fmy-project/tags/v1.0 HTTP/1.0
1763----
1764
1765As response a link:#tag-info[TagInfo] entity is returned that describes the tag.
1766
1767.Response
1768----
1769 HTTP/1.1 200 OK
1770 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001771 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09001772
1773 )]}'
1774 {
1775 "ref": "refs/tags/v1.0",
1776 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1777 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1778 "message": "Annotated tag",
1779 "tagger": {
1780 "name": "David Pursehouse",
1781 "email": "david.pursehouse@sonymobile.com",
1782 "date": "2014-10-06 07:35:03.000000000",
1783 "tz": 540
1784 }
1785 }
1786----
1787
1788
Edwin Kempin1b993602014-07-08 16:18:45 +02001789[[commit-endpoints]]
1790== Commit Endpoints
1791
1792[[get-commit]]
1793=== Get Commit
1794--
1795'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
1796--
1797
1798Retrieves a commit of a project.
1799
1800The commit must be visible to the caller.
1801
1802.Request
1803----
1804 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
1805----
1806
1807As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
1808is returned that describes the commit.
1809
1810.Response
1811----
1812 HTTP/1.1 200 OK
1813 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001814 Content-Type: application/json; charset=UTF-8
Edwin Kempin1b993602014-07-08 16:18:45 +02001815
1816 )]}'
1817 {
1818 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
1819 "parents": [
1820 {
1821 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
1822 "subject": "Migrate contributor agreements to All-Projects."
1823 }
1824 ],
1825 "author": {
1826 "name": "Shawn O. Pearce",
1827 "email": "sop@google.com",
1828 "date": "2012-04-24 18:08:08.000000000",
1829 "tz": -420
1830 },
1831 "committer": {
1832 "name": "Shawn O. Pearce",
1833 "email": "sop@google.com",
1834 "date": "2012-04-24 18:08:08.000000000",
1835 "tz": -420
1836 },
1837 "subject": "Use an EventBus to manage star icons",
1838 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
1839 }
1840----
1841
Zhen Chend1462d82016-05-12 13:55:37 -07001842[[get-content-from-commit]]
Edwin Kempin6f7410a2014-07-09 15:46:22 +02001843=== Get Content
1844--
1845'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1846--
1847
1848Gets the content of a file from a certain commit.
1849
1850.Request
1851----
1852 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1853----
1854
1855The content is returned as base64 encoded string.
1856
1857.Response
1858----
1859 HTTP/1.1 200 OK
1860 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001861 Content-Type: text/plain; charset=UTF-8
Edwin Kempin6f7410a2014-07-09 15:46:22 +02001862
1863 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1864----
1865
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01001866[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001867== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01001868
Edwin Kempin76202742013-02-15 13:51:50 +01001869[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001870=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001871--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001872'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001873--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001874
Edwin Kempind0a63922013-01-23 16:32:59 +01001875List custom dashboards for a project.
1876
Edwin Kempin55367622013-02-05 09:09:23 +01001877As result a list of link:#dashboard-info[DashboardInfo] entries is
1878returned.
1879
Edwin Kempind0a63922013-01-23 16:32:59 +01001880List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01001881
1882.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01001883----
1884 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01001885----
Edwin Kempind0a63922013-01-23 16:32:59 +01001886
Edwin Kempin37440832013-02-06 11:36:00 +01001887.Response
1888----
Edwin Kempind0a63922013-01-23 16:32:59 +01001889 HTTP/1.1 200 OK
1890 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001891 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01001892
1893 )]}'
1894 [
1895 {
Edwin Kempind0a63922013-01-23 16:32:59 +01001896 "id": "main:closed",
1897 "ref": "main",
1898 "path": "closed",
1899 "description": "Merged and abandoned changes in last 7 weeks",
1900 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1901 "default": true,
1902 "title": "Closed changes",
1903 "sections": [
1904 {
1905 "name": "Merged",
1906 "query": "status:merged age:7w"
1907 },
1908 {
1909 "name": "Abandoned",
1910 "query": "status:abandoned age:7w"
1911 }
1912 ]
1913 }
1914 ]
1915----
1916
Edwin Kempina64c4b92013-01-23 11:30:40 +01001917.Get all dashboards of the 'All-Projects' project
1918****
1919get::/projects/All-Projects/dashboards/
1920****
1921
Edwin Kempin67e923c2013-02-14 13:57:12 +01001922[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001923=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001924--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001925'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001926--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001927
Edwin Kempin67e923c2013-02-14 13:57:12 +01001928Retrieves a project dashboard. The dashboard can be defined on that
1929project or be inherited from a parent project.
1930
1931.Request
1932----
1933 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
1934----
1935
1936As response a link:#dashboard-info[DashboardInfo] entity is returned
1937that describes the dashboard.
1938
1939.Response
1940----
1941 HTTP/1.1 200 OK
1942 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001943 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01001944
1945 )]}'
1946 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01001947 "id": "main:closed",
1948 "ref": "main",
1949 "path": "closed",
1950 "description": "Merged and abandoned changes in last 7 weeks",
1951 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1952 "default": true,
1953 "title": "Closed changes",
1954 "sections": [
1955 {
1956 "name": "Merged",
1957 "query": "status:merged age:7w"
1958 },
1959 {
1960 "name": "Abandoned",
1961 "query": "status:abandoned age:7w"
1962 }
1963 ]
1964 }
1965----
1966
1967To retrieve the default dashboard of a project use `default` as
1968dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01001969
1970.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01001971----
1972 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01001973----
Edwin Kempind0a63922013-01-23 16:32:59 +01001974
Edwin Kempin37440832013-02-06 11:36:00 +01001975.Response
1976----
Edwin Kempind0a63922013-01-23 16:32:59 +01001977 HTTP/1.1 200 OK
1978 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001979 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01001980
1981 )]}'
1982 {
Edwin Kempind0a63922013-01-23 16:32:59 +01001983 "id": "main:closed",
1984 "ref": "main",
1985 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01001986 "description": "Merged and abandoned changes in last 7 weeks",
1987 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
Edwin Kempind0a63922013-01-23 16:32:59 +01001988 "default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01001989 "title": "Closed changes",
1990 "sections": [
1991 {
1992 "name": "Merged",
1993 "query": "status:merged age:7w"
1994 },
1995 {
1996 "name": "Abandoned",
1997 "query": "status:abandoned age:7w"
1998 }
1999 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01002000 }
2001----
2002
Edwin Kempin67e923c2013-02-14 13:57:12 +01002003[[set-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002004=== Set Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002005--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002006'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002007--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002008
Edwin Kempin67e923c2013-02-14 13:57:12 +01002009Updates/Creates a project dashboard.
2010
2011Currently only supported for the `default` dashboard.
2012
2013The creation/update information for the dashboard must be provided in
2014the request body as a link:#dashboard-input[DashboardInput] entity.
2015
2016.Request
2017----
2018 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002019 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002020
2021 {
2022 "id": "main:closed",
2023 "commit_message": "Define the default dashboard"
2024 }
2025----
2026
2027As response the new/updated dashboard is returned as a
2028link:#dashboard-info[DashboardInfo] entity.
2029
2030.Response
2031----
2032 HTTP/1.1 200 OK
2033 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002034 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002035
2036 )]}'
2037 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002038 "id": "main:closed",
2039 "ref": "main",
2040 "path": "closed",
2041 "description": "Merged and abandoned changes in last 7 weeks",
2042 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
2043 "default": true,
2044 "title": "Closed changes",
2045 "sections": [
2046 {
2047 "name": "Merged",
2048 "query": "status:merged age:7w"
2049 },
2050 {
2051 "name": "Abandoned",
2052 "query": "status:abandoned age:7w"
2053 }
2054 ]
2055 }
2056----
2057
2058[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002059=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002060--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002061'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002062--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002063
Edwin Kempin67e923c2013-02-14 13:57:12 +01002064Deletes a project dashboard.
2065
2066Currently only supported for the `default` dashboard.
2067
Edwin Kempinefec4492013-02-22 10:09:23 +01002068The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05002069DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002070
2071Please note that some proxies prohibit request bodies for DELETE
2072requests.
2073
2074.Request
2075----
2076 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
2077----
2078
2079.Response
2080----
2081 HTTP/1.1 204 No Content
2082----
2083
Edwin Kempin34d83352013-02-06 10:40:17 +01002084
2085[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002086== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01002087
Edwin Kempin196e1732013-05-09 15:12:34 +02002088[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002089=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02002090The name of a branch or `HEAD`. The prefix `refs/heads/` can be
2091omitted.
2092
Edwin Kempin1b993602014-07-08 16:18:45 +02002093[[commit-id]]
2094=== \{commit-id\}
2095Commit ID.
2096
David Pursehouse8cc68902014-10-06 18:17:16 +09002097[[tag-id]]
2098=== \{tag-id\}
2099The name of a tag. The prefix `refs/tags/` can be omitted.
2100
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002101[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002102=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01002103The ID of a dashboard in the format '<ref>:<path>'.
2104
2105A special dashboard ID is `default` which represents the default
2106dashboard of a project.
2107
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002108[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002109=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01002110The name of the project.
2111
Edwin Kempina9e94ab2015-03-06 10:35:39 +01002112If the name ends with `.git`, the suffix will be automatically removed.
2113
Edwin Kempin34d83352013-02-06 10:40:17 +01002114
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002115[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002116== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002117
Edwin Kempin62946742014-07-09 11:17:58 +02002118[[ban-input]]
2119=== BanInput
2120The `BanInput` entity contains information for banning commits in a
2121project.
2122
David Pursehouseae367192014-11-25 17:24:47 +09002123[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02002124|=======================
2125|Field Name||Description
2126|`commits` ||List of commits to be banned.
2127|`reason` |optional|Reason for banning the commits.
2128|=======================
2129
2130[[ban-result-info]]
2131=== BanResultInfo
2132The `BanResultInfo` entity describes the result of banning commits.
2133
David Pursehouseae367192014-11-25 17:24:47 +09002134[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02002135|=============================
2136|Field Name ||Description
2137|`newly_banned` |optional|List of newly banned commits.
2138|`already_banned`|optional|List of commits that were already banned.
2139|`ignored` |optional|List of object IDs that were ignored.
2140|=============================
2141
Edwin Kempin521c1242015-01-23 12:44:44 +01002142[[branch-info]]
2143=== BranchInfo
2144The `BranchInfo` entity contains information about a branch.
2145
2146[options="header",cols="1,^2,4"]
2147|=========================
2148|Field Name ||Description
2149|`ref` ||The ref of the branch.
2150|`revision` ||The revision to which the branch points.
2151|`can_delete`|`false` if not set|
2152Whether the calling user can delete this branch.
2153|`web_links` |optional|
2154Links to the branch in external sites as a list of
2155link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
2156|=========================
2157
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002158[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002159=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002160The `BranchInput` entity contains information for the creation of
2161a new branch.
2162
David Pursehouseae367192014-11-25 17:24:47 +09002163[options="header",cols="1,^2,4"]
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002164|=======================
2165|Field Name||Description
2166|`ref` |optional|
2167The name of the branch. The prefix `refs/heads/` can be
2168omitted. +
2169If set, must match the branch ID in the URL.
2170|`revision`|optional|
2171The base revision of the new branch. +
2172If not set, `HEAD` will be used as base revision.
2173|=======================
2174
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002175[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002176=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002177The `ConfigInfo` entity contains information about the effective project
2178configuration.
2179
David Pursehouseae367192014-11-25 17:24:47 +09002180[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02002181|=======================================================
2182|Field Name ||Description
2183|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002184The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002185|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002186link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2187authors must complete a contributor agreement on the site before
2188pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002189|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002190link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2191Gerrit will try to perform a 3-way merge of text file content when a
2192file has been modified by both the destination branch and the change
2193being submitted. This option only takes effect if submit type is not
2194FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002195|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002196link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2197each change must contain a Signed-off-by line from either the author or
2198the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002199|`create_new_change_for_all_not_in_target` |optional|
2200link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2201a new change is created for every commit not in target branch.
2202|`require_change_id` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002203link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
2204valid link:user-changeid.html[Change-Id] footer in any commit uploaded
2205for review is required. This does not apply to commits pushed directly
2206to a branch or tag.
Doug Claar1b0f76252016-03-23 13:34:55 -07002207|`enable_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz5170e0f2015-06-18 21:05:29 -04002208link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2209signed push validation is enabled on the project.
Doug Claar1b0f76252016-03-23 13:34:55 -07002210|`require_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz0543c732015-10-20 10:35:26 -04002211link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2212signed push validation is required on the project.
Edwin Kempin3c99f592013-07-15 10:12:27 +02002213|`max_object_size_limit` ||
2214The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2215limit] of this project as a link:#max-object-size-limit-info[
2216MaxObjectSizeLimitInfo] entity.
2217|`submit_type` ||
2218The default submit type of the project, can be `MERGE_IF_NECESSARY`,
2219`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
2220`CHERRY_PICK`.
2221|`state` |optional|
2222The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
2223Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02002224|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02002225Map with the comment link configurations of the project. The name of
2226the comment link configuration is mapped to the comment link
2227configuration, which has the same format as the
2228link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[
2229commentlink section] of `gerrit.config`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002230|`theme` |optional|
Edwin Kempin272402e2013-07-15 11:17:36 +02002231The theme that is configured for the project as a link:#theme-info[
2232ThemeInfo] entity.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002233|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002234Plugin configuration as map which maps the plugin name to a map of
2235parameter names to link:#config-parameter-info[ConfigParameterInfo]
2236entities.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002237|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02002238Actions the caller might be able to perform on this project. The
2239information is a map of view names to
2240link:rest-api-changes.html#action-info[ActionInfo] entities.
David Pursehouse510b87d2014-11-25 16:46:28 +09002241|=======================================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002242
Edwin Kempina23eb102013-07-17 09:10:54 +02002243[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002244=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02002245The `ConfigInput` entity describes a new project configuration.
2246
David Pursehouseae367192014-11-25 17:24:47 +09002247[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02002248|======================================================
2249|Field Name ||Description
2250|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002251The new description of the project. +
2252If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002253|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002254Whether authors must complete a contributor agreement on the site
2255before pushing any commits or changes to this project. +
2256Can be `TRUE`, `FALSE` or `INHERIT`. +
2257If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002258|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002259Whether Gerrit will try to perform a 3-way merge of text file content
2260when a file has been modified by both the destination branch and the
2261change being submitted. This option only takes effect if submit type is
2262not FAST_FORWARD_ONLY. +
2263Can be `TRUE`, `FALSE` or `INHERIT`. +
2264If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002265|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002266Whether each change must contain a Signed-off-by line from either the
2267author or the uploader in the commit message. +
2268Can be `TRUE`, `FALSE` or `INHERIT`. +
2269If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002270|`create_new_change_for_all_not_in_target` |optional|
2271Whether a new change will be created for every commit not in target
2272branch. +
2273Can be `TRUE`, `FALSE` or `INHERIT`. +
2274If not set, this setting is not updated.
2275|`require_change_id` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002276Whether a valid link:user-changeid.html[Change-Id] footer in any commit
2277uploaded for review is required. This does not apply to commits pushed
2278directly to a branch or tag. +
2279Can be `TRUE`, `FALSE` or `INHERIT`. +
2280If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002281|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002282The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2283limit] of this project as a link:#max-object-size-limit-info[
2284MaxObjectSizeLimitInfo] entity. +
2285If set to `0`, the max object size limit is removed. +
2286If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002287|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002288The default submit type of the project, can be `MERGE_IF_NECESSARY`,
2289`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
2290`CHERRY_PICK`. +
2291If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002292|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002293The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
2294Not set if the project state is `ACTIVE`. +
2295If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002296|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002297Plugin configuration values as map which maps the plugin name to a map
2298of parameter names to values.
David Pursehouse510b87d2014-11-25 16:46:28 +09002299|======================================================
Edwin Kempina23eb102013-07-17 09:10:54 +02002300
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002301[[config-parameter-info]]
2302ConfigParameterInfo
2303~~~~~~~~~~~~~~~~~~~
2304The `ConfigParameterInfo` entity describes a project configuration
2305parameter.
2306
David Pursehouseae367192014-11-25 17:24:47 +09002307[options="header",cols="1,^2,4"]
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002308|===============================
2309|Field Name ||Description
2310|`display_name` |optional|
2311The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01002312|`description` |optional|
2313The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01002314|`warning` |optional|
2315Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002316|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002317The type of the configuration parameter. Can be `STRING`, `INT`,
2318`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002319|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01002320The value of the configuration parameter as string. If the parameter
2321is inheritable this is the effective value which is deduced from
2322`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002323|`values` |optional|
2324The list of values. Only set if the `type` is `ARRAY`.
Doug Claar1b0f76252016-03-23 13:34:55 -07002325|`editable` |`false` if not set|
Edwin Kempin0d485232013-11-17 18:55:48 +01002326Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01002327|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002328The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01002329|`inheritable` |`false` if not set|
2330Whether the configuration parameter can be inherited.
2331|`configured_value`|optional|
2332The value of the configuration parameter that is configured on this
2333project, only set if `inheritable` is true.
2334|`inherited_value` |optional|
2335The inherited value of the configuration parameter, only set if
2336`inheritable` is true.
2337|`permitted_values` |optional|
2338The list of permitted values, only set if the `type` is `LIST`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002339|===============================
2340
Edwin Kempin55367622013-02-05 09:09:23 +01002341[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002342=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002343The `DashboardInfo` entity contains information about a project
2344dashboard.
2345
David Pursehouseae367192014-11-25 17:24:47 +09002346[options="header",cols="1,^2,4"]
Edwin Kempin55367622013-02-05 09:09:23 +01002347|===============================
2348|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01002349|`id` ||
2350The ID of the dashboard. The ID has the format '<ref>:<path>',
2351where ref and path are URL encoded.
2352|`project` ||
2353The name of the project for which this dashboard is returned.
2354|`defining_project`||
2355The name of the project in which this dashboard is defined.
2356This is different from `project` if the dashboard is inherited from a
2357parent project.
2358|`ref` ||
2359The name of the ref in which the dashboard is defined, without the
2360`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
2361|`path` ||
2362The path of the file in which the dashboard is defined.
2363|`description` |optional|The description of the dashboard.
2364|`foreach` |optional|
2365Subquery that applies to all sections in the dashboard. +
2366Tokens such as `${project}` are not resolved.
2367|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09002368The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01002369The URL is relative to the canonical web URL. +
2370Tokens in the queries such as `${project}` are resolved.
2371|`default` |not set if `false`|
2372Whether this is the default dashboard of the project.
2373|`title` |optional|The title of the dashboard.
2374|`sections` ||
2375The list of link:#dashboard-section-info[sections] in the dashboard.
2376|===============================
2377
Edwin Kempin67e923c2013-02-14 13:57:12 +01002378[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002379=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01002380The `DashboardInput` entity contains information to create/update a
2381project dashboard.
2382
David Pursehouseae367192014-11-25 17:24:47 +09002383[options="header",cols="1,^2,4"]
Edwin Kempin67e923c2013-02-14 13:57:12 +01002384|=============================
2385|Field Name ||Description
2386|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01002387URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002388|`commit_message`|optional|
2389Message that should be used to commit the change of the dashboard.
2390|=============================
2391
Edwin Kempin55367622013-02-05 09:09:23 +01002392[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002393=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002394The `DashboardSectionInfo` entity contains information about a section
2395in a dashboard.
2396
David Pursehouseae367192014-11-25 17:24:47 +09002397[options="header",cols="1,6"]
Edwin Kempin55367622013-02-05 09:09:23 +01002398|===========================
2399|Field Name |Description
2400|`name` |The title of the section.
2401|`query` |The query of the section. +
2402Tokens such as `${project}` are not resolved.
2403|===========================
2404
Hugo Arèsef8e3202015-01-12 15:09:06 -05002405[[delete-branches-input]]
2406=== DeleteBranchesInput
2407The `DeleteBranchesInput` entity contains information about branches that should
2408be deleted.
2409
2410[options="header",width="50%",cols="1,6"]
2411|==========================
2412|Field Name |Description
2413|`branches` |A list of branch names that identify the branches that should be
2414deleted.
2415|==========================
2416
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002417[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002418=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002419The `GCInput` entity contains information to run the Git garbage
2420collection.
2421
David Pursehouseae367192014-11-25 17:24:47 +09002422[options="header",cols="1,^2,4"]
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002423|=============================
2424|Field Name ||Description
2425|`show_progress` |`false` if not set|
2426Whether progress information should be shown.
Christian Halstrick2f94e2e2015-03-11 15:13:31 +01002427|`aggressive` |`false` if not set|
2428Whether an aggressive garbage collection should be done.
Adrian Görler92410a12015-11-03 16:20:56 +01002429|`async` |`false` if not set|
2430Whether the garbage collection should run asynchronously.
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002431|=============================
2432
Edwin Kempin6b813372013-03-13 17:07:33 +01002433[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002434=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01002435The `HeadInput` entity contains information for setting `HEAD` for a
2436project.
2437
David Pursehouseae367192014-11-25 17:24:47 +09002438[options="header",cols="1,6"]
Edwin Kempin6b813372013-03-13 17:07:33 +01002439|============================
2440|Field Name |Description
2441|`ref` |
2442The ref to which `HEAD` should be set, the `refs/heads` prefix can be
2443omitted.
2444|============================
2445
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002446[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002447=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002448A boolean value that can also be inherited.
2449
David Pursehouseae367192014-11-25 17:24:47 +09002450[options="header",cols="1,^2,4"]
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002451|================================
2452|Field Name ||Description
2453|`value` ||
2454The effective boolean value.
2455|`configured_value` ||
2456The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
2457|`inherited_value` |optional|
2458The boolean value inherited from the parent. +
2459Not set if there is no parent.
2460|================================
2461
Edwin Kempin3c99f592013-07-15 10:12:27 +02002462[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002463=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02002464The `MaxObjectSizeLimitInfo` entity contains information about the
2465link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2466limit] of a project.
2467
David Pursehouseae367192014-11-25 17:24:47 +09002468[options="header",cols="1,^2,4"]
Edwin Kempin3c99f592013-07-15 10:12:27 +02002469|===============================
2470|Field Name ||Description
2471|`value` |optional|
2472The effective value of the max object size limit as a formatted string. +
2473Not set if there is no limit for the object size.
2474|`configured_value`|optional|
2475The max object size limit that is configured on the project as a
2476formatted string. +
2477Not set if there is no limit for the object size configured on project
2478level.
2479|`inherited_value` |optional|
2480The max object size limit that is inherited as a formatted string. +
2481Not set if there is no global limit for the object size.
2482|===============================
2483
Patrick Hiesel21816f12016-04-22 08:53:06 +02002484[[project-access-input]]
2485=== ProjectAccessInput
2486The `ProjectAccessInput` describes changes that should be applied to a project
2487access config.
2488
2489[options="header",cols="1,^2,4"]
2490|=============================
2491|Field Name | |Description
2492|`remove` |optional|
2493A list of deductions to be applied to the project access as
2494link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
2495|`add` |optional|
2496A list of additions to be applied to the project access as
2497link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
2498|`message` |optional|
2499A commit message for this change.
2500|`parent` |optional|
2501A new parent for the project to inherit from. Changing the parent project
2502requires administrative privileges.
2503|=============================
2504
Edwin Kempin57f303c2013-02-13 15:52:22 +01002505[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002506=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01002507The `ProjectDescriptionInput` entity contains information for setting a
2508project description.
2509
David Pursehouseae367192014-11-25 17:24:47 +09002510[options="header",cols="1,^2,4"]
Edwin Kempin57f303c2013-02-13 15:52:22 +01002511|=============================
2512|Field Name ||Description
2513|`description` |optional|The project description. +
2514The project description will be deleted if not set.
2515|`commit_message`|optional|
2516Message that should be used to commit the change of the project
2517description in the `project.config` file to the `refs/meta/config`
2518branch.
2519|=============================
2520
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002521[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002522=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002523The `ProjectInfo` entity contains information about a project.
2524
David Pursehouseae367192014-11-25 17:24:47 +09002525[options="header",cols="1,^2,4"]
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002526|===========================
2527|Field Name ||Description
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002528|`id` ||The URL encoded project name.
2529|`name` |
2530not set if returned in a map where the project name is used as map key|
2531The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01002532|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002533The name of the parent project. +
2534`?-<n>` if the parent project is not visible (`<n>` is a number which
2535is increased for each non-visible project).
2536|`description` |optional|The description of the project.
Shawn Pearce21a6c212014-04-23 12:35:10 -07002537|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002538|`branches` |optional|Map of branch names to HEAD revisions.
Edwin Kempin26c95a42014-11-25 16:29:47 +01002539|`web_links` |optional|
Edwin Kempinea004752014-04-11 15:56:02 +02002540Links to the project in external sites as a list of
2541link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002542|===========================
2543
Bruce Zu798ea122013-02-18 16:55:43 +08002544[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002545=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08002546The `ProjectInput` entity contains information for the creation of
2547a new project.
2548
David Pursehouseae367192014-11-25 17:24:47 +09002549[options="header",cols="1,^2,4"]
Bruce Zu798ea122013-02-18 16:55:43 +08002550|=========================================
2551|Field Name ||Description
2552|`name` |optional|
2553The name of the project (not encoded). +
David Pursehouse8c5ad412015-02-03 14:19:09 +09002554If set, must match the project name in the URL. +
2555If name ends with `.git` the suffix will be automatically removed.
Bruce Zu798ea122013-02-18 16:55:43 +08002556|`parent` |optional|
2557The name of the parent project. +
2558If not set, the `All-Projects` project will be the parent project.
2559|`description` |optional|The description of the project.
2560|`permissions_only` |`false` if not set|
2561Whether a permission-only project should be created.
2562|`create_empty_commit` |`false` if not set|
2563Whether an empty initial commit should be created.
2564|`submit_type` |optional|
2565The submit type that should be set for the project
2566(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
2567`MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01002568If not set, `MERGE_IF_NECESSARY` is set as submit type unless
2569link:config-gerrit.html#repository.name.defaultSubmitType[
2570repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08002571|`branches` |optional|
2572A list of branches that should be initially created. +
2573For the branch names the `refs/heads/` prefix can be omitted.
2574|`owners` |optional|
2575A list of groups that should be assigned as project owner. +
2576Each group in the list must be specified as
2577link:rest-api-groups.html#group-id[group-id]. +
2578If not set, the link:config-gerrit.html#repository.name.ownerGroup[
2579groups that are configured as default owners] are set as project
2580owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002581|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002582Whether contributor agreements should be used for the project (`TRUE`,
2583`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02002584|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002585Whether the usage of 'Signed-Off-By' footers is required for the
2586project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02002587|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
2588Whether a new change is created for every commit not in target branch
2589for the project (`TRUE`, `FALSE`, `INHERIT`).
2590|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002591Whether content merge should be enabled for the project (`TRUE`,
2592`FALSE`, `INHERIT`). +
2593`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002594|`require_change_id` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002595Whether the usage of Change-Ids is required for the project (`TRUE`,
2596`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02002597|`max_object_size_limit` |optional|
2598Max allowed Git object size for this project.
2599Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01002600|`plugin_config_values` |optional|
2601Plugin configuration values as map which maps the plugin name to a map
2602of parameter names to values.
Bruce Zu798ea122013-02-18 16:55:43 +08002603|=========================================
2604
Edwin Kempinecad88c2013-02-14 12:09:44 +01002605[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002606=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01002607The `ProjectParentInput` entity contains information for setting a
2608project parent.
2609
David Pursehouseae367192014-11-25 17:24:47 +09002610[options="header",cols="1,^2,4"]
Edwin Kempinecad88c2013-02-14 12:09:44 +01002611|=============================
2612|Field Name ||Description
2613|`parent` ||The name of the parent project.
2614|`commit_message`|optional|
2615Message that should be used to commit the change of the project parent
2616in the `project.config` file to the `refs/meta/config` branch.
2617|=============================
2618
Edwin Kempin87504d92014-07-04 12:59:19 +02002619[[reflog-entry-info]]
2620=== ReflogEntryInfo
2621The `ReflogEntryInfo` entity describes an entry in a reflog.
2622
David Pursehouseae367192014-11-25 17:24:47 +09002623[options="header",cols="1,6"]
Edwin Kempin87504d92014-07-04 12:59:19 +02002624|============================
2625|Field Name |Description
2626|`old_id` |The old commit ID.
2627|`new_id` |The new commit ID.
2628|`who` |
2629The user performing the change as a
2630link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
2631|`comment` |Comment of the reflog entry.
2632|============================
2633
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002634[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002635=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002636The `RepositoryStatisticsInfo` entity contains information about
2637statistics of a Git repository.
2638
David Pursehouseae367192014-11-25 17:24:47 +09002639[options="header",cols="1,6"]
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002640|======================================
2641|Field Name |Description
2642|`number_of_loose_objects` |Number of loose objects.
2643|`number_of_loose_refs` |Number of loose refs.
2644|`number_of_pack_files` |Number of pack files.
2645|`number_of_packed_objects`|Number of packed objects.
2646|`number_of_packed_refs` |Number of packed refs.
2647|`size_of_loose_objects` |Size of loose objects in bytes.
2648|`size_of_packed_objects` |Size of packed objects in bytes.
2649|======================================
2650
David Pursehouse8cc68902014-10-06 18:17:16 +09002651[[tag-info]]
2652=== TagInfo
2653The `TagInfo` entity contains information about a tag.
2654
David Pursehouseae367192014-11-25 17:24:47 +09002655[options="header",cols="1,^2,4"]
David Pursehouse8cc68902014-10-06 18:17:16 +09002656|=========================
2657|Field Name ||Description
2658|`ref` ||The ref of the tag.
2659|`revision` ||For lightweight tags, the revision of the commit to which the tag
2660points. For annotated tags, the revision of the tag object.
2661|`object`|Only set for annotated tags.|The revision of the object to which the
2662tag points.
2663|`message`|Only set for annotated tags.|The tag message. For signed tags, includes
2664the signature.
David Pursehousec9f5a5a2015-12-07 19:13:16 +09002665|`tagger`|Only set for annotated tags, if present in the tag.|The tagger as a
David Pursehouse8cc68902014-10-06 18:17:16 +09002666link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
2667|=========================
2668
David Pursehouse6a446192016-06-03 10:00:34 +09002669[[tag-input]]
2670=== TagInput
2671
2672The `TagInput` entity contains information for creating a tag.
2673
2674[options="header",cols="1,^2,4"]
2675|=========================
2676|Field Name ||Description
2677|`ref` ||The name of the tag. The leading `refs/tags/` is optional.
2678|`revision` |optional|The revision to which the tag should point. If not
2679specified, the project's `HEAD` will be used.
2680|`message` |optional|The tag message. When set, the tag will be created
2681as an annotated tag.
2682|=========================
2683
2684
Edwin Kempin272402e2013-07-15 11:17:36 +02002685[[theme-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002686=== ThemeInfo
Edwin Kempin272402e2013-07-15 11:17:36 +02002687The `ThemeInfo` entity describes a theme.
2688
David Pursehouseae367192014-11-25 17:24:47 +09002689[options="header",cols="1,^2,4"]
Edwin Kempin272402e2013-07-15 11:17:36 +02002690|=============================
2691|Field Name ||Description
2692|`css` |optional|
2693The path to the `GerritSite.css` file.
2694|`header` |optional|
2695The path to the `GerritSiteHeader.html` file.
2696|`footer` |optional|
2697The path to the `GerritSiteFooter.html` file.
2698|=============================
2699
Patrick Hiesel5a3475f2016-04-21 11:44:29 +02002700----
Edwin Kempind0a63922013-01-23 16:32:59 +01002701
2702GERRIT
2703------
2704Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07002705
2706SEARCHBOX
2707---------