blob: 20795b64a352a21829f1eae9b3b7d43a308322ab [file] [log] [blame]
Marian Harbachebeb1542019-12-13 10:42:46 +01001:linkattrs:
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002= Gerrit Code Review - /projects/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01003
4This page describes the project related REST endpoints.
5Please also take note of the general information on the
6link:rest-api.html[REST API].
7
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01008[[project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08009== Project Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +010010
Edwin Kempin76202742013-02-15 13:51:50 +010011[[list-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080012=== List Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080013--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010014'GET /projects/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080015--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010016
Edwin Kempind0a63922013-01-23 16:32:59 +010017Lists the projects accessible by the caller. This is the same as
18using the link:cmd-ls-projects.html[ls-projects] command over SSH,
19and accepts the same options as query parameters.
20
Edwin Kempin51a6dc92013-02-04 15:43:59 +010021As result a map is returned that maps the project names to
22link:#project-info[ProjectInfo] entries. The entries in the map are sorted
23by project name.
24
Edwin Kempin37440832013-02-06 11:36:00 +010025.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010026----
27 GET /projects/?d HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010028----
Edwin Kempind0a63922013-01-23 16:32:59 +010029
Edwin Kempin37440832013-02-06 11:36:00 +010030.Response
31----
Edwin Kempind0a63922013-01-23 16:32:59 +010032 HTTP/1.1 200 OK
33 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090034 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010035
36 )]}'
37 {
38 "external/bison": {
Edwin Kempind0a63922013-01-23 16:32:59 +010039 "id": "external%2Fbison",
40 "description": "GNU parser generator"
41 },
42 "external/gcc": {
Edwin Kempin068511b2015-01-20 09:17:12 +010043 "id": "external%2Fgcc"
Edwin Kempind0a63922013-01-23 16:32:59 +010044 },
45 "external/openssl": {
Edwin Kempind0a63922013-01-23 16:32:59 +010046 "id": "external%2Fopenssl",
47 "description": "encryption\ncrypto routines"
48 },
49 "test": {
Edwin Kempind0a63922013-01-23 16:32:59 +010050 "id": "test",
51 "description": "\u003chtml\u003e is escaped"
52 }
53 }
54----
55
Hugo Arèsbdd7f682014-07-08 10:57:52 -040056[[project-options]]
57==== Project Options
58
59Branch(b)::
60Limit the results to the projects having the specified branch and
61include the sha1 of the branch in the results.
62+
63Get projects that have a 'master' branch:
64+
65.Request
66----
67GET /projects/?b=master HTTP/1.0
68----
69+
70.Response
71----
72 HTTP/1.1 200 OK
73 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090074 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -040075
76 )]}'
77 {
78 "some-project": {
79 "id": "some-project",
80 "branches": {
81 "master": "c5ed9dfcbf002ca0e432d788dab6ca2387829ca7"
82 }
83 },
84 "some-other-project": {
85 "id": "some-other-project",
86 "branches": {
87 "master": "ef1c270142f9581ecf768f4193fc8f8a81102ec2"
88 }
89 },
90 }
91----
92
93Description(d)::
94Include project description in the results.
95+
96Get all the projects with their description:
97+
98.Request
99----
100GET /projects/?d HTTP/1.0
101----
102+
103.Response
104----
105 HTTP/1.1 200 OK
106 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900107 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400108
109 )]}'
110 {
111 "some-project": {
112 "id": "some-project",
113 "description": "Description of some project."
114 },
115 "some-other-project": {
116 "id": "some-other-project",
117 "description": "Description of some other project."
118 }
119 },
120 }
121----
122
123Limit(n)::
124Limit the number of projects to be included in the results.
125+
126Query the first project in the project list:
127+
128.Request
129----
130 GET /projects/?n=1 HTTP/1.0
131----
132+
133.Response
134----
135 HTTP/1.1 200 OK
136 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900137 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400138
139 )]}'
140 {
141 "some-project": {
142 "id": "some-project"
143 }
144 }
145----
146
Edwin Kempina64c4b92013-01-23 11:30:40 +0100147
Edwin Kempind0a63922013-01-23 16:32:59 +0100148[[suggest-projects]]
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400149Prefix(p)::
150Limit the results to those projects that start with the specified
Edwin Kempind0a63922013-01-23 16:32:59 +0100151prefix.
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400152+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900153The match is case sensitive. May not be used together with `m` or `r`.
154+
Edwin Kempind0a63922013-01-23 16:32:59 +0100155List all projects that start with `platform/`:
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400156+
Edwin Kempin37440832013-02-06 11:36:00 +0100157.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100158----
159 GET /projects/?p=platform%2F HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100160----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400161+
Edwin Kempin37440832013-02-06 11:36:00 +0100162.Response
163----
Edwin Kempind0a63922013-01-23 16:32:59 +0100164 HTTP/1.1 200 OK
165 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900166 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100167
168 )]}'
169 {
170 "platform/drivers": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100171 "id": "platform%2Fdrivers"
Edwin Kempind0a63922013-01-23 16:32:59 +0100172 },
173 "platform/tools": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100174 "id": "platform%2Ftools"
Edwin Kempind0a63922013-01-23 16:32:59 +0100175 }
176 }
177----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400178+
Edwin Kempind0a63922013-01-23 16:32:59 +0100179E.g. this feature can be used by suggestion client UI's to limit results.
180
Hugo Arèsb8aae412014-07-08 11:04:43 -0400181Regex(r)::
182Limit the results to those projects that match the specified regex.
183+
184Boundary matchers '^' and '$' are implicit. For example: the regex 'test.*' will
185match any projects that start with 'test' and regex '.*test' will match any
186project that end with 'test'.
187+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900188The match is case sensitive. May not be used together with `m` or `p`.
189+
Hugo Arèsb8aae412014-07-08 11:04:43 -0400190List all projects that match regex `test.*project`:
191+
192.Request
193----
194 GET /projects/?r=test.*project HTTP/1.0
195----
196+
197.Response
198----
199 HTTP/1.1 200 OK
200 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900201 Content-Type: application/json; charset=UTF-8
Hugo Arèsb8aae412014-07-08 11:04:43 -0400202
203 )]}'
204 {
205 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100206 "id": "test%2Fsome-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400207 },
208 "test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100209 "id": "test%2Fsome-other-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400210 }
211 }
212
213----
214
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400215Skip(S)::
216Skip the given number of projects from the beginning of the list.
217+
218Query the second project in the project list:
219+
220.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400221----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400222 GET /projects/?n=1&S=1 HTTP/1.0
223----
224+
225.Response
226----
227 HTTP/1.1 200 OK
228 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900229 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400230
231 )]}'
232 {
233 "some-other-project": {
234 "id": "some-other-project"
235 }
236 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400237----
238
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400239Substring(m)::
240Limit the results to those projects that match the specified substring.
241+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900242The match is case insensitive. May not be used together with `r` or `p`.
243+
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400244List all projects that match substring `test/`:
245+
246.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400247----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400248 GET /projects/?m=test%2F HTTP/1.0
249----
250+
251.Response
252----
253 HTTP/1.1 200 OK
254 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900255 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400256
257 )]}'
258 {
259 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100260 "id": "test%2Fsome-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400261 },
262 "some-path/test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100263 "id": "some-path%2Ftest%2Fsome-other-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400264 }
265 }
266----
267
268Tree(t)::
269Get projects inheritance in a tree-like format. This option does
270not work together with the branch option.
271+
272Get all the projects with tree option:
273+
274.Request
275----
276GET /projects/?t HTTP/1.0
277----
278+
279.Response
280----
281 HTTP/1.1 200 OK
282 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900283 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400284
285 )]}'
286 {
287 "All-Projects" {
288 "id": "All-Projects"
289 },
290 "child-project": {
291 "id": "child-project",
Edwin Kempine813c5a2019-03-13 09:51:12 +0100292 "parent": "parent-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400293 },
294 "parent-project": {
295 "id": "parent-project",
Edwin Kempine813c5a2019-03-13 09:51:12 +0100296 "parent": "All-Projects"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400297 }
298 }
299----
300
301Type(type)::
302Get projects with specified type: ALL, CODE, PERMISSIONS.
303+
304Get all the projects of type 'PERMISSIONS':
305+
306.Request
307----
308GET /projects/?type=PERMISSIONS HTTP/1.0
309----
310+
311.Response
312----
313 HTTP/1.1 200 OK
314 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900315 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400316
317 )]}'
318 {
319 "All-Projects" {
320 "id": "All-Projects"
321 },
322 "some-parent-project": {
323 "id": "some-parent-project"
324 }
325 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400326----
327
David Pursehousec141bd32017-11-15 21:42:14 +0900328All::
David Pursehouse54508762017-11-28 13:37:48 +0900329Get all projects, including those whose state is "HIDDEN". May not be used
330together with the `state` option.
David Pursehousec141bd32017-11-15 21:42:14 +0900331+
332.Request
333----
334GET /projects/?all HTTP/1.0
335----
336+
337.Response
338----
339 HTTP/1.1 200 OK
340 Content-Disposition: attachment
341 Content-Type: application/json; charset=UTF-8
342
343 )]}'
344 {
345 "All-Projects" {
346 "id": "All-Projects",
347 "state": "ACTIVE"
348 },
349 "some-other-project": {
350 "id": "some-other-project",
351 "state": "HIDDEN"
352 }
353 }
354----
355
David Pursehouse54508762017-11-28 13:37:48 +0900356State(s)::
357Get all projects with the given state. May not be used together with the
358`all` option.
359+
360.Request
361----
362GET /projects/?state=HIDDEN HTTP/1.0
363----
364+
365.Response
366----
367 HTTP/1.1 200 OK
368 Content-Disposition: attachment
369 Content-Type: application/json; charset=UTF-8
370
371 )]}'
372 {
373 "some-other-project": {
374 "id": "some-other-project",
375 "state": "HIDDEN"
376 }
377 }
378----
379
Xin Sund8dd1532017-07-18 17:13:52 -0700380[[query-projects]]
381=== Query Projects
382--
383'GET /projects/?query=<query>'
384--
385
386Queries projects visible to the caller. The
387link:user-search-projects.html#_search_operators[query string] must be
388provided by the `query` parameter. The `start` and `limit` parameters
389can be used to skip/limit results.
390
391As result a list of link:#project-info[ProjectInfo] entities is returned.
392
393.Request
394----
395 GET /projects/?query=name:test HTTP/1.0
396----
397
398.Response
399----
400 HTTP/1.1 200 OK
401 Content-Disposition: attachment
402 Content-Type: application/json; charset=UTF-8
403
404 )]}'
405 {
406 "test": {
407 "id": "test",
408 "description": "\u003chtml\u003e is escaped"
409 }
410 }
411----
412
413[[project-query-limit]]
414==== Project Limit
415The `/projects/?query=<query>` URL also accepts a limit integer in the
416`limit` parameter. This limits the results to `limit` projects.
417
418Query the first 25 projects in project list.
419----
420 GET /projects/?query=<query>&limit=25 HTTP/1.0
421----
422
423The `/projects/` URL also accepts a start integer in the `start`
Nasser Grainawif7059c72021-09-22 19:44:39 -0600424parameter. The results will skip `start` projects from project list.
Xin Sund8dd1532017-07-18 17:13:52 -0700425
426Query 25 projects starting from index 50.
427----
Nasser Grainawif7059c72021-09-22 19:44:39 -0600428 GET /projects/?query=<query>&limit=25&start=50 HTTP/1.0
Xin Sund8dd1532017-07-18 17:13:52 -0700429----
430
431[[project-query-options]]
432==== Project Options
433Additional fields can be obtained by adding `o` parameters. Each option
434requires more lookups and slows down the query response time to the
435client so they are generally disabled by default. The supported fields
436are described in the context of the link:#project-options[List Projects]
437REST endpoint.
438
Edwin Kempin5c544e22013-03-06 13:35:45 +0100439[[get-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800440=== Get Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800441--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100442'GET /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800443--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100444
445Retrieves a project.
446
447.Request
448----
449 GET /projects/plugins%2Freplication HTTP/1.0
450----
451
452As response a link:#project-info[ProjectInfo] entity is returned that
453describes the project.
454
455.Response
456----
457 HTTP/1.1 200 OK
458 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900459 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c544e22013-03-06 13:35:45 +0100460
461 )]}'
462 {
Edwin Kempin5c544e22013-03-06 13:35:45 +0100463 "id": "plugins%2Freplication",
464 "name": "plugins/replication",
465 "parent": "Public-Plugins",
Shawn Pearce21a6c212014-04-23 12:35:10 -0700466 "description": "Copies to other servers using the Git protocol",
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +0200467 "state": "ACTIVE",
468 "labels": {
469 "Code-Review": {
470 "values": {
471 " 0": "No score",
472 "+1": "Approved"
473 },
474 "default_value": 0
475 }
476 }
Edwin Kempin5c544e22013-03-06 13:35:45 +0100477 }
478----
479
Bruce Zu798ea122013-02-18 16:55:43 +0800480[[create-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800481=== Create Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800482--
Bruce Zu798ea122013-02-18 16:55:43 +0800483'PUT /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800484--
Bruce Zu798ea122013-02-18 16:55:43 +0800485
486Creates a new project.
487
488In the request body additional data for the project can be provided as
489link:#project-input[ProjectInput].
490
491.Request
492----
493 PUT /projects/MyProject HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900494 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800495
496 {
497 "description": "This is a demo project.",
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400498 "submit_type": "INHERIT",
Bruce Zu798ea122013-02-18 16:55:43 +0800499 "owners": [
500 "MyProject-Owners"
501 ]
502 }
503----
504
505As response the link:#project-info[ProjectInfo] entity is returned that
506describes the created project.
507
508.Response
509----
510 HTTP/1.1 201 Created
511 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900512 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800513
514 )]}'
515 {
Bruce Zu798ea122013-02-18 16:55:43 +0800516 "id": "MyProject",
517 "name": "MyProject",
518 "parent": "All-Projects",
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +0200519 "description": "This is a demo project.",
520 "labels": {
521 "Code-Review": {
522 "values": {
523 " 0": "No score",
524 "+1": "Approved"
525 },
526 "default_value": 0
527 }
528 }
Bruce Zu798ea122013-02-18 16:55:43 +0800529 }
530----
531
Edwin Kempin57f303c2013-02-13 15:52:22 +0100532[[get-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800533=== Get Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800534--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100535'GET /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800536--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100537
Edwin Kempin57f303c2013-02-13 15:52:22 +0100538Retrieves the description of a project.
539
540.Request
541----
542 GET /projects/plugins%2Freplication/description HTTP/1.0
543----
544
545.Response
546----
547 HTTP/1.1 200 OK
548 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900549 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100550
551 )]}'
552 "Copies to other servers using the Git protocol"
553----
554
Edwin Kempinefec4492013-02-22 10:09:23 +0100555If the project does not have a description an empty string is returned.
556
Edwin Kempin57f303c2013-02-13 15:52:22 +0100557[[set-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800558=== Set Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800559--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100560'PUT /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800561--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100562
Edwin Kempin57f303c2013-02-13 15:52:22 +0100563Sets the description of a project.
564
565The new project description must be provided in the request body inside
566a link:#project-description-input[ProjectDescriptionInput] entity.
567
568.Request
569----
570 PUT /projects/plugins%2Freplication/description HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900571 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100572
573 {
574 "description": "Plugin for Gerrit that handles the replication.",
575 "commit_message": "Update the project description"
576 }
577----
578
579As response the new project description is returned.
580
581.Response
582----
583 HTTP/1.1 200 OK
584 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900585 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100586
587 )]}'
588 "Plugin for Gerrit that handles the replication."
589----
590
Edwin Kempin114ab162013-02-28 09:25:37 +0100591If the description was deleted the response is "`204 No Content`".
592
Edwin Kempin57f303c2013-02-13 15:52:22 +0100593[[delete-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800594=== Delete Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800595--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100596'DELETE /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800597--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100598
Edwin Kempin57f303c2013-02-13 15:52:22 +0100599Deletes the description of a project.
600
Edwin Kempin57f303c2013-02-13 15:52:22 +0100601.Request
602----
603 DELETE /projects/plugins%2Freplication/description HTTP/1.0
604----
605
606.Response
607----
608 HTTP/1.1 204 No Content
609----
610
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +0200611A commit message can be provided in the request body as a
612link:#project-description-input[ProjectDescriptionInput] entity.
613Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +0100614link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +0200615In this case, use link:#set-project-description[PUT] instead.
616
617.Request
618----
619 PUT /projects/plugins%2Freplication/description HTTP/1.0
620 Content-Type: application/json; charset=UTF-8
621
622 {
623 "commit_message": "Update the project description"
624 }
625----
626
627.Response
628----
629 HTTP/1.1 204 No Content
630----
631
Edwin Kempinecad88c2013-02-14 12:09:44 +0100632[[get-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800633=== Get Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800634--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100635'GET /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800636--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100637
Edwin Kempinecad88c2013-02-14 12:09:44 +0100638Retrieves the name of a project's parent project. For the
639`All-Projects` root project an empty string is returned.
640
641.Request
642----
643 GET /projects/plugins%2Freplication/parent HTTP/1.0
644----
645
646.Response
647----
648 HTTP/1.1 200 OK
649 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900650 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100651
652 )]}'
653 "All-Projects"
654----
655
656[[set-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800657=== Set Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800658--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100659'PUT /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800660--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100661
Edwin Kempinecad88c2013-02-14 12:09:44 +0100662Sets the parent project for a project.
663
664The new name of the parent project must be provided in the request body
665inside a link:#project-parent-input[ProjectParentInput] entity.
666
667.Request
668----
669 PUT /projects/plugins%2Freplication/parent HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900670 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100671
672 {
673 "parent": "Public-Plugins",
674 "commit_message": "Update the project parent"
675 }
676----
677
678As response the new parent project name is returned.
679
680.Response
681----
682 HTTP/1.1 200 OK
683 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900684 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100685
686 )]}'
687 "Public-Plugins"
688----
689
Edwin Kempin6b813372013-03-13 17:07:33 +0100690[[get-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800691=== Get HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800692--
Edwin Kempin6b813372013-03-13 17:07:33 +0100693'GET /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800694--
Edwin Kempin6b813372013-03-13 17:07:33 +0100695
696Retrieves for a project the name of the branch to which `HEAD` points.
697
698.Request
699----
700 GET /projects/plugins%2Freplication/HEAD HTTP/1.0
701----
702
703.Response
704----
705 HTTP/1.1 200 OK
706 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900707 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100708
709 )]}'
710 "refs/heads/master"
711----
712
713[[set-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800714=== Set HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800715--
Edwin Kempin6b813372013-03-13 17:07:33 +0100716'PUT /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800717--
Edwin Kempin6b813372013-03-13 17:07:33 +0100718
719Sets `HEAD` for a project.
720
721The new ref to which `HEAD` should point must be provided in the
722request body inside a link:#head-input[HeadInput] entity.
723
724.Request
725----
726 PUT /projects/plugins%2Freplication/HEAD HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900727 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100728
729 {
730 "ref": "refs/heads/stable"
731 }
732----
733
734As response the new ref to which `HEAD` points is returned.
735
736.Response
737----
738 HTTP/1.1 200 OK
739 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900740 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100741
742 )]}'
743 "refs/heads/stable"
744----
745
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100746[[get-repository-statistics]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800747=== Get Repository Statistics
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800748--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100749'GET /projects/link:#project-name[\{project-name\}]/statistics.git'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800750--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100751
752Return statistics for the repository of a project.
753
754.Request
755----
756 GET /projects/plugins%2Freplication/statistics.git HTTP/1.0
757----
758
759The repository statistics are returned as a
760link:#repository-statistics-info[RepositoryStatisticsInfo] entity.
761
762.Response
763----
764 HTTP/1.1 200 OK
765 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900766 Content-Type: application/json; charset=UTF-8
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100767
768 )]}'
769 {
770 "number_of_loose_objects": 127,
771 "number_of_loose_refs": 15,
772 "number_of_pack_files": 15,
773 "number_of_packed_objects": 67,
774 "number_of_packed_refs": 0,
775 "size_of_loose_objects": 29466,
776 "size_of_packed_objects": 9646
777 }
778----
779
Dave Borowitz237073a2013-04-04 16:52:27 -0700780[[get-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800781=== Get Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800782--
Dave Borowitz237073a2013-04-04 16:52:27 -0700783'GET /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800784--
Dave Borowitz237073a2013-04-04 16:52:27 -0700785
786Gets some configuration information about a project. Note that this
787config info is not simply the contents of `project.config`; it generally
788contains fields that may have been inherited from parent projects.
789
790.Request
791----
792 GET /projects/myproject/config
793----
794
795A link:#config-info[ConfigInfo] entity is returned that describes the
796project configuration. Some fields are only visible to users that have
797read access to `refs/meta/config`.
798
799.Response
800----
801 HTTP/1.1 200 OK
802 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900803 Content-Type: application/json; charset=UTF-8
Dave Borowitz237073a2013-04-04 16:52:27 -0700804
805 )]}'
806 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200807 "description": "demo project",
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200808 "use_contributor_agreements": {
809 "value": true,
810 "configured_value": "TRUE",
811 "inherited_value": false
812 },
813 "use_content_merge": {
814 "value": true,
815 "configured_value": "INHERIT",
816 "inherited_value": true
817 },
818 "use_signed_off_by": {
819 "value": false,
820 "configured_value": "INHERIT",
821 "inherited_value": false
822 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200823 "create_new_change_for_all_not_in_target": {
824 "value": false,
825 "configured_value": "INHERIT",
826 "inherited_value": false
827 },
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200828 "require_change_id": {
829 "value": false,
830 "configured_value": "FALSE",
831 "inherited_value": true
832 },
Edwin Kempin3c99f592013-07-15 10:12:27 +0200833 "max_object_size_limit": {
834 "value": "15m",
835 "configured_value": "15m",
836 "inherited_value": "20m"
837 },
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400838 "submit_type": "INHERIT",
839 "default_submit_type": {
840 "value": "MERGE_IF_NECESSARY",
841 "configured_value": "INHERIT",
842 "inherited_value": "MERGE_IF_NECESSARY"
843 },
Edwin Kempin3c99f592013-07-15 10:12:27 +0200844 "state": "ACTIVE",
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200845 "commentlinks": {},
Edwin Kempin9ce4f552013-11-15 16:00:00 +0100846 "plugin_config": {
847 "helloworld": {
848 "language": {
849 "display_name": "Preferred Language",
850 "type": "STRING",
851 "value": "en"
852 }
853 }
854 },
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200855 "actions": {
856 "cookbook~hello-project": {
857 "method": "POST",
858 "label": "Say hello",
859 "title": "Say hello in different languages",
860 "enabled": true
861 }
862 }
Dave Borowitz237073a2013-04-04 16:52:27 -0700863 }
864----
865
Edwin Kempina23eb102013-07-17 09:10:54 +0200866[[set-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800867=== Set Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800868--
Edwin Kempina23eb102013-07-17 09:10:54 +0200869'PUT /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800870--
Edwin Kempina23eb102013-07-17 09:10:54 +0200871
872Sets the configuration of a project.
873
874The new configuration must be provided in the request body as a
875link:#config-input[ConfigInput] entity.
876
877.Request
878----
879 PUT /projects/myproject/config HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900880 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200881
882 {
883 "description": "demo project",
884 "use_contributor_agreements": "FALSE",
885 "use_content_merge": "INHERIT",
886 "use_signed_off_by": "INHERIT",
Deniz Türkoglu52777272014-09-08 17:02:48 +0200887 "create_new_change_for_all_not_in_target": "INHERIT",
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400888 "enable_signed_push": "INHERIT",
Dave Borowitz0543c732015-10-20 10:35:26 -0400889 "require_signed_push": "INHERIT",
Saša Živkov225b7a72015-11-17 17:37:43 +0100890 "reject_implicit_merges": "INHERIT",
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200891 "require_change_id": "TRUE",
Edwin Kempina23eb102013-07-17 09:10:54 +0200892 "max_object_size_limit": "10m",
893 "submit_type": "REBASE_IF_NECESSARY",
894 "state": "ACTIVE"
895 }
896----
897
898As response the new configuration is returned as a link:#config-info[
899ConfigInfo] entity.
900
901.Response
902----
903 HTTP/1.1 200 OK
904 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900905 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200906
907 )]}'
908 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200909 "use_contributor_agreements": {
910 "value": false,
911 "configured_value": "FALSE",
912 "inherited_value": false
913 },
914 "use_content_merge": {
915 "value": true,
916 "configured_value": "INHERIT",
917 "inherited_value": true
918 },
919 "use_signed_off_by": {
920 "value": false,
921 "configured_value": "INHERIT",
922 "inherited_value": false
923 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200924 "create_new_change_for_all_not_in_target": {
925 "value": true,
926 "configured_value": "INHERIT",
927 "inherited_value": false
928 },
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200929 "require_change_id": {
930 "value": true,
931 "configured_value": "TRUE",
932 "inherited_value": true
933 },
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400934 "enable_signed_push": {
935 "value": true,
936 "configured_value": "INHERIT",
937 "inherited_value": false
938 },
Dave Borowitz0543c732015-10-20 10:35:26 -0400939 "require_signed_push": {
940 "value": false,
941 "configured_value": "INHERIT",
942 "inherited_value": false
943 },
Saša Živkov225b7a72015-11-17 17:37:43 +0100944 "reject_implicit_merges": {
945 "value": false,
946 "configured_value": "INHERIT",
947 "inherited_value": false
948 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200949 "max_object_size_limit": {
950 "value": "10m",
951 "configured_value": "10m",
952 "inherited_value": "20m"
953 },
954 "submit_type": "REBASE_IF_NECESSARY",
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400955 "default_submit_type": {
956 "value": "REBASE_IF_NECESSARY",
957 "configured_value": "INHERIT",
958 "inherited_value": "REBASE_IF_NECESSARY"
959 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200960 "state": "ACTIVE",
961 "commentlinks": {}
962 }
963----
964
Edwin Kempinef3542f2013-03-19 13:31:49 +0100965[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800966=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800967--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100968'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800969--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100970
971Run the Git garbage collection for the repository of a project.
972
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100973Options for the Git garbage collection can be specified in the
974request body as a link:#gc-input[GCInput] entity.
975
Edwin Kempinef3542f2013-03-19 13:31:49 +0100976.Request
977----
978 POST /projects/plugins%2Freplication/gc HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900979 Content-Type: application/json; charset=UTF-8
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100980
981 {
982 "show_progress": true
983 }
Edwin Kempinef3542f2013-03-19 13:31:49 +0100984----
985
986The response is the streamed output of the garbage collection.
987
988.Response
989----
990 HTTP/1.1 200 OK
991 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900992 Content-Type: text/plain; charset=UTF-8
Edwin Kempinef3542f2013-03-19 13:31:49 +0100993
994 collecting garbage for "plugins/replication":
995 Pack refs: 100% (21/21)
996 Counting objects: 20
997 Finding sources: 100% (20/20)
998 Getting sizes: 100% (13/13)
999 Compressing objects: 83% (5/6)
1000 Writing objects: 100% (20/20)
1001 Selecting commits: 100% (7/7)
1002 Building bitmaps: 100% (7/7)
1003 Finding sources: 100% (41/41)
1004 Getting sizes: 100% (25/25)
1005 Compressing objects: 52% (12/23)
1006 Writing objects: 100% (41/41)
1007 Prune loose objects also found in pack files: 100% (36/36)
1008 Prune loose, unreferenced objects: 100% (36/36)
1009 done.
1010----
1011
Adrian Görler92410a12015-11-03 16:20:56 +01001012==== Asynchronous Execution
1013
1014The option `async` allows to schedule a background task that asynchronously
1015executes a Git garbage collection.
1016
1017The `Location` header of the response refers to the link:rest-api-config.html#get-task[background task]
1018which allows to inspect the progress of its execution. In case of asynchronous
1019execution the `show_progress` option is ignored.
1020
1021.Request
1022----
1023 POST /projects/plugins%2Freplication/gc HTTP/1.0
1024 Content-Type: application/json;charset=UTF-8
1025
1026 {
1027 "async": true
1028 }
1029----
1030
1031The response is empty.
1032
1033.Response
1034----
1035 HTTP/1.1 202 Accepted
1036 Content-Disposition: attachment
1037 Location: https:<host>/a/config/server/tasks/383a0602
1038----
1039
Edwin Kempin62946742014-07-09 11:17:58 +02001040[[ban-commit]]
1041=== Ban Commit
1042--
1043'PUT /projects/link:#project-name[\{project-name\}]/ban'
1044--
1045
1046Marks commits as banned for the project. If a commit is banned Gerrit
1047rejects every push that includes this commit with
1048link:error-contains-banned-commit.html[contains banned commit ...].
1049
1050[NOTE]
1051This REST endpoint only marks the commits as banned, but it does not
1052remove the commits from the history of any central branch. This needs
1053to be done manually.
1054
1055The commits to be banned must be specified in the request body as a
1056link:#ban-input[BanInput] entity.
1057
1058The caller must be project owner.
1059
1060.Request
1061----
1062 PUT /projects/plugins%2Freplication/ban HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001063 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +02001064
1065 {
1066 "commits": [
1067 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
1068 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
1069 ],
1070 "reason": "Violates IP"
1071 }
1072----
1073
1074As response a link:#ban-result-info[BanResultInfo] entity is returned.
1075
1076.Response
1077----
1078 HTTP/1.1 200 OK
1079 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001080 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +02001081
1082 )]}'
1083 {
1084 "newly_banned": [
1085 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
1086 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
1087 ]
1088 }
1089----
1090
Patrick Hiesel21816f12016-04-22 08:53:06 +02001091[[get-access]]
1092=== List Access Rights for Project
1093--
1094'GET /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
1095--
1096
1097Lists the access rights for a single project.
1098
Han-Wen Nienhuysbfd1b352018-01-10 15:02:32 +01001099As result a
1100link:rest-api-access.html#project-access-info[ProjectAccessInfo]
1101entity is returned.
Patrick Hiesel21816f12016-04-22 08:53:06 +02001102
1103.Request
1104----
1105 GET /projects/MyProject/access HTTP/1.0
1106----
1107
1108.Response
1109----
1110 HTTP/1.1 200 OK
1111 Content-Type: application/json; charset=UTF-8
1112
1113 )]}'
1114 {
1115 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1116 "inherits_from": {
1117 "id": "All-Projects",
1118 "name": "All-Projects",
1119 "description": "Access inherited by all other projects."
1120 },
1121 "local": {
1122 "refs/*": {
1123 "permissions": {
1124 "read": {
1125 "rules": {
1126 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1127 "action": "ALLOW",
1128 "force": false
1129 },
1130 "global:Anonymous-Users": {
1131 "action": "ALLOW",
1132 "force": false
1133 }
1134 }
1135 }
1136 }
1137 }
1138 },
1139 "is_owner": true,
1140 "owner_of": [
1141 "refs/*"
1142 ],
1143 "can_upload": true,
1144 "can_add": true,
Marco Millerc2114ac2018-09-10 16:52:54 -04001145 "can_add_tags": true,
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001146 "config_visible": true,
1147 "groups": {
1148 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1149 "url": "#/admin/groups/uuid-c2ce4749a32ceb82cd6adcce65b8216e12afb41c",
1150 "options": {},
1151 "description": "Users who perform batch actions on Gerrit",
1152 "group_id": 2,
1153 "owner": "Administrators",
1154 "owner_id": "d5b7124af4de52924ed397913e2c3b37bf186948",
1155 "created_on": "2009-06-08 23:31:00.000000000",
Patrick Hiesele587c402020-08-07 16:11:29 +02001156 "name": "Service Users"
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001157 },
1158 "global:Anonymous-Users": {
1159 "options": {},
1160 "name": "Anonymous Users"
1161 }
1162 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001163 }
1164----
1165
1166[[set-access]]
1167=== Add, Update and Delete Access Rights for Project
1168--
1169'POST /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
1170--
1171
1172Sets access rights for the project using the diff schema provided by
1173link:#project-access-input[ProjectAccessInput]. Deductions are used to
1174remove access sections, permissions or permission rules. The backend will remove
1175the entity with the finest granularity in the request, meaning that if an
1176access section without permissions is posted, the access section will be
1177removed; if an access section with a permission but no permission rules is
1178posted, the permission will be removed; if an access section with a permission
1179and a permission rule is posted, the permission rule will be removed.
1180
1181Additionally, access sections and permissions will be cleaned up after applying
1182the deductions by removing items that have no child elements.
1183
1184After removals have been applied, additions will be applied.
1185
Han-Wen Nienhuysbfd1b352018-01-10 15:02:32 +01001186As result a
1187link:rest-api-access.html#project-access-info[ProjectAccessInfo]
1188entity is returned.
Patrick Hiesel21816f12016-04-22 08:53:06 +02001189
1190.Request
1191----
1192 POST /projects/MyProject/access HTTP/1.0
1193 Content-Type: application/json; charset=UTF-8
1194
1195 {
Florian Ramillien4978ae52018-12-04 11:04:59 +01001196 "remove": {
1197 "refs/*": {
1198 "permissions": {
1199 "read": {
1200 "rules": {
1201 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1202 "action": "ALLOW"
Patrick Hiesel21816f12016-04-22 08:53:06 +02001203 }
1204 }
1205 }
1206 }
1207 }
Florian Ramillien4978ae52018-12-04 11:04:59 +01001208 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001209 }
1210----
1211
1212.Response
1213----
1214 HTTP/1.1 200 OK
1215 Content-Type: application/json; charset=UTF-8
1216
1217 )]}'
1218 {
1219 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1220 "inherits_from": {
1221 "id": "All-Projects",
1222 "name": "All-Projects",
1223 "description": "Access inherited by all other projects."
1224 },
1225 "local": {
1226 "refs/*": {
1227 "permissions": {
1228 "read": {
1229 "rules": {
1230 "global:Anonymous-Users": {
1231 "action": "ALLOW",
1232 "force": false
1233 }
1234 }
1235 }
1236 }
1237 }
1238 },
1239 "is_owner": true,
1240 "owner_of": [
1241 "refs/*"
1242 ],
1243 "can_upload": true,
1244 "can_add": true,
Marco Millerc2114ac2018-09-10 16:52:54 -04001245 "can_add_tags": true,
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001246 "config_visible": true,
1247 "groups": {
1248 "global:Anonymous-Users": {
1249 "options": {},
1250 "name": "Anonymous Users"
1251 }
1252 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001253 }
1254----
1255
Han-Wen Nienhuysa4726c32019-10-14 17:47:42 +02001256[[create-change]]
1257=== Create Change for review.
1258
1259This endpoint is functionally equivalent to
1260link:rest-api-changes.html#create-change[create change in the change
1261API], but it has the project name in the URL, which is easier to route
1262in sharded deployments.
1263
1264.Request
1265----
1266 POST /projects/myProject/create.change HTTP/1.0
1267 Content-Type: application/json; charset=UTF-8
1268
1269 {
1270 "subject" : "Let's support 100% Gerrit workflow direct in browser",
1271 "branch" : "master",
1272 "topic" : "create-change-in-browser",
1273 "status" : "NEW"
1274 }
1275----
1276
1277As response a link:#change-info[ChangeInfo] entity is returned that describes
1278the resulting change.
1279
1280.Response
1281----
1282 HTTP/1.1 201 OK
1283 Content-Disposition: attachment
1284 Content-Type: application/json; charset=UTF-8
1285
1286 )]}'
1287 {
1288 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
1289 "project": "myProject",
1290 "branch": "master",
1291 "topic": "create-change-in-browser",
1292 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
1293 "subject": "Let's support 100% Gerrit workflow direct in browser",
1294 "status": "NEW",
1295 "created": "2014-05-05 07:15:44.639000000",
1296 "updated": "2014-05-05 07:15:44.639000000",
1297 "mergeable": true,
1298 "insertions": 0,
1299 "deletions": 0,
1300 "_number": 4711,
1301 "owner": {
1302 "name": "John Doe"
1303 }
1304 }
1305----
1306
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001307[[create-access-change]]
1308=== Create Access Rights Change for review.
1309--
1310'PUT /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access:review
1311--
1312
1313Sets access rights for the project using the diff schema provided by
1314link:#project-access-input[ProjectAccessInput]
1315
1316This takes the same input as link:#set-access[Update Access Rights], but creates a pending
1317change for review. Like link:#create-change[Create Change], it returns
1318a link:#change-info[ChangeInfo] entity describing the resulting change.
1319
1320.Request
1321----
1322 PUT /projects/MyProject/access:review HTTP/1.0
1323 Content-Type: application/json; charset=UTF-8
1324
1325 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01001326 "add": {
1327 "refs/heads/*": {
1328 "permissions": {
1329 "read": {
1330 "rules": {
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001331 "global:Anonymous-Users": {
Edwin Kempine813c5a2019-03-13 09:51:12 +01001332 "action": "DENY",
1333 "force": false
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001334 }
1335 }
1336 }
1337 }
1338 }
1339 }
1340 }
1341----
1342
1343.Response
1344----
1345 HTTP/1.1 200 OK
1346 Content-Type: application/json; charset=UTF-8
1347
1348 )]}'
1349 {
1350 "id": "testproj~refs%2Fmeta%2Fconfig~Ieaf185bf90a1fc3b58461e399385e158a20b31a2",
1351 "project": "testproj",
1352 "branch": "refs/meta/config",
1353 "hashtags": [],
1354 "change_id": "Ieaf185bf90a1fc3b58461e399385e158a20b31a2",
1355 "subject": "Review access change",
1356 "status": "NEW",
1357 "created": "2017-09-07 14:31:11.852000000",
1358 "updated": "2017-09-07 14:31:11.852000000",
1359 "submit_type": "CHERRY_PICK",
1360 "mergeable": true,
1361 "insertions": 2,
1362 "deletions": 0,
1363 "unresolved_comment_count": 0,
1364 "has_review_started": true,
1365 "_number": 7,
1366 "owner": {
1367 "_account_id": 1000000
1368 }
1369 }
1370----
1371
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001372[[check-access]]
1373=== Check Access
1374--
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001375'GET /projects/MyProject/check.access?account=1000098&ref=refs%2Fheads%2Fsecret%2Fbla'
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001376--
1377
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001378This command runs access checks for other users. This requires the
1379link:access-control.html#capability_viewAccess[View Access] global
1380capability.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001381
1382The result is a link:#access-check-info[AccessCheckInfo] entity
Han-Wen Nienhuys8a4a6822018-01-18 19:27:46 +01001383detailing the access of the given user for the given project,
1384project-ref, or project-permission-ref combination.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001385
1386.Response
1387----
1388 HTTP/1.1 200 OK
1389 Content-Type: application/json; charset=UTF-8
1390
1391 )]}'
1392 {
1393 "message": "user Kristen Burns \u003cKristen.Burns@gerritcodereview.com\u003e (1000098) cannot see ref refs/heads/secret/bla in project MyProject",
1394 "status": 403
1395 }
1396----
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001397
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001398[[check-access-options]]
1399==== Check Access Options
Han-Wen Nienhuys5b089f22018-04-17 16:26:44 +02001400
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001401Account(account)::
1402The account for which to check access. Mandatory.
Han-Wen Nienhuys5b089f22018-04-17 16:26:44 +02001403
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001404Permission(perm)::
1405The ref permission for which to check access. If not specified, read
1406access to at least branch is checked.
1407
1408Ref(ref)::
1409The branch for which to check access. This must be given if `perm` is specified.
1410
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001411[[index]]
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001412=== Index project
1413
1414Adds or updates the current project (and children, if specified) in the secondary index.
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02001415The indexing task is executed asynchronously in background and this command returns
1416immediately if `async` is specified in the input.
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001417
1418As an input, a link:#index-project-input[IndexProjectInput] entity can be provided.
1419
1420.Request
1421----
1422 POST /projects/MyProject/index HTTP/1.0
1423 Content-Type: application/json; charset=UTF-8
1424
1425 {
1426 "index_children": "true"
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02001427 "async": "true"
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001428 }
1429----
1430
1431.Response
1432----
1433 HTTP/1.1 202 Accepted
1434 Content-Disposition: attachment
1435----
1436
1437[[index.changes]]
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001438=== Index all changes in a project
1439
1440Adds or updates all the changes belonging to a project in the secondary index.
1441The indexing task is executed asynchronously in background, so this command
1442returns immediately.
1443
1444.Request
1445----
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001446 POST /projects/MyProject/index.changes HTTP/1.0
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001447----
1448
1449.Response
1450----
Edwin Kempin4145f972018-01-12 16:30:44 +01001451 HTTP/1.1 202 Accepted
1452 Content-Disposition: attachment
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001453----
1454
Edwin Kempinbf9df392018-01-12 15:20:48 +01001455[[check]]
1456=== Check project consistency
1457
1458Performs consistency checks on the project.
1459
1460Which consistency checks should be performed is controlled by the
1461link:#check-project-input[CheckProjectInput] entity in the request
1462body.
1463
1464The following consistency checks are supported:
1465
1466[[auto-closeable-changes-check]]
1467--
1468* AutoCloseableChangesCheck: Searches for open changes that can be
1469 auto-closed because a patch set of the change is already contained in
1470 the destination branch or because the destination branch contains a
1471 commit with the same Change-Id. Normally Gerrit auto-closes such
1472 changes when the corresponding commits are pushed directly to the
1473 repository. However if a branch is updated behind Gerrit's back or if
1474 auto-closing changes fails (and the push is still successful) change
1475 states can get inconsistent (changes that are already part of the
1476 destination branch are still open). This consistency check is
1477 intended to detect and repair this situation.
1478--
1479
1480To fix any problems that can be fixed automatically set the `fix` field
1481in the inputs for the consistency checks to `true`.
1482
1483This REST endpoint requires the
1484link:access-control.html#capability_administrateServer[Administrate Server]
1485global capability.
1486
1487.Request
1488----
1489 POST /projects/MyProject/check HTTP/1.0
1490 Content-Type: application/json; charset=UTF-8
1491
1492 {
1493 "auto_closeable_changes_check": {
1494 "fix": true,
1495 "branch": "refs/heads/master",
1496 "max_commits": 100
1497 }
1498 }
1499----
1500
1501As response a link:#check-project-result-info[CheckProjectResultInfo]
1502entity is returned that results for the consistency checks.
1503
1504.Response
1505----
1506 HTTP/1.1 200 OK
1507 Content-Disposition: attachment
1508 Content-Type: application/json; charset=UTF-8
1509
1510 )]}'
1511 {
1512 "auto_closeable_changes_check_result": {
1513 "auto_closeable_changes": {
1514 "refs/heads/master": [
1515 {
1516 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1517 "project": "myProject",
1518 "branch": "master",
1519 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1520 "subject": "Implementing Feature X",
1521 "status": "NEW",
1522 "created": "2013-02-01 09:59:32.126000000",
1523 "updated": "2013-02-21 11:16:36.775000000",
1524 "insertions": 34,
1525 "deletions": 101,
1526 "_number": 3965,
1527 "owner": {
1528 "name": "John Doe"
1529 },
1530 "problems": [
1531 {
1532 "message": "Patch set 1 (2f15e416237ed9b561199f24184f5f5d2708c584) is merged into destination ref refs/heads/master (2f15e416237ed9b561199f24184f5f5d2708c584), but change status is NEW",
1533 "status": "FIXED",
1534 "outcome": "Marked change as merged"
1535 }
1536 ]
1537 }
1538 ]
1539 }
1540 }
1541 }
1542----
1543
Prudhvi Akhil Alahari559132d2021-09-28 18:27:44 +05301544[[commits-included-in]]
1545=== Get Commits Included In Refs
1546--
1547'GET /projects/link:#project-name[\{project-name\}]/commits:in'
1548--
1549
1550Gets refs in which the specified commits were merged into. Returns a map of commits
1551to sets of full ref names.
1552
1553One or more `commit` query parameters are required and each specifies a
1554commit-id (SHA-1 in 40 digit hex representation). Commits will not be contained
1555in the map if they do not exist or are not reachable from visible, specified refs.
1556
1557One or more `ref` query parameters are required and each specifies a full ref name.
1558Refs which are not visible to the calling user according to the project's read
1559permissions and refs which do not exist will be filtered out from the result.
1560
1561.Request
1562----
1563 GET /projects/work%2Fmy-project/commits:in?commit=a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96&commit=6d2a3adb10e844c33617fc948dbeb88e868d396e&ref=refs/heads/master&ref=refs/heads/branch1 HTTP/1.0
1564----
1565
1566.Response
1567----
1568 HTTP/1.1 200 OK
1569 Content-Disposition: attachment
1570 Content-Type: application/json;charset=UTF-8
1571
1572 )]}'
1573 {
1574 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96": [
1575 "refs/heads/master"
1576 ],
1577 "6d2a3adb10e844c33617fc948dbeb88e868d396e": [
1578 "refs/heads/branch1",
1579 "refs/heads/master"
1580 ]
1581 }
1582
1583----
1584
Edwin Kempina686de92013-05-09 15:12:34 +02001585[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001586== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +02001587
1588[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001589=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001590--
Edwin Kempina686de92013-05-09 15:12:34 +02001591'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001592--
Edwin Kempina686de92013-05-09 15:12:34 +02001593
1594List the branches of a project.
1595
1596As result a list of link:#branch-info[BranchInfo] entries is
1597returned.
1598
1599.Request
1600----
1601 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
1602----
1603
1604.Response
1605----
1606 HTTP/1.1 200 OK
1607 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001608 Content-Type: application/json; charset=UTF-8
Edwin Kempina686de92013-05-09 15:12:34 +02001609
1610 )]}'
1611 [
1612 {
1613 "ref": "HEAD",
1614 "revision": "master"
1615 },
1616 {
1617 "ref": "refs/meta/config",
1618 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1619 },
1620 {
1621 "ref": "refs/heads/master",
1622 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1623 },
1624 {
1625 "ref": "refs/heads/stable",
1626 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
1627 "can_delete": true
1628 }
1629 ]
1630----
1631
Hugo Arès3133b4b2014-10-14 14:05:10 -04001632[[branch-options]]
1633==== Branch Options
1634
Hugo Arès15856622014-10-14 14:19:01 -04001635Limit(n)::
1636Limit the number of branches to be included in the results.
1637+
1638.Request
1639----
1640 GET /projects/testproject/branches?n=1 HTTP/1.0
1641----
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
Hugo Arès15856622014-10-14 14:19:01 -04001648
1649 )]}'
1650 [
1651 {
1652 "ref": "HEAD",
1653 "revision": "master",
Hugo Arès15856622014-10-14 14:19:01 -04001654 }
1655 ]
1656----
1657
David Pursehouse5cb38192017-07-28 16:11:33 +01001658Skip(S)::
Hugo Arès15856622014-10-14 14:19:01 -04001659Skip the given number of branches from the beginning of the list.
1660+
1661.Request
1662----
1663 GET /projects/testproject/branches?n=1&s=0 HTTP/1.0
1664----
1665+
1666.Response
1667----
1668 HTTP/1.1 200 OK
1669 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001670 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001671
1672 )]}'
1673 [
1674 {
1675 "ref": "HEAD",
1676 "revision": "master",
Hugo Arès15856622014-10-14 14:19:01 -04001677 }
1678 ]
1679----
1680
Hugo Arès3133b4b2014-10-14 14:05:10 -04001681Substring(m)::
David Pursehouse1d4d67d2017-07-13 09:58:10 +09001682Limit the results to those branches that match the specified substring.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001683+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09001684The match is case insensitive. May not be used together with `r`.
David Pursehouse5851bfe2017-07-13 09:56:26 +09001685+
David Pursehouse1d4d67d2017-07-13 09:58:10 +09001686List all branches that match substring `test`:
Hugo Arès3133b4b2014-10-14 14:05:10 -04001687+
1688.Request
1689----
1690 GET /projects/testproject/branches?m=test HTTP/1.0
1691----
1692+
1693.Response
1694----
1695 HTTP/1.1 200 OK
1696 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001697 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001698
1699 )]}'
1700 [
1701 {
1702 "ref": "refs/heads/test1",
1703 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1704 "can_delete": true
1705 }
1706 ]
1707----
1708
1709Regex(r)::
1710Limit the results to those branches that match the specified regex.
1711Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
David Pursehousea6cd67f2017-07-13 16:40:58 +09001712match any branches that start with 't' and regex '*t' will match any
1713branches that end with 't'.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001714+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09001715The match is case sensitive. May not be used together with `m`.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001716+
1717List all branches that match regex `t.*1`:
1718+
1719.Request
1720----
1721 GET /projects/testproject/branches?r=t.*1 HTTP/1.0
1722----
1723+
1724.Response
1725----
1726 HTTP/1.1 200 OK
1727 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001728 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001729
1730 )]}'
1731 [
1732 {
1733 "ref": "refs/heads/test1",
1734 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1735 "can_delete": true
1736 }
1737 ]
1738----
1739
Edwin Kempin196e1732013-05-09 15:12:34 +02001740[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001741=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001742--
Edwin Kempin196e1732013-05-09 15:12:34 +02001743'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001744--
Edwin Kempin196e1732013-05-09 15:12:34 +02001745
Youssef Elghareeba5639fc2020-10-26 19:02:39 +01001746Retrieves a branch of a project. For the "All-Users" repository, the magic
1747branch "refs/users/self" is automatically resolved to the user branch of the
1748calling user.
Edwin Kempin196e1732013-05-09 15:12:34 +02001749
1750.Request
1751----
1752 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
1753----
1754
1755As response a link:#branch-info[BranchInfo] entity is returned that
1756describes the branch.
1757
1758.Response
1759----
1760 HTTP/1.1 200 OK
1761 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001762 Content-Type: application/json; charset=UTF-8
Edwin Kempin196e1732013-05-09 15:12:34 +02001763
1764 )]}'
1765 {
1766 "ref": "refs/heads/master",
1767 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1768 }
1769----
1770
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001771[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001772=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001773--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001774'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001775--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001776
1777Creates a new branch.
1778
1779In the request body additional data for the branch can be provided as
Youssef Elghareeb49451912021-01-15 11:49:15 +01001780link:#branch-input[BranchInput]. The link:#branch-id[\{branch-id\}] in the URL
1781should exactly match with the `ref` field of link:#branch-input[BranchInput], or
1782otherwise the request would fail with `400 Bad Request`.
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001783
1784.Request
1785----
1786 PUT /projects/MyProject/branches/stable HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001787 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001788
1789 {
1790 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1791 }
1792----
1793
1794As response a link:#branch-info[BranchInfo] entity is returned that
1795describes the created branch.
1796
1797.Response
1798----
1799 HTTP/1.1 201 Created
1800 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001801 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001802
1803 )]}'
1804 {
1805 "ref": "refs/heads/stable",
1806 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
1807 "can_delete": true
1808 }
1809----
1810
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001811[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001812=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001813--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001814'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001815--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001816
1817Deletes a branch.
1818
1819.Request
1820----
1821 DELETE /projects/MyProject/branches/stable HTTP/1.0
1822----
1823
1824.Response
1825----
1826 HTTP/1.1 204 No Content
1827----
1828
Hugo Arèsef8e3202015-01-12 15:09:06 -05001829[[delete-branches]]
1830=== Delete Branches
1831--
1832'POST /projects/link:#project-name[\{project-name\}]/branches:delete'
1833--
1834
1835Delete one or more branches.
1836
1837The branches to be deleted must be provided in the request body as a
1838link:#delete-branches-input[DeleteBranchesInput] entity.
1839
1840.Request
1841----
1842 POST /projects/MyProject/branches:delete HTTP/1.0
1843 Content-Type: application/json;charset=UTF-8
1844
1845 {
1846 "branches": [
1847 "stable-1.0",
1848 "stable-2.0"
1849 ]
1850 }
1851----
1852
1853.Response
1854----
1855 HTTP/1.1 204 No Content
1856----
1857
1858If some branches could not be deleted, the response is "`409 Conflict`" and the
1859error message is contained in the response body.
1860
Edwin Kempind31e5582013-11-30 12:07:08 +01001861[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001862=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001863--
1864'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1865--
1866
1867Gets the content of a file from the HEAD revision of a certain branch.
1868
1869.Request
1870----
1871 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1872----
1873
1874The content is returned as base64 encoded string.
1875
1876.Response
1877----
1878 HTTP/1.1 200 OK
1879 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001880 Content-Type: text/plain; charset=UTF-8
Edwin Kempind31e5582013-11-30 12:07:08 +01001881
1882 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1883----
1884
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001885
1886[[get-mergeable-info]]
1887=== Get Mergeable Information
1888--
1889'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/mergeable'
1890--
1891
1892Gets whether the source is mergeable with the target branch.
1893
Han-Wen Nienhuys253730c2020-12-23 16:26:12 +01001894The `source` query parameter is required, which can be anything that
1895could be resolved to a commit, and is visible to the caller. See
1896examples of the `source` attribute in
Zhen Chen8f00d552016-07-26 16:54:59 -07001897link:rest-api-changes.html#merge-input[MergeInput].
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001898
1899Also takes an optional parameter `strategy`, which can be `recursive`, `resolve`,
1900`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
1901
1902.Request
1903----
1904 GET /projects/test/branches/master/mergeable?source=testbranch&strategy=recursive HTTP/1.0
1905----
1906
Zhen Chen8f00d552016-07-26 16:54:59 -07001907As response a link:rest-api-changes.html#mergeable-info[MergeableInfo] entity is returned.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001908
1909.Response
1910----
1911 HTTP/1.1 200 OK
1912 Content-Disposition: attachment
1913 Content-Type: application/json; charset=UTF-8
1914
1915 )]}'
1916 {
Zhen Chen8f00d552016-07-26 16:54:59 -07001917 "submit_type": "MERGE_IF_NECESSARY",
1918 "strategy": "recursive",
1919 "mergeable": true,
1920 "commit_merged": false,
1921 "content_merged": false
1922 }
1923----
1924
1925or when there were conflicts.
1926
1927.Response
1928----
1929 HTTP/1.1 200 OK
1930 Content-Disposition: attachment
1931 Content-Type: application/json; charset=UTF-8
1932
1933 )]}'
1934 {
1935 "submit_type": "MERGE_IF_NECESSARY",
1936 "strategy": "recursive",
1937 "mergeable": false,
1938 "conflicts": [
1939 "common.txt",
1940 "shared.txt"
1941 ]
1942 }
1943----
1944
1945or when the 'testbranch' has been already merged.
1946
1947.Response
1948----
1949 HTTP/1.1 200 OK
1950 Content-Disposition: attachment
1951 Content-Type: application/json; charset=UTF-8
1952
1953 )]}'
1954 {
1955 "submit_type": "MERGE_IF_NECESSARY",
1956 "strategy": "recursive",
1957 "mergeable": true,
1958 "commit_merged": true,
1959 "content_merged": true
1960 }
1961----
1962
1963or when only the content of 'testbranch' has been merged.
1964
1965.Response
1966----
1967 HTTP/1.1 200 OK
1968 Content-Disposition: attachment
1969 Content-Type: application/json; charset=UTF-8
1970
1971 )]}'
1972 {
1973 "submit_type": "MERGE_IF_NECESSARY",
1974 "strategy": "recursive",
1975 "mergeable": true,
1976 "commit_merged": false,
1977 "content_merged": true
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001978 }
1979----
1980
Edwin Kempin87504d92014-07-04 12:59:19 +02001981[[get-reflog]]
1982=== Get Reflog
1983--
1984'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
1985--
1986
1987Gets the reflog of a certain branch.
1988
1989The caller must be project owner.
1990
1991.Request
1992----
1993 GET /projects/gerrit/branches/master/reflog HTTP/1.0
1994----
1995
1996As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
1997is returned that describe the reflog entries. The reflog entries are
1998returned in reverse order.
1999
2000.Response
2001----
2002 HTTP/1.1 200 OK
2003 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002004 Content-Type: application/json; charset=UTF-8
Edwin Kempin87504d92014-07-04 12:59:19 +02002005
2006 )]}'
2007 [
2008 {
2009 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
2010 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
2011 "who": {
2012 "name": "Jane Roe",
2013 "email": "jane.roe@example.com",
2014 "date": "2014-06-30 11:53:43.000000000",
2015 "tz": 120
2016 },
2017 "comment": "merged: fast forward"
2018 },
2019 {
2020 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
2021 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
2022 "who": {
2023 "name": "John Doe",
2024 "email": "john.doe@example.com",
2025 "date": "2013-10-02 10:45:26.000000000",
2026 "tz": 120
2027 },
2028 "comment": "merged: fast forward"
2029 },
2030 {
2031 "old_id": "0000000000000000000000000000000000000000",
2032 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
2033 "who": {
2034 "name": "John Doe",
2035 "email": "john.doe@example.com",
2036 "date": "2013-09-30 19:08:44.000000000",
2037 "tz": 120
2038 },
2039 "comment": ""
2040 }
2041 ]
2042----
2043
2044The get reflog endpoint also accepts a limit integer in the `n`
2045parameter. This limits the results to show the last `n` reflog entries.
2046
2047Query the last 25 reflog entries.
2048----
2049 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
2050----
2051
Edwin Kempin2a581fd2014-07-04 14:04:54 +02002052The reflog can also be filtered by timestamp by specifying the `from`
2053and `to` parameters. The timestamp for `from` and `to` must be given as
2054UTC in the following format: `yyyyMMdd_HHmm`.
2055
2056----
2057 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
2058----
2059
Edwin Kempin4425c742013-03-18 13:23:00 +01002060[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002061== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01002062
2063[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002064=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002065--
Edwin Kempin4425c742013-03-18 13:23:00 +01002066'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002067--
Edwin Kempin4425c742013-03-18 13:23:00 +01002068
2069List the direct child projects of a project.
2070
2071.Request
2072----
2073 GET /projects/Public-Plugins/children/ HTTP/1.0
2074----
2075
2076As result a list of link:#project-info[ProjectInfo] entries is
2077returned that describe the child projects.
2078
2079.Response
2080----
2081 HTTP/1.1 200 OK
2082 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002083 Content-Type: application/json; charset=UTF-8
Edwin Kempin4425c742013-03-18 13:23:00 +01002084
2085 )]}'
2086 [
2087 {
Edwin Kempin4425c742013-03-18 13:23:00 +01002088 "id": "plugins%2Freplication",
2089 "name": "plugins/replication",
2090 "parent": "Public-Plugins",
2091 "description": "Copies to other servers using the Git protocol"
2092 },
2093 {
Edwin Kempin4425c742013-03-18 13:23:00 +01002094 "id": "plugins%2Freviewnotes",
2095 "name": "plugins/reviewnotes",
2096 "parent": "Public-Plugins",
2097 "description": "Annotates merged commits using notes on refs/notes/review."
2098 },
2099 {
Edwin Kempin4425c742013-03-18 13:23:00 +01002100 "id": "plugins%2Fsingleusergroup",
2101 "name": "plugins/singleusergroup",
2102 "parent": "Public-Plugins",
2103 "description": "GroupBackend enabling users to be directly added to access rules"
2104 }
2105 ]
2106----
2107
Edwin Kempinf95bd172013-03-19 11:10:57 +01002108To resolve the child projects of a project recursively the parameter
2109`recursive` can be set.
2110
2111Child projects that are not visible to the calling user are ignored and
2112are not resolved further.
2113
2114.Request
2115----
2116 GET /projects/Public-Projects/children/?recursive HTTP/1.0
2117----
2118
2119.Response
2120----
2121 HTTP/1.1 200 OK
2122 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002123 Content-Type: application/json; charset=UTF-8
Edwin Kempinf95bd172013-03-19 11:10:57 +01002124
2125 )]}'
2126 [
2127 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002128 "id": "gerrit",
2129 "name": "gerrit",
2130 "parent": "Public-Projects",
2131 "description": "Gerrit Code Review"
2132 },
2133 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002134 "id": "plugins%2Freplication",
2135 "name": "plugins/replication",
2136 "parent": "Public-Plugins",
2137 "description": "Copies to other servers using the Git protocol"
2138 },
2139 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002140 "id": "plugins%2Freviewnotes",
2141 "name": "plugins/reviewnotes",
2142 "parent": "Public-Plugins",
2143 "description": "Annotates merged commits using notes on refs/notes/review."
2144 },
2145 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002146 "id": "plugins%2Fsingleusergroup",
2147 "name": "plugins/singleusergroup",
2148 "parent": "Public-Plugins",
2149 "description": "GroupBackend enabling users to be directly added to access rules"
2150 },
2151 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002152 "id": "Public-Plugins",
2153 "name": "Public-Plugins",
2154 "parent": "Public-Projects",
2155 "description": "Parent project for plugins/*"
2156 }
2157 ]
2158----
2159
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002160[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002161=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002162--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002163'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002164--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002165
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01002166Retrieves a child project. If a non-direct child project should be
2167retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002168
2169.Request
2170----
2171 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
2172----
2173
2174As response a link:#project-info[ProjectInfo] entity is returned that
2175describes the child project.
2176
2177.Response
2178----
2179 HTTP/1.1 200 OK
2180 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002181 Content-Type: application/json; charset=UTF-8
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002182
2183 )]}'
2184 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002185 "id": "plugins%2Freplication",
2186 "name": "plugins/replication",
2187 "parent": "Public-Plugins",
2188 "description": "Copies to other servers using the Git protocol"
2189 }
2190----
2191
David Pursehouse8cc68902014-10-06 18:17:16 +09002192[[tag-endpoints]]
2193== Tag Endpoints
2194
David Pursehouse6a446192016-06-03 10:00:34 +09002195[[create-tag]]
2196=== Create Tag
2197
2198--
2199'PUT /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2200--
2201
2202Create a new tag on the project.
2203
2204In the request body additional data for the tag can be provided as
2205link:#tag-input[TagInput].
2206
2207If a message is provided in the input, the tag is created as an
2208annotated tag with the current user as tagger. Signed tags are not
2209supported.
2210
2211.Request
2212----
2213 PUT /projects/MyProject/tags/v1.0 HTTP/1.0
2214 Content-Type: application/json; charset=UTF-8
2215
2216 {
2217 "message": "annotation",
2218 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
2219 }
2220----
2221
2222As response a link:#tag-info[TagInfo] entity is returned that describes
2223the created tag.
2224
2225.Response
2226----
2227 HTTP/1.1 201 Created
2228 Content-Disposition: attachment
2229 Content-Type: application/json; charset=UTF-8
2230
2231 )]}'
2232
2233 "object": "d48d304adc4b6674e11dc2c018ea05fcbdda32fd",
2234 "message": "annotation",
2235 "tagger": {
2236 "name": "David Pursehouse",
2237 "email": "dpursehouse@collab.net",
2238 "date": "2016-06-06 01:22:03.000000000",
2239 "tz": 540
2240 },
2241 "ref": "refs/tags/v1.0",
2242 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
2243 }
2244----
2245
David Pursehouse8cc68902014-10-06 18:17:16 +09002246[[list-tags]]
2247=== List Tags
2248--
2249'GET /projects/link:#project-name[\{project-name\}]/tags/'
2250--
2251
2252List the tags of a project.
2253
2254As result a list of link:#tag-info[TagInfo] entries is returned.
2255
2256Only includes tags under the `refs/tags/` namespace.
2257
2258.Request
2259----
2260 GET /projects/work%2Fmy-project/tags/ HTTP/1.0
2261----
2262
2263.Response
2264----
2265 HTTP/1.1 200 OK
2266 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002267 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09002268
2269 )]}'
2270 [
2271 {
2272 "ref": "refs/tags/v1.0",
2273 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2274 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2275 "message": "Annotated tag",
2276 "tagger": {
2277 "name": "David Pursehouse",
2278 "email": "david.pursehouse@sonymobile.com",
2279 "date": "2014-10-06 07:35:03.000000000",
2280 "tz": 540
2281 }
2282 },
2283 {
2284 "ref": "refs/tags/v2.0",
2285 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2286 },
2287 {
2288 "ref": "refs/tags/v3.0",
2289 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2290 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2291 "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-----",
2292 "tagger": {
2293 "name": "David Pursehouse",
2294 "email": "david.pursehouse@sonymobile.com",
2295 "date": "2014-10-06 09:02:16.000000000",
2296 "tz": 540
2297 }
2298 }
2299 ]
2300----
2301
David Pursehouseb0ba1512015-09-10 14:17:05 +09002302[[tag-options]]
2303==== Tag Options
2304
2305Limit(n)::
2306Limit the number of tags to be included in the results.
2307+
2308.Request
2309----
2310 GET /projects/work%2Fmy-project/tags?n=2 HTTP/1.0
2311----
2312+
2313.Response
2314----
2315 HTTP/1.1 200 OK
2316 Content-Disposition: attachment
2317 Content-Type: application/json; charset=UTF-8
2318
2319 )]}'
2320 [
2321 {
2322 "ref": "refs/tags/v1.0",
2323 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2324 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2325 "message": "Annotated tag",
2326 "tagger": {
2327 "name": "David Pursehouse",
2328 "email": "david.pursehouse@sonymobile.com",
2329 "date": "2014-10-06 07:35:03.000000000",
2330 "tz": 540
2331 }
2332 },
2333 {
2334 "ref": "refs/tags/v2.0",
2335 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2336 }
2337 ]
2338----
2339
David Pursehouse5cb38192017-07-28 16:11:33 +01002340Skip(S)::
David Pursehouseb0ba1512015-09-10 14:17:05 +09002341Skip the given number of tags from the beginning of the list.
2342+
2343.Request
2344----
2345 GET /projects/work%2Fmy-project/tags?n=2&s=1 HTTP/1.0
2346----
2347+
2348.Response
2349----
2350 HTTP/1.1 200 OK
2351 Content-Disposition: attachment
2352 Content-Type: application/json; charset=UTF-8
2353
2354 )]}'
2355 [
2356 {
2357 "ref": "refs/tags/v2.0",
2358 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2359 },
2360 {
2361 "ref": "refs/tags/v3.0",
2362 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2363 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2364 "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-----",
2365 "tagger": {
2366 "name": "David Pursehouse",
2367 "email": "david.pursehouse@sonymobile.com",
2368 "date": "2014-10-06 09:02:16.000000000",
2369 "tz": 540
2370 }
2371 }
2372 ]
2373----
2374
David Pursehousecf1ed062017-07-13 10:05:43 +09002375Substring(m)::
2376Limit the results to those tags that match the specified substring.
2377+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09002378The match is case insensitive. May not be used together with `r`.
David Pursehousecf1ed062017-07-13 10:05:43 +09002379+
2380List all tags that match substring `v2`:
2381
2382+
2383.Request
2384----
2385 GET /projects/testproject/tags?m=v2 HTTP/1.0
2386----
2387+
2388.Response
2389----
2390 HTTP/1.1 200 OK
2391 Content-Disposition: attachment
2392 Content-Type: application/json; charset=UTF-8
2393
2394 )]}'
2395 [
2396 {
2397 "ref": "refs/tags/v2.0",
2398 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2399 },
2400 ]
2401----
2402
2403Regex(r)::
2404Limit the results to those tags that match the specified regex.
2405Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
2406match any tags that start with 't' and regex '*t' will match any
2407tags that end with 't'.
2408+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09002409The match is case sensitive. May not be used together with `m`.
David Pursehousef648e042017-07-13 10:08:46 +09002410+
David Pursehousecf1ed062017-07-13 10:05:43 +09002411List all tags that match regex `v.*0`:
2412+
2413.Request
2414----
2415 GET /projects/testproject/tags?r=v.*0 HTTP/1.0
2416----
2417+
2418.Response
2419----
2420 HTTP/1.1 200 OK
2421 Content-Disposition: attachment
2422 Content-Type: application/json; charset=UTF-8
2423
2424 )]}'
2425 [
2426 {
2427 "ref": "refs/tags/v1.0",
2428 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2429 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2430 "message": "Annotated tag",
2431 "tagger": {
2432 "name": "David Pursehouse",
2433 "email": "david.pursehouse@sonymobile.com",
2434 "date": "2014-10-06 07:35:03.000000000",
2435 "tz": 540
2436 }
2437 },
2438 {
2439 "ref": "refs/tags/v2.0",
2440 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2441 },
2442 {
2443 "ref": "refs/tags/v3.0",
2444 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2445 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2446 "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-----",
2447 "tagger": {
2448 "name": "David Pursehouse",
2449 "email": "david.pursehouse@sonymobile.com",
2450 "date": "2014-10-06 09:02:16.000000000",
2451 "tz": 540
2452 }
2453 }
2454 ]
2455----
David Pursehouseb0ba1512015-09-10 14:17:05 +09002456
David Pursehouse8cc68902014-10-06 18:17:16 +09002457[[get-tag]]
2458=== Get Tag
2459--
2460'GET /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2461--
2462
2463Retrieves a tag of a project.
2464
2465.Request
2466----
2467 GET /projects/work%2Fmy-project/tags/v1.0 HTTP/1.0
2468----
2469
2470As response a link:#tag-info[TagInfo] entity is returned that describes the tag.
2471
2472.Response
2473----
2474 HTTP/1.1 200 OK
2475 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002476 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09002477
2478 )]}'
2479 {
2480 "ref": "refs/tags/v1.0",
2481 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2482 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2483 "message": "Annotated tag",
2484 "tagger": {
2485 "name": "David Pursehouse",
2486 "email": "david.pursehouse@sonymobile.com",
2487 "date": "2014-10-06 07:35:03.000000000",
2488 "tz": 540
2489 }
2490 }
2491----
2492
David Pursehousee1132162016-11-30 20:42:33 +09002493[[delete-tag]]
2494=== Delete Tag
2495--
2496'DELETE /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2497--
2498
2499Deletes a tag.
2500
2501.Request
2502----
2503 DELETE /projects/MyProject/tags/v1.0 HTTP/1.0
2504----
2505
2506.Response
2507----
2508 HTTP/1.1 204 No Content
2509----
David Pursehouse8cc68902014-10-06 18:17:16 +09002510
David Pursehouse467aecb2016-12-02 14:18:42 +09002511[[delete-tags]]
2512=== Delete Tags
2513--
2514'POST /projects/link:#project-name[\{project-name\}]/tags:delete'
2515--
2516
2517Delete one or more tags.
2518
2519The tags to be deleted must be provided in the request body as a
2520link:#delete-tags-input[DeleteTagsInput] entity.
2521
2522.Request
2523----
2524 POST /projects/MyProject/tags:delete HTTP/1.0
2525 Content-Type: application/json;charset=UTF-8
2526
2527 {
2528 "tags": [
2529 "v1.0",
2530 "v2.0"
2531 ]
2532 }
2533----
2534
2535.Response
2536----
2537 HTTP/1.1 204 No Content
2538----
2539
2540If some tags could not be deleted, the response is "`409 Conflict`" and the
2541error message is contained in the response body.
2542
Edwin Kempin1b993602014-07-08 16:18:45 +02002543[[commit-endpoints]]
2544== Commit Endpoints
2545
2546[[get-commit]]
2547=== Get Commit
2548--
2549'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
2550--
2551
2552Retrieves a commit of a project.
2553
2554The commit must be visible to the caller.
2555
2556.Request
2557----
2558 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
2559----
2560
2561As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
2562is returned that describes the commit.
2563
2564.Response
2565----
2566 HTTP/1.1 200 OK
2567 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002568 Content-Type: application/json; charset=UTF-8
Edwin Kempin1b993602014-07-08 16:18:45 +02002569
2570 )]}'
2571 {
2572 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
2573 "parents": [
2574 {
2575 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2576 "subject": "Migrate contributor agreements to All-Projects."
2577 }
2578 ],
2579 "author": {
2580 "name": "Shawn O. Pearce",
2581 "email": "sop@google.com",
2582 "date": "2012-04-24 18:08:08.000000000",
2583 "tz": -420
2584 },
2585 "committer": {
2586 "name": "Shawn O. Pearce",
2587 "email": "sop@google.com",
2588 "date": "2012-04-24 18:08:08.000000000",
2589 "tz": -420
2590 },
2591 "subject": "Use an EventBus to manage star icons",
2592 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2593 }
2594----
2595
Gustaf Lundh1386d592016-10-19 23:19:08 +02002596[[get-included-in]]
2597=== Get Included In
2598--
2599'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/in'
2600--
2601
2602Retrieves the branches and tags in which a change is included. As result
2603an link:rest-api-changes.html#included-in-info[IncludedInInfo] entity is returned.
2604
Youssef Elghareeb4c3ee4b2021-06-18 14:10:25 +02002605Branches that are not visible to the calling user according to the project's
2606read permissions are filtered out from the result.
2607
Gustaf Lundh1386d592016-10-19 23:19:08 +02002608.Request
2609----
2610 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/in HTTP/1.0
2611----
2612
2613.Response
2614----
2615 HTTP/1.1 200 OK
2616 Content-Disposition: attachment
2617 Content-Type: application/json;charset=UTF-8
2618
2619 )]}'
2620 {
2621 "branches": [
2622 "master"
2623 ],
2624 "tags": []
2625 }
2626----
2627
Zhen Chend1462d82016-05-12 13:55:37 -07002628[[get-content-from-commit]]
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002629=== Get Content
2630--
2631'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
2632--
2633
2634Gets the content of a file from a certain commit.
2635
2636.Request
2637----
2638 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
2639----
2640
2641The content is returned as base64 encoded string.
2642
2643.Response
2644----
2645 HTTP/1.1 200 OK
2646 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002647 Content-Type: text/plain; charset=UTF-8
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002648
2649 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
2650----
2651
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002652
2653[[cherry-pick-commit]]
2654=== Cherry Pick Commit
2655--
2656'POST /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/cherrypick'
2657--
2658
2659Cherry-picks a commit of a project to a destination branch.
2660
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02002661To cherry pick a change revision, see link:rest-api-changes.html#cherry-pick[CherryPick].
2662
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002663The destination branch must be provided in the request body inside a
2664link:rest-api-changes.html#cherrypick-input[CherryPickInput] entity.
2665If the commit message is not set, the commit message of the source
2666commit will be used.
2667
Gal Paikin8dadd422021-05-07 10:21:54 +02002668When cherry-picking a commit into a branch that already contains the Change-Id
2669that we want to cherry-pick, the cherry-pick will create a new patch-set on the
2670destination's branch's appropriate Change-Id. If the change is closed on the
2671destination branch, the cherry-pick will fail.
2672
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002673.Request
2674----
2675 POST /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/cherrypick HTTP/1.0
2676 Content-Type: application/json; charset=UTF-8
2677
2678 {
2679 "message" : "Implementing Feature X",
2680 "destination" : "release-branch"
2681 }
2682----
2683
Edwin Kempinaab27d32020-01-29 13:17:04 +01002684As response a link:rest-api-changes.html#change-info[ChangeInfo] entity
2685is returned that describes the resulting cherry-picked change.
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002686
2687.Response
2688----
2689 HTTP/1.1 200 OK
2690 Content-Disposition: attachment
2691 Content-Type: application/json; charset=UTF-8
2692
2693 )]}'
2694 {
2695 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
2696 "project": "myProject",
2697 "branch": "release-branch",
2698 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
2699 "subject": "Implementing Feature X",
2700 "status": "NEW",
2701 "created": "2013-02-01 09:59:32.126000000",
2702 "updated": "2013-02-21 11:16:36.775000000",
2703 "mergeable": true,
2704 "insertions": 12,
2705 "deletions": 11,
2706 "_number": 3965,
2707 "owner": {
2708 "name": "John Doe"
2709 }
2710 }
2711----
2712
Makson Lee7824f302018-07-20 10:33:56 +08002713[[list-files]]
2714=== List Files
2715--
2716'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/'
2717--
2718
2719Lists the files that were modified, added or deleted in a commit.
2720
2721.Request
2722----
2723 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/ HTTP/1.0
2724----
2725
2726As result a map is returned that maps the link:rest-api-changes.html#file-id[file path] to a
2727link:rest-api-changes.html#file-info[FileInfo] entry. The entries in the map are
2728sorted by file path.
2729
2730.Response
2731----
2732 HTTP/1.1 200 OK
2733 Content-Disposition: attachment
2734 Content-Type: application/json; charset=UTF-8
2735
2736 )]}'
2737 {
2738 "/COMMIT_MSG": {
2739 "status": "A",
2740 "lines_inserted": 7,
2741 "size_delta": 551,
2742 "size": 551
2743 },
2744 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
2745 "lines_inserted": 5,
2746 "lines_deleted": 3,
2747 "size_delta": 98,
2748 "size": 23348
2749 }
2750 }
2751----
2752
2753The integer-valued request parameter `parent` changes the response to return a
2754list of the files which are different in this commit compared to the given
2755parent commit. This is useful for supporting review of merge commits. The value
Youssef Elghareeb8df6d5c2021-02-08 12:19:27 +01002756is the 1-based index of the parent's position in the commit object. If the
2757value 0 is used for `parent`, the default base commit will be used, which is
2758the only parent for commits having one parent or the auto-merge commit
2759otherwise.
Makson Lee7824f302018-07-20 10:33:56 +08002760
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002761[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002762== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002763
Edwin Kempin76202742013-02-15 13:51:50 +01002764[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002765=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002766--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002767'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002768--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002769
Edwin Kempind0a63922013-01-23 16:32:59 +01002770List custom dashboards for a project.
2771
Edwin Kempin55367622013-02-05 09:09:23 +01002772As result a list of link:#dashboard-info[DashboardInfo] entries is
2773returned.
2774
Edwin Kempind0a63922013-01-23 16:32:59 +01002775List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01002776
2777.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002778----
2779 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002780----
Edwin Kempind0a63922013-01-23 16:32:59 +01002781
Edwin Kempin37440832013-02-06 11:36:00 +01002782.Response
2783----
Edwin Kempind0a63922013-01-23 16:32:59 +01002784 HTTP/1.1 200 OK
2785 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002786 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002787
2788 )]}'
2789 [
2790 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002791 "id": "main:closed",
2792 "ref": "main",
2793 "path": "closed",
2794 "description": "Merged and abandoned changes in last 7 weeks",
2795 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002796 "is_default": true,
Edwin Kempind0a63922013-01-23 16:32:59 +01002797 "title": "Closed changes",
2798 "sections": [
2799 {
2800 "name": "Merged",
2801 "query": "status:merged age:7w"
2802 },
2803 {
2804 "name": "Abandoned",
2805 "query": "status:abandoned age:7w"
2806 }
2807 ]
2808 }
2809 ]
2810----
2811
Edwin Kempina64c4b92013-01-23 11:30:40 +01002812.Get all dashboards of the 'All-Projects' project
2813****
2814get::/projects/All-Projects/dashboards/
2815****
2816
Edwin Kempin67e923c2013-02-14 13:57:12 +01002817[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002818=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002819--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002820'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002821--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002822
Edwin Kempin67e923c2013-02-14 13:57:12 +01002823Retrieves a project dashboard. The dashboard can be defined on that
2824project or be inherited from a parent project.
2825
2826.Request
2827----
2828 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
2829----
2830
2831As response a link:#dashboard-info[DashboardInfo] entity is returned
2832that describes the dashboard.
2833
2834.Response
2835----
2836 HTTP/1.1 200 OK
2837 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002838 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002839
2840 )]}'
2841 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002842 "id": "main:closed",
2843 "ref": "main",
2844 "path": "closed",
2845 "description": "Merged and abandoned changes in last 7 weeks",
2846 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002847 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002848 "title": "Closed changes",
2849 "sections": [
2850 {
2851 "name": "Merged",
2852 "query": "status:merged age:7w"
2853 },
2854 {
2855 "name": "Abandoned",
2856 "query": "status:abandoned age:7w"
2857 }
2858 ]
2859 }
2860----
2861
2862To retrieve the default dashboard of a project use `default` as
2863dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01002864
2865.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002866----
2867 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002868----
Edwin Kempind0a63922013-01-23 16:32:59 +01002869
Edwin Kempin37440832013-02-06 11:36:00 +01002870.Response
2871----
Edwin Kempind0a63922013-01-23 16:32:59 +01002872 HTTP/1.1 200 OK
2873 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002874 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002875
2876 )]}'
2877 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002878 "id": "main:closed",
2879 "ref": "main",
2880 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01002881 "description": "Merged and abandoned changes in last 7 weeks",
2882 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002883 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002884 "title": "Closed changes",
2885 "sections": [
2886 {
2887 "name": "Merged",
2888 "query": "status:merged age:7w"
2889 },
2890 {
2891 "name": "Abandoned",
2892 "query": "status:abandoned age:7w"
2893 }
2894 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01002895 }
2896----
2897
Edwin Kempin339cb312019-08-05 15:59:58 +02002898[[create-dashboard]]
2899=== Create Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002900--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002901'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002902--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002903
Edwin Kempin339cb312019-08-05 15:59:58 +02002904Creates a project dashboard, if a project dashboard with the given
2905dashboard ID doesn't exist yet.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002906
2907Currently only supported for the `default` dashboard.
2908
Edwin Kempin339cb312019-08-05 15:59:58 +02002909The creation information for the dashboard must be provided in
Edwin Kempin67e923c2013-02-14 13:57:12 +01002910the request body as a link:#dashboard-input[DashboardInput] entity.
2911
2912.Request
2913----
2914 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002915 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002916
2917 {
2918 "id": "main:closed",
2919 "commit_message": "Define the default dashboard"
2920 }
2921----
2922
Edwin Kempin339cb312019-08-05 15:59:58 +02002923As response the new dashboard is returned as a link:#dashboard-info[
2924DashboardInfo] entity.
2925
2926.Response
2927----
2928 HTTP/1.1 201 Created
2929 Content-Disposition: attachment
2930 Content-Type: application/json; charset=UTF-8
2931
2932 )]}'
2933 {
2934 "id": "main:closed",
2935 "ref": "main",
2936 "path": "closed",
2937 "description": "Merged and abandoned changes in last 7 weeks",
2938 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
2939 "is_default": true,
2940 "title": "Closed changes",
2941 "sections": [
2942 {
2943 "name": "Merged",
2944 "query": "status:merged age:7w"
2945 },
2946 {
2947 "name": "Abandoned",
2948 "query": "status:abandoned age:7w"
2949 }
2950 ]
2951 }
2952----
2953
2954[[update-dashboard]]
2955=== Update Dashboard
2956--
2957'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
2958--
2959
2960Updates a project dashboard, if a project dashboard with the given
2961dashboard ID already exists.
2962
2963Currently only supported for the `default` dashboard.
2964
2965The update information for the dashboard must be provided in
2966the request body as a link:#dashboard-input[DashboardInput] entity.
2967
2968.Request
2969----
2970 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
2971 Content-Type: application/json; charset=UTF-8
2972
2973 {
2974 "id": "main:closed",
2975 "commit_message": "Update the default dashboard"
2976 }
2977----
2978
2979As response the updated dashboard is returned as a
Edwin Kempin67e923c2013-02-14 13:57:12 +01002980link:#dashboard-info[DashboardInfo] entity.
2981
2982.Response
2983----
2984 HTTP/1.1 200 OK
2985 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002986 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002987
2988 )]}'
2989 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002990 "id": "main:closed",
2991 "ref": "main",
2992 "path": "closed",
2993 "description": "Merged and abandoned changes in last 7 weeks",
2994 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002995 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002996 "title": "Closed changes",
2997 "sections": [
2998 {
2999 "name": "Merged",
3000 "query": "status:merged age:7w"
3001 },
3002 {
3003 "name": "Abandoned",
3004 "query": "status:abandoned age:7w"
3005 }
3006 ]
3007 }
3008----
3009
3010[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003011=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003012--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003013'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003014--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003015
Edwin Kempin67e923c2013-02-14 13:57:12 +01003016Deletes a project dashboard.
3017
3018Currently only supported for the `default` dashboard.
3019
Edwin Kempinefec4492013-02-22 10:09:23 +01003020The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05003021DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01003022
3023Please note that some proxies prohibit request bodies for DELETE
3024requests.
3025
3026.Request
3027----
3028 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
3029----
3030
3031.Response
3032----
3033 HTTP/1.1 204 No Content
3034----
3035
Edwin Kempin44098d02019-10-24 09:22:34 +02003036[[label-endpoints]]
3037== Label Endpoints
3038
3039[[list-labels]]
3040=== List Labels
3041--
3042'GET /projects/link:#project-name[\{project-name\}]/labels/'
3043--
3044
3045Lists the labels that are defined in this project.
3046
3047The calling user must have read access to the `refs/meta/config` branch of the
3048project.
3049
3050.Request
3051----
3052 GET /projects/All-Projects/labels/ HTTP/1.0
3053----
3054
3055As result a list of link:#label-definition-info[LabelDefinitionInfo] entities
3056is returned that describe the labels that are defined in this project
Edwin Kempinb5275262019-10-24 16:03:27 +02003057(inherited labels are not returned unless the `inherited` parameter is set, see
3058link:#list-with-inherited-labels[below]). The returned labels are sorted by
3059label name.
Edwin Kempin44098d02019-10-24 09:22:34 +02003060
3061.Response
3062----
3063 HTTP/1.1 200 OK
3064 Content-Disposition: attachment
3065 Content-Type: application/json; charset=UTF-8
3066
3067 )]}'
3068 [
3069 {
3070 "name": "Code-Review",
Edwin Kempinb5275262019-10-24 16:03:27 +02003071 "project": "All-Projects",
Edwin Kempin44098d02019-10-24 09:22:34 +02003072 "function": "MaxWithBlock",
3073 "values": {
3074 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003075 "-1": "I would prefer this is not submitted as is",
3076 "-2": "This shall not be submitted",
Edwin Kempin44098d02019-10-24 09:22:34 +02003077 "+1": "Looks good to me, but someone else must approve",
3078 "+2": "Looks good to me, approved"
3079 },
3080 "default_value": 0,
3081 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003082 "copy_condition": "changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE or is:MIN",
Edwin Kempin44098d02019-10-24 09:22:34 +02003083 "allow_post_submit": true
3084 }
3085 ]
3086----
3087
Edwin Kempinb5275262019-10-24 16:03:27 +02003088[[list-with-inherited-labels]]
3089To include inherited labels from all parent projects the parameter `inherited`
3090can be set.
3091
3092The calling user must have read access to the `refs/meta/config` branch of the
3093project and all its parent projects.
3094
3095.Request
3096----
3097 GET /projects/My-Project/labels/?inherited HTTP/1.0
3098----
3099
3100As result a list of link:#label-definition-info[LabelDefinitionInfo] entities
3101is returned that describe the labels that are defined in this project and in
3102all its parent projects. The returned labels are sorted by parent projects
3103in-order from `All-Projects` through the project hierarchy to this project.
3104Labels that belong to the same project are sorted by label name.
3105
3106.Response
3107----
3108 HTTP/1.1 200 OK
3109 Content-Disposition: attachment
3110 Content-Type: application/json; charset=UTF-8
3111
3112 )]}'
3113 [
3114 {
3115 "name": "Code-Review",
3116 "project": "All-Projects",
3117 "function": "MaxWithBlock",
3118 "values": {
3119 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003120 "-1": "I would prefer this is not submitted as is",
3121 "-2": "This shall not be submitted",
Edwin Kempinb5275262019-10-24 16:03:27 +02003122 "+1": "Looks good to me, but someone else must approve",
3123 "+2": "Looks good to me, approved"
3124 },
3125 "default_value": 0,
3126 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003127 "copy_condition": "changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE or is:MIN",
Edwin Kempinb5275262019-10-24 16:03:27 +02003128 "allow_post_submit": true
3129 },
3130 {
3131 "name": "Foo-Review",
3132 "project": "My-Project",
3133 "function": "MaxWithBlock",
3134 "values": {
3135 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003136 "-1": "I would prefer this is not submitted as is",
3137 "-2": "This shall not be submitted",
Edwin Kempinb5275262019-10-24 16:03:27 +02003138 "+1": "Looks good to me, but someone else must approve",
3139 "+2": "Looks good to me, approved"
3140 },
3141 "default_value": 0,
3142 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003143 "copy_condition": "is:ANY",
Edwin Kempinb5275262019-10-24 16:03:27 +02003144 "allow_post_submit": true
3145 }
3146 ]
3147----
3148
Edwin Kempinaa56f442019-10-25 08:40:24 +02003149[[get-label]]
3150=== Get Label
3151--
3152'GET /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3153--
3154
3155Retrieves the definition of a label that is defined in this project.
3156
3157The calling user must have read access to the `refs/meta/config` branch of the
3158project.
3159
3160.Request
3161----
3162 GET /projects/All-Projects/labels/Code-Review HTTP/1.0
3163----
3164
3165As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3166returned that describes the label.
3167
3168.Response
3169----
3170 HTTP/1.1 200 OK
3171 Content-Disposition: attachment
3172 Content-Type: application/json; charset=UTF-8
3173
3174 )]}'
3175 {
3176 "name": "Code-Review",
3177 "project": "All-Projects",
3178 "function": "MaxWithBlock",
3179 "values": {
3180 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003181 "-1": "I would prefer this is not submitted as is",
3182 "-2": "This shall not be submitted",
Edwin Kempinaa56f442019-10-25 08:40:24 +02003183 "+1": "Looks good to me, but someone else must approve",
3184 "+2": "Looks good to me, approved"
3185 },
3186 "default_value": 0,
3187 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003188 "copy_condition": "changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE OR is:MIN",
Edwin Kempinaa56f442019-10-25 08:40:24 +02003189 "allow_post_submit": true
3190 }
3191----
3192
Edwin Kempina020d262019-10-25 16:36:45 +02003193[[create-label]]
3194=== Create Label
3195--
3196'PUT /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3197--
3198
3199Creates a new label definition in this project.
3200
3201The calling user must have write access to the `refs/meta/config` branch of the
3202project.
3203
3204If a label with this name is already defined in this project, this label
3205definition is updated (see link:#set-label[Set Label]).
3206
3207.Request
3208----
3209 PUT /projects/My-Project/labels/Foo HTTP/1.0
3210 Content-Type: application/json; charset=UTF-8
3211
3212 {
3213 "commit_message": "Create Foo Label",
3214 "values": {
3215 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003216 "-1": "I would prefer this is not submitted as is",
3217 "-2": "This shall not be submitted",
Edwin Kempina020d262019-10-25 16:36:45 +02003218 "+1": "Looks good to me, but someone else must approve",
3219 "+2": "Looks good to me, approved"
3220 }
3221 }
3222----
3223
3224As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3225returned that describes the created label.
3226
3227.Response
3228----
3229 HTTP/1.1 200 OK
3230 Content-Disposition: attachment
3231 Content-Type: application/json; charset=UTF-8
3232
3233 )]}'
3234 {
3235 "name": "Foo",
3236 "project_name": "My-Project",
3237 "function": "MaxWithBlock",
3238 "values": {
3239 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003240 "-1": "I would prefer this is not submitted as is",
3241 "-2": "This shall not be submitted",
Edwin Kempina020d262019-10-25 16:36:45 +02003242 "+1": "Looks good to me, but someone else must approve",
3243 "+2": "Looks good to me, approved"
3244 },
3245 "default_value": 0,
3246 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003247 "copy_condition": "changekind:NO_CHANGE",
Edwin Kempina020d262019-10-25 16:36:45 +02003248 "allow_post_submit": true
3249 }
3250----
3251
Edwin Kempinb5e87452019-10-25 13:28:46 +02003252[[set-label]]
3253=== Set Label
3254--
3255'PUT /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3256--
3257
3258Updates the definition of a label that is defined in this project.
3259
3260The calling user must have write access to the `refs/meta/config` branch of the
3261project.
3262
3263Properties which are not set in the input entity are not modified.
3264
3265.Request
3266----
3267 PUT /projects/All-Projects/labels/Code-Review HTTP/1.0
3268 Content-Type: application/json; charset=UTF-8
3269
3270 {
3271 "commit_message": "Ignore self approvals for Code-Review label",
3272 "ignore_self_approval": true
3273 }
3274----
3275
3276As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3277returned that describes the updated label.
3278
3279.Response
3280----
3281 HTTP/1.1 200 OK
3282 Content-Disposition: attachment
3283 Content-Type: application/json; charset=UTF-8
3284
3285 )]}'
3286 {
3287 "name": "Code-Review",
3288 "project": "All-Projects",
3289 "function": "MaxWithBlock",
3290 "values": {
3291 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003292 "-1": "I would prefer this is not submitted as is",
3293 "-2": "This shall not be submitted",
Edwin Kempinb5e87452019-10-25 13:28:46 +02003294 "+1": "Looks good to me, but someone else must approve",
3295 "+2": "Looks good to me, approved"
3296 },
3297 "default_value": 0,
3298 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003299 "copy_condition": "changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE OR is:MIN",
Edwin Kempinb5e87452019-10-25 13:28:46 +02003300 "allow_post_submit": true,
3301 "ignore_self_approval": true
3302 }
3303----
3304
Edwin Kempin920f6f82019-10-28 10:43:13 +01003305[[delete-label]]
3306=== Delete Label
3307--
3308'DELETE /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3309--
3310
3311Deletes the definition of a label that is defined in this project.
3312
3313The calling user must have write access to the `refs/meta/config` branch of the
3314project.
3315
3316The request body does not need to include a link:#delete-label-input[
3317DeleteLabelInput] entity if no commit message is specified.
3318
3319.Request
3320----
Edwin Kempin6b96af62019-10-28 13:55:14 +01003321 DELETE /projects/My-Project/labels/Foo-Review HTTP/1.0
Edwin Kempin920f6f82019-10-28 10:43:13 +01003322 Content-Type: application/json; charset=UTF-8
3323
3324 {
3325 "commit_message": "Delete Foo-Review label",
3326 }
3327----
3328
3329If a label was deleted the response is "`204 No Content`".
3330
3331.Response
3332----
3333 HTTP/1.1 204 No Content
3334----
3335
Edwin Kempin83d6d222019-10-28 13:45:52 +01003336[[batch-update-labels]]
3337=== Batch Update Labels
3338--
3339'POST /projects/link:#project-name[\{project-name\}]/labels/'
3340--
3341
3342Creates/updates/deletes multiple label definitions in this project at once.
3343
3344The calling user must have write access to the `refs/meta/config` branch of the
3345project.
3346
3347The updates must be specified in the request body as
3348link:#batch-label-input[BatchLabelInput] entity.
3349
3350The updates are processed in the following order:
3351
33521. label deletions
33532. label creations
33543. label updates
3355
3356.Request
3357----
3358 POST /projects/My-Project/labels/ HTTP/1.0
3359 Content-Type: application/json; charset=UTF-8
3360
3361 {
3362 "commit_message": "Update Labels",
3363 "delete": [
3364 "Old-Review",
3365 "Unused-Review"
3366 ],
3367 "create": [
3368 {
3369 "name": "Foo-Review",
3370 "values": {
3371 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003372 "-1": "I would prefer this is not submitted as is",
3373 "-2": "This shall not be submitted",
Edwin Kempin83d6d222019-10-28 13:45:52 +01003374 "+1": "Looks good to me, but someone else must approve",
3375 "+2": "Looks good to me, approved"
3376 }
3377 ],
3378 "update:" {
3379 "Bar-Review": {
3380 "function": "MaxWithBlock"
3381 },
3382 "Baz-Review": {
Edwin Kempin53bdd552022-04-05 14:03:26 +02003383 "copy_condition": "is:MIN"
Edwin Kempin83d6d222019-10-28 13:45:52 +01003384 }
3385 }
3386 }
3387----
3388
3389If the label updates were done successfully the response is "`200 OK`".
3390
3391.Response
3392----
3393 HTTP/1.1 200 OK
3394----
3395
Youssef Elghareeb859b0522021-05-21 00:34:59 +02003396[[submit-requirement-endpoints]]
3397== Submit Requirement Endpoints
3398
3399[[create-submit-requirement]]
3400=== Create Submit Requirement
3401
3402--
3403'PUT /projects/link:#project-name[\{project-name\}]/submit_requirements/link:#submit-requirement-name[\{submit-requirement-name\}]'
3404--
3405
3406Creates a new submit requirement definition in this project.
3407
3408The calling user must have write access to the `refs/meta/config` branch of the
3409project.
3410
3411If a submit requirement with this name is already defined in this project, this
3412submit requirement definition is updated
3413(see link:#update-submit-requirement[Update Submit Requirement]).
3414
3415The submit requirement data must be provided in the request body as
3416link:#submit-requirement-input[SubmitRequirementInput].
3417
3418.Request
3419----
3420 PUT /projects/My-Project/submit_requirements/Code-Review HTTP/1.0
3421 Content-Type: application/json; charset=UTF-8
3422
3423 {
3424 "name": "Code-Review",
3425 "description": "At least one maximum vote for the Code-Review label is required",
3426 "submittability_expression": "label:Code-Review=+2"
3427 }
3428----
3429
3430As response a link:#submit-requirement-info[SubmitRequirementInfo] entity is
3431returned that describes the created submit requirement.
3432
3433.Response
3434----
3435 HTTP/1.1 200 OK
3436 Content-Disposition: attachment
3437 Content-Type: application/json; charset=UTF-8
3438
3439 )]}'
3440 {
3441 "name": "Code-Review",
3442 "description": "At least one maximum vote for the Code-Review label is required",
3443 "submittability_expression": "label:Code-Review=+2",
3444 "allow_override_in_child_projects": false
3445 }
3446----
3447
3448[[update-submit-requirement]]
3449=== Update Submit Requirement
3450
3451--
3452'PUT /projects/link:#project-name[\{project-name\}]/submit_requirements/link:#submit-requirement-name[\{submit-requirement-name\}]'
3453--
3454
3455Updates the definition of a submit requirement that is defined in this project.
3456
3457The calling user must have write access to the `refs/meta/config` branch of the
3458project.
3459
3460The new submit requirement will overwrite the existing submit requirement.
3461That is, unspecified attributes will be set to their defaults.
3462
3463.Request
3464----
3465 PUT /projects/My-Project/submit_requirements/Code-Review HTTP/1.0
3466 Content-Type: application/json; charset=UTF-8
3467
3468 {
3469 "name": "Code-Review",
3470 "description": "At least one maximum vote for the Code-Review label is required",
3471 "submittability_expression": "label:Code-Review=+2"
3472 }
3473----
3474
3475As response a link:#submit-requirement-info[SubmitRequirementInfo] entity is
3476returned that describes the created submit requirement.
3477
3478.Response
3479----
3480 HTTP/1.1 200 OK
3481 Content-Disposition: attachment
3482 Content-Type: application/json; charset=UTF-8
3483
3484 )]}'
3485 {
3486 "name": "Code-Review",
3487 "description": "At least one maximum vote for the Code-Review label is required",
3488 "submittability_expression": "label:Code-Review=+2",
3489 "allow_override_in_child_projects": false
3490 }
3491----
3492
3493[[get-submit-requirement]]
3494=== Get Submit Requirement
3495--
3496'GET /projects/link:#project-name[\{project-name\}]/submit_requirements/link:#submit-requirement-name[\{submit-requirement-name\}]'
3497--
3498
3499Retrieves the definition of a submit requirement that is defined in this project.
3500
3501The calling user must have read access to the `refs/meta/config` branch of the
3502project.
3503
3504.Request
3505----
3506 GET /projects/All-Projects/submit-requirement/Code-Review HTTP/1.0
3507----
3508
3509.Response
3510----
3511 HTTP/1.1 200 OK
3512 Content-Disposition: attachment
3513 Content-Type: application/json; charset=UTF-8
3514
3515 )]}'
3516 {
3517 "name": "Code-Review",
3518 "description": "At least one maximum vote for the Code-Review label is required",
3519 "submittability_expression": "label:Code-Review=+2",
3520 "allow_override_in_child_projects": false
3521 }
3522----
Edwin Kempin34d83352013-02-06 10:40:17 +01003523
3524[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003525== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01003526
Edwin Kempin196e1732013-05-09 15:12:34 +02003527[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003528=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02003529The name of a branch or `HEAD`. The prefix `refs/heads/` can be
3530omitted.
3531
Edwin Kempin1b993602014-07-08 16:18:45 +02003532[[commit-id]]
3533=== \{commit-id\}
3534Commit ID.
3535
David Pursehouse8cc68902014-10-06 18:17:16 +09003536[[tag-id]]
3537=== \{tag-id\}
3538The name of a tag. The prefix `refs/tags/` can be omitted.
3539
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003540[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003541=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01003542The ID of a dashboard in the format '<ref>:<path>'.
3543
3544A special dashboard ID is `default` which represents the default
3545dashboard of a project.
3546
Edwin Kempinaa56f442019-10-25 08:40:24 +02003547[[label-name]]
3548=== \{label-name\}
3549The name of a review label.
3550
Youssef Elghareeb859b0522021-05-21 00:34:59 +02003551[[submit-requirement-name]]
3552=== \{submit-requirement-name\}
3553The name of a submit requirement.
3554
3555
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003556[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003557=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01003558The name of the project.
3559
Edwin Kempina9e94ab2015-03-06 10:35:39 +01003560If the name ends with `.git`, the suffix will be automatically removed.
3561
Edwin Kempin34d83352013-02-06 10:40:17 +01003562
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003563[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003564== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003565
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02003566[[access-check-info]]
3567=== AccessCheckInfo
3568
3569The `AccessCheckInfo` entity is the result of an access check.
3570
3571[options="header",cols="1,^1,5"]
3572|=========================================
3573|Field Name ||Description
3574|`status` ||The HTTP status code for the access.
Han-Wen Nienhuys3364c472018-10-01 16:49:42 +02003575200 means success and 403 means denied.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02003576|`message` |optional|A clarifying message if `status` is not 200.
Edwin Kempin35b6f4a2020-02-14 13:33:45 +01003577|`debug_logs` |optional|
3578Debug logs that may help to understand why a permission is denied or allowed.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02003579|=========================================
3580
Edwin Kempinbf9df392018-01-12 15:20:48 +01003581[[auto_closeable_changes_check_input]]
3582=== AutoCloseableChangesCheckInput
3583The `AutoCloseableChangesCheckInput` entity contains options for running
3584the link:#auto-closeable-changes-check[AutoCloseableChangesCheck].
3585
3586[options="header",cols="1,^2,4"]
3587|=============================
3588|Field Name ||Description
3589|`fix` |optional|
3590Whether auto-closeable changes should be closed automatically.
3591|`branch` ||
3592The branch for which the link:#auto-closeable-changes-check[
3593AutoCloseableChangesCheck] should be performed. The 'refs/heads/'
3594prefix for the branch name can be omitted.
3595|`skip_commits` |optional|
3596Number of commits that should be skipped when walking the commits of
3597the branch.
3598|`max_commits` |optional|
3599Maximum number of commits to walk. If not specified this defaults to
360010,000 commits. 10,000 is also the maximum that can be set.
3601Auto-closing changes is an expensive operation and the more commits
3602are walked the slower it gets. This is why you should avoid walking too
3603many commits.
3604|=============================
3605
3606[[auto_closeable_changes_check_result]]
3607=== AutoCloseableChangesCheckResult
3608The `AutoCloseableChangesCheckResult` entity contains the results of
3609running the link:#auto-closeable-changes-check[AutoCloseableChangesCheck]
3610on a project.
3611
3612[options="header",cols="1,6"]
3613|====================================
3614|Field Name |Description
3615|`auto_closeable_changes`|
3616Changes that can be auto-closed as list of
3617link:rest-api-changes.html#change-info[ChangeInfo] entities. For each
3618returned link:rest-api-changes.html#change-info[ChangeInfo] entity the
3619`problems` field is populated that includes details about the detected
3620issues. If `fix` in the link:#auto_closeable_changes_check_input[
3621AutoCloseableChangesCheckInput] was set to `true`, `status` and
3622`outcome` in link:rest-api-changes.html#problem-info[ProblemInfo] are
3623populated. If the status says `FIXED` Gerrit was able to auto-close the
3624change now.
3625|====================================
3626
Edwin Kempin62946742014-07-09 11:17:58 +02003627[[ban-input]]
3628=== BanInput
3629The `BanInput` entity contains information for banning commits in a
3630project.
3631
David Pursehouseae367192014-11-25 17:24:47 +09003632[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02003633|=======================
3634|Field Name||Description
3635|`commits` ||List of commits to be banned.
3636|`reason` |optional|Reason for banning the commits.
3637|=======================
3638
3639[[ban-result-info]]
3640=== BanResultInfo
3641The `BanResultInfo` entity describes the result of banning commits.
3642
David Pursehouseae367192014-11-25 17:24:47 +09003643[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02003644|=============================
3645|Field Name ||Description
3646|`newly_banned` |optional|List of newly banned commits.
3647|`already_banned`|optional|List of commits that were already banned.
3648|`ignored` |optional|List of object IDs that were ignored.
3649|=============================
3650
Edwin Kempin521c1242015-01-23 12:44:44 +01003651[[branch-info]]
3652=== BranchInfo
3653The `BranchInfo` entity contains information about a branch.
3654
3655[options="header",cols="1,^2,4"]
3656|=========================
3657|Field Name ||Description
3658|`ref` ||The ref of the branch.
3659|`revision` ||The revision to which the branch points.
David Pursehoused00515e2017-11-10 15:57:41 +09003660|`can_delete`|not set if `false`|
Edwin Kempin521c1242015-01-23 12:44:44 +01003661Whether the calling user can delete this branch.
3662|`web_links` |optional|
3663Links to the branch in external sites as a list of
3664link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
3665|=========================
3666
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003667[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003668=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003669The `BranchInput` entity contains information for the creation of
3670a new branch.
3671
David Pursehouseae367192014-11-25 17:24:47 +09003672[options="header",cols="1,^2,4"]
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003673|=======================
Edwin Kempin11663f72022-02-15 10:24:33 +01003674|Field Name ||Description
3675|`ref` |optional|
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003676The name of the branch. The prefix `refs/heads/` can be
3677omitted. +
3678If set, must match the branch ID in the URL.
Edwin Kempin11663f72022-02-15 10:24:33 +01003679|`revision` |optional|
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003680The base revision of the new branch. +
3681If not set, `HEAD` will be used as base revision.
Edwin Kempin11663f72022-02-15 10:24:33 +01003682|`validation_options`|optional|
3683Map with key-value pairs that are forwarded as options to the ref operation
3684validation listeners (e.g. can be used to skip certain validations). Which
3685validation options are supported depends on the installed ref operation
3686validation listeners. Gerrit core doesn't support any validation options, but
3687ref operation validation listeners that are implemented in plugins may. Please
3688refer to the documentation of the installed plugins to learn whether they
3689support validation options. Unknown validation options are silently ignored.
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003690|=======================
3691
Edwin Kempinbf9df392018-01-12 15:20:48 +01003692[[check-project-input]]
3693=== CheckProjectInput
3694The `CheckProjectInput` entity contains information about which
3695consistency checks should be run on a project.
3696
3697[options="header",cols="1,^2,4"]
3698|===========================================
3699|Field Name ||Description
3700|`auto_closeable_changes_check`|optional|
3701Parameters for the link:#auto-closeable-changes-check[
3702AutoCloseableChangesCheck] as
3703link:rest-api-changes.html#auto_closeable_changes_check_input[
3704AutoCloseableChangesCheckInput] entity.
3705|===========================================
3706
3707[[check-project-result-info]]
3708=== CheckProjectResultInfo
3709The `CheckProjectResultInfo` entity contains results for consistency
3710checks that have been run on a project.
3711
3712[options="header",cols="1,^2,4"]
3713|==================================================
3714|Field Name ||Description
3715|`auto_closeable_changes_check_result`|optional|
3716Results for the link:#auto-closeable-changes-check[
3717AutoCloseableChangesCheck] as
3718link:rest-api-changes.html#auto_closeable_changes_check_result[
3719AutoCloseableChangesCheckResult] entity.
3720|==================================================
3721
Edwin Kempin043436d2018-10-17 12:23:22 +02003722[[commentlink-info]]
3723=== CommentLinkInfo
3724The `CommentLinkInfo` entity describes a
3725link:config-gerrit.html#commentlink[commentlink].
3726
3727[options="header",cols="1,^2,4"]
3728|==================================================
3729|Field Name | |Description
3730|`match` | |A JavaScript regular expression to match
3731positions to be replaced with a hyperlink, as documented in
Gal Paikin86367472019-08-02 09:59:42 +02003732link:config-gerrit.html#commentlink.name.match[commentlink.name.match].
Edwin Kempin043436d2018-10-17 12:23:22 +02003733|`link` | |The URL to direct the user to whenever the
3734regular expression is matched, as documented in
Gal Paikin86367472019-08-02 09:59:42 +02003735link:config-gerrit.html#commentlink.name.link[commentlink.name.link].
Edwin Kempin043436d2018-10-17 12:23:22 +02003736|`enabled` |optional|Whether the commentlink is enabled, as documented
Gal Paikin86367472019-08-02 09:59:42 +02003737in link:config-gerrit.html#commentlink.name.enabled[
Edwin Kempin043436d2018-10-17 12:23:22 +02003738commentlink.name.enabled]. If not set the commentlink is enabled.
David Pursehouse67c8f142018-10-14 14:01:29 +09003739
3740[[commentlink-input]]
3741=== CommentLinkInput
3742The `CommentLinkInput` entity describes the input for a
3743link:config-gerrit.html#commentlink[commentlink].
3744
3745|==================================================
3746[options="header",cols="1,^2,4"]
3747|==================================================
3748|Field Name | |Description
3749|`match` | |A JavaScript regular expression to match
3750positions to be replaced with a hyperlink, as documented in
3751link:config-gerrit.html#commentlink.name.match[commentlink.name.match].
3752|`link` | |The URL to direct the user to whenever the
3753regular expression is matched, as documented in
3754link:config-gerrit.html#commentlink.name.link[commentlink.name.link].
3755|`enabled` |optional|Whether the commentlink is enabled, as documented
3756in link:config-gerrit.html#commentlink.name.enabled[
3757commentlink.name.enabled]. If not set the commentlink is enabled.
Edwin Kempin043436d2018-10-17 12:23:22 +02003758|==================================================
3759
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003760[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003761=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003762The `ConfigInfo` entity contains information about the effective project
3763configuration.
3764
David Pursehouseae367192014-11-25 17:24:47 +09003765[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02003766|=======================================================
3767|Field Name ||Description
3768|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003769The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003770|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003771link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3772authors must complete a contributor agreement on the site before
3773pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003774|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003775link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3776Gerrit will try to perform a 3-way merge of text file content when a
3777file has been modified by both the destination branch and the change
3778being submitted. This option only takes effect if submit type is not
3779FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003780|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003781link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3782each change must contain a Signed-off-by line from either the author or
3783the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003784|`create_new_change_for_all_not_in_target` |optional|
3785link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3786a new change is created for every commit not in target branch.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02003787|`require_change_id` |optional|
3788link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
3789valid link:user-changeid.html[Change-Id] footer in any commit uploaded
3790for review is required. This does not apply to commits pushed directly
3791to a branch or tag. This property is deprecated and will be removed in
3792a future release.
Doug Claar1b0f76252016-03-23 13:34:55 -07003793|`enable_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz5170e0f2015-06-18 21:05:29 -04003794link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3795signed push validation is enabled on the project.
Doug Claar1b0f76252016-03-23 13:34:55 -07003796|`require_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz0543c732015-10-20 10:35:26 -04003797link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3798signed push validation is required on the project.
Saša Živkov225b7a72015-11-17 17:37:43 +01003799|`reject_implicit_merges`|optional|
3800link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3801implicit merges should be rejected on changes pushed to the project.
David Ostrovsky96909942018-06-10 08:30:33 +02003802|`private_by_default` ||
Changcheng Xiaod089b4a2017-08-10 14:05:22 +02003803link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3804all new changes are set as private by default.
David Ostrovsky96909942018-06-10 08:30:33 +02003805|`work_in_progress_by_default`||
3806link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3807all new changes are set as work-in-progress by default.
3808|`max_object_size_limit` ||
Edwin Kempin3c99f592013-07-15 10:12:27 +02003809The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
3810limit] of this project as a link:#max-object-size-limit-info[
3811MaxObjectSizeLimitInfo] entity.
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04003812|`default_submit_type` ||
3813link:#submit-type-info[SubmitTypeInfo] that describes the default submit type of
3814the project, when not overridden at the change level.
Edwin Kempin3c99f592013-07-15 10:12:27 +02003815|`submit_type` ||
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04003816Deprecated; equivalent to link:#submit-type-info[`value`] in
3817`default_submit_type`.
Patrick Hiesel5a316352017-06-22 15:38:06 +02003818|`match_author_to_committer_date` |optional|
3819link:#inherited-boolean-info[InheritedBooleanInfo] that indicates whether
3820a change's author date will be changed to match its submitter date upon submit.
Edwin Kempin3c99f592013-07-15 10:12:27 +02003821|`state` |optional|
3822The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
3823Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02003824|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02003825Map with the comment link configurations of the project. The name of
Edwin Kempin043436d2018-10-17 12:23:22 +02003826the comment link configuration is mapped to a link:#commentlink-info[
3827CommentlinkInfo] entity.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003828|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003829Plugin configuration as map which maps the plugin name to a map of
3830parameter names to link:#config-parameter-info[ConfigParameterInfo]
Alice Kober-Sotzek77bc1862020-06-25 20:05:47 +02003831entities. Only filled for users who have read access to `refs/meta/config`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003832|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02003833Actions the caller might be able to perform on this project. The
3834information is a map of view names to
Patrick Hieseldc285c72018-01-08 17:20:15 +01003835|`reject_empty_commit` |optional|
3836link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3837empty commits should be rejected when a change is merged.
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02003838link:rest-api-changes.html#action-info[ActionInfo] entities.
David Pursehouse510b87d2014-11-25 16:46:28 +09003839|=======================================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003840
Edwin Kempina23eb102013-07-17 09:10:54 +02003841[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003842=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02003843The `ConfigInput` entity describes a new project configuration.
3844
David Pursehouseae367192014-11-25 17:24:47 +09003845[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02003846|======================================================
3847|Field Name ||Description
3848|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003849The new description of the project. +
3850If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003851|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003852Whether authors must complete a contributor agreement on the site
3853before pushing any commits or changes to this project. +
3854Can be `TRUE`, `FALSE` or `INHERIT`. +
3855If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003856|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003857Whether Gerrit will try to perform a 3-way merge of text file content
3858when a file has been modified by both the destination branch and the
3859change being submitted. This option only takes effect if submit type is
3860not FAST_FORWARD_ONLY. +
3861Can be `TRUE`, `FALSE` or `INHERIT`. +
3862If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003863|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003864Whether each change must contain a Signed-off-by line from either the
3865author or the uploader in the commit message. +
3866Can be `TRUE`, `FALSE` or `INHERIT`. +
3867If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003868|`create_new_change_for_all_not_in_target` |optional|
3869Whether a new change will be created for every commit not in target
3870branch. +
3871Can be `TRUE`, `FALSE` or `INHERIT`. +
3872If not set, this setting is not updated.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02003873|`require_change_id` |optional|
3874Whether a valid link:user-changeid.html[Change-Id] footer in any commit
3875uploaded for review is required. This does not apply to commits pushed
3876directly to a branch or tag. +
3877Can be `TRUE`, `FALSE` or `INHERIT`. +
3878If not set, this setting is not updated.
3879This property is deprecated and will be removed in
3880a future release.
Saša Živkov225b7a72015-11-17 17:37:43 +01003881|`reject_implicit_merges` |optional|
3882Whether a check for implicit merges will be performed when changes
3883are pushed for review. +
3884Can be `TRUE`, `FALSE` or `INHERIT`. +
3885If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003886|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003887The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
3888limit] of this project as a link:#max-object-size-limit-info[
3889MaxObjectSizeLimitInfo] entity. +
3890If set to `0`, the max object size limit is removed. +
3891If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003892|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003893The default submit type of the project, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02003894`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Edwin Kempina23eb102013-07-17 09:10:54 +02003895`CHERRY_PICK`. +
3896If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003897|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003898The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
3899Not set if the project state is `ACTIVE`. +
3900If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003901|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003902Plugin configuration values as map which maps the plugin name to a map
3903of parameter names to values.
Patrick Hieseldc285c72018-01-08 17:20:15 +01003904|`reject_empty_commit` |optional|
3905Whether empty commits should be rejected when a change is merged.
3906Can be `TRUE`, `FALSE` or `INHERIT`. +
3907If not set, this setting is not updated.
David Pursehouse67c8f142018-10-14 14:01:29 +09003908|commentlinks |optional|
3909Map of commentlink names to link:#commentlink-input[CommentLinkInput]
3910entities to add or update on the project. If the given commentlink
3911already exists, it will be updated with the given values, otherwise
3912it will be created. If the value is null, that entry is deleted.
David Pursehouse510b87d2014-11-25 16:46:28 +09003913|======================================================
Edwin Kempina23eb102013-07-17 09:10:54 +02003914
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003915[[config-parameter-info]]
David Pursehouseb10c2662016-12-06 08:41:33 +09003916=== ConfigParameterInfo
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003917The `ConfigParameterInfo` entity describes a project configuration
3918parameter.
3919
David Pursehouseae367192014-11-25 17:24:47 +09003920[options="header",cols="1,^2,4"]
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003921|===============================
3922|Field Name ||Description
3923|`display_name` |optional|
3924The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01003925|`description` |optional|
3926The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01003927|`warning` |optional|
3928Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003929|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01003930The type of the configuration parameter. Can be `STRING`, `INT`,
3931`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003932|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01003933The value of the configuration parameter as string. If the parameter
3934is inheritable this is the effective value which is deduced from
3935`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01003936|`values` |optional|
3937The list of values. Only set if the `type` is `ARRAY`.
Doug Claar1b0f76252016-03-23 13:34:55 -07003938|`editable` |`false` if not set|
Edwin Kempin0d485232013-11-17 18:55:48 +01003939Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01003940|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01003941The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01003942|`inheritable` |`false` if not set|
3943Whether the configuration parameter can be inherited.
3944|`configured_value`|optional|
3945The value of the configuration parameter that is configured on this
3946project, only set if `inheritable` is true.
3947|`inherited_value` |optional|
3948The inherited value of the configuration parameter, only set if
3949`inheritable` is true.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003950|===============================
3951
Edwin Kempin55367622013-02-05 09:09:23 +01003952[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003953=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01003954The `DashboardInfo` entity contains information about a project
3955dashboard.
3956
David Pursehouseae367192014-11-25 17:24:47 +09003957[options="header",cols="1,^2,4"]
Edwin Kempin55367622013-02-05 09:09:23 +01003958|===============================
3959|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01003960|`id` ||
3961The ID of the dashboard. The ID has the format '<ref>:<path>',
3962where ref and path are URL encoded.
3963|`project` ||
3964The name of the project for which this dashboard is returned.
3965|`defining_project`||
3966The name of the project in which this dashboard is defined.
3967This is different from `project` if the dashboard is inherited from a
3968parent project.
3969|`ref` ||
3970The name of the ref in which the dashboard is defined, without the
3971`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
3972|`path` ||
3973The path of the file in which the dashboard is defined.
3974|`description` |optional|The description of the dashboard.
3975|`foreach` |optional|
3976Subquery that applies to all sections in the dashboard. +
3977Tokens such as `${project}` are not resolved.
3978|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09003979The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01003980The URL is relative to the canonical web URL. +
3981Tokens in the queries such as `${project}` are resolved.
David Pursehouse8edc1992017-09-15 17:12:09 +09003982|`is_default` |not set if `false`|
Edwin Kempin55367622013-02-05 09:09:23 +01003983Whether this is the default dashboard of the project.
3984|`title` |optional|The title of the dashboard.
3985|`sections` ||
3986The list of link:#dashboard-section-info[sections] in the dashboard.
3987|===============================
3988
Edwin Kempin67e923c2013-02-14 13:57:12 +01003989[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003990=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01003991The `DashboardInput` entity contains information to create/update a
3992project dashboard.
3993
David Pursehouseae367192014-11-25 17:24:47 +09003994[options="header",cols="1,^2,4"]
Edwin Kempin67e923c2013-02-14 13:57:12 +01003995|=============================
3996|Field Name ||Description
3997|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01003998URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01003999|`commit_message`|optional|
4000Message that should be used to commit the change of the dashboard.
4001|=============================
4002
Edwin Kempin55367622013-02-05 09:09:23 +01004003[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004004=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01004005The `DashboardSectionInfo` entity contains information about a section
4006in a dashboard.
4007
David Pursehouseae367192014-11-25 17:24:47 +09004008[options="header",cols="1,6"]
Edwin Kempin55367622013-02-05 09:09:23 +01004009|===========================
4010|Field Name |Description
4011|`name` |The title of the section.
4012|`query` |The query of the section. +
4013Tokens such as `${project}` are not resolved.
4014|===========================
4015
Edwin Kempin920f6f82019-10-28 10:43:13 +01004016[[delete-label-input]]
4017=== DeleteLabelInput
4018The `DeleteLabelInput` entity contains information for deleting a label
4019definition in a project.
4020
4021[options="header",cols="1,^2,4"]
4022|=============================
4023|Field Name ||Description
4024|`commit_message`|optional|
4025Message that should be used to commit the deletion of the label in the
4026`project.config` file to the `refs/meta/config` branch.
4027|=============================
4028
Hugo Arèsef8e3202015-01-12 15:09:06 -05004029[[delete-branches-input]]
4030=== DeleteBranchesInput
4031The `DeleteBranchesInput` entity contains information about branches that should
4032be deleted.
4033
4034[options="header",width="50%",cols="1,6"]
4035|==========================
4036|Field Name |Description
4037|`branches` |A list of branch names that identify the branches that should be
4038deleted.
4039|==========================
4040
David Pursehouse467aecb2016-12-02 14:18:42 +09004041[[delete-tags-input]]
4042=== DeleteTagsInput
4043The `DeleteTagsInput` entity contains information about tags that should
4044be deleted.
4045
4046[options="header",width="50%",cols="1,6"]
4047|==========================
4048|Field Name |Description
4049|`tags` |A list of tag names that identify the tags that should be
4050deleted.
4051|==========================
4052
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01004053[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004054=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01004055The `GCInput` entity contains information to run the Git garbage
4056collection.
4057
David Pursehouseae367192014-11-25 17:24:47 +09004058[options="header",cols="1,^2,4"]
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01004059|=============================
4060|Field Name ||Description
4061|`show_progress` |`false` if not set|
4062Whether progress information should be shown.
Christian Halstrick2f94e2e2015-03-11 15:13:31 +01004063|`aggressive` |`false` if not set|
4064Whether an aggressive garbage collection should be done.
Adrian Görler92410a12015-11-03 16:20:56 +01004065|`async` |`false` if not set|
4066Whether the garbage collection should run asynchronously.
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01004067|=============================
4068
Edwin Kempin6b813372013-03-13 17:07:33 +01004069[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004070=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01004071The `HeadInput` entity contains information for setting `HEAD` for a
4072project.
4073
David Pursehouseae367192014-11-25 17:24:47 +09004074[options="header",cols="1,6"]
Edwin Kempin6b813372013-03-13 17:07:33 +01004075|============================
4076|Field Name |Description
4077|`ref` |
4078The ref to which `HEAD` should be set, the `refs/heads` prefix can be
4079omitted.
4080|============================
4081
Patrick Hiesel20d981e2018-07-04 09:48:21 +02004082[[index-project-input]]
4083=== IndexProjectInput
4084The `IndexProjectInput` contains parameters for indexing a project.
4085
4086[options="header",cols="1,^2,4"]
4087|================================
4088|Field Name ||Description
4089|`index_children` ||
4090If children should be indexed recursively.
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02004091|`async` ||
4092If projects should be indexed asynchronously.
Patrick Hiesel20d981e2018-07-04 09:48:21 +02004093|================================
4094
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004095[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004096=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004097A boolean value that can also be inherited.
4098
David Pursehouseae367192014-11-25 17:24:47 +09004099[options="header",cols="1,^2,4"]
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004100|================================
4101|Field Name ||Description
4102|`value` ||
4103The effective boolean value.
4104|`configured_value` ||
4105The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
4106|`inherited_value` |optional|
4107The boolean value inherited from the parent. +
4108Not set if there is no parent.
4109|================================
4110
Edwin Kempin44098d02019-10-24 09:22:34 +02004111[[label-definition-info]]
4112=== LabelDefinitionInfo
Edwin Kempin07bd7132019-11-11 13:11:00 +01004113The `LabelDefinitionInfo` entity describes a link:config-labels.html[
Edwin Kempin44098d02019-10-24 09:22:34 +02004114review label].
4115
4116[options="header",cols="1,^2,4"]
4117|=============================
4118|Field Name ||Description
4119|`name` ||
4120The link:config-labels.html#label_name[name] of the label.
Youssef Elghareeb261691a2021-11-17 13:01:08 +01004121|`description` |optional|
4122The description of the label.
Edwin Kempinb5275262019-10-24 16:03:27 +02004123|`project_name` ||
4124The name of the project in which this label is defined.
Edwin Kempin44098d02019-10-24 09:22:34 +02004125|`function` ||
4126The link:config-labels.html#label_function[function] of the label (can be
4127`MaxWithBlock`, `AnyWithBlock`, `MaxNoBlock`, `NoBlock`, `NoOp` and `PatchSetLock`.
4128|`values` ||
4129The link:config-labels.html#label_value[values] of the label as a map of label
4130value to value description. The label values are formatted strings, e.g. "+1"
4131instead of "1", " 0" instead of "0".
4132|`default_value` ||
4133The link:config-labels.html#label_defaultValue[default value] of the label (as
4134integer).
4135|`branches` |optional|
4136A list of link:config-labels.html#label_branch[branches] for which the label
4137applies. A branch can be a ref, a ref pattern or a regular expression. If not
4138set, the label applies for all branches.
4139|`can_override` |`false` if not set|
4140Whether this label can be link:config-labels.html#label_canOverride[overridden]
4141by child projects.
4142|`copy_any_score`|`false` if not set|
Sven Selberg3dba2fd2022-01-05 12:11:40 +01004143*DEPRECATED* Whether link:config-labels.html#label_copyAnyScore[copyAnyScore]
4144is set on the label.
Patrick Hieselc429ff32021-06-01 15:56:30 +02004145|`copy_condition`|optional|
4146See link:config-labels.html#label_copyCondition[copyCondition].
Edwin Kempin44098d02019-10-24 09:22:34 +02004147|`copy_min_score`|`false` if not set|
Sven Selberg3dba2fd2022-01-05 12:11:40 +01004148*DEPRECATED* Whether link:config-labels.html#label_copyMinScore[copyMinScore]
4149is set on the label.
Edwin Kempin44098d02019-10-24 09:22:34 +02004150|`copy_max_score`|`false` if not set|
Sven Selberg3dba2fd2022-01-05 12:11:40 +01004151*DEPRECATED* Whether link:config-labels.html#label_copyMaxScore[copyMaxScore]
4152is set on the label.
Edwin Kempin44098d02019-10-24 09:22:34 +02004153|`copy_all_scores_if_no_change`|`false` if not set|
Sven Selberg3dba2fd2022-01-05 12:11:40 +01004154*DEPRECATED* Whether link:config-labels.html#label_copyAllScoresIfNoChange[
Edwin Kempin44098d02019-10-24 09:22:34 +02004155copyAllScoresIfNoChange] is set on the label.
4156|`copy_all_scores_if_no_code_change`|`false` if not set|
Sven Selberg3dba2fd2022-01-05 12:11:40 +01004157*DEPRECATED* Whether link:config-labels.html#label_copyAllScoresIfNoCodeChange[
Edwin Kempin44098d02019-10-24 09:22:34 +02004158copyAllScoresIfNoCodeChange] is set on the label.
4159|`copy_all_scores_on_trivial_rebase`|`false` if not set|
Sven Selberg3dba2fd2022-01-05 12:11:40 +01004160*DEPRECATED* Whether link:config-labels.html#label_copyAllScoresOnTrivialRebase[
Edwin Kempin44098d02019-10-24 09:22:34 +02004161copyAllScoresOnTrivialRebase] is set on the label.
Gal Paikinbef260ec2021-01-19 11:55:19 +01004162|`copy_all_scores_if_list_of_files_did_not_change`|`false` if not set|
Sven Selberg3dba2fd2022-01-05 12:11:40 +01004163*DEPRECATED* Whether
4164link:config-labels.html#label_copyAllScoresIfListOfFilesDidNotChange[
Gal Paikinbef260ec2021-01-19 11:55:19 +01004165copyAllScoresIfListOfFilesDidNotChange] is set on the label.
Edwin Kempin44098d02019-10-24 09:22:34 +02004166|`copy_all_scores_on_merge_first_parent_update`|`false` if not set|
Sven Selberg3dba2fd2022-01-05 12:11:40 +01004167*DEPRECATED* Whether
4168link:config-labels.html#label_copyAllScoresOnMergeFirstParentUpdate[
Edwin Kempin44098d02019-10-24 09:22:34 +02004169copyAllScoresOnMergeFirstParentUpdate] is set on the label.
Edwin Kempin33c13a42020-01-10 11:38:06 +01004170|`copy_values` |optional|
4171List of values that should be copied forward when a new patch set is uploaded.
Edwin Kempin44098d02019-10-24 09:22:34 +02004172|`allow_post_submit`|`false` if not set|
4173Whether link:config-labels.html#label_allowPostSubmit[allowPostSubmit] is set
4174on the label.
4175|`ignore_self_approval`|`false` if not set|
4176Whether link:config-labels.html#label_ignoreSelfApproval[ignoreSelfApproval] is
4177set on the label.
4178|=============================
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02004179
Edwin Kempinb5e87452019-10-25 13:28:46 +02004180[[label-definition-input]]
4181=== LabelDefinitionInput
Edwin Kempin07bd7132019-11-11 13:11:00 +01004182The `LabelDefinitionInput` entity describes a link:config-labels.html[
Edwin Kempinb5e87452019-10-25 13:28:46 +02004183review label].
4184
4185[options="header",cols="1,^2,4"]
4186|=============================
4187|Field Name ||Description
4188|`commit_message`|optional|
4189Message that should be used to commit the change of the label in the
Edwin Kempin83d6d222019-10-28 13:45:52 +01004190`project.config` file to the `refs/meta/config` branch.+
4191Must not be set if this `LabelDefinitionInput` entity is contained in a
4192link:#batch-label-input[BatchLabelInput] entity.
Edwin Kempinb5e87452019-10-25 13:28:46 +02004193|`name` |optional|
Edwin Kempin83d6d222019-10-28 13:45:52 +01004194The new link:config-labels.html#label_name[name] of the label.+
4195For label creation the name is required if this `LabelDefinitionInput` entity
4196is contained in a link:#batch-label-input[BatchLabelInput]
4197entity.
Youssef Elghareeb261691a2021-11-17 13:01:08 +01004198|`description` |optional|
4199The new description for the label.
Edwin Kempinb5e87452019-10-25 13:28:46 +02004200|`function` |optional|
4201The new link:config-labels.html#label_function[function] of the label (can be
4202`MaxWithBlock`, `AnyWithBlock`, `MaxNoBlock`, `NoBlock`, `NoOp` and `PatchSetLock`.
4203|`values` |optional|
4204The new link:config-labels.html#label_value[values] of the label as a map of
4205label value to value description. The label values are formatted strings, e.g.
4206"+1" instead of "1", " 0" instead of "0".
4207|`default_value` |optional|
4208The new link:config-labels.html#label_defaultValue[default value] of the label
4209(as integer).
4210|`branches` |optional|
4211The new branches for which the label applies as a list of
4212link:config-labels.html#label_branch[branches]. A branch can be a ref, a ref
4213pattern or a regular expression. If not set, the label applies for all
4214branches.
4215|`can_override` |optional|
4216Whether this label can be link:config-labels.html#label_canOverride[overridden]
4217by child projects.
4218|`copy_any_score`|optional|
4219Whether link:config-labels.html#label_copyAnyScore[copyAnyScore] is set on the
4220label.
Patrick Hieselc429ff32021-06-01 15:56:30 +02004221|`copy_condition`|optional|
4222See link:config-labels.html#label_copyCondition[copyCondition].
4223|`unset_copy_condition`|optional|
4224If true, clears the value stored in `copy_condition`.
Edwin Kempinb5e87452019-10-25 13:28:46 +02004225|`copy_min_score`|optional|
4226Whether link:config-labels.html#label_copyMinScore[copyMinScore] is set on the
4227label.
4228|`copy_max_score`|optional|
4229Whether link:config-labels.html#label_copyMaxScore[copyMaxScore] is set on the
4230label.
4231|`copy_all_scores_if_no_change`|optional|
4232Whether link:config-labels.html#label_copyAllScoresIfNoChange[
4233copyAllScoresIfNoChange] is set on the label.
4234|`copy_all_scores_if_no_code_change`|optional|
4235Whether link:config-labels.html#label_copyAllScoresIfNoCodeChange[
4236copyAllScoresIfNoCodeChange] is set on the label.
4237|`copy_all_scores_on_trivial_rebase`|optional|
4238Whether link:config-labels.html#label_copyAllScoresOnTrivialRebase[
4239copyAllScoresOnTrivialRebase] is set on the label.
Gal Paikinbef260ec2021-01-19 11:55:19 +01004240|`copy_all_scores_if_list_of_files_did_not_change`|optional|
4241Whether link:config-labels.html#label_copyAllScoresIfListOfFilesDidNotChange[
4242copyAllScoresIfListOfFilesDidNotChange] is set on the label.
Edwin Kempinb5e87452019-10-25 13:28:46 +02004243|`copy_all_scores_on_merge_first_parent_update`|optional|
4244Whether link:config-labels.html#label_copyAllScoresOnMergeFirstParentUpdate[
4245copyAllScoresOnMergeFirstParentUpdate] is set on the label.
Edwin Kempin33c13a42020-01-10 11:38:06 +01004246|`copy_values` |optional|
4247List of values that should be copied forward when a new patch set is uploaded.
Edwin Kempinb5e87452019-10-25 13:28:46 +02004248|`allow_post_submit`|optional|
4249Whether link:config-labels.html#label_allowPostSubmit[allowPostSubmit] is set
4250on the label.
4251|`ignore_self_approval`|optional|
4252Whether link:config-labels.html#label_ignoreSelfApproval[ignoreSelfApproval] is
4253set on the label.
4254|=============================
4255
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02004256[[label-type-info]]
4257=== LabelTypeInfo
4258The `LabelTypeInfo` entity contains metadata about the labels that a
4259project has.
4260
4261[options="header",cols="1,^2,4"]
4262|================================
4263|Field Name ||Description
4264|`values` ||Map of the available values to their description.
4265|`default_value` ||The default value of this label.
4266|================================
4267
Edwin Kempin3c99f592013-07-15 10:12:27 +02004268[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004269=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02004270The `MaxObjectSizeLimitInfo` entity contains information about the
4271link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
4272limit] of a project.
4273
David Pursehouseae367192014-11-25 17:24:47 +09004274[options="header",cols="1,^2,4"]
Edwin Kempin3c99f592013-07-15 10:12:27 +02004275|===============================
4276|Field Name ||Description
4277|`value` |optional|
David Pursehouse33f544a2018-08-20 12:20:18 +09004278The effective value in bytes of the max object size limit. +
Edwin Kempin3c99f592013-07-15 10:12:27 +02004279Not set if there is no limit for the object size.
4280|`configured_value`|optional|
4281The max object size limit that is configured on the project as a
4282formatted string. +
4283Not set if there is no limit for the object size configured on project
4284level.
David Pursehouse81f2b5c2018-08-23 14:44:14 +09004285|`summary` |optional|
4286A string describing whether the value was inherited or overridden from
4287the parent project or global config. +
4288Not set if not inherited or overridden.
Edwin Kempin3c99f592013-07-15 10:12:27 +02004289|===============================
4290
Edwin Kempin83d6d222019-10-28 13:45:52 +01004291[[batch-label-input]]
4292=== BatchLabelInput
4293The `BatchLabelInput` entity contains information for batch updating label
4294definitions in a project.
4295
4296[options="header",cols="1,^2,4"]
4297|=============================
4298|Field Name ||Description
4299|`commit_message`|optional|
4300Message that should be used to commit the label updates in the
4301`project.config` file to the `refs/meta/config` branch.
4302|`delete` |optional|
4303List of labels that should be deleted.
4304|`create` |optional|
4305List of link:#label-definition-input[LabelDefinitionInput] entities that
4306describe labels that should be created.
4307|`update` |optional|
4308Map of label names to link:#label-definition-input[LabelDefinitionInput]
4309entities that describe the updates that should be done for the labels.
4310|=============================
4311
Patrick Hiesel21816f12016-04-22 08:53:06 +02004312[[project-access-input]]
4313=== ProjectAccessInput
4314The `ProjectAccessInput` describes changes that should be applied to a project
4315access config.
4316
4317[options="header",cols="1,^2,4"]
4318|=============================
4319|Field Name | |Description
4320|`remove` |optional|
4321A list of deductions to be applied to the project access as
4322link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
4323|`add` |optional|
4324A list of additions to be applied to the project access as
4325link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
4326|`message` |optional|
4327A commit message for this change.
4328|`parent` |optional|
4329A new parent for the project to inherit from. Changing the parent project
4330requires administrative privileges.
4331|=============================
4332
Edwin Kempin57f303c2013-02-13 15:52:22 +01004333[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004334=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01004335The `ProjectDescriptionInput` entity contains information for setting a
4336project description.
4337
David Pursehouseae367192014-11-25 17:24:47 +09004338[options="header",cols="1,^2,4"]
Edwin Kempin57f303c2013-02-13 15:52:22 +01004339|=============================
4340|Field Name ||Description
4341|`description` |optional|The project description. +
4342The project description will be deleted if not set.
4343|`commit_message`|optional|
4344Message that should be used to commit the change of the project
4345description in the `project.config` file to the `refs/meta/config`
4346branch.
4347|=============================
4348
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004349[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004350=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004351The `ProjectInfo` entity contains information about a project.
4352
David Pursehouseae367192014-11-25 17:24:47 +09004353[options="header",cols="1,^2,4"]
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004354|===========================
4355|Field Name ||Description
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004356|`id` ||The URL encoded project name.
4357|`name` |
4358not set if returned in a map where the project name is used as map key|
4359The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01004360|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004361The name of the parent project. +
4362`?-<n>` if the parent project is not visible (`<n>` is a number which
4363is increased for each non-visible project).
4364|`description` |optional|The description of the project.
Shawn Pearce21a6c212014-04-23 12:35:10 -07004365|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004366|`branches` |optional|Map of branch names to HEAD revisions.
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02004367|`labels` |optional|
4368Map of label names to
4369link:#label-type-info[LabelTypeInfo] entries.
4370This field is filled for link:#create-project[Create Project] and
4371link:#get-project[Get Project] calls.
Edwin Kempin26c95a42014-11-25 16:29:47 +01004372|`web_links` |optional|
Edwin Kempinea004752014-04-11 15:56:02 +02004373Links to the project in external sites as a list of
4374link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004375|===========================
4376
Bruce Zu798ea122013-02-18 16:55:43 +08004377[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004378=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08004379The `ProjectInput` entity contains information for the creation of
4380a new project.
4381
David Pursehouseae367192014-11-25 17:24:47 +09004382[options="header",cols="1,^2,4"]
Bruce Zu798ea122013-02-18 16:55:43 +08004383|=========================================
4384|Field Name ||Description
4385|`name` |optional|
4386The name of the project (not encoded). +
David Pursehouse8c5ad412015-02-03 14:19:09 +09004387If set, must match the project name in the URL. +
4388If name ends with `.git` the suffix will be automatically removed.
Bruce Zu798ea122013-02-18 16:55:43 +08004389|`parent` |optional|
4390The name of the parent project. +
4391If not set, the `All-Projects` project will be the parent project.
4392|`description` |optional|The description of the project.
4393|`permissions_only` |`false` if not set|
4394Whether a permission-only project should be created.
4395|`create_empty_commit` |`false` if not set|
4396Whether an empty initial commit should be created.
4397|`submit_type` |optional|
4398The submit type that should be set for the project
Gert van Dijka4e49d02017-08-27 22:50:40 +02004399(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`,
4400`FAST_FORWARD_ONLY`, `MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01004401If not set, `MERGE_IF_NECESSARY` is set as submit type unless
4402link:config-gerrit.html#repository.name.defaultSubmitType[
4403repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08004404|`branches` |optional|
4405A list of branches that should be initially created. +
Han-Wen Nienhuys5a0f5cb2020-11-24 19:13:55 +01004406For the branch names the `refs/heads/` prefix can be omitted. +
Marija Savtchouk714fbff2021-03-12 16:02:12 +00004407The first entry of the list will be the
4408link:project-configuration.html#default-branch[default branch]. +
4409If the list is empty, link:config-gerrit.html#gerrit.defaultBranch[host-level default]
4410is used. +
Youssef Elghareeb5b944612021-02-17 14:50:12 +01004411Branches in the Gerrit internal ref space are not allowed, such as
4412refs/groups/, refs/changes/, etc...
Bruce Zu798ea122013-02-18 16:55:43 +08004413|`owners` |optional|
4414A list of groups that should be assigned as project owner. +
4415Each group in the list must be specified as
4416link:rest-api-groups.html#group-id[group-id]. +
4417If not set, the link:config-gerrit.html#repository.name.ownerGroup[
4418groups that are configured as default owners] are set as project
4419owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004420|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004421Whether contributor agreements should be used for the project (`TRUE`,
4422`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02004423|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004424Whether the usage of 'Signed-Off-By' footers is required for the
4425project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02004426|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
4427Whether a new change is created for every commit not in target branch
4428for the project (`TRUE`, `FALSE`, `INHERIT`).
4429|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004430Whether content merge should be enabled for the project (`TRUE`,
4431`FALSE`, `INHERIT`). +
4432`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02004433|`require_change_id` |`INHERIT` if not set|
4434Whether the usage of Change-Ids is required for the project (`TRUE`,
4435`FALSE`, `INHERIT`).
4436This property is deprecated and will be removed in
4437a future release.
David Ostrovsky1c6ff2e2018-09-18 07:52:51 +02004438|`enable_signed_push` |`INHERIT` if not set|
4439Whether signed push validation is enabled on the project (`TRUE`,
4440`FALSE`, `INHERIT`).
4441|`require_signed_push` |`INHERIT` if not set|
4442Whether signed push validation is required on the project (`TRUE`,
4443`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02004444|`max_object_size_limit` |optional|
4445Max allowed Git object size for this project.
4446Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01004447|`plugin_config_values` |optional|
4448Plugin configuration values as map which maps the plugin name to a map
4449of parameter names to values.
Patrick Hieseldc285c72018-01-08 17:20:15 +01004450|`reject_empty_commit` |optional|
4451Whether empty commits should be rejected when a change is merged
4452(`TRUE`, `FALSE`, `INHERIT`).
Bruce Zu798ea122013-02-18 16:55:43 +08004453|=========================================
4454
Edwin Kempinecad88c2013-02-14 12:09:44 +01004455[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004456=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01004457The `ProjectParentInput` entity contains information for setting a
4458project parent.
4459
David Pursehouseae367192014-11-25 17:24:47 +09004460[options="header",cols="1,^2,4"]
Edwin Kempinecad88c2013-02-14 12:09:44 +01004461|=============================
4462|Field Name ||Description
4463|`parent` ||The name of the parent project.
4464|`commit_message`|optional|
4465Message that should be used to commit the change of the project parent
4466in the `project.config` file to the `refs/meta/config` branch.
4467|=============================
4468
Edwin Kempin87504d92014-07-04 12:59:19 +02004469[[reflog-entry-info]]
4470=== ReflogEntryInfo
4471The `ReflogEntryInfo` entity describes an entry in a reflog.
4472
David Pursehouseae367192014-11-25 17:24:47 +09004473[options="header",cols="1,6"]
Edwin Kempin87504d92014-07-04 12:59:19 +02004474|============================
4475|Field Name |Description
4476|`old_id` |The old commit ID.
4477|`new_id` |The new commit ID.
4478|`who` |
4479The user performing the change as a
4480link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
4481|`comment` |Comment of the reflog entry.
4482|============================
4483
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004484[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004485=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004486The `RepositoryStatisticsInfo` entity contains information about
4487statistics of a Git repository.
4488
David Pursehouseae367192014-11-25 17:24:47 +09004489[options="header",cols="1,6"]
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004490|======================================
4491|Field Name |Description
4492|`number_of_loose_objects` |Number of loose objects.
4493|`number_of_loose_refs` |Number of loose refs.
4494|`number_of_pack_files` |Number of pack files.
4495|`number_of_packed_objects`|Number of packed objects.
4496|`number_of_packed_refs` |Number of packed refs.
4497|`size_of_loose_objects` |Size of loose objects in bytes.
4498|`size_of_packed_objects` |Size of packed objects in bytes.
4499|======================================
4500
Youssef Elghareeb859b0522021-05-21 00:34:59 +02004501[[submit-requirement-info]]
4502=== SubmitRequirementInfo
4503The `SubmitRequirementInfo` entity describes a submit requirement.
4504
4505[options="header",cols="1,^1,5"]
4506|===========================
4507|Field Name ||Description
4508|`name`||
4509The submit requirement name.
4510|`description`|optional|
4511Description of the submit requirement.
4512|`applicability_expression`|optional|
4513Query expression that can be evaluated on any change. If evaluated to true on a
4514change, the submit requirement is then applicable for this change.
4515If not specified, the submit requirement is applicable for all changes.
4516|`submittability_expression`||
4517Query expression that can be evaluated on any change. If evaluated to true on a
4518change, the submit requirement is fulfilled and not blocking change submission.
4519|`override_expression`|optional|
4520Query expression that can be evaluated on any change. If evaluated to true on a
4521change, the submit requirement is overridden and not blocking change submission.
4522|`allow_override_in_child_projects`||
4523Whether this submit requirement can be overridden in child projects.
4524|===========================
4525
4526[[submit-requirement-input]]
4527=== SubmitRequirementInput
4528The `SubmitRequirementInput` entity describes a submit requirement.
4529
4530[options="header",cols="1,^1,5"]
4531|===========================
4532|Field Name ||Description
4533|`name`||
4534The submit requirement name.
4535|`description`|optional|
4536Description of the submit requirement.
4537|`applicability_expression`|optional|
4538Query expression that can be evaluated on any change. If evaluated to true on a
4539change, the submit requirement is then applicable for this change.
4540If not specified, the submit requirement is applicable for all changes.
4541|`submittability_expression`||
4542Query expression that can be evaluated on any change. If evaluated to true on a
4543change, the submit requirement is fulfilled and not blocking change submission.
4544|`override_expression`|optional|
4545Query expression that can be evaluated on any change. If evaluated to true on a
4546change, the submit requirement is overridden and not blocking change submission.
4547|`allow_override_in_child_projects`|optional|
4548Whether this submit requirement can be overridden in child projects. Default is
4549`false`.
4550|===========================
4551
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004552[[submit-type-info]]
4553=== SubmitTypeInfo
Changcheng Xiao21885982019-01-15 18:16:51 +01004554Information about the link:config-project-config.html#submit-type[default submit
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004555type of a project], taking into account project inheritance.
4556
4557Valid values for each field are `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
4558`REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or `CHERRY_PICK`, plus
4559`INHERIT` where applicable.
4560
4561[options="header",cols="1,6"]
4562|===============================
4563|Field Name |Description
4564|`value` |
4565The effective submit type value. Never `INHERIT`.
4566|`configured_value` |
4567The configured value, can be one of the submit types, or `INHERIT` to inherit
4568from the parent project.
4569|`inherited_value` |
4570The effective value that would be inherited from the parent. Never `INHERIT`.
4571|===============================
4572
David Pursehouse8cc68902014-10-06 18:17:16 +09004573[[tag-info]]
4574=== TagInfo
4575The `TagInfo` entity contains information about a tag.
4576
David Pursehouseae367192014-11-25 17:24:47 +09004577[options="header",cols="1,^2,4"]
David Pursehouse8cc68902014-10-06 18:17:16 +09004578|=========================
4579|Field Name ||Description
4580|`ref` ||The ref of the tag.
4581|`revision` ||For lightweight tags, the revision of the commit to which the tag
4582points. For annotated tags, the revision of the tag object.
4583|`object`|Only set for annotated tags.|The revision of the object to which the
4584tag points.
4585|`message`|Only set for annotated tags.|The tag message. For signed tags, includes
4586the signature.
David Pursehousec9f5a5a2015-12-07 19:13:16 +09004587|`tagger`|Only set for annotated tags, if present in the tag.|The tagger as a
David Pursehouse8cc68902014-10-06 18:17:16 +09004588link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
David Pursehousec4e4d932017-11-10 10:17:46 +09004589|`created`|optional|The link:rest-api.html#timestamp[timestamp] of when the tag
4590was created. For annotated and signed tags, this is the timestamp of the tag object
4591and is the same as the `date` field in the `tagger`. For lightweight tags, it is
4592the commit timestamp of the commit to which the tag points, when the object is a
4593commit. It is not set when the object is any other type.
David Pursehoused00515e2017-11-10 15:57:41 +09004594|`can_delete`|not set if `false`|
David Pursehouse23669da2017-02-23 13:43:57 +09004595Whether the calling user can delete this tag.
Paladox none34da15c2017-07-01 14:49:10 +00004596|`web_links` |optional|
4597Links to the tag in external sites as a list of
4598link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse8cc68902014-10-06 18:17:16 +09004599|=========================
4600
David Pursehouse6a446192016-06-03 10:00:34 +09004601[[tag-input]]
4602=== TagInput
4603
4604The `TagInput` entity contains information for creating a tag.
4605
4606[options="header",cols="1,^2,4"]
4607|=========================
4608|Field Name ||Description
4609|`ref` ||The name of the tag. The leading `refs/tags/` is optional.
4610|`revision` |optional|The revision to which the tag should point. If not
4611specified, the project's `HEAD` will be used.
4612|`message` |optional|The tag message. When set, the tag will be created
4613as an annotated tag.
4614|=========================
4615
4616
Edwin Kempind0a63922013-01-23 16:32:59 +01004617GERRIT
4618------
4619Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07004620
4621SEARCHBOX
4622---------