blob: 4658e2ce7bc673a9df12737fdfd6a0ad70db5b6f [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",
Edwin Kempina23eb102013-07-17 09:10:54 +0200735 "require_change_id": "TRUE",
736 "max_object_size_limit": "10m",
737 "submit_type": "REBASE_IF_NECESSARY",
738 "state": "ACTIVE"
739 }
740----
741
742As response the new configuration is returned as a link:#config-info[
743ConfigInfo] entity.
744
745.Response
746----
747 HTTP/1.1 200 OK
748 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900749 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200750
751 )]}'
752 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200753 "use_contributor_agreements": {
754 "value": false,
755 "configured_value": "FALSE",
756 "inherited_value": false
757 },
758 "use_content_merge": {
759 "value": true,
760 "configured_value": "INHERIT",
761 "inherited_value": true
762 },
763 "use_signed_off_by": {
764 "value": false,
765 "configured_value": "INHERIT",
766 "inherited_value": false
767 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200768 "create_new_change_for_all_not_in_target": {
769 "value": true,
770 "configured_value": "INHERIT",
771 "inherited_value": false
772 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200773 "require_change_id": {
774 "value": true,
775 "configured_value": "TRUE",
776 "inherited_value": true
777 },
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400778 "enable_signed_push": {
779 "value": true,
780 "configured_value": "INHERIT",
781 "inherited_value": false
782 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200783 "max_object_size_limit": {
784 "value": "10m",
785 "configured_value": "10m",
786 "inherited_value": "20m"
787 },
788 "submit_type": "REBASE_IF_NECESSARY",
789 "state": "ACTIVE",
790 "commentlinks": {}
791 }
792----
793
Edwin Kempinef3542f2013-03-19 13:31:49 +0100794[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800795=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800796--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100797'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800798--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100799
800Run the Git garbage collection for the repository of a project.
801
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100802Options for the Git garbage collection can be specified in the
803request body as a link:#gc-input[GCInput] entity.
804
Edwin Kempinef3542f2013-03-19 13:31:49 +0100805.Request
806----
807 POST /projects/plugins%2Freplication/gc HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900808 Content-Type: application/json; charset=UTF-8
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100809
810 {
811 "show_progress": true
812 }
Edwin Kempinef3542f2013-03-19 13:31:49 +0100813----
814
815The response is the streamed output of the garbage collection.
816
817.Response
818----
819 HTTP/1.1 200 OK
820 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900821 Content-Type: text/plain; charset=UTF-8
Edwin Kempinef3542f2013-03-19 13:31:49 +0100822
823 collecting garbage for "plugins/replication":
824 Pack refs: 100% (21/21)
825 Counting objects: 20
826 Finding sources: 100% (20/20)
827 Getting sizes: 100% (13/13)
828 Compressing objects: 83% (5/6)
829 Writing objects: 100% (20/20)
830 Selecting commits: 100% (7/7)
831 Building bitmaps: 100% (7/7)
832 Finding sources: 100% (41/41)
833 Getting sizes: 100% (25/25)
834 Compressing objects: 52% (12/23)
835 Writing objects: 100% (41/41)
836 Prune loose objects also found in pack files: 100% (36/36)
837 Prune loose, unreferenced objects: 100% (36/36)
838 done.
839----
840
Edwin Kempin62946742014-07-09 11:17:58 +0200841[[ban-commit]]
842=== Ban Commit
843--
844'PUT /projects/link:#project-name[\{project-name\}]/ban'
845--
846
847Marks commits as banned for the project. If a commit is banned Gerrit
848rejects every push that includes this commit with
849link:error-contains-banned-commit.html[contains banned commit ...].
850
851[NOTE]
852This REST endpoint only marks the commits as banned, but it does not
853remove the commits from the history of any central branch. This needs
854to be done manually.
855
856The commits to be banned must be specified in the request body as a
857link:#ban-input[BanInput] entity.
858
859The caller must be project owner.
860
861.Request
862----
863 PUT /projects/plugins%2Freplication/ban HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900864 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +0200865
866 {
867 "commits": [
868 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
869 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
870 ],
871 "reason": "Violates IP"
872 }
873----
874
875As response a link:#ban-result-info[BanResultInfo] entity is returned.
876
877.Response
878----
879 HTTP/1.1 200 OK
880 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900881 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +0200882
883 )]}'
884 {
885 "newly_banned": [
886 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
887 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
888 ]
889 }
890----
891
Edwin Kempina686de92013-05-09 15:12:34 +0200892[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800893== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +0200894
895[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800896=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800897--
Edwin Kempina686de92013-05-09 15:12:34 +0200898'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800899--
Edwin Kempina686de92013-05-09 15:12:34 +0200900
901List the branches of a project.
902
903As result a list of link:#branch-info[BranchInfo] entries is
904returned.
905
906.Request
907----
908 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
909----
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 Kempina686de92013-05-09 15:12:34 +0200916
917 )]}'
918 [
919 {
920 "ref": "HEAD",
921 "revision": "master"
922 },
923 {
924 "ref": "refs/meta/config",
925 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
926 },
927 {
928 "ref": "refs/heads/master",
929 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
930 },
931 {
932 "ref": "refs/heads/stable",
933 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
934 "can_delete": true
935 }
936 ]
937----
938
Hugo Arès3133b4b2014-10-14 14:05:10 -0400939[[branch-options]]
940==== Branch Options
941
Hugo Arès15856622014-10-14 14:19:01 -0400942Limit(n)::
943Limit the number of branches to be included in the results.
944+
945.Request
946----
947 GET /projects/testproject/branches?n=1 HTTP/1.0
948----
949+
950.Response
951----
952 HTTP/1.1 200 OK
953 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900954 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -0400955
956 )]}'
957 [
958 {
959 "ref": "HEAD",
960 "revision": "master",
961 "can_delete": false
962 }
963 ]
964----
965
966Skip(s)::
967Skip the given number of branches from the beginning of the list.
968+
969.Request
970----
971 GET /projects/testproject/branches?n=1&s=0 HTTP/1.0
972----
973+
974.Response
975----
976 HTTP/1.1 200 OK
977 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900978 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -0400979
980 )]}'
981 [
982 {
983 "ref": "HEAD",
984 "revision": "master",
985 "can_delete": false
986 }
987 ]
988----
989
Hugo Arès3133b4b2014-10-14 14:05:10 -0400990Substring(m)::
991Limit the results to those projects that match the specified substring.
992+
993List all projects that match substring `test`:
994+
995.Request
996----
997 GET /projects/testproject/branches?m=test HTTP/1.0
998----
999+
1000.Response
1001----
1002 HTTP/1.1 200 OK
1003 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001004 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001005
1006 )]}'
1007 [
1008 {
1009 "ref": "refs/heads/test1",
1010 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1011 "can_delete": true
1012 }
1013 ]
1014----
1015
1016Regex(r)::
1017Limit the results to those branches that match the specified regex.
1018Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
1019match any branches that start with 'test' and regex '*t' will match any
1020branches that end with 'test'.
1021+
1022List all branches that match regex `t.*1`:
1023+
1024.Request
1025----
1026 GET /projects/testproject/branches?r=t.*1 HTTP/1.0
1027----
1028+
1029.Response
1030----
1031 HTTP/1.1 200 OK
1032 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001033 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001034
1035 )]}'
1036 [
1037 {
1038 "ref": "refs/heads/test1",
1039 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1040 "can_delete": true
1041 }
1042 ]
1043----
1044
Edwin Kempin196e1732013-05-09 15:12:34 +02001045[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001046=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001047--
Edwin Kempin196e1732013-05-09 15:12:34 +02001048'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001049--
Edwin Kempin196e1732013-05-09 15:12:34 +02001050
1051Retrieves a branch of a project.
1052
1053.Request
1054----
1055 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
1056----
1057
1058As response a link:#branch-info[BranchInfo] entity is returned that
1059describes the branch.
1060
1061.Response
1062----
1063 HTTP/1.1 200 OK
1064 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001065 Content-Type: application/json; charset=UTF-8
Edwin Kempin196e1732013-05-09 15:12:34 +02001066
1067 )]}'
1068 {
1069 "ref": "refs/heads/master",
1070 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1071 }
1072----
1073
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001074[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001075=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001076--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001077'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001078--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001079
1080Creates a new branch.
1081
1082In the request body additional data for the branch can be provided as
1083link:#branch-input[BranchInput].
1084
1085.Request
1086----
1087 PUT /projects/MyProject/branches/stable HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001088 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001089
1090 {
1091 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1092 }
1093----
1094
1095As response a link:#branch-info[BranchInfo] entity is returned that
1096describes the created branch.
1097
1098.Response
1099----
1100 HTTP/1.1 201 Created
1101 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001102 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001103
1104 )]}'
1105 {
1106 "ref": "refs/heads/stable",
1107 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
1108 "can_delete": true
1109 }
1110----
1111
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001112[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001113=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001114--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001115'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001116--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001117
1118Deletes a branch.
1119
1120.Request
1121----
1122 DELETE /projects/MyProject/branches/stable HTTP/1.0
1123----
1124
1125.Response
1126----
1127 HTTP/1.1 204 No Content
1128----
1129
Hugo Arèsef8e3202015-01-12 15:09:06 -05001130[[delete-branches]]
1131=== Delete Branches
1132--
1133'POST /projects/link:#project-name[\{project-name\}]/branches:delete'
1134--
1135
1136Delete one or more branches.
1137
1138The branches to be deleted must be provided in the request body as a
1139link:#delete-branches-input[DeleteBranchesInput] entity.
1140
1141.Request
1142----
1143 POST /projects/MyProject/branches:delete HTTP/1.0
1144 Content-Type: application/json;charset=UTF-8
1145
1146 {
1147 "branches": [
1148 "stable-1.0",
1149 "stable-2.0"
1150 ]
1151 }
1152----
1153
1154.Response
1155----
1156 HTTP/1.1 204 No Content
1157----
1158
1159If some branches could not be deleted, the response is "`409 Conflict`" and the
1160error message is contained in the response body.
1161
Edwin Kempind31e5582013-11-30 12:07:08 +01001162[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001163=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001164--
1165'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1166--
1167
1168Gets the content of a file from the HEAD revision of a certain branch.
1169
1170.Request
1171----
1172 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1173----
1174
1175The content is returned as base64 encoded string.
1176
1177.Response
1178----
1179 HTTP/1.1 200 OK
1180 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001181 Content-Type: text/plain; charset=UTF-8
Edwin Kempind31e5582013-11-30 12:07:08 +01001182
1183 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1184----
1185
Edwin Kempin87504d92014-07-04 12:59:19 +02001186[[get-reflog]]
1187=== Get Reflog
1188--
1189'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
1190--
1191
1192Gets the reflog of a certain branch.
1193
1194The caller must be project owner.
1195
1196.Request
1197----
1198 GET /projects/gerrit/branches/master/reflog HTTP/1.0
1199----
1200
1201As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
1202is returned that describe the reflog entries. The reflog entries are
1203returned in reverse order.
1204
1205.Response
1206----
1207 HTTP/1.1 200 OK
1208 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001209 Content-Type: application/json; charset=UTF-8
Edwin Kempin87504d92014-07-04 12:59:19 +02001210
1211 )]}'
1212 [
1213 {
1214 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1215 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
1216 "who": {
1217 "name": "Jane Roe",
1218 "email": "jane.roe@example.com",
1219 "date": "2014-06-30 11:53:43.000000000",
1220 "tz": 120
1221 },
1222 "comment": "merged: fast forward"
1223 },
1224 {
1225 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1226 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1227 "who": {
1228 "name": "John Doe",
1229 "email": "john.doe@example.com",
1230 "date": "2013-10-02 10:45:26.000000000",
1231 "tz": 120
1232 },
1233 "comment": "merged: fast forward"
1234 },
1235 {
1236 "old_id": "0000000000000000000000000000000000000000",
1237 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1238 "who": {
1239 "name": "John Doe",
1240 "email": "john.doe@example.com",
1241 "date": "2013-09-30 19:08:44.000000000",
1242 "tz": 120
1243 },
1244 "comment": ""
1245 }
1246 ]
1247----
1248
1249The get reflog endpoint also accepts a limit integer in the `n`
1250parameter. This limits the results to show the last `n` reflog entries.
1251
1252Query the last 25 reflog entries.
1253----
1254 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
1255----
1256
Edwin Kempin2a581fd2014-07-04 14:04:54 +02001257The reflog can also be filtered by timestamp by specifying the `from`
1258and `to` parameters. The timestamp for `from` and `to` must be given as
1259UTC in the following format: `yyyyMMdd_HHmm`.
1260
1261----
1262 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
1263----
1264
Edwin Kempin4425c742013-03-18 13:23:00 +01001265[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001266== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01001267
1268[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001269=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001270--
Edwin Kempin4425c742013-03-18 13:23:00 +01001271'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001272--
Edwin Kempin4425c742013-03-18 13:23:00 +01001273
1274List the direct child projects of a project.
1275
1276.Request
1277----
1278 GET /projects/Public-Plugins/children/ HTTP/1.0
1279----
1280
1281As result a list of link:#project-info[ProjectInfo] entries is
1282returned that describe the child projects.
1283
1284.Response
1285----
1286 HTTP/1.1 200 OK
1287 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001288 Content-Type: application/json; charset=UTF-8
Edwin Kempin4425c742013-03-18 13:23:00 +01001289
1290 )]}'
1291 [
1292 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001293 "id": "plugins%2Freplication",
1294 "name": "plugins/replication",
1295 "parent": "Public-Plugins",
1296 "description": "Copies to other servers using the Git protocol"
1297 },
1298 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001299 "id": "plugins%2Freviewnotes",
1300 "name": "plugins/reviewnotes",
1301 "parent": "Public-Plugins",
1302 "description": "Annotates merged commits using notes on refs/notes/review."
1303 },
1304 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001305 "id": "plugins%2Fsingleusergroup",
1306 "name": "plugins/singleusergroup",
1307 "parent": "Public-Plugins",
1308 "description": "GroupBackend enabling users to be directly added to access rules"
1309 }
1310 ]
1311----
1312
Edwin Kempinf95bd172013-03-19 11:10:57 +01001313To resolve the child projects of a project recursively the parameter
1314`recursive` can be set.
1315
1316Child projects that are not visible to the calling user are ignored and
1317are not resolved further.
1318
1319.Request
1320----
1321 GET /projects/Public-Projects/children/?recursive HTTP/1.0
1322----
1323
1324.Response
1325----
1326 HTTP/1.1 200 OK
1327 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001328 Content-Type: application/json; charset=UTF-8
Edwin Kempinf95bd172013-03-19 11:10:57 +01001329
1330 )]}'
1331 [
1332 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001333 "id": "gerrit",
1334 "name": "gerrit",
1335 "parent": "Public-Projects",
1336 "description": "Gerrit Code Review"
1337 },
1338 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001339 "id": "plugins%2Freplication",
1340 "name": "plugins/replication",
1341 "parent": "Public-Plugins",
1342 "description": "Copies to other servers using the Git protocol"
1343 },
1344 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001345 "id": "plugins%2Freviewnotes",
1346 "name": "plugins/reviewnotes",
1347 "parent": "Public-Plugins",
1348 "description": "Annotates merged commits using notes on refs/notes/review."
1349 },
1350 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001351 "id": "plugins%2Fsingleusergroup",
1352 "name": "plugins/singleusergroup",
1353 "parent": "Public-Plugins",
1354 "description": "GroupBackend enabling users to be directly added to access rules"
1355 },
1356 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001357 "id": "Public-Plugins",
1358 "name": "Public-Plugins",
1359 "parent": "Public-Projects",
1360 "description": "Parent project for plugins/*"
1361 }
1362 ]
1363----
1364
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001365[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001366=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001367--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001368'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001369--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001370
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01001371Retrieves a child project. If a non-direct child project should be
1372retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001373
1374.Request
1375----
1376 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
1377----
1378
1379As response a link:#project-info[ProjectInfo] entity is returned that
1380describes the child project.
1381
1382.Response
1383----
1384 HTTP/1.1 200 OK
1385 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001386 Content-Type: application/json; charset=UTF-8
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001387
1388 )]}'
1389 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001390 "id": "plugins%2Freplication",
1391 "name": "plugins/replication",
1392 "parent": "Public-Plugins",
1393 "description": "Copies to other servers using the Git protocol"
1394 }
1395----
1396
David Pursehouse8cc68902014-10-06 18:17:16 +09001397[[tag-endpoints]]
1398== Tag Endpoints
1399
1400[[list-tags]]
1401=== List Tags
1402--
1403'GET /projects/link:#project-name[\{project-name\}]/tags/'
1404--
1405
1406List the tags of a project.
1407
1408As result a list of link:#tag-info[TagInfo] entries is returned.
1409
1410Only includes tags under the `refs/tags/` namespace.
1411
1412.Request
1413----
1414 GET /projects/work%2Fmy-project/tags/ HTTP/1.0
1415----
1416
1417.Response
1418----
1419 HTTP/1.1 200 OK
1420 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001421 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09001422
1423 )]}'
1424 [
1425 {
1426 "ref": "refs/tags/v1.0",
1427 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1428 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1429 "message": "Annotated tag",
1430 "tagger": {
1431 "name": "David Pursehouse",
1432 "email": "david.pursehouse@sonymobile.com",
1433 "date": "2014-10-06 07:35:03.000000000",
1434 "tz": 540
1435 }
1436 },
1437 {
1438 "ref": "refs/tags/v2.0",
1439 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
1440 },
1441 {
1442 "ref": "refs/tags/v3.0",
1443 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
1444 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1445 "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-----",
1446 "tagger": {
1447 "name": "David Pursehouse",
1448 "email": "david.pursehouse@sonymobile.com",
1449 "date": "2014-10-06 09:02:16.000000000",
1450 "tz": 540
1451 }
1452 }
1453 ]
1454----
1455
1456[[get-tag]]
1457=== Get Tag
1458--
1459'GET /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
1460--
1461
1462Retrieves a tag of a project.
1463
1464.Request
1465----
1466 GET /projects/work%2Fmy-project/tags/v1.0 HTTP/1.0
1467----
1468
1469As response a link:#tag-info[TagInfo] entity is returned that describes the tag.
1470
1471.Response
1472----
1473 HTTP/1.1 200 OK
1474 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001475 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09001476
1477 )]}'
1478 {
1479 "ref": "refs/tags/v1.0",
1480 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
1481 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
1482 "message": "Annotated tag",
1483 "tagger": {
1484 "name": "David Pursehouse",
1485 "email": "david.pursehouse@sonymobile.com",
1486 "date": "2014-10-06 07:35:03.000000000",
1487 "tz": 540
1488 }
1489 }
1490----
1491
1492
Edwin Kempin1b993602014-07-08 16:18:45 +02001493[[commit-endpoints]]
1494== Commit Endpoints
1495
1496[[get-commit]]
1497=== Get Commit
1498--
1499'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
1500--
1501
1502Retrieves a commit of a project.
1503
1504The commit must be visible to the caller.
1505
1506.Request
1507----
1508 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
1509----
1510
1511As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
1512is returned that describes the commit.
1513
1514.Response
1515----
1516 HTTP/1.1 200 OK
1517 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001518 Content-Type: application/json; charset=UTF-8
Edwin Kempin1b993602014-07-08 16:18:45 +02001519
1520 )]}'
1521 {
1522 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
1523 "parents": [
1524 {
1525 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
1526 "subject": "Migrate contributor agreements to All-Projects."
1527 }
1528 ],
1529 "author": {
1530 "name": "Shawn O. Pearce",
1531 "email": "sop@google.com",
1532 "date": "2012-04-24 18:08:08.000000000",
1533 "tz": -420
1534 },
1535 "committer": {
1536 "name": "Shawn O. Pearce",
1537 "email": "sop@google.com",
1538 "date": "2012-04-24 18:08:08.000000000",
1539 "tz": -420
1540 },
1541 "subject": "Use an EventBus to manage star icons",
1542 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
1543 }
1544----
1545
Edwin Kempin6f7410a2014-07-09 15:46:22 +02001546[[get-content]]
1547=== Get Content
1548--
1549'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1550--
1551
1552Gets the content of a file from a certain commit.
1553
1554.Request
1555----
1556 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1557----
1558
1559The content is returned as base64 encoded string.
1560
1561.Response
1562----
1563 HTTP/1.1 200 OK
1564 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001565 Content-Type: text/plain; charset=UTF-8
Edwin Kempin6f7410a2014-07-09 15:46:22 +02001566
1567 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1568----
1569
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01001570[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001571== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01001572
Edwin Kempin76202742013-02-15 13:51:50 +01001573[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001574=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001575--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001576'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001577--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001578
Edwin Kempind0a63922013-01-23 16:32:59 +01001579List custom dashboards for a project.
1580
Edwin Kempin55367622013-02-05 09:09:23 +01001581As result a list of link:#dashboard-info[DashboardInfo] entries is
1582returned.
1583
Edwin Kempind0a63922013-01-23 16:32:59 +01001584List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01001585
1586.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01001587----
1588 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01001589----
Edwin Kempind0a63922013-01-23 16:32:59 +01001590
Edwin Kempin37440832013-02-06 11:36:00 +01001591.Response
1592----
Edwin Kempind0a63922013-01-23 16:32:59 +01001593 HTTP/1.1 200 OK
1594 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001595 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01001596
1597 )]}'
1598 [
1599 {
Edwin Kempind0a63922013-01-23 16:32:59 +01001600 "id": "main:closed",
1601 "ref": "main",
1602 "path": "closed",
1603 "description": "Merged and abandoned changes in last 7 weeks",
1604 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1605 "default": true,
1606 "title": "Closed changes",
1607 "sections": [
1608 {
1609 "name": "Merged",
1610 "query": "status:merged age:7w"
1611 },
1612 {
1613 "name": "Abandoned",
1614 "query": "status:abandoned age:7w"
1615 }
1616 ]
1617 }
1618 ]
1619----
1620
Edwin Kempina64c4b92013-01-23 11:30:40 +01001621.Get all dashboards of the 'All-Projects' project
1622****
1623get::/projects/All-Projects/dashboards/
1624****
1625
Edwin Kempin67e923c2013-02-14 13:57:12 +01001626[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001627=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001628--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001629'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001630--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001631
Edwin Kempin67e923c2013-02-14 13:57:12 +01001632Retrieves a project dashboard. The dashboard can be defined on that
1633project or be inherited from a parent project.
1634
1635.Request
1636----
1637 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
1638----
1639
1640As response a link:#dashboard-info[DashboardInfo] entity is returned
1641that describes the dashboard.
1642
1643.Response
1644----
1645 HTTP/1.1 200 OK
1646 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001647 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01001648
1649 )]}'
1650 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01001651 "id": "main:closed",
1652 "ref": "main",
1653 "path": "closed",
1654 "description": "Merged and abandoned changes in last 7 weeks",
1655 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1656 "default": true,
1657 "title": "Closed changes",
1658 "sections": [
1659 {
1660 "name": "Merged",
1661 "query": "status:merged age:7w"
1662 },
1663 {
1664 "name": "Abandoned",
1665 "query": "status:abandoned age:7w"
1666 }
1667 ]
1668 }
1669----
1670
1671To retrieve the default dashboard of a project use `default` as
1672dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01001673
1674.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01001675----
1676 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01001677----
Edwin Kempind0a63922013-01-23 16:32:59 +01001678
Edwin Kempin37440832013-02-06 11:36:00 +01001679.Response
1680----
Edwin Kempind0a63922013-01-23 16:32:59 +01001681 HTTP/1.1 200 OK
1682 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001683 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01001684
1685 )]}'
1686 {
Edwin Kempind0a63922013-01-23 16:32:59 +01001687 "id": "main:closed",
1688 "ref": "main",
1689 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01001690 "description": "Merged and abandoned changes in last 7 weeks",
1691 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
Edwin Kempind0a63922013-01-23 16:32:59 +01001692 "default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01001693 "title": "Closed changes",
1694 "sections": [
1695 {
1696 "name": "Merged",
1697 "query": "status:merged age:7w"
1698 },
1699 {
1700 "name": "Abandoned",
1701 "query": "status:abandoned age:7w"
1702 }
1703 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01001704 }
1705----
1706
Edwin Kempin67e923c2013-02-14 13:57:12 +01001707[[set-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001708=== Set Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001709--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001710'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001711--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001712
Edwin Kempin67e923c2013-02-14 13:57:12 +01001713Updates/Creates a project dashboard.
1714
1715Currently only supported for the `default` dashboard.
1716
1717The creation/update information for the dashboard must be provided in
1718the request body as a link:#dashboard-input[DashboardInput] entity.
1719
1720.Request
1721----
1722 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001723 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01001724
1725 {
1726 "id": "main:closed",
1727 "commit_message": "Define the default dashboard"
1728 }
1729----
1730
1731As response the new/updated dashboard is returned as a
1732link:#dashboard-info[DashboardInfo] entity.
1733
1734.Response
1735----
1736 HTTP/1.1 200 OK
1737 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001738 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01001739
1740 )]}'
1741 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01001742 "id": "main:closed",
1743 "ref": "main",
1744 "path": "closed",
1745 "description": "Merged and abandoned changes in last 7 weeks",
1746 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
1747 "default": true,
1748 "title": "Closed changes",
1749 "sections": [
1750 {
1751 "name": "Merged",
1752 "query": "status:merged age:7w"
1753 },
1754 {
1755 "name": "Abandoned",
1756 "query": "status:abandoned age:7w"
1757 }
1758 ]
1759 }
1760----
1761
1762[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001763=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001764--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001765'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001766--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001767
Edwin Kempin67e923c2013-02-14 13:57:12 +01001768Deletes a project dashboard.
1769
1770Currently only supported for the `default` dashboard.
1771
Edwin Kempinefec4492013-02-22 10:09:23 +01001772The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05001773DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01001774
1775Please note that some proxies prohibit request bodies for DELETE
1776requests.
1777
1778.Request
1779----
1780 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
1781----
1782
1783.Response
1784----
1785 HTTP/1.1 204 No Content
1786----
1787
Edwin Kempin34d83352013-02-06 10:40:17 +01001788
1789[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001790== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01001791
Edwin Kempin196e1732013-05-09 15:12:34 +02001792[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001793=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02001794The name of a branch or `HEAD`. The prefix `refs/heads/` can be
1795omitted.
1796
Edwin Kempin1b993602014-07-08 16:18:45 +02001797[[commit-id]]
1798=== \{commit-id\}
1799Commit ID.
1800
David Pursehouse8cc68902014-10-06 18:17:16 +09001801[[tag-id]]
1802=== \{tag-id\}
1803The name of a tag. The prefix `refs/tags/` can be omitted.
1804
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001805[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001806=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01001807The ID of a dashboard in the format '<ref>:<path>'.
1808
1809A special dashboard ID is `default` which represents the default
1810dashboard of a project.
1811
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001812[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001813=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01001814The name of the project.
1815
Edwin Kempina9e94ab2015-03-06 10:35:39 +01001816If the name ends with `.git`, the suffix will be automatically removed.
1817
Edwin Kempin34d83352013-02-06 10:40:17 +01001818
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001819[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001820== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01001821
Edwin Kempin62946742014-07-09 11:17:58 +02001822[[ban-input]]
1823=== BanInput
1824The `BanInput` entity contains information for banning commits in a
1825project.
1826
David Pursehouseae367192014-11-25 17:24:47 +09001827[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02001828|=======================
1829|Field Name||Description
1830|`commits` ||List of commits to be banned.
1831|`reason` |optional|Reason for banning the commits.
1832|=======================
1833
1834[[ban-result-info]]
1835=== BanResultInfo
1836The `BanResultInfo` entity describes the result of banning commits.
1837
David Pursehouseae367192014-11-25 17:24:47 +09001838[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02001839|=============================
1840|Field Name ||Description
1841|`newly_banned` |optional|List of newly banned commits.
1842|`already_banned`|optional|List of commits that were already banned.
1843|`ignored` |optional|List of object IDs that were ignored.
1844|=============================
1845
Edwin Kempin521c1242015-01-23 12:44:44 +01001846[[branch-info]]
1847=== BranchInfo
1848The `BranchInfo` entity contains information about a branch.
1849
1850[options="header",cols="1,^2,4"]
1851|=========================
1852|Field Name ||Description
1853|`ref` ||The ref of the branch.
1854|`revision` ||The revision to which the branch points.
1855|`can_delete`|`false` if not set|
1856Whether the calling user can delete this branch.
1857|`web_links` |optional|
1858Links to the branch in external sites as a list of
1859link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
1860|=========================
1861
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001862[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001863=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001864The `BranchInput` entity contains information for the creation of
1865a new branch.
1866
David Pursehouseae367192014-11-25 17:24:47 +09001867[options="header",cols="1,^2,4"]
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001868|=======================
1869|Field Name||Description
1870|`ref` |optional|
1871The name of the branch. The prefix `refs/heads/` can be
1872omitted. +
1873If set, must match the branch ID in the URL.
1874|`revision`|optional|
1875The base revision of the new branch. +
1876If not set, `HEAD` will be used as base revision.
1877|=======================
1878
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001879[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001880=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001881The `ConfigInfo` entity contains information about the effective project
1882configuration.
1883
David Pursehouseae367192014-11-25 17:24:47 +09001884[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02001885|=======================================================
1886|Field Name ||Description
1887|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001888The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001889|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001890link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1891authors must complete a contributor agreement on the site before
1892pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001893|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001894link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1895Gerrit will try to perform a 3-way merge of text file content when a
1896file has been modified by both the destination branch and the change
1897being submitted. This option only takes effect if submit type is not
1898FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001899|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001900link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1901each change must contain a Signed-off-by line from either the author or
1902the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001903|`create_new_change_for_all_not_in_target` |optional|
1904link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1905a new change is created for every commit not in target branch.
1906|`require_change_id` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001907link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
1908valid link:user-changeid.html[Change-Id] footer in any commit uploaded
1909for review is required. This does not apply to commits pushed directly
1910to a branch or tag.
Dave Borowitz5170e0f2015-06-18 21:05:29 -04001911|`enable_signed_push` |optional|
1912link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
1913signed push validation is enabled on the project.
Edwin Kempin3c99f592013-07-15 10:12:27 +02001914|`max_object_size_limit` ||
1915The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
1916limit] of this project as a link:#max-object-size-limit-info[
1917MaxObjectSizeLimitInfo] entity.
1918|`submit_type` ||
1919The default submit type of the project, can be `MERGE_IF_NECESSARY`,
1920`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
1921`CHERRY_PICK`.
1922|`state` |optional|
1923The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
1924Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02001925|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02001926Map with the comment link configurations of the project. The name of
1927the comment link configuration is mapped to the comment link
1928configuration, which has the same format as the
1929link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[
1930commentlink section] of `gerrit.config`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001931|`theme` |optional|
Edwin Kempin272402e2013-07-15 11:17:36 +02001932The theme that is configured for the project as a link:#theme-info[
1933ThemeInfo] entity.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001934|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01001935Plugin configuration as map which maps the plugin name to a map of
1936parameter names to link:#config-parameter-info[ConfigParameterInfo]
1937entities.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001938|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02001939Actions the caller might be able to perform on this project. The
1940information is a map of view names to
1941link:rest-api-changes.html#action-info[ActionInfo] entities.
David Pursehouse510b87d2014-11-25 16:46:28 +09001942|=======================================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02001943
Edwin Kempina23eb102013-07-17 09:10:54 +02001944[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001945=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02001946The `ConfigInput` entity describes a new project configuration.
1947
David Pursehouseae367192014-11-25 17:24:47 +09001948[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02001949|======================================================
1950|Field Name ||Description
1951|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001952The new description of the project. +
1953If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001954|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001955Whether authors must complete a contributor agreement on the site
1956before pushing any commits or changes to this project. +
1957Can be `TRUE`, `FALSE` or `INHERIT`. +
1958If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001959|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001960Whether Gerrit will try to perform a 3-way merge of text file content
1961when a file has been modified by both the destination branch and the
1962change being submitted. This option only takes effect if submit type is
1963not FAST_FORWARD_ONLY. +
1964Can be `TRUE`, `FALSE` or `INHERIT`. +
1965If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001966|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001967Whether each change must contain a Signed-off-by line from either the
1968author or the uploader in the commit message. +
1969Can be `TRUE`, `FALSE` or `INHERIT`. +
1970If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001971|`create_new_change_for_all_not_in_target` |optional|
1972Whether a new change will be created for every commit not in target
1973branch. +
1974Can be `TRUE`, `FALSE` or `INHERIT`. +
1975If not set, this setting is not updated.
1976|`require_change_id` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001977Whether a valid link:user-changeid.html[Change-Id] footer in any commit
1978uploaded for review is required. This does not apply to commits pushed
1979directly to a branch or tag. +
1980Can be `TRUE`, `FALSE` or `INHERIT`. +
1981If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001982|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001983The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
1984limit] of this project as a link:#max-object-size-limit-info[
1985MaxObjectSizeLimitInfo] entity. +
1986If set to `0`, the max object size limit is removed. +
1987If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001988|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001989The default submit type of the project, can be `MERGE_IF_NECESSARY`,
1990`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
1991`CHERRY_PICK`. +
1992If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001993|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02001994The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
1995Not set if the project state is `ACTIVE`. +
1996If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02001997|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01001998Plugin configuration values as map which maps the plugin name to a map
1999of parameter names to values.
David Pursehouse510b87d2014-11-25 16:46:28 +09002000|======================================================
Edwin Kempina23eb102013-07-17 09:10:54 +02002001
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002002[[config-parameter-info]]
2003ConfigParameterInfo
2004~~~~~~~~~~~~~~~~~~~
2005The `ConfigParameterInfo` entity describes a project configuration
2006parameter.
2007
David Pursehouseae367192014-11-25 17:24:47 +09002008[options="header",cols="1,^2,4"]
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002009|===============================
2010|Field Name ||Description
2011|`display_name` |optional|
2012The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01002013|`description` |optional|
2014The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01002015|`warning` |optional|
2016Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002017|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002018The type of the configuration parameter. Can be `STRING`, `INT`,
2019`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002020|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01002021The value of the configuration parameter as string. If the parameter
2022is inheritable this is the effective value which is deduced from
2023`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002024|`values` |optional|
2025The list of values. Only set if the `type` is `ARRAY`.
Edwin Kempin0d485232013-11-17 18:55:48 +01002026`editable` |`false` if not set|
2027Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01002028|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002029The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01002030|`inheritable` |`false` if not set|
2031Whether the configuration parameter can be inherited.
2032|`configured_value`|optional|
2033The value of the configuration parameter that is configured on this
2034project, only set if `inheritable` is true.
2035|`inherited_value` |optional|
2036The inherited value of the configuration parameter, only set if
2037`inheritable` is true.
2038|`permitted_values` |optional|
2039The list of permitted values, only set if the `type` is `LIST`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002040|===============================
2041
Edwin Kempin55367622013-02-05 09:09:23 +01002042[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002043=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002044The `DashboardInfo` entity contains information about a project
2045dashboard.
2046
David Pursehouseae367192014-11-25 17:24:47 +09002047[options="header",cols="1,^2,4"]
Edwin Kempin55367622013-02-05 09:09:23 +01002048|===============================
2049|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01002050|`id` ||
2051The ID of the dashboard. The ID has the format '<ref>:<path>',
2052where ref and path are URL encoded.
2053|`project` ||
2054The name of the project for which this dashboard is returned.
2055|`defining_project`||
2056The name of the project in which this dashboard is defined.
2057This is different from `project` if the dashboard is inherited from a
2058parent project.
2059|`ref` ||
2060The name of the ref in which the dashboard is defined, without the
2061`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
2062|`path` ||
2063The path of the file in which the dashboard is defined.
2064|`description` |optional|The description of the dashboard.
2065|`foreach` |optional|
2066Subquery that applies to all sections in the dashboard. +
2067Tokens such as `${project}` are not resolved.
2068|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09002069The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01002070The URL is relative to the canonical web URL. +
2071Tokens in the queries such as `${project}` are resolved.
2072|`default` |not set if `false`|
2073Whether this is the default dashboard of the project.
2074|`title` |optional|The title of the dashboard.
2075|`sections` ||
2076The list of link:#dashboard-section-info[sections] in the dashboard.
2077|===============================
2078
Edwin Kempin67e923c2013-02-14 13:57:12 +01002079[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002080=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01002081The `DashboardInput` entity contains information to create/update a
2082project dashboard.
2083
David Pursehouseae367192014-11-25 17:24:47 +09002084[options="header",cols="1,^2,4"]
Edwin Kempin67e923c2013-02-14 13:57:12 +01002085|=============================
2086|Field Name ||Description
2087|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01002088URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002089|`commit_message`|optional|
2090Message that should be used to commit the change of the dashboard.
2091|=============================
2092
Edwin Kempin55367622013-02-05 09:09:23 +01002093[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002094=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002095The `DashboardSectionInfo` entity contains information about a section
2096in a dashboard.
2097
David Pursehouseae367192014-11-25 17:24:47 +09002098[options="header",cols="1,6"]
Edwin Kempin55367622013-02-05 09:09:23 +01002099|===========================
2100|Field Name |Description
2101|`name` |The title of the section.
2102|`query` |The query of the section. +
2103Tokens such as `${project}` are not resolved.
2104|===========================
2105
Hugo Arèsef8e3202015-01-12 15:09:06 -05002106[[delete-branches-input]]
2107=== DeleteBranchesInput
2108The `DeleteBranchesInput` entity contains information about branches that should
2109be deleted.
2110
2111[options="header",width="50%",cols="1,6"]
2112|==========================
2113|Field Name |Description
2114|`branches` |A list of branch names that identify the branches that should be
2115deleted.
2116|==========================
2117
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002118[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002119=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002120The `GCInput` entity contains information to run the Git garbage
2121collection.
2122
David Pursehouseae367192014-11-25 17:24:47 +09002123[options="header",cols="1,^2,4"]
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002124|=============================
2125|Field Name ||Description
2126|`show_progress` |`false` if not set|
2127Whether progress information should be shown.
Christian Halstrick2f94e2e2015-03-11 15:13:31 +01002128|`aggressive` |`false` if not set|
2129Whether an aggressive garbage collection should be done.
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01002130|=============================
2131
Edwin Kempin6b813372013-03-13 17:07:33 +01002132[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002133=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01002134The `HeadInput` entity contains information for setting `HEAD` for a
2135project.
2136
David Pursehouseae367192014-11-25 17:24:47 +09002137[options="header",cols="1,6"]
Edwin Kempin6b813372013-03-13 17:07:33 +01002138|============================
2139|Field Name |Description
2140|`ref` |
2141The ref to which `HEAD` should be set, the `refs/heads` prefix can be
2142omitted.
2143|============================
2144
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002145[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002146=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002147A boolean value that can also be inherited.
2148
David Pursehouseae367192014-11-25 17:24:47 +09002149[options="header",cols="1,^2,4"]
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002150|================================
2151|Field Name ||Description
2152|`value` ||
2153The effective boolean value.
2154|`configured_value` ||
2155The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
2156|`inherited_value` |optional|
2157The boolean value inherited from the parent. +
2158Not set if there is no parent.
2159|================================
2160
Edwin Kempin3c99f592013-07-15 10:12:27 +02002161[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002162=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02002163The `MaxObjectSizeLimitInfo` entity contains information about the
2164link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2165limit] of a project.
2166
David Pursehouseae367192014-11-25 17:24:47 +09002167[options="header",cols="1,^2,4"]
Edwin Kempin3c99f592013-07-15 10:12:27 +02002168|===============================
2169|Field Name ||Description
2170|`value` |optional|
2171The effective value of the max object size limit as a formatted string. +
2172Not set if there is no limit for the object size.
2173|`configured_value`|optional|
2174The max object size limit that is configured on the project as a
2175formatted string. +
2176Not set if there is no limit for the object size configured on project
2177level.
2178|`inherited_value` |optional|
2179The max object size limit that is inherited as a formatted string. +
2180Not set if there is no global limit for the object size.
2181|===============================
2182
Edwin Kempin57f303c2013-02-13 15:52:22 +01002183[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002184=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01002185The `ProjectDescriptionInput` entity contains information for setting a
2186project description.
2187
David Pursehouseae367192014-11-25 17:24:47 +09002188[options="header",cols="1,^2,4"]
Edwin Kempin57f303c2013-02-13 15:52:22 +01002189|=============================
2190|Field Name ||Description
2191|`description` |optional|The project description. +
2192The project description will be deleted if not set.
2193|`commit_message`|optional|
2194Message that should be used to commit the change of the project
2195description in the `project.config` file to the `refs/meta/config`
2196branch.
2197|=============================
2198
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002199[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002200=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002201The `ProjectInfo` entity contains information about a project.
2202
David Pursehouseae367192014-11-25 17:24:47 +09002203[options="header",cols="1,^2,4"]
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002204|===========================
2205|Field Name ||Description
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002206|`id` ||The URL encoded project name.
2207|`name` |
2208not set if returned in a map where the project name is used as map key|
2209The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01002210|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002211The name of the parent project. +
2212`?-<n>` if the parent project is not visible (`<n>` is a number which
2213is increased for each non-visible project).
2214|`description` |optional|The description of the project.
Shawn Pearce21a6c212014-04-23 12:35:10 -07002215|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002216|`branches` |optional|Map of branch names to HEAD revisions.
Edwin Kempin26c95a42014-11-25 16:29:47 +01002217|`web_links` |optional|
Edwin Kempinea004752014-04-11 15:56:02 +02002218Links to the project in external sites as a list of
2219link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002220|===========================
2221
Bruce Zu798ea122013-02-18 16:55:43 +08002222[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002223=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08002224The `ProjectInput` entity contains information for the creation of
2225a new project.
2226
David Pursehouseae367192014-11-25 17:24:47 +09002227[options="header",cols="1,^2,4"]
Bruce Zu798ea122013-02-18 16:55:43 +08002228|=========================================
2229|Field Name ||Description
2230|`name` |optional|
2231The name of the project (not encoded). +
David Pursehouse8c5ad412015-02-03 14:19:09 +09002232If set, must match the project name in the URL. +
2233If name ends with `.git` the suffix will be automatically removed.
Bruce Zu798ea122013-02-18 16:55:43 +08002234|`parent` |optional|
2235The name of the parent project. +
2236If not set, the `All-Projects` project will be the parent project.
2237|`description` |optional|The description of the project.
2238|`permissions_only` |`false` if not set|
2239Whether a permission-only project should be created.
2240|`create_empty_commit` |`false` if not set|
2241Whether an empty initial commit should be created.
2242|`submit_type` |optional|
2243The submit type that should be set for the project
2244(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
2245`MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01002246If not set, `MERGE_IF_NECESSARY` is set as submit type unless
2247link:config-gerrit.html#repository.name.defaultSubmitType[
2248repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08002249|`branches` |optional|
2250A list of branches that should be initially created. +
2251For the branch names the `refs/heads/` prefix can be omitted.
2252|`owners` |optional|
2253A list of groups that should be assigned as project owner. +
2254Each group in the list must be specified as
2255link:rest-api-groups.html#group-id[group-id]. +
2256If not set, the link:config-gerrit.html#repository.name.ownerGroup[
2257groups that are configured as default owners] are set as project
2258owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002259|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002260Whether contributor agreements should be used for the project (`TRUE`,
2261`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02002262|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002263Whether the usage of 'Signed-Off-By' footers is required for the
2264project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02002265|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
2266Whether a new change is created for every commit not in target branch
2267for the project (`TRUE`, `FALSE`, `INHERIT`).
2268|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002269Whether content merge should be enabled for the project (`TRUE`,
2270`FALSE`, `INHERIT`). +
2271`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002272|`require_change_id` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08002273Whether the usage of Change-Ids is required for the project (`TRUE`,
2274`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02002275|`max_object_size_limit` |optional|
2276Max allowed Git object size for this project.
2277Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01002278|`plugin_config_values` |optional|
2279Plugin configuration values as map which maps the plugin name to a map
2280of parameter names to values.
Bruce Zu798ea122013-02-18 16:55:43 +08002281|=========================================
2282
Edwin Kempinecad88c2013-02-14 12:09:44 +01002283[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002284=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01002285The `ProjectParentInput` entity contains information for setting a
2286project parent.
2287
David Pursehouseae367192014-11-25 17:24:47 +09002288[options="header",cols="1,^2,4"]
Edwin Kempinecad88c2013-02-14 12:09:44 +01002289|=============================
2290|Field Name ||Description
2291|`parent` ||The name of the parent project.
2292|`commit_message`|optional|
2293Message that should be used to commit the change of the project parent
2294in the `project.config` file to the `refs/meta/config` branch.
2295|=============================
2296
Edwin Kempin87504d92014-07-04 12:59:19 +02002297[[reflog-entry-info]]
2298=== ReflogEntryInfo
2299The `ReflogEntryInfo` entity describes an entry in a reflog.
2300
David Pursehouseae367192014-11-25 17:24:47 +09002301[options="header",cols="1,6"]
Edwin Kempin87504d92014-07-04 12:59:19 +02002302|============================
2303|Field Name |Description
2304|`old_id` |The old commit ID.
2305|`new_id` |The new commit ID.
2306|`who` |
2307The user performing the change as a
2308link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
2309|`comment` |Comment of the reflog entry.
2310|============================
2311
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002312[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002313=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002314The `RepositoryStatisticsInfo` entity contains information about
2315statistics of a Git repository.
2316
David Pursehouseae367192014-11-25 17:24:47 +09002317[options="header",cols="1,6"]
Edwin Kempin19ea9b92013-03-20 13:20:26 +01002318|======================================
2319|Field Name |Description
2320|`number_of_loose_objects` |Number of loose objects.
2321|`number_of_loose_refs` |Number of loose refs.
2322|`number_of_pack_files` |Number of pack files.
2323|`number_of_packed_objects`|Number of packed objects.
2324|`number_of_packed_refs` |Number of packed refs.
2325|`size_of_loose_objects` |Size of loose objects in bytes.
2326|`size_of_packed_objects` |Size of packed objects in bytes.
2327|======================================
2328
David Pursehouse8cc68902014-10-06 18:17:16 +09002329[[tag-info]]
2330=== TagInfo
2331The `TagInfo` entity contains information about a tag.
2332
David Pursehouseae367192014-11-25 17:24:47 +09002333[options="header",cols="1,^2,4"]
David Pursehouse8cc68902014-10-06 18:17:16 +09002334|=========================
2335|Field Name ||Description
2336|`ref` ||The ref of the tag.
2337|`revision` ||For lightweight tags, the revision of the commit to which the tag
2338points. For annotated tags, the revision of the tag object.
2339|`object`|Only set for annotated tags.|The revision of the object to which the
2340tag points.
2341|`message`|Only set for annotated tags.|The tag message. For signed tags, includes
2342the signature.
2343|`tagger`|Only set for annotated tags.|The tagger as a
2344link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
2345|=========================
2346
Edwin Kempin272402e2013-07-15 11:17:36 +02002347[[theme-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002348=== ThemeInfo
Edwin Kempin272402e2013-07-15 11:17:36 +02002349The `ThemeInfo` entity describes a theme.
2350
David Pursehouseae367192014-11-25 17:24:47 +09002351[options="header",cols="1,^2,4"]
Edwin Kempin272402e2013-07-15 11:17:36 +02002352|=============================
2353|Field Name ||Description
2354|`css` |optional|
2355The path to the `GerritSite.css` file.
2356|`header` |optional|
2357The path to the `GerritSiteHeader.html` file.
2358|`footer` |optional|
2359The path to the `GerritSiteFooter.html` file.
2360|=============================
2361
Edwin Kempind0a63922013-01-23 16:32:59 +01002362
2363GERRIT
2364------
2365Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07002366
2367SEARCHBOX
2368---------