blob: ab78ff02d1c1f73e1c32fcc53acd1e536e14058a [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": {
Edwin Kempin00cab362023-08-16 14:33:57 +0000142 "id": "some-project",
143 _more_projects: true
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400144 }
145 }
146----
147
Edwin Kempin00cab362023-08-16 14:33:57 +0000148If the number of projects matching the query exceeds either the
149internal limit or a supplied `limit` query parameter, the last project
150object has a `_more_projects: true` JSON field set.
151
Edwin Kempina64c4b92013-01-23 11:30:40 +0100152
Edwin Kempind0a63922013-01-23 16:32:59 +0100153[[suggest-projects]]
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400154Prefix(p)::
155Limit the results to those projects that start with the specified
Edwin Kempind0a63922013-01-23 16:32:59 +0100156prefix.
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400157+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900158The match is case sensitive. May not be used together with `m` or `r`.
159+
Edwin Kempind0a63922013-01-23 16:32:59 +0100160List all projects that start with `platform/`:
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400161+
Edwin Kempin37440832013-02-06 11:36:00 +0100162.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100163----
164 GET /projects/?p=platform%2F HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100165----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400166+
Edwin Kempin37440832013-02-06 11:36:00 +0100167.Response
168----
Edwin Kempind0a63922013-01-23 16:32:59 +0100169 HTTP/1.1 200 OK
170 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900171 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100172
173 )]}'
174 {
175 "platform/drivers": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100176 "id": "platform%2Fdrivers"
Edwin Kempind0a63922013-01-23 16:32:59 +0100177 },
178 "platform/tools": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100179 "id": "platform%2Ftools"
Edwin Kempind0a63922013-01-23 16:32:59 +0100180 }
181 }
182----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400183+
Edwin Kempind0a63922013-01-23 16:32:59 +0100184E.g. this feature can be used by suggestion client UI's to limit results.
185
Hugo Arèsb8aae412014-07-08 11:04:43 -0400186Regex(r)::
187Limit the results to those projects that match the specified regex.
188+
189Boundary matchers '^' and '$' are implicit. For example: the regex 'test.*' will
190match any projects that start with 'test' and regex '.*test' will match any
191project that end with 'test'.
192+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900193The match is case sensitive. May not be used together with `m` or `p`.
194+
Hugo Arèsb8aae412014-07-08 11:04:43 -0400195List all projects that match regex `test.*project`:
196+
197.Request
198----
199 GET /projects/?r=test.*project HTTP/1.0
200----
201+
202.Response
203----
204 HTTP/1.1 200 OK
205 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900206 Content-Type: application/json; charset=UTF-8
Hugo Arèsb8aae412014-07-08 11:04:43 -0400207
208 )]}'
209 {
210 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100211 "id": "test%2Fsome-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400212 },
213 "test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100214 "id": "test%2Fsome-other-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400215 }
216 }
217
218----
219
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400220Skip(S)::
221Skip the given number of projects from the beginning of the list.
222+
223Query the second project in the project list:
224+
225.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400226----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400227 GET /projects/?n=1&S=1 HTTP/1.0
228----
229+
230.Response
231----
232 HTTP/1.1 200 OK
233 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900234 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400235
236 )]}'
237 {
238 "some-other-project": {
239 "id": "some-other-project"
240 }
241 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400242----
243
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400244Substring(m)::
245Limit the results to those projects that match the specified substring.
246+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900247The match is case insensitive. May not be used together with `r` or `p`.
248+
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400249List all projects that match substring `test/`:
250+
251.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400252----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400253 GET /projects/?m=test%2F HTTP/1.0
254----
255+
256.Response
257----
258 HTTP/1.1 200 OK
259 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900260 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400261
262 )]}'
263 {
264 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100265 "id": "test%2Fsome-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400266 },
267 "some-path/test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100268 "id": "some-path%2Ftest%2Fsome-other-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400269 }
270 }
271----
272
273Tree(t)::
274Get projects inheritance in a tree-like format. This option does
275not work together with the branch option.
Alvaro Vilaplana Garciafe271832023-10-06 12:43:28 +0100276
277[NOTE]
278If the calling user does not meet any of the following criteria:
279
280* The state of the parent project is either "ACTIVE" or "READ ONLY",
281and the calling user has READ permission to at least one ref.
282* The state of the parent project is "HIDDEN" and the calling user
283has READ permission for 'refs/meta/config'.
284
285Then the 'parent' field will be labeled as '?-N', where N represents the
286nesting level within the project's tree structure. In the provided example,
287'All-Projects' corresponds to level 1, 'parent-project' to level 2, and
288'child-project' to level 3.
289
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400290Get all the projects with tree option:
291+
292.Request
293----
294GET /projects/?t HTTP/1.0
295----
296+
297.Response
298----
299 HTTP/1.1 200 OK
300 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900301 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400302
303 )]}'
304 {
305 "All-Projects" {
306 "id": "All-Projects"
307 },
308 "child-project": {
309 "id": "child-project",
Edwin Kempine813c5a2019-03-13 09:51:12 +0100310 "parent": "parent-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400311 },
312 "parent-project": {
313 "id": "parent-project",
Edwin Kempine813c5a2019-03-13 09:51:12 +0100314 "parent": "All-Projects"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400315 }
316 }
317----
318
319Type(type)::
320Get projects with specified type: ALL, CODE, PERMISSIONS.
321+
322Get all the projects of type 'PERMISSIONS':
323+
324.Request
325----
326GET /projects/?type=PERMISSIONS HTTP/1.0
327----
328+
329.Response
330----
331 HTTP/1.1 200 OK
332 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900333 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400334
335 )]}'
336 {
337 "All-Projects" {
338 "id": "All-Projects"
339 },
340 "some-parent-project": {
341 "id": "some-parent-project"
342 }
343 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400344----
345
David Pursehousec141bd32017-11-15 21:42:14 +0900346All::
David Pursehouse54508762017-11-28 13:37:48 +0900347Get all projects, including those whose state is "HIDDEN". May not be used
348together with the `state` option.
David Pursehousec141bd32017-11-15 21:42:14 +0900349+
350.Request
351----
352GET /projects/?all HTTP/1.0
353----
354+
355.Response
356----
357 HTTP/1.1 200 OK
358 Content-Disposition: attachment
359 Content-Type: application/json; charset=UTF-8
360
361 )]}'
362 {
363 "All-Projects" {
364 "id": "All-Projects",
365 "state": "ACTIVE"
366 },
367 "some-other-project": {
368 "id": "some-other-project",
369 "state": "HIDDEN"
370 }
371 }
372----
373
David Pursehouse54508762017-11-28 13:37:48 +0900374State(s)::
375Get all projects with the given state. May not be used together with the
376`all` option.
377+
378.Request
379----
380GET /projects/?state=HIDDEN HTTP/1.0
381----
382+
383.Response
384----
385 HTTP/1.1 200 OK
386 Content-Disposition: attachment
387 Content-Type: application/json; charset=UTF-8
388
389 )]}'
390 {
391 "some-other-project": {
392 "id": "some-other-project",
393 "state": "HIDDEN"
394 }
395 }
396----
397
Xin Sund8dd1532017-07-18 17:13:52 -0700398[[query-projects]]
399=== Query Projects
400--
401'GET /projects/?query=<query>'
402--
403
404Queries projects visible to the caller. The
405link:user-search-projects.html#_search_operators[query string] must be
406provided by the `query` parameter. The `start` and `limit` parameters
407can be used to skip/limit results.
408
409As result a list of link:#project-info[ProjectInfo] entities is returned.
410
411.Request
412----
413 GET /projects/?query=name:test HTTP/1.0
414----
415
416.Response
417----
418 HTTP/1.1 200 OK
419 Content-Disposition: attachment
420 Content-Type: application/json; charset=UTF-8
421
422 )]}'
Frank Borden1581f1e2022-06-29 17:34:55 +0200423 [
424 {
Xin Sund8dd1532017-07-18 17:13:52 -0700425 "id": "test",
426 "description": "\u003chtml\u003e is escaped"
427 }
Frank Borden1581f1e2022-06-29 17:34:55 +0200428 ]
Xin Sund8dd1532017-07-18 17:13:52 -0700429----
430
431[[project-query-limit]]
432==== Project Limit
433The `/projects/?query=<query>` URL also accepts a limit integer in the
434`limit` parameter. This limits the results to `limit` projects.
435
436Query the first 25 projects in project list.
437----
438 GET /projects/?query=<query>&limit=25 HTTP/1.0
439----
440
Edwin Kempin00cab362023-08-16 14:33:57 +0000441If the number of projects matching the query exceeds either the
442internal limit or a supplied `limit` query parameter, the last project
443object has a `_more_projects: true` JSON field set.
444
Xin Sund8dd1532017-07-18 17:13:52 -0700445The `/projects/` URL also accepts a start integer in the `start`
Nasser Grainawif7059c72021-09-22 19:44:39 -0600446parameter. The results will skip `start` projects from project list.
Xin Sund8dd1532017-07-18 17:13:52 -0700447
448Query 25 projects starting from index 50.
449----
Nasser Grainawif7059c72021-09-22 19:44:39 -0600450 GET /projects/?query=<query>&limit=25&start=50 HTTP/1.0
Xin Sund8dd1532017-07-18 17:13:52 -0700451----
452
453[[project-query-options]]
454==== Project Options
455Additional fields can be obtained by adding `o` parameters. Each option
456requires more lookups and slows down the query response time to the
457client so they are generally disabled by default. The supported fields
458are described in the context of the link:#project-options[List Projects]
459REST endpoint.
460
Edwin Kempin5c544e22013-03-06 13:35:45 +0100461[[get-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800462=== Get Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800463--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100464'GET /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800465--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100466
467Retrieves a project.
468
469.Request
470----
471 GET /projects/plugins%2Freplication HTTP/1.0
472----
473
474As response a link:#project-info[ProjectInfo] entity is returned that
475describes the project.
476
477.Response
478----
479 HTTP/1.1 200 OK
480 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900481 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c544e22013-03-06 13:35:45 +0100482
483 )]}'
484 {
Edwin Kempin5c544e22013-03-06 13:35:45 +0100485 "id": "plugins%2Freplication",
486 "name": "plugins/replication",
487 "parent": "Public-Plugins",
Shawn Pearce21a6c212014-04-23 12:35:10 -0700488 "description": "Copies to other servers using the Git protocol",
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +0200489 "state": "ACTIVE",
490 "labels": {
491 "Code-Review": {
492 "values": {
493 " 0": "No score",
494 "+1": "Approved"
495 },
496 "default_value": 0
497 }
498 }
Edwin Kempin5c544e22013-03-06 13:35:45 +0100499 }
500----
501
Bruce Zu798ea122013-02-18 16:55:43 +0800502[[create-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800503=== Create Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800504--
Bruce Zu798ea122013-02-18 16:55:43 +0800505'PUT /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800506--
Bruce Zu798ea122013-02-18 16:55:43 +0800507
508Creates a new project.
509
510In the request body additional data for the project can be provided as
511link:#project-input[ProjectInput].
512
513.Request
514----
515 PUT /projects/MyProject HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900516 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800517
518 {
519 "description": "This is a demo project.",
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400520 "submit_type": "INHERIT",
Bruce Zu798ea122013-02-18 16:55:43 +0800521 "owners": [
522 "MyProject-Owners"
523 ]
524 }
525----
526
527As response the link:#project-info[ProjectInfo] entity is returned that
528describes the created project.
529
530.Response
531----
532 HTTP/1.1 201 Created
533 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900534 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800535
536 )]}'
537 {
Bruce Zu798ea122013-02-18 16:55:43 +0800538 "id": "MyProject",
539 "name": "MyProject",
540 "parent": "All-Projects",
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +0200541 "description": "This is a demo project.",
542 "labels": {
543 "Code-Review": {
544 "values": {
545 " 0": "No score",
546 "+1": "Approved"
547 },
548 "default_value": 0
549 }
550 }
Bruce Zu798ea122013-02-18 16:55:43 +0800551 }
552----
553
Edwin Kempin57f303c2013-02-13 15:52:22 +0100554[[get-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800555=== Get Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800556--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100557'GET /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800558--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100559
Edwin Kempin57f303c2013-02-13 15:52:22 +0100560Retrieves the description of a project.
561
562.Request
563----
564 GET /projects/plugins%2Freplication/description HTTP/1.0
565----
566
567.Response
568----
569 HTTP/1.1 200 OK
570 Content-Disposition: attachment
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 "Copies to other servers using the Git protocol"
575----
576
Edwin Kempinefec4492013-02-22 10:09:23 +0100577If the project does not have a description an empty string is returned.
578
Edwin Kempin57f303c2013-02-13 15:52:22 +0100579[[set-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800580=== Set Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800581--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100582'PUT /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800583--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100584
Edwin Kempin57f303c2013-02-13 15:52:22 +0100585Sets the description of a project.
586
587The new project description must be provided in the request body inside
588a link:#project-description-input[ProjectDescriptionInput] entity.
589
590.Request
591----
592 PUT /projects/plugins%2Freplication/description HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900593 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100594
595 {
596 "description": "Plugin for Gerrit that handles the replication.",
597 "commit_message": "Update the project description"
598 }
599----
600
601As response the new project description is returned.
602
603.Response
604----
605 HTTP/1.1 200 OK
606 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900607 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100608
609 )]}'
610 "Plugin for Gerrit that handles the replication."
611----
612
Edwin Kempin114ab162013-02-28 09:25:37 +0100613If the description was deleted the response is "`204 No Content`".
614
Edwin Kempin57f303c2013-02-13 15:52:22 +0100615[[delete-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800616=== Delete Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800617--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100618'DELETE /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800619--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100620
Edwin Kempin57f303c2013-02-13 15:52:22 +0100621Deletes the description of a project.
622
Edwin Kempin57f303c2013-02-13 15:52:22 +0100623.Request
624----
625 DELETE /projects/plugins%2Freplication/description HTTP/1.0
626----
627
628.Response
629----
630 HTTP/1.1 204 No Content
631----
632
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +0200633A commit message can be provided in the request body as a
634link:#project-description-input[ProjectDescriptionInput] entity.
635Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +0100636link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +0200637In this case, use link:#set-project-description[PUT] instead.
638
639.Request
640----
641 PUT /projects/plugins%2Freplication/description HTTP/1.0
642 Content-Type: application/json; charset=UTF-8
643
644 {
645 "commit_message": "Update the project description"
646 }
647----
648
649.Response
650----
651 HTTP/1.1 204 No Content
652----
653
Edwin Kempinecad88c2013-02-14 12:09:44 +0100654[[get-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800655=== Get Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800656--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100657'GET /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800658--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100659
Edwin Kempinecad88c2013-02-14 12:09:44 +0100660Retrieves the name of a project's parent project. For the
661`All-Projects` root project an empty string is returned.
662
663.Request
664----
665 GET /projects/plugins%2Freplication/parent HTTP/1.0
666----
667
668.Response
669----
670 HTTP/1.1 200 OK
671 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900672 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100673
674 )]}'
675 "All-Projects"
676----
677
678[[set-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800679=== Set Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800680--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100681'PUT /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800682--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100683
Edwin Kempinecad88c2013-02-14 12:09:44 +0100684Sets the parent project for a project.
685
686The new name of the parent project must be provided in the request body
687inside a link:#project-parent-input[ProjectParentInput] entity.
688
689.Request
690----
691 PUT /projects/plugins%2Freplication/parent HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900692 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100693
694 {
695 "parent": "Public-Plugins",
696 "commit_message": "Update the project parent"
697 }
698----
699
700As response the new parent project name is returned.
701
702.Response
703----
704 HTTP/1.1 200 OK
705 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900706 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100707
708 )]}'
709 "Public-Plugins"
710----
711
Edwin Kempin6b813372013-03-13 17:07:33 +0100712[[get-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800713=== Get HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800714--
Edwin Kempin6b813372013-03-13 17:07:33 +0100715'GET /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800716--
Edwin Kempin6b813372013-03-13 17:07:33 +0100717
718Retrieves for a project the name of the branch to which `HEAD` points.
719
720.Request
721----
722 GET /projects/plugins%2Freplication/HEAD HTTP/1.0
723----
724
725.Response
726----
727 HTTP/1.1 200 OK
728 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900729 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100730
731 )]}'
732 "refs/heads/master"
733----
734
735[[set-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800736=== Set HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800737--
Edwin Kempin6b813372013-03-13 17:07:33 +0100738'PUT /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800739--
Edwin Kempin6b813372013-03-13 17:07:33 +0100740
741Sets `HEAD` for a project.
742
743The new ref to which `HEAD` should point must be provided in the
744request body inside a link:#head-input[HeadInput] entity.
745
746.Request
747----
748 PUT /projects/plugins%2Freplication/HEAD HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900749 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100750
751 {
752 "ref": "refs/heads/stable"
753 }
754----
755
756As response the new ref to which `HEAD` points is returned.
757
758.Response
759----
760 HTTP/1.1 200 OK
761 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900762 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100763
764 )]}'
765 "refs/heads/stable"
766----
767
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100768[[get-repository-statistics]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800769=== Get Repository Statistics
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800770--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100771'GET /projects/link:#project-name[\{project-name\}]/statistics.git'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800772--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100773
774Return statistics for the repository of a project.
775
776.Request
777----
778 GET /projects/plugins%2Freplication/statistics.git HTTP/1.0
779----
780
781The repository statistics are returned as a
782link:#repository-statistics-info[RepositoryStatisticsInfo] entity.
783
784.Response
785----
786 HTTP/1.1 200 OK
787 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900788 Content-Type: application/json; charset=UTF-8
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100789
790 )]}'
791 {
792 "number_of_loose_objects": 127,
793 "number_of_loose_refs": 15,
794 "number_of_pack_files": 15,
795 "number_of_packed_objects": 67,
796 "number_of_packed_refs": 0,
797 "size_of_loose_objects": 29466,
798 "size_of_packed_objects": 9646
799 }
800----
801
Dave Borowitz237073a2013-04-04 16:52:27 -0700802[[get-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800803=== Get Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800804--
Dave Borowitz237073a2013-04-04 16:52:27 -0700805'GET /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800806--
Dave Borowitz237073a2013-04-04 16:52:27 -0700807
808Gets some configuration information about a project. Note that this
809config info is not simply the contents of `project.config`; it generally
810contains fields that may have been inherited from parent projects.
811
812.Request
813----
814 GET /projects/myproject/config
815----
816
817A link:#config-info[ConfigInfo] entity is returned that describes the
818project configuration. Some fields are only visible to users that have
819read access to `refs/meta/config`.
820
821.Response
822----
823 HTTP/1.1 200 OK
824 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900825 Content-Type: application/json; charset=UTF-8
Dave Borowitz237073a2013-04-04 16:52:27 -0700826
827 )]}'
828 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200829 "description": "demo project",
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200830 "use_contributor_agreements": {
831 "value": true,
832 "configured_value": "TRUE",
833 "inherited_value": false
834 },
835 "use_content_merge": {
836 "value": true,
837 "configured_value": "INHERIT",
838 "inherited_value": true
839 },
840 "use_signed_off_by": {
841 "value": false,
842 "configured_value": "INHERIT",
843 "inherited_value": false
844 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200845 "create_new_change_for_all_not_in_target": {
846 "value": false,
847 "configured_value": "INHERIT",
848 "inherited_value": false
849 },
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200850 "require_change_id": {
851 "value": false,
852 "configured_value": "FALSE",
853 "inherited_value": true
854 },
Edwin Kempin3c99f592013-07-15 10:12:27 +0200855 "max_object_size_limit": {
856 "value": "15m",
857 "configured_value": "15m",
858 "inherited_value": "20m"
859 },
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400860 "submit_type": "INHERIT",
861 "default_submit_type": {
862 "value": "MERGE_IF_NECESSARY",
863 "configured_value": "INHERIT",
864 "inherited_value": "MERGE_IF_NECESSARY"
865 },
Edwin Kempin3c99f592013-07-15 10:12:27 +0200866 "state": "ACTIVE",
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200867 "commentlinks": {},
Edwin Kempin9ce4f552013-11-15 16:00:00 +0100868 "plugin_config": {
869 "helloworld": {
870 "language": {
871 "display_name": "Preferred Language",
872 "type": "STRING",
873 "value": "en"
874 }
875 }
876 },
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200877 "actions": {
878 "cookbook~hello-project": {
879 "method": "POST",
880 "label": "Say hello",
881 "title": "Say hello in different languages",
882 "enabled": true
883 }
884 }
Dave Borowitz237073a2013-04-04 16:52:27 -0700885 }
886----
887
Edwin Kempina23eb102013-07-17 09:10:54 +0200888[[set-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800889=== Set Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800890--
Edwin Kempina23eb102013-07-17 09:10:54 +0200891'PUT /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800892--
Edwin Kempina23eb102013-07-17 09:10:54 +0200893
894Sets the configuration of a project.
895
896The new configuration must be provided in the request body as a
897link:#config-input[ConfigInput] entity.
898
899.Request
900----
901 PUT /projects/myproject/config HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900902 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200903
904 {
905 "description": "demo project",
906 "use_contributor_agreements": "FALSE",
907 "use_content_merge": "INHERIT",
908 "use_signed_off_by": "INHERIT",
Deniz Türkoglu52777272014-09-08 17:02:48 +0200909 "create_new_change_for_all_not_in_target": "INHERIT",
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400910 "enable_signed_push": "INHERIT",
Dave Borowitz0543c732015-10-20 10:35:26 -0400911 "require_signed_push": "INHERIT",
Saša Živkov225b7a72015-11-17 17:37:43 +0100912 "reject_implicit_merges": "INHERIT",
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200913 "require_change_id": "TRUE",
Edwin Kempina23eb102013-07-17 09:10:54 +0200914 "max_object_size_limit": "10m",
915 "submit_type": "REBASE_IF_NECESSARY",
916 "state": "ACTIVE"
917 }
918----
919
920As response the new configuration is returned as a link:#config-info[
921ConfigInfo] entity.
922
923.Response
924----
925 HTTP/1.1 200 OK
926 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900927 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200928
929 )]}'
930 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200931 "use_contributor_agreements": {
932 "value": false,
933 "configured_value": "FALSE",
934 "inherited_value": false
935 },
936 "use_content_merge": {
937 "value": true,
938 "configured_value": "INHERIT",
939 "inherited_value": true
940 },
941 "use_signed_off_by": {
942 "value": false,
943 "configured_value": "INHERIT",
944 "inherited_value": false
945 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200946 "create_new_change_for_all_not_in_target": {
947 "value": true,
948 "configured_value": "INHERIT",
949 "inherited_value": false
950 },
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200951 "require_change_id": {
952 "value": true,
953 "configured_value": "TRUE",
954 "inherited_value": true
955 },
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400956 "enable_signed_push": {
957 "value": true,
958 "configured_value": "INHERIT",
959 "inherited_value": false
960 },
Dave Borowitz0543c732015-10-20 10:35:26 -0400961 "require_signed_push": {
962 "value": false,
963 "configured_value": "INHERIT",
964 "inherited_value": false
965 },
Saša Živkov225b7a72015-11-17 17:37:43 +0100966 "reject_implicit_merges": {
967 "value": false,
968 "configured_value": "INHERIT",
969 "inherited_value": false
970 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200971 "max_object_size_limit": {
972 "value": "10m",
973 "configured_value": "10m",
974 "inherited_value": "20m"
975 },
976 "submit_type": "REBASE_IF_NECESSARY",
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400977 "default_submit_type": {
978 "value": "REBASE_IF_NECESSARY",
979 "configured_value": "INHERIT",
980 "inherited_value": "REBASE_IF_NECESSARY"
981 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200982 "state": "ACTIVE",
983 "commentlinks": {}
984 }
985----
986
Edwin Kempinef3542f2013-03-19 13:31:49 +0100987[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800988=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800989--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100990'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800991--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100992
993Run the Git garbage collection for the repository of a project.
994
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100995Options for the Git garbage collection can be specified in the
996request body as a link:#gc-input[GCInput] entity.
997
Edwin Kempinef3542f2013-03-19 13:31:49 +0100998.Request
999----
1000 POST /projects/plugins%2Freplication/gc HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001001 Content-Type: application/json; charset=UTF-8
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01001002
1003 {
1004 "show_progress": true
1005 }
Edwin Kempinef3542f2013-03-19 13:31:49 +01001006----
1007
1008The response is the streamed output of the garbage collection.
1009
1010.Response
1011----
1012 HTTP/1.1 200 OK
1013 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001014 Content-Type: text/plain; charset=UTF-8
Edwin Kempinef3542f2013-03-19 13:31:49 +01001015
1016 collecting garbage for "plugins/replication":
1017 Pack refs: 100% (21/21)
1018 Counting objects: 20
1019 Finding sources: 100% (20/20)
1020 Getting sizes: 100% (13/13)
1021 Compressing objects: 83% (5/6)
1022 Writing objects: 100% (20/20)
1023 Selecting commits: 100% (7/7)
1024 Building bitmaps: 100% (7/7)
1025 Finding sources: 100% (41/41)
1026 Getting sizes: 100% (25/25)
1027 Compressing objects: 52% (12/23)
1028 Writing objects: 100% (41/41)
1029 Prune loose objects also found in pack files: 100% (36/36)
1030 Prune loose, unreferenced objects: 100% (36/36)
1031 done.
1032----
1033
Adrian Görler92410a12015-11-03 16:20:56 +01001034==== Asynchronous Execution
1035
1036The option `async` allows to schedule a background task that asynchronously
1037executes a Git garbage collection.
1038
1039The `Location` header of the response refers to the link:rest-api-config.html#get-task[background task]
1040which allows to inspect the progress of its execution. In case of asynchronous
1041execution the `show_progress` option is ignored.
1042
1043.Request
1044----
1045 POST /projects/plugins%2Freplication/gc HTTP/1.0
1046 Content-Type: application/json;charset=UTF-8
1047
1048 {
1049 "async": true
1050 }
1051----
1052
1053The response is empty.
1054
1055.Response
1056----
1057 HTTP/1.1 202 Accepted
1058 Content-Disposition: attachment
1059 Location: https:<host>/a/config/server/tasks/383a0602
1060----
1061
Edwin Kempin62946742014-07-09 11:17:58 +02001062[[ban-commit]]
1063=== Ban Commit
1064--
1065'PUT /projects/link:#project-name[\{project-name\}]/ban'
1066--
1067
1068Marks commits as banned for the project. If a commit is banned Gerrit
1069rejects every push that includes this commit with
1070link:error-contains-banned-commit.html[contains banned commit ...].
1071
1072[NOTE]
1073This REST endpoint only marks the commits as banned, but it does not
1074remove the commits from the history of any central branch. This needs
1075to be done manually.
1076
1077The commits to be banned must be specified in the request body as a
1078link:#ban-input[BanInput] entity.
1079
1080The caller must be project owner.
1081
1082.Request
1083----
1084 PUT /projects/plugins%2Freplication/ban HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001085 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +02001086
1087 {
1088 "commits": [
1089 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
1090 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
1091 ],
1092 "reason": "Violates IP"
1093 }
1094----
1095
1096As response a link:#ban-result-info[BanResultInfo] entity is returned.
1097
1098.Response
1099----
1100 HTTP/1.1 200 OK
1101 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001102 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +02001103
1104 )]}'
1105 {
1106 "newly_banned": [
1107 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
1108 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
1109 ]
1110 }
1111----
1112
Patrick Hiesel21816f12016-04-22 08:53:06 +02001113[[get-access]]
1114=== List Access Rights for Project
1115--
1116'GET /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
1117--
1118
1119Lists the access rights for a single project.
1120
Han-Wen Nienhuysbfd1b352018-01-10 15:02:32 +01001121As result a
1122link:rest-api-access.html#project-access-info[ProjectAccessInfo]
1123entity is returned.
Patrick Hiesel21816f12016-04-22 08:53:06 +02001124
1125.Request
1126----
1127 GET /projects/MyProject/access HTTP/1.0
1128----
1129
1130.Response
1131----
1132 HTTP/1.1 200 OK
1133 Content-Type: application/json; charset=UTF-8
1134
1135 )]}'
1136 {
1137 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1138 "inherits_from": {
1139 "id": "All-Projects",
1140 "name": "All-Projects",
1141 "description": "Access inherited by all other projects."
1142 },
1143 "local": {
1144 "refs/*": {
1145 "permissions": {
1146 "read": {
1147 "rules": {
1148 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1149 "action": "ALLOW",
1150 "force": false
1151 },
1152 "global:Anonymous-Users": {
1153 "action": "ALLOW",
1154 "force": false
1155 }
1156 }
1157 }
1158 }
1159 }
1160 },
1161 "is_owner": true,
1162 "owner_of": [
1163 "refs/*"
1164 ],
1165 "can_upload": true,
1166 "can_add": true,
Marco Millerc2114ac2018-09-10 16:52:54 -04001167 "can_add_tags": true,
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001168 "config_visible": true,
1169 "groups": {
1170 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1171 "url": "#/admin/groups/uuid-c2ce4749a32ceb82cd6adcce65b8216e12afb41c",
1172 "options": {},
1173 "description": "Users who perform batch actions on Gerrit",
1174 "group_id": 2,
1175 "owner": "Administrators",
1176 "owner_id": "d5b7124af4de52924ed397913e2c3b37bf186948",
1177 "created_on": "2009-06-08 23:31:00.000000000",
Patrick Hiesele587c402020-08-07 16:11:29 +02001178 "name": "Service Users"
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001179 },
1180 "global:Anonymous-Users": {
1181 "options": {},
1182 "name": "Anonymous Users"
1183 }
1184 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001185 }
1186----
1187
1188[[set-access]]
1189=== Add, Update and Delete Access Rights for Project
1190--
1191'POST /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
1192--
1193
1194Sets access rights for the project using the diff schema provided by
1195link:#project-access-input[ProjectAccessInput]. Deductions are used to
1196remove access sections, permissions or permission rules. The backend will remove
1197the entity with the finest granularity in the request, meaning that if an
1198access section without permissions is posted, the access section will be
1199removed; if an access section with a permission but no permission rules is
1200posted, the permission will be removed; if an access section with a permission
1201and a permission rule is posted, the permission rule will be removed.
1202
1203Additionally, access sections and permissions will be cleaned up after applying
1204the deductions by removing items that have no child elements.
1205
1206After removals have been applied, additions will be applied.
1207
Han-Wen Nienhuysbfd1b352018-01-10 15:02:32 +01001208As result a
1209link:rest-api-access.html#project-access-info[ProjectAccessInfo]
1210entity is returned.
Patrick Hiesel21816f12016-04-22 08:53:06 +02001211
1212.Request
1213----
1214 POST /projects/MyProject/access HTTP/1.0
1215 Content-Type: application/json; charset=UTF-8
1216
1217 {
Florian Ramillien4978ae52018-12-04 11:04:59 +01001218 "remove": {
1219 "refs/*": {
1220 "permissions": {
1221 "read": {
1222 "rules": {
1223 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1224 "action": "ALLOW"
Patrick Hiesel21816f12016-04-22 08:53:06 +02001225 }
1226 }
1227 }
1228 }
1229 }
Florian Ramillien4978ae52018-12-04 11:04:59 +01001230 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001231 }
1232----
1233
1234.Response
1235----
1236 HTTP/1.1 200 OK
1237 Content-Type: application/json; charset=UTF-8
1238
1239 )]}'
1240 {
1241 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1242 "inherits_from": {
1243 "id": "All-Projects",
1244 "name": "All-Projects",
1245 "description": "Access inherited by all other projects."
1246 },
1247 "local": {
1248 "refs/*": {
1249 "permissions": {
1250 "read": {
1251 "rules": {
1252 "global:Anonymous-Users": {
1253 "action": "ALLOW",
1254 "force": false
1255 }
1256 }
1257 }
1258 }
1259 }
1260 },
1261 "is_owner": true,
1262 "owner_of": [
1263 "refs/*"
1264 ],
1265 "can_upload": true,
1266 "can_add": true,
Marco Millerc2114ac2018-09-10 16:52:54 -04001267 "can_add_tags": true,
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001268 "config_visible": true,
1269 "groups": {
1270 "global:Anonymous-Users": {
1271 "options": {},
1272 "name": "Anonymous Users"
1273 }
1274 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001275 }
1276----
1277
Han-Wen Nienhuysa4726c32019-10-14 17:47:42 +02001278[[create-change]]
1279=== Create Change for review.
1280
1281This endpoint is functionally equivalent to
1282link:rest-api-changes.html#create-change[create change in the change
1283API], but it has the project name in the URL, which is easier to route
1284in sharded deployments.
1285
1286.Request
1287----
1288 POST /projects/myProject/create.change HTTP/1.0
1289 Content-Type: application/json; charset=UTF-8
1290
1291 {
1292 "subject" : "Let's support 100% Gerrit workflow direct in browser",
1293 "branch" : "master",
1294 "topic" : "create-change-in-browser",
1295 "status" : "NEW"
1296 }
1297----
1298
1299As response a link:#change-info[ChangeInfo] entity is returned that describes
1300the resulting change.
1301
1302.Response
1303----
1304 HTTP/1.1 201 OK
1305 Content-Disposition: attachment
1306 Content-Type: application/json; charset=UTF-8
1307
1308 )]}'
1309 {
1310 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
1311 "project": "myProject",
1312 "branch": "master",
1313 "topic": "create-change-in-browser",
1314 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
1315 "subject": "Let's support 100% Gerrit workflow direct in browser",
1316 "status": "NEW",
1317 "created": "2014-05-05 07:15:44.639000000",
1318 "updated": "2014-05-05 07:15:44.639000000",
1319 "mergeable": true,
1320 "insertions": 0,
1321 "deletions": 0,
1322 "_number": 4711,
1323 "owner": {
1324 "name": "John Doe"
1325 }
1326 }
1327----
1328
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001329[[create-access-change]]
1330=== Create Access Rights Change for review.
1331--
1332'PUT /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access:review
1333--
1334
1335Sets access rights for the project using the diff schema provided by
1336link:#project-access-input[ProjectAccessInput]
1337
1338This takes the same input as link:#set-access[Update Access Rights], but creates a pending
1339change for review. Like link:#create-change[Create Change], it returns
1340a link:#change-info[ChangeInfo] entity describing the resulting change.
1341
1342.Request
1343----
1344 PUT /projects/MyProject/access:review HTTP/1.0
1345 Content-Type: application/json; charset=UTF-8
1346
1347 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01001348 "add": {
1349 "refs/heads/*": {
1350 "permissions": {
1351 "read": {
1352 "rules": {
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001353 "global:Anonymous-Users": {
Edwin Kempine813c5a2019-03-13 09:51:12 +01001354 "action": "DENY",
1355 "force": false
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001356 }
1357 }
1358 }
1359 }
1360 }
1361 }
1362 }
1363----
1364
1365.Response
1366----
1367 HTTP/1.1 200 OK
1368 Content-Type: application/json; charset=UTF-8
1369
1370 )]}'
1371 {
1372 "id": "testproj~refs%2Fmeta%2Fconfig~Ieaf185bf90a1fc3b58461e399385e158a20b31a2",
1373 "project": "testproj",
1374 "branch": "refs/meta/config",
1375 "hashtags": [],
1376 "change_id": "Ieaf185bf90a1fc3b58461e399385e158a20b31a2",
1377 "subject": "Review access change",
1378 "status": "NEW",
1379 "created": "2017-09-07 14:31:11.852000000",
1380 "updated": "2017-09-07 14:31:11.852000000",
1381 "submit_type": "CHERRY_PICK",
1382 "mergeable": true,
1383 "insertions": 2,
1384 "deletions": 0,
1385 "unresolved_comment_count": 0,
1386 "has_review_started": true,
1387 "_number": 7,
1388 "owner": {
1389 "_account_id": 1000000
1390 }
1391 }
1392----
1393
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001394[[check-access]]
1395=== Check Access
1396--
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001397'GET /projects/MyProject/check.access?account=1000098&ref=refs%2Fheads%2Fsecret%2Fbla'
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001398--
1399
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001400This command runs access checks for other users. This requires the
1401link:access-control.html#capability_viewAccess[View Access] global
1402capability.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001403
1404The result is a link:#access-check-info[AccessCheckInfo] entity
Han-Wen Nienhuys8a4a6822018-01-18 19:27:46 +01001405detailing the access of the given user for the given project,
1406project-ref, or project-permission-ref combination.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001407
1408.Response
1409----
1410 HTTP/1.1 200 OK
1411 Content-Type: application/json; charset=UTF-8
1412
1413 )]}'
1414 {
1415 "message": "user Kristen Burns \u003cKristen.Burns@gerritcodereview.com\u003e (1000098) cannot see ref refs/heads/secret/bla in project MyProject",
1416 "status": 403
1417 }
1418----
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001419
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001420[[check-access-options]]
1421==== Check Access Options
Han-Wen Nienhuys5b089f22018-04-17 16:26:44 +02001422
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001423Account(account)::
1424The account for which to check access. Mandatory.
Han-Wen Nienhuys5b089f22018-04-17 16:26:44 +02001425
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001426Permission(perm)::
1427The ref permission for which to check access. If not specified, read
1428access to at least branch is checked.
1429
1430Ref(ref)::
1431The branch for which to check access. This must be given if `perm` is specified.
1432
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001433[[index]]
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001434=== Index project
1435
1436Adds or updates the current project (and children, if specified) in the secondary index.
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02001437The indexing task is executed asynchronously in background and this command returns
1438immediately if `async` is specified in the input.
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001439
1440As an input, a link:#index-project-input[IndexProjectInput] entity can be provided.
1441
1442.Request
1443----
1444 POST /projects/MyProject/index HTTP/1.0
1445 Content-Type: application/json; charset=UTF-8
1446
1447 {
1448 "index_children": "true"
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02001449 "async": "true"
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001450 }
1451----
1452
1453.Response
1454----
1455 HTTP/1.1 202 Accepted
1456 Content-Disposition: attachment
1457----
1458
1459[[index.changes]]
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001460=== Index all changes in a project
1461
1462Adds or updates all the changes belonging to a project in the secondary index.
1463The indexing task is executed asynchronously in background, so this command
1464returns immediately.
1465
1466.Request
1467----
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001468 POST /projects/MyProject/index.changes HTTP/1.0
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001469----
1470
1471.Response
1472----
Edwin Kempin4145f972018-01-12 16:30:44 +01001473 HTTP/1.1 202 Accepted
1474 Content-Disposition: attachment
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001475----
1476
Edwin Kempinbf9df392018-01-12 15:20:48 +01001477[[check]]
1478=== Check project consistency
1479
1480Performs consistency checks on the project.
1481
1482Which consistency checks should be performed is controlled by the
1483link:#check-project-input[CheckProjectInput] entity in the request
1484body.
1485
1486The following consistency checks are supported:
1487
1488[[auto-closeable-changes-check]]
1489--
1490* AutoCloseableChangesCheck: Searches for open changes that can be
1491 auto-closed because a patch set of the change is already contained in
1492 the destination branch or because the destination branch contains a
1493 commit with the same Change-Id. Normally Gerrit auto-closes such
1494 changes when the corresponding commits are pushed directly to the
1495 repository. However if a branch is updated behind Gerrit's back or if
1496 auto-closing changes fails (and the push is still successful) change
1497 states can get inconsistent (changes that are already part of the
1498 destination branch are still open). This consistency check is
1499 intended to detect and repair this situation.
1500--
1501
1502To fix any problems that can be fixed automatically set the `fix` field
1503in the inputs for the consistency checks to `true`.
1504
1505This REST endpoint requires the
1506link:access-control.html#capability_administrateServer[Administrate Server]
1507global capability.
1508
1509.Request
1510----
1511 POST /projects/MyProject/check HTTP/1.0
1512 Content-Type: application/json; charset=UTF-8
1513
1514 {
1515 "auto_closeable_changes_check": {
1516 "fix": true,
1517 "branch": "refs/heads/master",
1518 "max_commits": 100
1519 }
1520 }
1521----
1522
1523As response a link:#check-project-result-info[CheckProjectResultInfo]
1524entity is returned that results for the consistency checks.
1525
1526.Response
1527----
1528 HTTP/1.1 200 OK
1529 Content-Disposition: attachment
1530 Content-Type: application/json; charset=UTF-8
1531
1532 )]}'
1533 {
1534 "auto_closeable_changes_check_result": {
1535 "auto_closeable_changes": {
1536 "refs/heads/master": [
1537 {
1538 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1539 "project": "myProject",
1540 "branch": "master",
1541 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1542 "subject": "Implementing Feature X",
1543 "status": "NEW",
1544 "created": "2013-02-01 09:59:32.126000000",
1545 "updated": "2013-02-21 11:16:36.775000000",
1546 "insertions": 34,
1547 "deletions": 101,
1548 "_number": 3965,
1549 "owner": {
1550 "name": "John Doe"
1551 },
1552 "problems": [
1553 {
1554 "message": "Patch set 1 (2f15e416237ed9b561199f24184f5f5d2708c584) is merged into destination ref refs/heads/master (2f15e416237ed9b561199f24184f5f5d2708c584), but change status is NEW",
1555 "status": "FIXED",
1556 "outcome": "Marked change as merged"
1557 }
1558 ]
1559 }
1560 ]
1561 }
1562 }
1563 }
1564----
1565
Prudhvi Akhil Alahari559132d2021-09-28 18:27:44 +05301566[[commits-included-in]]
1567=== Get Commits Included In Refs
1568--
1569'GET /projects/link:#project-name[\{project-name\}]/commits:in'
1570--
1571
1572Gets refs in which the specified commits were merged into. Returns a map of commits
1573to sets of full ref names.
1574
1575One or more `commit` query parameters are required and each specifies a
1576commit-id (SHA-1 in 40 digit hex representation). Commits will not be contained
1577in the map if they do not exist or are not reachable from visible, specified refs.
1578
1579One or more `ref` query parameters are required and each specifies a full ref name.
1580Refs which are not visible to the calling user according to the project's read
1581permissions and refs which do not exist will be filtered out from the result.
1582
1583.Request
1584----
1585 GET /projects/work%2Fmy-project/commits:in?commit=a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96&commit=6d2a3adb10e844c33617fc948dbeb88e868d396e&ref=refs/heads/master&ref=refs/heads/branch1 HTTP/1.0
1586----
1587
1588.Response
1589----
1590 HTTP/1.1 200 OK
1591 Content-Disposition: attachment
1592 Content-Type: application/json;charset=UTF-8
1593
1594 )]}'
1595 {
1596 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96": [
1597 "refs/heads/master"
1598 ],
1599 "6d2a3adb10e844c33617fc948dbeb88e868d396e": [
1600 "refs/heads/branch1",
1601 "refs/heads/master"
1602 ]
1603 }
1604
1605----
1606
Edwin Kempina686de92013-05-09 15:12:34 +02001607[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001608== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +02001609
1610[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001611=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001612--
Edwin Kempina686de92013-05-09 15:12:34 +02001613'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001614--
Edwin Kempina686de92013-05-09 15:12:34 +02001615
1616List the branches of a project.
1617
1618As result a list of link:#branch-info[BranchInfo] entries is
1619returned.
1620
Youssef Elghareeb875bc6f2023-09-07 14:37:34 +02001621If the `limit` parameter was set and the number of branches is larger than the
1622`limit`, the response header `X-GERRIT-NEXT-PAGE-TOKEN` will be set. Clients
1623can pass this token with subsequent requests (using the `next-page-token`
1624request parameter) for pagination to skip over previous results.
1625
Edwin Kempina686de92013-05-09 15:12:34 +02001626.Request
1627----
1628 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
1629----
1630
1631.Response
1632----
1633 HTTP/1.1 200 OK
1634 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001635 Content-Type: application/json; charset=UTF-8
Edwin Kempina686de92013-05-09 15:12:34 +02001636
1637 )]}'
1638 [
1639 {
1640 "ref": "HEAD",
1641 "revision": "master"
1642 },
1643 {
1644 "ref": "refs/meta/config",
1645 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1646 },
1647 {
1648 "ref": "refs/heads/master",
1649 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1650 },
1651 {
1652 "ref": "refs/heads/stable",
1653 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
1654 "can_delete": true
1655 }
1656 ]
1657----
1658
Hugo Arès3133b4b2014-10-14 14:05:10 -04001659[[branch-options]]
1660==== Branch Options
1661
Hugo Arès15856622014-10-14 14:19:01 -04001662Limit(n)::
1663Limit the number of branches to be included in the results.
1664+
1665.Request
1666----
1667 GET /projects/testproject/branches?n=1 HTTP/1.0
1668----
1669+
1670.Response
1671----
1672 HTTP/1.1 200 OK
1673 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001674 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001675
1676 )]}'
1677 [
1678 {
1679 "ref": "HEAD",
1680 "revision": "master",
Hugo Arès15856622014-10-14 14:19:01 -04001681 }
1682 ]
1683----
1684
David Pursehouse5cb38192017-07-28 16:11:33 +01001685Skip(S)::
Hugo Arès15856622014-10-14 14:19:01 -04001686Skip the given number of branches from the beginning of the list.
1687+
1688.Request
1689----
1690 GET /projects/testproject/branches?n=1&s=0 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ès15856622014-10-14 14:19:01 -04001698
1699 )]}'
1700 [
1701 {
1702 "ref": "HEAD",
1703 "revision": "master",
Hugo Arès15856622014-10-14 14:19:01 -04001704 }
1705 ]
1706----
1707
Hugo Arès3133b4b2014-10-14 14:05:10 -04001708Substring(m)::
David Pursehouse1d4d67d2017-07-13 09:58:10 +09001709Limit the results to those branches that match the specified substring.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001710+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09001711The match is case insensitive. May not be used together with `r`.
David Pursehouse5851bfe2017-07-13 09:56:26 +09001712+
David Pursehouse1d4d67d2017-07-13 09:58:10 +09001713List all branches that match substring `test`:
Hugo Arès3133b4b2014-10-14 14:05:10 -04001714+
1715.Request
1716----
1717 GET /projects/testproject/branches?m=test HTTP/1.0
1718----
1719+
1720.Response
1721----
1722 HTTP/1.1 200 OK
1723 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001724 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001725
1726 )]}'
1727 [
1728 {
1729 "ref": "refs/heads/test1",
1730 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1731 "can_delete": true
1732 }
1733 ]
1734----
1735
1736Regex(r)::
1737Limit the results to those branches that match the specified regex.
1738Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
David Pursehousea6cd67f2017-07-13 16:40:58 +09001739match any branches that start with 't' and regex '*t' will match any
1740branches that end with 't'.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001741+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09001742The match is case sensitive. May not be used together with `m`.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001743+
1744List all branches that match regex `t.*1`:
1745+
1746.Request
1747----
1748 GET /projects/testproject/branches?r=t.*1 HTTP/1.0
1749----
1750+
1751.Response
1752----
1753 HTTP/1.1 200 OK
1754 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001755 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001756
1757 )]}'
1758 [
1759 {
1760 "ref": "refs/heads/test1",
1761 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1762 "can_delete": true
1763 }
1764 ]
1765----
1766
Youssef Elghareeb875bc6f2023-09-07 14:37:34 +02001767Next-page-token(t)::
1768Skips over previous results. Cannot be set simultaneously with the `Skip`
1769parameter, and also must be set to an exact token received by the server in a
1770previous call, otherwise the request would fail with `400 Bad Request`.
1771
Edwin Kempin196e1732013-05-09 15:12:34 +02001772[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001773=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001774--
Edwin Kempin196e1732013-05-09 15:12:34 +02001775'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001776--
Edwin Kempin196e1732013-05-09 15:12:34 +02001777
Youssef Elghareeba5639fc2020-10-26 19:02:39 +01001778Retrieves a branch of a project. For the "All-Users" repository, the magic
1779branch "refs/users/self" is automatically resolved to the user branch of the
1780calling user.
Edwin Kempin196e1732013-05-09 15:12:34 +02001781
1782.Request
1783----
1784 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
1785----
1786
1787As response a link:#branch-info[BranchInfo] entity is returned that
1788describes the branch.
1789
1790.Response
1791----
1792 HTTP/1.1 200 OK
1793 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001794 Content-Type: application/json; charset=UTF-8
Edwin Kempin196e1732013-05-09 15:12:34 +02001795
1796 )]}'
1797 {
1798 "ref": "refs/heads/master",
1799 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1800 }
1801----
1802
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001803[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001804=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001805--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001806'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001807--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001808
1809Creates a new branch.
1810
1811In the request body additional data for the branch can be provided as
Youssef Elghareeb49451912021-01-15 11:49:15 +01001812link:#branch-input[BranchInput]. The link:#branch-id[\{branch-id\}] in the URL
1813should exactly match with the `ref` field of link:#branch-input[BranchInput], or
1814otherwise the request would fail with `400 Bad Request`.
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001815
1816.Request
1817----
1818 PUT /projects/MyProject/branches/stable HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001819 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001820
1821 {
1822 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1823 }
1824----
1825
1826As response a link:#branch-info[BranchInfo] entity is returned that
1827describes the created branch.
1828
1829.Response
1830----
1831 HTTP/1.1 201 Created
1832 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001833 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001834
1835 )]}'
1836 {
1837 "ref": "refs/heads/stable",
1838 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
1839 "can_delete": true
1840 }
1841----
1842
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001843[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001844=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001845--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001846'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001847--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001848
1849Deletes a branch.
1850
1851.Request
1852----
1853 DELETE /projects/MyProject/branches/stable HTTP/1.0
1854----
1855
1856.Response
1857----
1858 HTTP/1.1 204 No Content
1859----
1860
Hugo Arèsef8e3202015-01-12 15:09:06 -05001861[[delete-branches]]
1862=== Delete Branches
1863--
1864'POST /projects/link:#project-name[\{project-name\}]/branches:delete'
1865--
1866
1867Delete one or more branches.
1868
1869The branches to be deleted must be provided in the request body as a
1870link:#delete-branches-input[DeleteBranchesInput] entity.
1871
1872.Request
1873----
1874 POST /projects/MyProject/branches:delete HTTP/1.0
1875 Content-Type: application/json;charset=UTF-8
1876
1877 {
1878 "branches": [
1879 "stable-1.0",
1880 "stable-2.0"
1881 ]
1882 }
1883----
1884
1885.Response
1886----
1887 HTTP/1.1 204 No Content
1888----
1889
1890If some branches could not be deleted, the response is "`409 Conflict`" and the
1891error message is contained in the response body.
1892
Edwin Kempind31e5582013-11-30 12:07:08 +01001893[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001894=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001895--
1896'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1897--
1898
1899Gets the content of a file from the HEAD revision of a certain branch.
1900
1901.Request
1902----
1903 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1904----
1905
1906The content is returned as base64 encoded string.
1907
1908.Response
1909----
1910 HTTP/1.1 200 OK
1911 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001912 Content-Type: text/plain; charset=UTF-8
Edwin Kempind31e5582013-11-30 12:07:08 +01001913
1914 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1915----
1916
Dhruv Srivastava079714cb2023-09-04 17:18:45 +02001917[[suggest-reviewers]]
1918=== Suggest Reviewers
1919--
1920'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/suggest_reviewers?q=J&n=5'
1921--
1922
1923Suggest the reviewers for a given query `q` and result limit `n`. If result
1924limit is not passed, then the default 10 is used.
1925
1926This REST endpoint only suggests accounts that
1927
1928* are active
1929* can see the branch
1930* are visible to the calling user
1931* are not service users (unless
1932 link:config.html#suggest.skipServiceUsers[skipServiceUsers] is set to `false`)
1933
1934Groups can be excluded from the results by specifying the 'exclude-groups'
1935request parameter:
1936
1937--
1938'GET /changes/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/suggest_reviewers?q=J&n=5&exclude-groups'
1939--
1940
1941As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
1942
1943.Request
1944----
1945 GET /projects/myProject/branches/myBranch/suggest_reviewers?q=J HTTP/1.0
1946----
1947
1948.Response
1949----
1950 HTTP/1.1 200 OK
1951 Content-Disposition: attachment
1952 Content-Type: application/json; charset=UTF-8
1953
1954 )]}'
1955 [
1956 {
1957 "account": {
1958 "_account_id": 1000097,
1959 "name": "Jane Roe",
1960 "email": "jane.roe@example.com"
1961 },
1962 "count": 1
1963 },
1964 {
1965 "group": {
1966 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
1967 "name": "Joiner"
1968 },
1969 "count": 5
1970 }
1971 ]
1972----
1973
1974To suggest CCs `reviewer-state=CC` can be specified as additional URL
1975parameter.
1976--
1977'GET /changes/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/suggest_reviewers?q=J&reviewer-state=CC'
1978--
1979
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001980
1981[[get-mergeable-info]]
1982=== Get Mergeable Information
1983--
1984'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/mergeable'
1985--
1986
1987Gets whether the source is mergeable with the target branch.
1988
Han-Wen Nienhuys253730c2020-12-23 16:26:12 +01001989The `source` query parameter is required, which can be anything that
1990could be resolved to a commit, and is visible to the caller. See
1991examples of the `source` attribute in
Zhen Chen8f00d552016-07-26 16:54:59 -07001992link:rest-api-changes.html#merge-input[MergeInput].
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001993
1994Also takes an optional parameter `strategy`, which can be `recursive`, `resolve`,
1995`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
1996
1997.Request
1998----
1999 GET /projects/test/branches/master/mergeable?source=testbranch&strategy=recursive HTTP/1.0
2000----
2001
Zhen Chen8f00d552016-07-26 16:54:59 -07002002As response a link:rest-api-changes.html#mergeable-info[MergeableInfo] entity is returned.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07002003
2004.Response
2005----
2006 HTTP/1.1 200 OK
2007 Content-Disposition: attachment
2008 Content-Type: application/json; charset=UTF-8
2009
2010 )]}'
2011 {
Zhen Chen8f00d552016-07-26 16:54:59 -07002012 "submit_type": "MERGE_IF_NECESSARY",
2013 "strategy": "recursive",
2014 "mergeable": true,
2015 "commit_merged": false,
2016 "content_merged": false
2017 }
2018----
2019
2020or when there were conflicts.
2021
2022.Response
2023----
2024 HTTP/1.1 200 OK
2025 Content-Disposition: attachment
2026 Content-Type: application/json; charset=UTF-8
2027
2028 )]}'
2029 {
2030 "submit_type": "MERGE_IF_NECESSARY",
2031 "strategy": "recursive",
2032 "mergeable": false,
2033 "conflicts": [
2034 "common.txt",
2035 "shared.txt"
2036 ]
2037 }
2038----
2039
2040or when the 'testbranch' has been already merged.
2041
2042.Response
2043----
2044 HTTP/1.1 200 OK
2045 Content-Disposition: attachment
2046 Content-Type: application/json; charset=UTF-8
2047
2048 )]}'
2049 {
2050 "submit_type": "MERGE_IF_NECESSARY",
2051 "strategy": "recursive",
2052 "mergeable": true,
2053 "commit_merged": true,
2054 "content_merged": true
2055 }
2056----
2057
2058or when only the content of 'testbranch' has been merged.
2059
2060.Response
2061----
2062 HTTP/1.1 200 OK
2063 Content-Disposition: attachment
2064 Content-Type: application/json; charset=UTF-8
2065
2066 )]}'
2067 {
2068 "submit_type": "MERGE_IF_NECESSARY",
2069 "strategy": "recursive",
2070 "mergeable": true,
2071 "commit_merged": false,
2072 "content_merged": true
Zhen Chenf7d85ea2016-05-02 15:14:43 -07002073 }
2074----
2075
Edwin Kempin87504d92014-07-04 12:59:19 +02002076[[get-reflog]]
2077=== Get Reflog
2078--
2079'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
2080--
2081
2082Gets the reflog of a certain branch.
2083
2084The caller must be project owner.
2085
2086.Request
2087----
2088 GET /projects/gerrit/branches/master/reflog HTTP/1.0
2089----
2090
2091As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
2092is returned that describe the reflog entries. The reflog entries are
2093returned in reverse order.
2094
2095.Response
2096----
2097 HTTP/1.1 200 OK
2098 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002099 Content-Type: application/json; charset=UTF-8
Edwin Kempin87504d92014-07-04 12:59:19 +02002100
2101 )]}'
2102 [
2103 {
2104 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
2105 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
2106 "who": {
2107 "name": "Jane Roe",
2108 "email": "jane.roe@example.com",
2109 "date": "2014-06-30 11:53:43.000000000",
2110 "tz": 120
2111 },
2112 "comment": "merged: fast forward"
2113 },
2114 {
2115 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
2116 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
2117 "who": {
2118 "name": "John Doe",
2119 "email": "john.doe@example.com",
2120 "date": "2013-10-02 10:45:26.000000000",
2121 "tz": 120
2122 },
2123 "comment": "merged: fast forward"
2124 },
2125 {
2126 "old_id": "0000000000000000000000000000000000000000",
2127 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
2128 "who": {
2129 "name": "John Doe",
2130 "email": "john.doe@example.com",
2131 "date": "2013-09-30 19:08:44.000000000",
2132 "tz": 120
2133 },
2134 "comment": ""
2135 }
2136 ]
2137----
2138
2139The get reflog endpoint also accepts a limit integer in the `n`
2140parameter. This limits the results to show the last `n` reflog entries.
2141
2142Query the last 25 reflog entries.
2143----
2144 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
2145----
2146
Edwin Kempin2a581fd2014-07-04 14:04:54 +02002147The reflog can also be filtered by timestamp by specifying the `from`
2148and `to` parameters. The timestamp for `from` and `to` must be given as
2149UTC in the following format: `yyyyMMdd_HHmm`.
2150
2151----
2152 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
2153----
2154
Edwin Kempin4425c742013-03-18 13:23:00 +01002155[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002156== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01002157
2158[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002159=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002160--
Edwin Kempin4425c742013-03-18 13:23:00 +01002161'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002162--
Edwin Kempin4425c742013-03-18 13:23:00 +01002163
2164List the direct child projects of a project.
2165
2166.Request
2167----
2168 GET /projects/Public-Plugins/children/ HTTP/1.0
2169----
2170
2171As result a list of link:#project-info[ProjectInfo] entries is
2172returned that describe the child projects.
2173
2174.Response
2175----
2176 HTTP/1.1 200 OK
2177 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002178 Content-Type: application/json; charset=UTF-8
Edwin Kempin4425c742013-03-18 13:23:00 +01002179
2180 )]}'
2181 [
2182 {
Edwin Kempin4425c742013-03-18 13:23:00 +01002183 "id": "plugins%2Freplication",
2184 "name": "plugins/replication",
2185 "parent": "Public-Plugins",
2186 "description": "Copies to other servers using the Git protocol"
2187 },
2188 {
Edwin Kempin4425c742013-03-18 13:23:00 +01002189 "id": "plugins%2Freviewnotes",
2190 "name": "plugins/reviewnotes",
2191 "parent": "Public-Plugins",
2192 "description": "Annotates merged commits using notes on refs/notes/review."
2193 },
2194 {
Edwin Kempin4425c742013-03-18 13:23:00 +01002195 "id": "plugins%2Fsingleusergroup",
2196 "name": "plugins/singleusergroup",
2197 "parent": "Public-Plugins",
2198 "description": "GroupBackend enabling users to be directly added to access rules"
2199 }
2200 ]
2201----
2202
Edwin Kempinf95bd172013-03-19 11:10:57 +01002203To resolve the child projects of a project recursively the parameter
2204`recursive` can be set.
2205
2206Child projects that are not visible to the calling user are ignored and
2207are not resolved further.
2208
2209.Request
2210----
2211 GET /projects/Public-Projects/children/?recursive HTTP/1.0
2212----
2213
2214.Response
2215----
2216 HTTP/1.1 200 OK
2217 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002218 Content-Type: application/json; charset=UTF-8
Edwin Kempinf95bd172013-03-19 11:10:57 +01002219
2220 )]}'
2221 [
2222 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002223 "id": "gerrit",
2224 "name": "gerrit",
2225 "parent": "Public-Projects",
2226 "description": "Gerrit Code Review"
2227 },
2228 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002229 "id": "plugins%2Freplication",
2230 "name": "plugins/replication",
2231 "parent": "Public-Plugins",
2232 "description": "Copies to other servers using the Git protocol"
2233 },
2234 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002235 "id": "plugins%2Freviewnotes",
2236 "name": "plugins/reviewnotes",
2237 "parent": "Public-Plugins",
2238 "description": "Annotates merged commits using notes on refs/notes/review."
2239 },
2240 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002241 "id": "plugins%2Fsingleusergroup",
2242 "name": "plugins/singleusergroup",
2243 "parent": "Public-Plugins",
2244 "description": "GroupBackend enabling users to be directly added to access rules"
2245 },
2246 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002247 "id": "Public-Plugins",
2248 "name": "Public-Plugins",
2249 "parent": "Public-Projects",
2250 "description": "Parent project for plugins/*"
2251 }
2252 ]
2253----
2254
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002255[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002256=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002257--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002258'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002259--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002260
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01002261Retrieves a child project. If a non-direct child project should be
2262retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002263
2264.Request
2265----
2266 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
2267----
2268
2269As response a link:#project-info[ProjectInfo] entity is returned that
2270describes the child project.
2271
2272.Response
2273----
2274 HTTP/1.1 200 OK
2275 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002276 Content-Type: application/json; charset=UTF-8
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002277
2278 )]}'
2279 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002280 "id": "plugins%2Freplication",
2281 "name": "plugins/replication",
2282 "parent": "Public-Plugins",
2283 "description": "Copies to other servers using the Git protocol"
2284 }
2285----
2286
David Pursehouse8cc68902014-10-06 18:17:16 +09002287[[tag-endpoints]]
2288== Tag Endpoints
2289
David Pursehouse6a446192016-06-03 10:00:34 +09002290[[create-tag]]
2291=== Create Tag
2292
2293--
2294'PUT /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2295--
2296
2297Create a new tag on the project.
2298
2299In the request body additional data for the tag can be provided as
2300link:#tag-input[TagInput].
2301
2302If a message is provided in the input, the tag is created as an
2303annotated tag with the current user as tagger. Signed tags are not
2304supported.
2305
2306.Request
2307----
2308 PUT /projects/MyProject/tags/v1.0 HTTP/1.0
2309 Content-Type: application/json; charset=UTF-8
2310
2311 {
2312 "message": "annotation",
2313 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
2314 }
2315----
2316
2317As response a link:#tag-info[TagInfo] entity is returned that describes
2318the created tag.
2319
2320.Response
2321----
2322 HTTP/1.1 201 Created
2323 Content-Disposition: attachment
2324 Content-Type: application/json; charset=UTF-8
2325
2326 )]}'
2327
2328 "object": "d48d304adc4b6674e11dc2c018ea05fcbdda32fd",
2329 "message": "annotation",
2330 "tagger": {
2331 "name": "David Pursehouse",
2332 "email": "dpursehouse@collab.net",
2333 "date": "2016-06-06 01:22:03.000000000",
2334 "tz": 540
2335 },
2336 "ref": "refs/tags/v1.0",
2337 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
2338 }
2339----
2340
David Pursehouse8cc68902014-10-06 18:17:16 +09002341[[list-tags]]
2342=== List Tags
2343--
2344'GET /projects/link:#project-name[\{project-name\}]/tags/'
2345--
2346
2347List the tags of a project.
2348
2349As result a list of link:#tag-info[TagInfo] entries is returned.
2350
2351Only includes tags under the `refs/tags/` namespace.
2352
2353.Request
2354----
2355 GET /projects/work%2Fmy-project/tags/ HTTP/1.0
2356----
2357
2358.Response
2359----
2360 HTTP/1.1 200 OK
2361 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002362 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09002363
2364 )]}'
2365 [
2366 {
2367 "ref": "refs/tags/v1.0",
2368 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2369 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2370 "message": "Annotated tag",
2371 "tagger": {
2372 "name": "David Pursehouse",
2373 "email": "david.pursehouse@sonymobile.com",
2374 "date": "2014-10-06 07:35:03.000000000",
2375 "tz": 540
2376 }
2377 },
2378 {
2379 "ref": "refs/tags/v2.0",
2380 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2381 },
2382 {
2383 "ref": "refs/tags/v3.0",
2384 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2385 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2386 "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-----",
2387 "tagger": {
2388 "name": "David Pursehouse",
2389 "email": "david.pursehouse@sonymobile.com",
2390 "date": "2014-10-06 09:02:16.000000000",
2391 "tz": 540
2392 }
2393 }
2394 ]
2395----
2396
David Pursehouseb0ba1512015-09-10 14:17:05 +09002397[[tag-options]]
2398==== Tag Options
2399
2400Limit(n)::
2401Limit the number of tags to be included in the results.
2402+
2403.Request
2404----
2405 GET /projects/work%2Fmy-project/tags?n=2 HTTP/1.0
2406----
2407+
2408.Response
2409----
2410 HTTP/1.1 200 OK
2411 Content-Disposition: attachment
2412 Content-Type: application/json; charset=UTF-8
2413
2414 )]}'
2415 [
2416 {
2417 "ref": "refs/tags/v1.0",
2418 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2419 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2420 "message": "Annotated tag",
2421 "tagger": {
2422 "name": "David Pursehouse",
2423 "email": "david.pursehouse@sonymobile.com",
2424 "date": "2014-10-06 07:35:03.000000000",
2425 "tz": 540
2426 }
2427 },
2428 {
2429 "ref": "refs/tags/v2.0",
2430 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2431 }
2432 ]
2433----
2434
David Pursehouse5cb38192017-07-28 16:11:33 +01002435Skip(S)::
David Pursehouseb0ba1512015-09-10 14:17:05 +09002436Skip the given number of tags from the beginning of the list.
2437+
2438.Request
2439----
2440 GET /projects/work%2Fmy-project/tags?n=2&s=1 HTTP/1.0
2441----
2442+
2443.Response
2444----
2445 HTTP/1.1 200 OK
2446 Content-Disposition: attachment
2447 Content-Type: application/json; charset=UTF-8
2448
2449 )]}'
2450 [
2451 {
2452 "ref": "refs/tags/v2.0",
2453 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2454 },
2455 {
2456 "ref": "refs/tags/v3.0",
2457 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2458 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2459 "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-----",
2460 "tagger": {
2461 "name": "David Pursehouse",
2462 "email": "david.pursehouse@sonymobile.com",
2463 "date": "2014-10-06 09:02:16.000000000",
2464 "tz": 540
2465 }
2466 }
2467 ]
2468----
2469
Idan Attias8bbe6832024-03-13 12:40:43 +02002470DescendingOrder(d)::
2471Sort the returned tags in descending order.
2472+
2473.Request
2474----
2475 GET /projects/work%2Fmy-project/tags?d HTTP/1.0
2476----
2477+
2478.Response
2479----
2480 HTTP/1.1 200 OK
2481 Content-Disposition: attachment
2482 Content-Type: application/json; charset=UTF-8
2483
2484 )]}'
2485 [
2486 {
2487 "ref": "refs/tags/v3.0",
2488 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2489 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2490 "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-----",
2491 "tagger": {
2492 "name": "David Pursehouse",
2493 "email": "david.pursehouse@sonymobile.com",
2494 "date": "2014-10-06 09:02:16.000000000",
2495 "tz": 540
2496 }
2497 },
2498 {
2499 "ref": "refs/tags/v2.0",
2500 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2501 },
2502 {
2503 "ref": "refs/tags/v1.0",
2504 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2505 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2506 "message": "Annotated tag",
2507 "tagger": {
2508 "name": "David Pursehouse",
2509 "email": "david.pursehouse@sonymobile.com",
2510 "date": "2014-10-06 07:35:03.000000000",
2511 "tz": 540
2512 }
2513 }
2514 ]
2515----
2516
Idan Attias8ee461f2024-04-10 11:26:08 +03002517SortBy(sort-by)::
Idan Attias33bc55b2024-03-27 15:11:46 +02002518Sort the returned tags by one of the supported sort options: ref (default), creation_time.
2519+
2520.Request
2521----
Idan Attias8ee461f2024-04-10 11:26:08 +03002522 GET /projects/work%2Fmy-project/tags?sort-by=creation_time HTTP/1.0
Idan Attias33bc55b2024-03-27 15:11:46 +02002523----
2524+
2525.Response
2526----
2527 HTTP/1.1 200 OK
2528 Content-Disposition: attachment
2529 Content-Type: application/json; charset=UTF-8
2530
2531 )]}'
2532 [
2533 {
2534 "ref": "refs/tags/v1.0",
2535 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2536 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2537 "message": "Annotated tag",
2538 "tagger": {
2539 "name": "David Pursehouse",
2540 "email": "david.pursehouse@sonymobile.com",
2541 "date": "2014-10-06 07:35:03.000000000",
2542 "tz": 540
2543 }
2544 },
2545 {
2546 "ref": "refs/tags/v3.0",
2547 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2548 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2549 "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-----",
2550 "tagger": {
2551 "name": "David Pursehouse",
2552 "email": "david.pursehouse@sonymobile.com",
2553 "date": "2014-10-06 09:02:16.000000000",
2554 "tz": 540
2555 }
2556 },
2557 {
2558 "ref": "refs/tags/v2.0",
2559 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2560 }
2561 ]
2562----
2563
David Pursehousecf1ed062017-07-13 10:05:43 +09002564Substring(m)::
2565Limit the results to those tags that match the specified substring.
2566+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09002567The match is case insensitive. May not be used together with `r`.
David Pursehousecf1ed062017-07-13 10:05:43 +09002568+
2569List all tags that match substring `v2`:
2570
2571+
2572.Request
2573----
2574 GET /projects/testproject/tags?m=v2 HTTP/1.0
2575----
2576+
2577.Response
2578----
2579 HTTP/1.1 200 OK
2580 Content-Disposition: attachment
2581 Content-Type: application/json; charset=UTF-8
2582
2583 )]}'
2584 [
2585 {
2586 "ref": "refs/tags/v2.0",
2587 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2588 },
2589 ]
2590----
2591
2592Regex(r)::
2593Limit the results to those tags that match the specified regex.
2594Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
2595match any tags that start with 't' and regex '*t' will match any
2596tags that end with 't'.
2597+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09002598The match is case sensitive. May not be used together with `m`.
David Pursehousef648e042017-07-13 10:08:46 +09002599+
David Pursehousecf1ed062017-07-13 10:05:43 +09002600List all tags that match regex `v.*0`:
2601+
2602.Request
2603----
2604 GET /projects/testproject/tags?r=v.*0 HTTP/1.0
2605----
2606+
2607.Response
2608----
2609 HTTP/1.1 200 OK
2610 Content-Disposition: attachment
2611 Content-Type: application/json; charset=UTF-8
2612
2613 )]}'
2614 [
2615 {
2616 "ref": "refs/tags/v1.0",
2617 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2618 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2619 "message": "Annotated tag",
2620 "tagger": {
2621 "name": "David Pursehouse",
2622 "email": "david.pursehouse@sonymobile.com",
2623 "date": "2014-10-06 07:35:03.000000000",
2624 "tz": 540
2625 }
2626 },
2627 {
2628 "ref": "refs/tags/v2.0",
2629 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2630 },
2631 {
2632 "ref": "refs/tags/v3.0",
2633 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2634 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2635 "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-----",
2636 "tagger": {
2637 "name": "David Pursehouse",
2638 "email": "david.pursehouse@sonymobile.com",
2639 "date": "2014-10-06 09:02:16.000000000",
2640 "tz": 540
2641 }
2642 }
2643 ]
2644----
David Pursehouseb0ba1512015-09-10 14:17:05 +09002645
David Pursehouse8cc68902014-10-06 18:17:16 +09002646[[get-tag]]
2647=== Get Tag
2648--
2649'GET /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2650--
2651
2652Retrieves a tag of a project.
2653
2654.Request
2655----
2656 GET /projects/work%2Fmy-project/tags/v1.0 HTTP/1.0
2657----
2658
2659As response a link:#tag-info[TagInfo] entity is returned that describes the tag.
2660
2661.Response
2662----
2663 HTTP/1.1 200 OK
2664 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002665 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09002666
2667 )]}'
2668 {
2669 "ref": "refs/tags/v1.0",
2670 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2671 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2672 "message": "Annotated tag",
2673 "tagger": {
2674 "name": "David Pursehouse",
2675 "email": "david.pursehouse@sonymobile.com",
2676 "date": "2014-10-06 07:35:03.000000000",
2677 "tz": 540
2678 }
2679 }
2680----
2681
David Pursehousee1132162016-11-30 20:42:33 +09002682[[delete-tag]]
2683=== Delete Tag
2684--
2685'DELETE /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2686--
2687
2688Deletes a tag.
2689
2690.Request
2691----
2692 DELETE /projects/MyProject/tags/v1.0 HTTP/1.0
2693----
2694
2695.Response
2696----
2697 HTTP/1.1 204 No Content
2698----
David Pursehouse8cc68902014-10-06 18:17:16 +09002699
David Pursehouse467aecb2016-12-02 14:18:42 +09002700[[delete-tags]]
2701=== Delete Tags
2702--
2703'POST /projects/link:#project-name[\{project-name\}]/tags:delete'
2704--
2705
2706Delete one or more tags.
2707
2708The tags to be deleted must be provided in the request body as a
2709link:#delete-tags-input[DeleteTagsInput] entity.
2710
2711.Request
2712----
2713 POST /projects/MyProject/tags:delete HTTP/1.0
2714 Content-Type: application/json;charset=UTF-8
2715
2716 {
2717 "tags": [
2718 "v1.0",
2719 "v2.0"
2720 ]
2721 }
2722----
2723
2724.Response
2725----
2726 HTTP/1.1 204 No Content
2727----
2728
2729If some tags could not be deleted, the response is "`409 Conflict`" and the
2730error message is contained in the response body.
2731
Edwin Kempin1b993602014-07-08 16:18:45 +02002732[[commit-endpoints]]
2733== Commit Endpoints
2734
2735[[get-commit]]
2736=== Get Commit
2737--
2738'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
2739--
2740
2741Retrieves a commit of a project.
2742
2743The commit must be visible to the caller.
2744
2745.Request
2746----
2747 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
2748----
2749
2750As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
2751is returned that describes the commit.
2752
2753.Response
2754----
2755 HTTP/1.1 200 OK
2756 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002757 Content-Type: application/json; charset=UTF-8
Edwin Kempin1b993602014-07-08 16:18:45 +02002758
2759 )]}'
2760 {
2761 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
2762 "parents": [
2763 {
2764 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2765 "subject": "Migrate contributor agreements to All-Projects."
2766 }
2767 ],
2768 "author": {
2769 "name": "Shawn O. Pearce",
2770 "email": "sop@google.com",
2771 "date": "2012-04-24 18:08:08.000000000",
2772 "tz": -420
2773 },
2774 "committer": {
2775 "name": "Shawn O. Pearce",
2776 "email": "sop@google.com",
2777 "date": "2012-04-24 18:08:08.000000000",
2778 "tz": -420
2779 },
2780 "subject": "Use an EventBus to manage star icons",
2781 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2782 }
2783----
2784
Gustaf Lundh1386d592016-10-19 23:19:08 +02002785[[get-included-in]]
2786=== Get Included In
2787--
2788'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/in'
2789--
2790
2791Retrieves the branches and tags in which a change is included. As result
2792an link:rest-api-changes.html#included-in-info[IncludedInInfo] entity is returned.
2793
Youssef Elghareeb4c3ee4b2021-06-18 14:10:25 +02002794Branches that are not visible to the calling user according to the project's
2795read permissions are filtered out from the result.
2796
Gustaf Lundh1386d592016-10-19 23:19:08 +02002797.Request
2798----
2799 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/in HTTP/1.0
2800----
2801
2802.Response
2803----
2804 HTTP/1.1 200 OK
2805 Content-Disposition: attachment
2806 Content-Type: application/json;charset=UTF-8
2807
2808 )]}'
2809 {
2810 "branches": [
2811 "master"
2812 ],
2813 "tags": []
2814 }
2815----
2816
Zhen Chend1462d82016-05-12 13:55:37 -07002817[[get-content-from-commit]]
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002818=== Get Content
2819--
2820'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
2821--
2822
2823Gets the content of a file from a certain commit.
2824
2825.Request
2826----
2827 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
2828----
2829
2830The content is returned as base64 encoded string.
2831
2832.Response
2833----
2834 HTTP/1.1 200 OK
2835 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002836 Content-Type: text/plain; charset=UTF-8
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002837
2838 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
2839----
2840
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002841
2842[[cherry-pick-commit]]
2843=== Cherry Pick Commit
2844--
2845'POST /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/cherrypick'
2846--
2847
2848Cherry-picks a commit of a project to a destination branch.
2849
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05302850If one of the secondary emails associated with the user performing the operation was used as the
2851committer email in the original commit, the same email will be used as the committer email in the
2852new patch set; otherwise, the user's preferred email will be used.
2853
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02002854To cherry pick a change revision, see link:rest-api-changes.html#cherry-pick[CherryPick].
2855
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002856The destination branch must be provided in the request body inside a
2857link:rest-api-changes.html#cherrypick-input[CherryPickInput] entity.
2858If the commit message is not set, the commit message of the source
2859commit will be used.
2860
Gal Paikin8dadd422021-05-07 10:21:54 +02002861When cherry-picking a commit into a branch that already contains the Change-Id
2862that we want to cherry-pick, the cherry-pick will create a new patch-set on the
2863destination's branch's appropriate Change-Id. If the change is closed on the
2864destination branch, the cherry-pick will fail.
2865
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002866.Request
2867----
2868 POST /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/cherrypick HTTP/1.0
2869 Content-Type: application/json; charset=UTF-8
2870
2871 {
2872 "message" : "Implementing Feature X",
2873 "destination" : "release-branch"
2874 }
2875----
2876
Edwin Kempinaab27d32020-01-29 13:17:04 +01002877As response a link:rest-api-changes.html#change-info[ChangeInfo] entity
2878is returned that describes the resulting cherry-picked change.
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002879
2880.Response
2881----
2882 HTTP/1.1 200 OK
2883 Content-Disposition: attachment
2884 Content-Type: application/json; charset=UTF-8
2885
2886 )]}'
2887 {
2888 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
2889 "project": "myProject",
2890 "branch": "release-branch",
2891 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
2892 "subject": "Implementing Feature X",
2893 "status": "NEW",
2894 "created": "2013-02-01 09:59:32.126000000",
2895 "updated": "2013-02-21 11:16:36.775000000",
2896 "mergeable": true,
2897 "insertions": 12,
2898 "deletions": 11,
2899 "_number": 3965,
2900 "owner": {
2901 "name": "John Doe"
2902 }
2903 }
2904----
2905
Makson Lee7824f302018-07-20 10:33:56 +08002906[[list-files]]
2907=== List Files
2908--
2909'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/'
2910--
2911
2912Lists the files that were modified, added or deleted in a commit.
2913
2914.Request
2915----
2916 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/ HTTP/1.0
2917----
2918
2919As result a map is returned that maps the link:rest-api-changes.html#file-id[file path] to a
2920link:rest-api-changes.html#file-info[FileInfo] entry. The entries in the map are
2921sorted by file path.
2922
2923.Response
2924----
2925 HTTP/1.1 200 OK
2926 Content-Disposition: attachment
2927 Content-Type: application/json; charset=UTF-8
2928
2929 )]}'
2930 {
2931 "/COMMIT_MSG": {
2932 "status": "A",
2933 "lines_inserted": 7,
2934 "size_delta": 551,
2935 "size": 551
2936 },
2937 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
2938 "lines_inserted": 5,
2939 "lines_deleted": 3,
2940 "size_delta": 98,
2941 "size": 23348
2942 }
2943 }
2944----
2945
2946The integer-valued request parameter `parent` changes the response to return a
2947list of the files which are different in this commit compared to the given
2948parent commit. This is useful for supporting review of merge commits. The value
Youssef Elghareeb8df6d5c2021-02-08 12:19:27 +01002949is the 1-based index of the parent's position in the commit object. If the
2950value 0 is used for `parent`, the default base commit will be used, which is
2951the only parent for commits having one parent or the auto-merge commit
2952otherwise.
Makson Lee7824f302018-07-20 10:33:56 +08002953
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002954[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002955== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002956
Edwin Kempin76202742013-02-15 13:51:50 +01002957[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002958=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002959--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002960'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002961--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002962
Edwin Kempind0a63922013-01-23 16:32:59 +01002963List custom dashboards for a project.
2964
Edwin Kempin55367622013-02-05 09:09:23 +01002965As result a list of link:#dashboard-info[DashboardInfo] entries is
2966returned.
2967
Edwin Kempind0a63922013-01-23 16:32:59 +01002968List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01002969
2970.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002971----
2972 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002973----
Edwin Kempind0a63922013-01-23 16:32:59 +01002974
Edwin Kempin37440832013-02-06 11:36:00 +01002975.Response
2976----
Edwin Kempind0a63922013-01-23 16:32:59 +01002977 HTTP/1.1 200 OK
2978 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002979 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002980
2981 )]}'
2982 [
2983 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002984 "id": "main:closed",
2985 "ref": "main",
2986 "path": "closed",
2987 "description": "Merged and abandoned changes in last 7 weeks",
2988 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002989 "is_default": true,
Edwin Kempind0a63922013-01-23 16:32:59 +01002990 "title": "Closed changes",
2991 "sections": [
2992 {
2993 "name": "Merged",
2994 "query": "status:merged age:7w"
2995 },
2996 {
2997 "name": "Abandoned",
2998 "query": "status:abandoned age:7w"
2999 }
3000 ]
3001 }
3002 ]
3003----
3004
Edwin Kempina64c4b92013-01-23 11:30:40 +01003005.Get all dashboards of the 'All-Projects' project
3006****
3007get::/projects/All-Projects/dashboards/
3008****
3009
Edwin Kempin67e923c2013-02-14 13:57:12 +01003010[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003011=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003012--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003013'GET /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 +01003016Retrieves a project dashboard. The dashboard can be defined on that
3017project or be inherited from a parent project.
3018
3019.Request
3020----
3021 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
3022----
3023
3024As response a link:#dashboard-info[DashboardInfo] entity is returned
3025that describes the dashboard.
3026
3027.Response
3028----
3029 HTTP/1.1 200 OK
3030 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003031 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01003032
3033 )]}'
3034 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01003035 "id": "main:closed",
3036 "ref": "main",
3037 "path": "closed",
3038 "description": "Merged and abandoned changes in last 7 weeks",
3039 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09003040 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01003041 "title": "Closed changes",
3042 "sections": [
3043 {
3044 "name": "Merged",
3045 "query": "status:merged age:7w"
3046 },
3047 {
3048 "name": "Abandoned",
3049 "query": "status:abandoned age:7w"
3050 }
3051 ]
3052 }
3053----
3054
3055To retrieve the default dashboard of a project use `default` as
3056dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01003057
3058.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01003059----
3060 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01003061----
Edwin Kempind0a63922013-01-23 16:32:59 +01003062
Edwin Kempin37440832013-02-06 11:36:00 +01003063.Response
3064----
Edwin Kempind0a63922013-01-23 16:32:59 +01003065 HTTP/1.1 200 OK
3066 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003067 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01003068
3069 )]}'
3070 {
Edwin Kempind0a63922013-01-23 16:32:59 +01003071 "id": "main:closed",
3072 "ref": "main",
3073 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01003074 "description": "Merged and abandoned changes in last 7 weeks",
3075 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09003076 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01003077 "title": "Closed changes",
3078 "sections": [
3079 {
3080 "name": "Merged",
3081 "query": "status:merged age:7w"
3082 },
3083 {
3084 "name": "Abandoned",
3085 "query": "status:abandoned age:7w"
3086 }
3087 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01003088 }
3089----
3090
Edwin Kempin339cb312019-08-05 15:59:58 +02003091[[create-dashboard]]
3092=== Create Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003093--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003094'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003095--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003096
Edwin Kempin339cb312019-08-05 15:59:58 +02003097Creates a project dashboard, if a project dashboard with the given
3098dashboard ID doesn't exist yet.
Edwin Kempin67e923c2013-02-14 13:57:12 +01003099
3100Currently only supported for the `default` dashboard.
3101
Edwin Kempin339cb312019-08-05 15:59:58 +02003102The creation information for the dashboard must be provided in
Edwin Kempin67e923c2013-02-14 13:57:12 +01003103the request body as a link:#dashboard-input[DashboardInput] entity.
3104
3105.Request
3106----
3107 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003108 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01003109
3110 {
3111 "id": "main:closed",
3112 "commit_message": "Define the default dashboard"
3113 }
3114----
3115
Edwin Kempin339cb312019-08-05 15:59:58 +02003116As response the new dashboard is returned as a link:#dashboard-info[
3117DashboardInfo] entity.
3118
3119.Response
3120----
3121 HTTP/1.1 201 Created
3122 Content-Disposition: attachment
3123 Content-Type: application/json; charset=UTF-8
3124
3125 )]}'
3126 {
3127 "id": "main:closed",
3128 "ref": "main",
3129 "path": "closed",
3130 "description": "Merged and abandoned changes in last 7 weeks",
3131 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
3132 "is_default": true,
3133 "title": "Closed changes",
3134 "sections": [
3135 {
3136 "name": "Merged",
3137 "query": "status:merged age:7w"
3138 },
3139 {
3140 "name": "Abandoned",
3141 "query": "status:abandoned age:7w"
3142 }
3143 ]
3144 }
3145----
3146
3147[[update-dashboard]]
3148=== Update Dashboard
3149--
3150'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
3151--
3152
3153Updates a project dashboard, if a project dashboard with the given
3154dashboard ID already exists.
3155
3156Currently only supported for the `default` dashboard.
3157
3158The update information for the dashboard must be provided in
3159the request body as a link:#dashboard-input[DashboardInput] entity.
3160
3161.Request
3162----
3163 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
3164 Content-Type: application/json; charset=UTF-8
3165
3166 {
3167 "id": "main:closed",
3168 "commit_message": "Update the default dashboard"
3169 }
3170----
3171
3172As response the updated dashboard is returned as a
Edwin Kempin67e923c2013-02-14 13:57:12 +01003173link:#dashboard-info[DashboardInfo] entity.
3174
3175.Response
3176----
3177 HTTP/1.1 200 OK
3178 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003179 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01003180
3181 )]}'
3182 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01003183 "id": "main:closed",
3184 "ref": "main",
3185 "path": "closed",
3186 "description": "Merged and abandoned changes in last 7 weeks",
3187 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09003188 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01003189 "title": "Closed changes",
3190 "sections": [
3191 {
3192 "name": "Merged",
3193 "query": "status:merged age:7w"
3194 },
3195 {
3196 "name": "Abandoned",
3197 "query": "status:abandoned age:7w"
3198 }
3199 ]
3200 }
3201----
3202
3203[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003204=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003205--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003206'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003207--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003208
Edwin Kempin67e923c2013-02-14 13:57:12 +01003209Deletes a project dashboard.
3210
3211Currently only supported for the `default` dashboard.
3212
Edwin Kempinefec4492013-02-22 10:09:23 +01003213The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05003214DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01003215
3216Please note that some proxies prohibit request bodies for DELETE
3217requests.
3218
3219.Request
3220----
3221 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
3222----
3223
3224.Response
3225----
3226 HTTP/1.1 204 No Content
3227----
3228
Edwin Kempin44098d02019-10-24 09:22:34 +02003229[[label-endpoints]]
3230== Label Endpoints
3231
3232[[list-labels]]
3233=== List Labels
3234--
3235'GET /projects/link:#project-name[\{project-name\}]/labels/'
3236--
3237
3238Lists the labels that are defined in this project.
3239
3240The calling user must have read access to the `refs/meta/config` branch of the
3241project.
3242
3243.Request
3244----
3245 GET /projects/All-Projects/labels/ HTTP/1.0
3246----
3247
3248As result a list of link:#label-definition-info[LabelDefinitionInfo] entities
3249is returned that describe the labels that are defined in this project
Edwin Kempinb5275262019-10-24 16:03:27 +02003250(inherited labels are not returned unless the `inherited` parameter is set, see
3251link:#list-with-inherited-labels[below]). The returned labels are sorted by
3252label name.
Edwin Kempin44098d02019-10-24 09:22:34 +02003253
3254.Response
3255----
3256 HTTP/1.1 200 OK
3257 Content-Disposition: attachment
3258 Content-Type: application/json; charset=UTF-8
3259
3260 )]}'
3261 [
3262 {
3263 "name": "Code-Review",
Edwin Kempinb5275262019-10-24 16:03:27 +02003264 "project": "All-Projects",
Edwin Kempin44098d02019-10-24 09:22:34 +02003265 "function": "MaxWithBlock",
3266 "values": {
3267 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003268 "-1": "I would prefer this is not submitted as is",
3269 "-2": "This shall not be submitted",
Edwin Kempin44098d02019-10-24 09:22:34 +02003270 "+1": "Looks good to me, but someone else must approve",
3271 "+2": "Looks good to me, approved"
3272 },
3273 "default_value": 0,
3274 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003275 "copy_condition": "changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE or is:MIN",
Edwin Kempin44098d02019-10-24 09:22:34 +02003276 "allow_post_submit": true
3277 }
3278 ]
3279----
3280
Edwin Kempinb5275262019-10-24 16:03:27 +02003281[[list-with-inherited-labels]]
3282To include inherited labels from all parent projects the parameter `inherited`
3283can be set.
3284
3285The calling user must have read access to the `refs/meta/config` branch of the
3286project and all its parent projects.
3287
3288.Request
3289----
3290 GET /projects/My-Project/labels/?inherited HTTP/1.0
3291----
3292
3293As result a list of link:#label-definition-info[LabelDefinitionInfo] entities
3294is returned that describe the labels that are defined in this project and in
3295all its parent projects. The returned labels are sorted by parent projects
3296in-order from `All-Projects` through the project hierarchy to this project.
3297Labels that belong to the same project are sorted by label name.
3298
3299.Response
3300----
3301 HTTP/1.1 200 OK
3302 Content-Disposition: attachment
3303 Content-Type: application/json; charset=UTF-8
3304
3305 )]}'
3306 [
3307 {
3308 "name": "Code-Review",
3309 "project": "All-Projects",
3310 "function": "MaxWithBlock",
3311 "values": {
3312 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003313 "-1": "I would prefer this is not submitted as is",
3314 "-2": "This shall not be submitted",
Edwin Kempinb5275262019-10-24 16:03:27 +02003315 "+1": "Looks good to me, but someone else must approve",
3316 "+2": "Looks good to me, approved"
3317 },
3318 "default_value": 0,
3319 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003320 "copy_condition": "changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE or is:MIN",
Edwin Kempinb5275262019-10-24 16:03:27 +02003321 "allow_post_submit": true
3322 },
3323 {
3324 "name": "Foo-Review",
3325 "project": "My-Project",
3326 "function": "MaxWithBlock",
3327 "values": {
3328 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003329 "-1": "I would prefer this is not submitted as is",
3330 "-2": "This shall not be submitted",
Edwin Kempinb5275262019-10-24 16:03:27 +02003331 "+1": "Looks good to me, but someone else must approve",
3332 "+2": "Looks good to me, approved"
3333 },
3334 "default_value": 0,
3335 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003336 "copy_condition": "is:ANY",
Edwin Kempinb5275262019-10-24 16:03:27 +02003337 "allow_post_submit": true
3338 }
3339 ]
3340----
3341
Edwin Kempinaa56f442019-10-25 08:40:24 +02003342[[get-label]]
3343=== Get Label
3344--
3345'GET /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3346--
3347
3348Retrieves the definition of a label that is defined in this project.
3349
3350The calling user must have read access to the `refs/meta/config` branch of the
3351project.
3352
3353.Request
3354----
3355 GET /projects/All-Projects/labels/Code-Review HTTP/1.0
3356----
3357
3358As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3359returned that describes the label.
3360
3361.Response
3362----
3363 HTTP/1.1 200 OK
3364 Content-Disposition: attachment
3365 Content-Type: application/json; charset=UTF-8
3366
3367 )]}'
3368 {
3369 "name": "Code-Review",
3370 "project": "All-Projects",
3371 "function": "MaxWithBlock",
3372 "values": {
3373 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003374 "-1": "I would prefer this is not submitted as is",
3375 "-2": "This shall not be submitted",
Edwin Kempinaa56f442019-10-25 08:40:24 +02003376 "+1": "Looks good to me, but someone else must approve",
3377 "+2": "Looks good to me, approved"
3378 },
3379 "default_value": 0,
3380 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003381 "copy_condition": "changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE OR is:MIN",
Edwin Kempinaa56f442019-10-25 08:40:24 +02003382 "allow_post_submit": true
3383 }
3384----
3385
Edwin Kempina020d262019-10-25 16:36:45 +02003386[[create-label]]
3387=== Create Label
3388--
3389'PUT /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3390--
3391
3392Creates a new label definition in this project.
3393
3394The calling user must have write access to the `refs/meta/config` branch of the
3395project.
3396
3397If a label with this name is already defined in this project, this label
3398definition is updated (see link:#set-label[Set Label]).
3399
3400.Request
3401----
3402 PUT /projects/My-Project/labels/Foo HTTP/1.0
3403 Content-Type: application/json; charset=UTF-8
3404
3405 {
3406 "commit_message": "Create Foo Label",
3407 "values": {
3408 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003409 "-1": "I would prefer this is not submitted as is",
3410 "-2": "This shall not be submitted",
Edwin Kempina020d262019-10-25 16:36:45 +02003411 "+1": "Looks good to me, but someone else must approve",
3412 "+2": "Looks good to me, approved"
3413 }
3414 }
3415----
3416
3417As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3418returned that describes the created label.
3419
3420.Response
3421----
3422 HTTP/1.1 200 OK
3423 Content-Disposition: attachment
3424 Content-Type: application/json; charset=UTF-8
3425
3426 )]}'
3427 {
3428 "name": "Foo",
3429 "project_name": "My-Project",
3430 "function": "MaxWithBlock",
3431 "values": {
3432 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003433 "-1": "I would prefer this is not submitted as is",
3434 "-2": "This shall not be submitted",
Edwin Kempina020d262019-10-25 16:36:45 +02003435 "+1": "Looks good to me, but someone else must approve",
3436 "+2": "Looks good to me, approved"
3437 },
3438 "default_value": 0,
3439 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003440 "copy_condition": "changekind:NO_CHANGE",
Edwin Kempina020d262019-10-25 16:36:45 +02003441 "allow_post_submit": true
3442 }
3443----
3444
Edwin Kempinb5e87452019-10-25 13:28:46 +02003445[[set-label]]
3446=== Set Label
3447--
3448'PUT /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3449--
3450
3451Updates the definition of a label that is defined in this project.
3452
3453The calling user must have write access to the `refs/meta/config` branch of the
3454project.
3455
3456Properties which are not set in the input entity are not modified.
3457
3458.Request
3459----
3460 PUT /projects/All-Projects/labels/Code-Review HTTP/1.0
3461 Content-Type: application/json; charset=UTF-8
3462
3463 {
3464 "commit_message": "Ignore self approvals for Code-Review label",
3465 "ignore_self_approval": true
3466 }
3467----
3468
3469As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3470returned that describes the updated label.
3471
3472.Response
3473----
3474 HTTP/1.1 200 OK
3475 Content-Disposition: attachment
3476 Content-Type: application/json; charset=UTF-8
3477
3478 )]}'
3479 {
3480 "name": "Code-Review",
3481 "project": "All-Projects",
3482 "function": "MaxWithBlock",
3483 "values": {
3484 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003485 "-1": "I would prefer this is not submitted as is",
3486 "-2": "This shall not be submitted",
Edwin Kempinb5e87452019-10-25 13:28:46 +02003487 "+1": "Looks good to me, but someone else must approve",
3488 "+2": "Looks good to me, approved"
3489 },
3490 "default_value": 0,
3491 "can_override": true,
Edwin Kempin53bdd552022-04-05 14:03:26 +02003492 "copy_condition": "changekind:NO_CHANGE OR changekind:TRIVIAL_REBASE OR is:MIN",
Edwin Kempinb5e87452019-10-25 13:28:46 +02003493 "allow_post_submit": true,
3494 "ignore_self_approval": true
3495 }
3496----
3497
Edwin Kempin920f6f82019-10-28 10:43:13 +01003498[[delete-label]]
3499=== Delete Label
3500--
3501'DELETE /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3502--
3503
3504Deletes the definition of a label that is defined in this project.
3505
3506The calling user must have write access to the `refs/meta/config` branch of the
3507project.
3508
3509The request body does not need to include a link:#delete-label-input[
3510DeleteLabelInput] entity if no commit message is specified.
3511
3512.Request
3513----
Edwin Kempin6b96af62019-10-28 13:55:14 +01003514 DELETE /projects/My-Project/labels/Foo-Review HTTP/1.0
Edwin Kempin920f6f82019-10-28 10:43:13 +01003515 Content-Type: application/json; charset=UTF-8
3516
3517 {
3518 "commit_message": "Delete Foo-Review label",
3519 }
3520----
3521
3522If a label was deleted the response is "`204 No Content`".
3523
3524.Response
3525----
3526 HTTP/1.1 204 No Content
3527----
3528
Edwin Kempin83d6d222019-10-28 13:45:52 +01003529[[batch-update-labels]]
3530=== Batch Update Labels
3531--
3532'POST /projects/link:#project-name[\{project-name\}]/labels/'
3533--
3534
3535Creates/updates/deletes multiple label definitions in this project at once.
3536
3537The calling user must have write access to the `refs/meta/config` branch of the
3538project.
3539
3540The updates must be specified in the request body as
3541link:#batch-label-input[BatchLabelInput] entity.
3542
3543The updates are processed in the following order:
3544
35451. label deletions
35462. label creations
35473. label updates
3548
3549.Request
3550----
3551 POST /projects/My-Project/labels/ HTTP/1.0
3552 Content-Type: application/json; charset=UTF-8
3553
3554 {
3555 "commit_message": "Update Labels",
3556 "delete": [
3557 "Old-Review",
3558 "Unused-Review"
3559 ],
3560 "create": [
3561 {
3562 "name": "Foo-Review",
3563 "values": {
3564 " 0": "No score",
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01003565 "-1": "I would prefer this is not submitted as is",
3566 "-2": "This shall not be submitted",
Edwin Kempin83d6d222019-10-28 13:45:52 +01003567 "+1": "Looks good to me, but someone else must approve",
3568 "+2": "Looks good to me, approved"
3569 }
3570 ],
3571 "update:" {
3572 "Bar-Review": {
3573 "function": "MaxWithBlock"
3574 },
3575 "Baz-Review": {
Edwin Kempin53bdd552022-04-05 14:03:26 +02003576 "copy_condition": "is:MIN"
Edwin Kempin83d6d222019-10-28 13:45:52 +01003577 }
3578 }
3579 }
3580----
3581
3582If the label updates were done successfully the response is "`200 OK`".
3583
3584.Response
3585----
3586 HTTP/1.1 200 OK
3587----
3588
Youssef Elghareeb859b0522021-05-21 00:34:59 +02003589[[submit-requirement-endpoints]]
3590== Submit Requirement Endpoints
3591
3592[[create-submit-requirement]]
3593=== Create Submit Requirement
3594
3595--
3596'PUT /projects/link:#project-name[\{project-name\}]/submit_requirements/link:#submit-requirement-name[\{submit-requirement-name\}]'
3597--
3598
3599Creates a new submit requirement definition in this project.
3600
3601The calling user must have write access to the `refs/meta/config` branch of the
3602project.
3603
3604If a submit requirement with this name is already defined in this project, this
3605submit requirement definition is updated
3606(see link:#update-submit-requirement[Update Submit Requirement]).
3607
3608The submit requirement data must be provided in the request body as
3609link:#submit-requirement-input[SubmitRequirementInput].
3610
3611.Request
3612----
3613 PUT /projects/My-Project/submit_requirements/Code-Review HTTP/1.0
3614 Content-Type: application/json; charset=UTF-8
3615
3616 {
3617 "name": "Code-Review",
3618 "description": "At least one maximum vote for the Code-Review label is required",
3619 "submittability_expression": "label:Code-Review=+2"
3620 }
3621----
3622
3623As response a link:#submit-requirement-info[SubmitRequirementInfo] entity is
3624returned that describes the created submit requirement.
3625
3626.Response
3627----
3628 HTTP/1.1 200 OK
3629 Content-Disposition: attachment
3630 Content-Type: application/json; charset=UTF-8
3631
3632 )]}'
3633 {
3634 "name": "Code-Review",
3635 "description": "At least one maximum vote for the Code-Review label is required",
3636 "submittability_expression": "label:Code-Review=+2",
3637 "allow_override_in_child_projects": false
3638 }
3639----
3640
3641[[update-submit-requirement]]
3642=== Update Submit Requirement
3643
3644--
3645'PUT /projects/link:#project-name[\{project-name\}]/submit_requirements/link:#submit-requirement-name[\{submit-requirement-name\}]'
3646--
3647
3648Updates the definition of a submit requirement that is defined in this project.
3649
3650The calling user must have write access to the `refs/meta/config` branch of the
3651project.
3652
3653The new submit requirement will overwrite the existing submit requirement.
3654That is, unspecified attributes will be set to their defaults.
3655
3656.Request
3657----
3658 PUT /projects/My-Project/submit_requirements/Code-Review HTTP/1.0
3659 Content-Type: application/json; charset=UTF-8
3660
3661 {
3662 "name": "Code-Review",
3663 "description": "At least one maximum vote for the Code-Review label is required",
3664 "submittability_expression": "label:Code-Review=+2"
3665 }
3666----
3667
3668As response a link:#submit-requirement-info[SubmitRequirementInfo] entity is
3669returned that describes the created submit requirement.
3670
3671.Response
3672----
3673 HTTP/1.1 200 OK
3674 Content-Disposition: attachment
3675 Content-Type: application/json; charset=UTF-8
3676
3677 )]}'
3678 {
3679 "name": "Code-Review",
3680 "description": "At least one maximum vote for the Code-Review label is required",
3681 "submittability_expression": "label:Code-Review=+2",
3682 "allow_override_in_child_projects": false
3683 }
3684----
3685
3686[[get-submit-requirement]]
3687=== Get Submit Requirement
3688--
3689'GET /projects/link:#project-name[\{project-name\}]/submit_requirements/link:#submit-requirement-name[\{submit-requirement-name\}]'
3690--
3691
3692Retrieves the definition of a submit requirement that is defined in this project.
3693
3694The calling user must have read access to the `refs/meta/config` branch of the
3695project.
3696
3697.Request
3698----
3699 GET /projects/All-Projects/submit-requirement/Code-Review HTTP/1.0
3700----
3701
3702.Response
3703----
3704 HTTP/1.1 200 OK
3705 Content-Disposition: attachment
3706 Content-Type: application/json; charset=UTF-8
3707
3708 )]}'
3709 {
3710 "name": "Code-Review",
3711 "description": "At least one maximum vote for the Code-Review label is required",
3712 "submittability_expression": "label:Code-Review=+2",
3713 "allow_override_in_child_projects": false
3714 }
3715----
Edwin Kempin34d83352013-02-06 10:40:17 +01003716
Youssef Elghareeb39a4b222021-05-21 11:43:19 +02003717[[list-submit-requirements]]
3718=== List Submit Requirements
3719--
3720'GET /projects/link:#project-name[\{project-name\}]/submit_requirements'
3721--
3722
3723Retrieves a list of all submit requirements for this project. The `inherited`
3724parameter can be supplied to also list submit requirements from parent projects.
3725
3726The calling user must have read access to the `refs/meta/config` branch of the
3727project. If the `inherited` option is used, the caller must have read access to
3728the `refs/meta/config` branch of all parent projects as well.
3729
3730As response a list of link:#submit-requirement-info[SubmitRequirementInfo]
3731entities is returned.
3732
3733.Request
3734----
3735 GET /projects/All-Projects/submit-requirements HTTP/1.0
3736----
3737
3738.Response
3739----
3740 HTTP/1.1 200 OK
3741 Content-Disposition: attachment
3742 Content-Type: application/json; charset=UTF-8
3743
3744 )]}'
3745 [
3746 {
3747 "name": "Code-Review",
3748 "description": "At least one maximum vote for the Code-Review label is required",
3749 "submittability_expression": "label:Code-Review=+2",
3750 "allow_override_in_child_projects": false
3751 }
3752 ]
3753----
3754
Youssef Elghareeb7c2bb9c2021-05-21 11:55:44 +02003755[[delete-submit-requirement]]
3756=== Delete Submit Requirement
3757--
3758'DELETE /projects/link:#project-name[\{project-name\}]/submit_requirements/link:#submit-requirement-name[\{submit-requirement-name\}]'
3759--
3760
3761Deletes the definition of a submit requirement that is defined in this project.
3762
3763The calling user must have write access to the `refs/meta/config` branch of the
3764project. The request would fail with `404 Not Found` if there is no submit
3765requirement with this name for this project.
3766
3767No request body is needed.
3768
3769.Request
3770----
3771 DELETE /projects/My-Project/submit_requirements/Foo-Review HTTP/1.0
3772 Content-Type: application/json; charset=UTF-8
3773----
3774
3775If a submit requirement was deleted the response is "`204 No Content`".
3776
3777.Response
3778----
3779 HTTP/1.1 204 No Content
3780----
3781
Edwin Kempin34d83352013-02-06 10:40:17 +01003782[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003783== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01003784
Edwin Kempin196e1732013-05-09 15:12:34 +02003785[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003786=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02003787The name of a branch or `HEAD`. The prefix `refs/heads/` can be
3788omitted.
3789
Edwin Kempin1b993602014-07-08 16:18:45 +02003790[[commit-id]]
3791=== \{commit-id\}
3792Commit ID.
3793
David Pursehouse8cc68902014-10-06 18:17:16 +09003794[[tag-id]]
3795=== \{tag-id\}
3796The name of a tag. The prefix `refs/tags/` can be omitted.
3797
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003798[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003799=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01003800The ID of a dashboard in the format '<ref>:<path>'.
3801
3802A special dashboard ID is `default` which represents the default
3803dashboard of a project.
3804
Edwin Kempinaa56f442019-10-25 08:40:24 +02003805[[label-name]]
3806=== \{label-name\}
3807The name of a review label.
3808
Youssef Elghareeb859b0522021-05-21 00:34:59 +02003809[[submit-requirement-name]]
3810=== \{submit-requirement-name\}
3811The name of a submit requirement.
3812
3813
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003814[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003815=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01003816The name of the project.
3817
Edwin Kempina9e94ab2015-03-06 10:35:39 +01003818If the name ends with `.git`, the suffix will be automatically removed.
3819
Edwin Kempin34d83352013-02-06 10:40:17 +01003820
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003821[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003822== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003823
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02003824[[access-check-info]]
3825=== AccessCheckInfo
3826
3827The `AccessCheckInfo` entity is the result of an access check.
3828
3829[options="header",cols="1,^1,5"]
3830|=========================================
3831|Field Name ||Description
3832|`status` ||The HTTP status code for the access.
Han-Wen Nienhuys3364c472018-10-01 16:49:42 +02003833200 means success and 403 means denied.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02003834|`message` |optional|A clarifying message if `status` is not 200.
Edwin Kempin35b6f4a2020-02-14 13:33:45 +01003835|`debug_logs` |optional|
3836Debug logs that may help to understand why a permission is denied or allowed.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02003837|=========================================
3838
Edwin Kempinbf9df392018-01-12 15:20:48 +01003839[[auto_closeable_changes_check_input]]
3840=== AutoCloseableChangesCheckInput
3841The `AutoCloseableChangesCheckInput` entity contains options for running
3842the link:#auto-closeable-changes-check[AutoCloseableChangesCheck].
3843
3844[options="header",cols="1,^2,4"]
3845|=============================
3846|Field Name ||Description
3847|`fix` |optional|
3848Whether auto-closeable changes should be closed automatically.
3849|`branch` ||
3850The branch for which the link:#auto-closeable-changes-check[
3851AutoCloseableChangesCheck] should be performed. The 'refs/heads/'
3852prefix for the branch name can be omitted.
3853|`skip_commits` |optional|
3854Number of commits that should be skipped when walking the commits of
3855the branch.
3856|`max_commits` |optional|
3857Maximum number of commits to walk. If not specified this defaults to
385810,000 commits. 10,000 is also the maximum that can be set.
3859Auto-closing changes is an expensive operation and the more commits
3860are walked the slower it gets. This is why you should avoid walking too
3861many commits.
3862|=============================
3863
3864[[auto_closeable_changes_check_result]]
3865=== AutoCloseableChangesCheckResult
3866The `AutoCloseableChangesCheckResult` entity contains the results of
3867running the link:#auto-closeable-changes-check[AutoCloseableChangesCheck]
3868on a project.
3869
3870[options="header",cols="1,6"]
3871|====================================
3872|Field Name |Description
3873|`auto_closeable_changes`|
3874Changes that can be auto-closed as list of
3875link:rest-api-changes.html#change-info[ChangeInfo] entities. For each
3876returned link:rest-api-changes.html#change-info[ChangeInfo] entity the
3877`problems` field is populated that includes details about the detected
3878issues. If `fix` in the link:#auto_closeable_changes_check_input[
3879AutoCloseableChangesCheckInput] was set to `true`, `status` and
3880`outcome` in link:rest-api-changes.html#problem-info[ProblemInfo] are
3881populated. If the status says `FIXED` Gerrit was able to auto-close the
3882change now.
3883|====================================
3884
Edwin Kempin62946742014-07-09 11:17:58 +02003885[[ban-input]]
3886=== BanInput
3887The `BanInput` entity contains information for banning commits in a
3888project.
3889
David Pursehouseae367192014-11-25 17:24:47 +09003890[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02003891|=======================
3892|Field Name||Description
3893|`commits` ||List of commits to be banned.
3894|`reason` |optional|Reason for banning the commits.
3895|=======================
3896
3897[[ban-result-info]]
3898=== BanResultInfo
3899The `BanResultInfo` entity describes the result of banning commits.
3900
David Pursehouseae367192014-11-25 17:24:47 +09003901[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02003902|=============================
3903|Field Name ||Description
3904|`newly_banned` |optional|List of newly banned commits.
3905|`already_banned`|optional|List of commits that were already banned.
3906|`ignored` |optional|List of object IDs that were ignored.
3907|=============================
3908
Edwin Kempin521c1242015-01-23 12:44:44 +01003909[[branch-info]]
3910=== BranchInfo
3911The `BranchInfo` entity contains information about a branch.
3912
3913[options="header",cols="1,^2,4"]
3914|=========================
3915|Field Name ||Description
3916|`ref` ||The ref of the branch.
3917|`revision` ||The revision to which the branch points.
David Pursehoused00515e2017-11-10 15:57:41 +09003918|`can_delete`|not set if `false`|
Edwin Kempin521c1242015-01-23 12:44:44 +01003919Whether the calling user can delete this branch.
3920|`web_links` |optional|
3921Links to the branch in external sites as a list of
3922link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
3923|=========================
3924
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003925[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003926=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003927The `BranchInput` entity contains information for the creation of
3928a new branch.
3929
David Pursehouseae367192014-11-25 17:24:47 +09003930[options="header",cols="1,^2,4"]
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003931|=======================
Edwin Kempin11663f72022-02-15 10:24:33 +01003932|Field Name ||Description
3933|`ref` |optional|
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003934The name of the branch. The prefix `refs/heads/` can be
3935omitted. +
3936If set, must match the branch ID in the URL.
Edwin Kempin11663f72022-02-15 10:24:33 +01003937|`revision` |optional|
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003938The base revision of the new branch. +
3939If not set, `HEAD` will be used as base revision.
Edwin Kempin11663f72022-02-15 10:24:33 +01003940|`validation_options`|optional|
3941Map with key-value pairs that are forwarded as options to the ref operation
3942validation listeners (e.g. can be used to skip certain validations). Which
3943validation options are supported depends on the installed ref operation
3944validation listeners. Gerrit core doesn't support any validation options, but
3945ref operation validation listeners that are implemented in plugins may. Please
3946refer to the documentation of the installed plugins to learn whether they
3947support validation options. Unknown validation options are silently ignored.
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003948|=======================
3949
Edwin Kempinbf9df392018-01-12 15:20:48 +01003950[[check-project-input]]
3951=== CheckProjectInput
3952The `CheckProjectInput` entity contains information about which
3953consistency checks should be run on a project.
3954
3955[options="header",cols="1,^2,4"]
3956|===========================================
3957|Field Name ||Description
3958|`auto_closeable_changes_check`|optional|
3959Parameters for the link:#auto-closeable-changes-check[
3960AutoCloseableChangesCheck] as
3961link:rest-api-changes.html#auto_closeable_changes_check_input[
3962AutoCloseableChangesCheckInput] entity.
3963|===========================================
3964
3965[[check-project-result-info]]
3966=== CheckProjectResultInfo
3967The `CheckProjectResultInfo` entity contains results for consistency
3968checks that have been run on a project.
3969
3970[options="header",cols="1,^2,4"]
3971|==================================================
3972|Field Name ||Description
3973|`auto_closeable_changes_check_result`|optional|
3974Results for the link:#auto-closeable-changes-check[
3975AutoCloseableChangesCheck] as
3976link:rest-api-changes.html#auto_closeable_changes_check_result[
3977AutoCloseableChangesCheckResult] entity.
3978|==================================================
3979
Edwin Kempin043436d2018-10-17 12:23:22 +02003980[[commentlink-info]]
3981=== CommentLinkInfo
3982The `CommentLinkInfo` entity describes a
3983link:config-gerrit.html#commentlink[commentlink].
3984
3985[options="header",cols="1,^2,4"]
3986|==================================================
3987|Field Name | |Description
3988|`match` | |A JavaScript regular expression to match
3989positions to be replaced with a hyperlink, as documented in
Gal Paikin86367472019-08-02 09:59:42 +02003990link:config-gerrit.html#commentlink.name.match[commentlink.name.match].
Edwin Kempin043436d2018-10-17 12:23:22 +02003991|`link` | |The URL to direct the user to whenever the
3992regular expression is matched, as documented in
Gal Paikin86367472019-08-02 09:59:42 +02003993link:config-gerrit.html#commentlink.name.link[commentlink.name.link].
Kamil Musin9148ba62022-09-15 14:21:34 +02003994|`prefix` |optional|Text inserted before the link.
3995|`suffix` |optional|Text inserted after the link.
3996|`text` |optional|Text of the link.
Edwin Kempin043436d2018-10-17 12:23:22 +02003997|`enabled` |optional|Whether the commentlink is enabled, as documented
Gal Paikin86367472019-08-02 09:59:42 +02003998in link:config-gerrit.html#commentlink.name.enabled[
Edwin Kempin043436d2018-10-17 12:23:22 +02003999commentlink.name.enabled]. If not set the commentlink is enabled.
Edwin Kempin1fed9b12022-10-04 08:26:56 +02004000|==================================================
David Pursehouse67c8f142018-10-14 14:01:29 +09004001
4002[[commentlink-input]]
4003=== CommentLinkInput
4004The `CommentLinkInput` entity describes the input for a
4005link:config-gerrit.html#commentlink[commentlink].
4006
David Pursehouse67c8f142018-10-14 14:01:29 +09004007[options="header",cols="1,^2,4"]
4008|==================================================
4009|Field Name | |Description
4010|`match` | |A JavaScript regular expression to match
4011positions to be replaced with a hyperlink, as documented in
4012link:config-gerrit.html#commentlink.name.match[commentlink.name.match].
4013|`link` | |The URL to direct the user to whenever the
4014regular expression is matched, as documented in
4015link:config-gerrit.html#commentlink.name.link[commentlink.name.link].
Kamil Musin9148ba62022-09-15 14:21:34 +02004016|`prefix` |optional|Text inserted before the link.
4017|`suffix` |optional|Text inserted after the link.
4018|`text` |optional|Text of the link.
David Pursehouse67c8f142018-10-14 14:01:29 +09004019|`enabled` |optional|Whether the commentlink is enabled, as documented
4020in link:config-gerrit.html#commentlink.name.enabled[
4021commentlink.name.enabled]. If not set the commentlink is enabled.
Edwin Kempin043436d2018-10-17 12:23:22 +02004022|==================================================
4023
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004024[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004025=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004026The `ConfigInfo` entity contains information about the effective project
4027configuration.
4028
David Pursehouseae367192014-11-25 17:24:47 +09004029[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02004030|=======================================================
4031|Field Name ||Description
4032|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02004033The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004034|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004035link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4036authors must complete a contributor agreement on the site before
4037pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004038|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004039link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4040Gerrit will try to perform a 3-way merge of text file content when a
4041file has been modified by both the destination branch and the change
4042being submitted. This option only takes effect if submit type is not
4043FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004044|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004045link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4046each change must contain a Signed-off-by line from either the author or
4047the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004048|`create_new_change_for_all_not_in_target` |optional|
4049link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4050a new change is created for every commit not in target branch.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02004051|`require_change_id` |optional|
4052link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
4053valid link:user-changeid.html[Change-Id] footer in any commit uploaded
4054for review is required. This does not apply to commits pushed directly
4055to a branch or tag. This property is deprecated and will be removed in
4056a future release.
Doug Claar1b0f76252016-03-23 13:34:55 -07004057|`enable_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz5170e0f2015-06-18 21:05:29 -04004058link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4059signed push validation is enabled on the project.
Doug Claar1b0f76252016-03-23 13:34:55 -07004060|`require_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz0543c732015-10-20 10:35:26 -04004061link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4062signed push validation is required on the project.
Saša Živkov225b7a72015-11-17 17:37:43 +01004063|`reject_implicit_merges`|optional|
4064link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4065implicit merges should be rejected on changes pushed to the project.
David Ostrovsky96909942018-06-10 08:30:33 +02004066|`private_by_default` ||
Changcheng Xiaod089b4a2017-08-10 14:05:22 +02004067link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4068all new changes are set as private by default.
David Ostrovsky96909942018-06-10 08:30:33 +02004069|`work_in_progress_by_default`||
4070link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4071all new changes are set as work-in-progress by default.
4072|`max_object_size_limit` ||
Edwin Kempin3c99f592013-07-15 10:12:27 +02004073The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
4074limit] of this project as a link:#max-object-size-limit-info[
4075MaxObjectSizeLimitInfo] entity.
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004076|`default_submit_type` ||
4077link:#submit-type-info[SubmitTypeInfo] that describes the default submit type of
4078the project, when not overridden at the change level.
Edwin Kempin3c99f592013-07-15 10:12:27 +02004079|`submit_type` ||
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004080Deprecated; equivalent to link:#submit-type-info[`value`] in
4081`default_submit_type`.
Patrick Hiesel5a316352017-06-22 15:38:06 +02004082|`match_author_to_committer_date` |optional|
4083link:#inherited-boolean-info[InheritedBooleanInfo] that indicates whether
4084a change's author date will be changed to match its submitter date upon submit.
Edwin Kempin3c99f592013-07-15 10:12:27 +02004085|`state` |optional|
4086The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
4087Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02004088|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02004089Map with the comment link configurations of the project. The name of
Edwin Kempin043436d2018-10-17 12:23:22 +02004090the comment link configuration is mapped to a link:#commentlink-info[
4091CommentlinkInfo] entity.
Nitzan Gur-Furmanaab10692022-11-08 11:40:10 +01004092|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01004093Plugin configuration as map which maps the plugin name to a map of
4094parameter names to link:#config-parameter-info[ConfigParameterInfo]
Alice Kober-Sotzek77bc1862020-06-25 20:05:47 +02004095entities. Only filled for users who have read access to `refs/meta/config`.
Nitzan Gur-Furmanaab10692022-11-08 11:40:10 +01004096|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02004097Actions the caller might be able to perform on this project. The
4098information is a map of view names to
Nitzan Gur-Furmanaab10692022-11-08 11:40:10 +01004099|`reject_empty_commit` |optional|
Patrick Hieseldc285c72018-01-08 17:20:15 +01004100link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
4101empty commits should be rejected when a change is merged.
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02004102link:rest-api-changes.html#action-info[ActionInfo] entities.
Nitzan Gur-Furmanaab10692022-11-08 11:40:10 +01004103|`skip_adding_author_and_committer_as_reviewers` |optional|
4104Whether to skip adding the Git commit author and committer as reviewers for a new change.
David Pursehouse510b87d2014-11-25 16:46:28 +09004105|=======================================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004106
Edwin Kempina23eb102013-07-17 09:10:54 +02004107[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004108=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02004109The `ConfigInput` entity describes a new project configuration.
4110
David Pursehouseae367192014-11-25 17:24:47 +09004111[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02004112|======================================================
4113|Field Name ||Description
4114|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02004115The new description of the project. +
4116If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004117|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02004118Whether authors must complete a contributor agreement on the site
4119before pushing any commits or changes to this project. +
4120Can be `TRUE`, `FALSE` or `INHERIT`. +
4121If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004122|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02004123Whether Gerrit will try to perform a 3-way merge of text file content
4124when a file has been modified by both the destination branch and the
4125change being submitted. This option only takes effect if submit type is
4126not FAST_FORWARD_ONLY. +
4127Can be `TRUE`, `FALSE` or `INHERIT`. +
4128If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004129|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02004130Whether each change must contain a Signed-off-by line from either the
4131author or the uploader in the commit message. +
4132Can be `TRUE`, `FALSE` or `INHERIT`. +
4133If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004134|`create_new_change_for_all_not_in_target` |optional|
4135Whether a new change will be created for every commit not in target
4136branch. +
4137Can be `TRUE`, `FALSE` or `INHERIT`. +
4138If not set, this setting is not updated.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02004139|`require_change_id` |optional|
4140Whether a valid link:user-changeid.html[Change-Id] footer in any commit
4141uploaded for review is required. This does not apply to commits pushed
4142directly to a branch or tag. +
4143Can be `TRUE`, `FALSE` or `INHERIT`. +
4144If not set, this setting is not updated.
4145This property is deprecated and will be removed in
4146a future release.
Saša Živkov225b7a72015-11-17 17:37:43 +01004147|`reject_implicit_merges` |optional|
4148Whether a check for implicit merges will be performed when changes
4149are pushed for review. +
4150Can be `TRUE`, `FALSE` or `INHERIT`. +
4151If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004152|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02004153The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
4154limit] of this project as a link:#max-object-size-limit-info[
4155MaxObjectSizeLimitInfo] entity. +
4156If set to `0`, the max object size limit is removed. +
4157If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004158|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02004159The default submit type of the project, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02004160`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Edwin Kempina23eb102013-07-17 09:10:54 +02004161`CHERRY_PICK`. +
4162If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004163|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02004164The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
4165Not set if the project state is `ACTIVE`. +
4166If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004167|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01004168Plugin configuration values as map which maps the plugin name to a map
4169of parameter names to values.
Patrick Hieseldc285c72018-01-08 17:20:15 +01004170|`reject_empty_commit` |optional|
4171Whether empty commits should be rejected when a change is merged.
4172Can be `TRUE`, `FALSE` or `INHERIT`. +
4173If not set, this setting is not updated.
David Pursehouse67c8f142018-10-14 14:01:29 +09004174|commentlinks |optional|
4175Map of commentlink names to link:#commentlink-input[CommentLinkInput]
4176entities to add or update on the project. If the given commentlink
4177already exists, it will be updated with the given values, otherwise
4178it will be created. If the value is null, that entry is deleted.
David Pursehouse510b87d2014-11-25 16:46:28 +09004179|======================================================
Edwin Kempina23eb102013-07-17 09:10:54 +02004180
Edwin Kempin9ce4f552013-11-15 16:00:00 +01004181[[config-parameter-info]]
David Pursehouseb10c2662016-12-06 08:41:33 +09004182=== ConfigParameterInfo
Edwin Kempin9ce4f552013-11-15 16:00:00 +01004183The `ConfigParameterInfo` entity describes a project configuration
4184parameter.
4185
David Pursehouseae367192014-11-25 17:24:47 +09004186[options="header",cols="1,^2,4"]
Edwin Kempin9ce4f552013-11-15 16:00:00 +01004187|===============================
4188|Field Name ||Description
4189|`display_name` |optional|
4190The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01004191|`description` |optional|
4192The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01004193|`warning` |optional|
4194Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01004195|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01004196The type of the configuration parameter. Can be `STRING`, `INT`,
4197`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01004198|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01004199The value of the configuration parameter as string. If the parameter
4200is inheritable this is the effective value which is deduced from
4201`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01004202|`values` |optional|
4203The list of values. Only set if the `type` is `ARRAY`.
Doug Claar1b0f76252016-03-23 13:34:55 -07004204|`editable` |`false` if not set|
Edwin Kempin0d485232013-11-17 18:55:48 +01004205Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01004206|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01004207The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01004208|`inheritable` |`false` if not set|
4209Whether the configuration parameter can be inherited.
4210|`configured_value`|optional|
4211The value of the configuration parameter that is configured on this
4212project, only set if `inheritable` is true.
4213|`inherited_value` |optional|
4214The inherited value of the configuration parameter, only set if
4215`inheritable` is true.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01004216|===============================
4217
Edwin Kempin55367622013-02-05 09:09:23 +01004218[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004219=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01004220The `DashboardInfo` entity contains information about a project
4221dashboard.
4222
David Pursehouseae367192014-11-25 17:24:47 +09004223[options="header",cols="1,^2,4"]
Edwin Kempin55367622013-02-05 09:09:23 +01004224|===============================
4225|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01004226|`id` ||
4227The ID of the dashboard. The ID has the format '<ref>:<path>',
4228where ref and path are URL encoded.
4229|`project` ||
4230The name of the project for which this dashboard is returned.
4231|`defining_project`||
4232The name of the project in which this dashboard is defined.
4233This is different from `project` if the dashboard is inherited from a
4234parent project.
4235|`ref` ||
4236The name of the ref in which the dashboard is defined, without the
4237`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
4238|`path` ||
4239The path of the file in which the dashboard is defined.
4240|`description` |optional|The description of the dashboard.
4241|`foreach` |optional|
4242Subquery that applies to all sections in the dashboard. +
4243Tokens such as `${project}` are not resolved.
4244|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09004245The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01004246The URL is relative to the canonical web URL. +
4247Tokens in the queries such as `${project}` are resolved.
David Pursehouse8edc1992017-09-15 17:12:09 +09004248|`is_default` |not set if `false`|
Edwin Kempin55367622013-02-05 09:09:23 +01004249Whether this is the default dashboard of the project.
4250|`title` |optional|The title of the dashboard.
4251|`sections` ||
4252The list of link:#dashboard-section-info[sections] in the dashboard.
4253|===============================
4254
Edwin Kempin67e923c2013-02-14 13:57:12 +01004255[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004256=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01004257The `DashboardInput` entity contains information to create/update a
4258project dashboard.
4259
David Pursehouseae367192014-11-25 17:24:47 +09004260[options="header",cols="1,^2,4"]
Edwin Kempin67e923c2013-02-14 13:57:12 +01004261|=============================
4262|Field Name ||Description
4263|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01004264URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01004265|`commit_message`|optional|
4266Message that should be used to commit the change of the dashboard.
4267|=============================
4268
Edwin Kempin55367622013-02-05 09:09:23 +01004269[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004270=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01004271The `DashboardSectionInfo` entity contains information about a section
4272in a dashboard.
4273
David Pursehouseae367192014-11-25 17:24:47 +09004274[options="header",cols="1,6"]
Edwin Kempin55367622013-02-05 09:09:23 +01004275|===========================
4276|Field Name |Description
4277|`name` |The title of the section.
4278|`query` |The query of the section. +
4279Tokens such as `${project}` are not resolved.
4280|===========================
4281
Edwin Kempin920f6f82019-10-28 10:43:13 +01004282[[delete-label-input]]
4283=== DeleteLabelInput
4284The `DeleteLabelInput` entity contains information for deleting a label
4285definition in a project.
4286
4287[options="header",cols="1,^2,4"]
4288|=============================
4289|Field Name ||Description
4290|`commit_message`|optional|
4291Message that should be used to commit the deletion of the label in the
4292`project.config` file to the `refs/meta/config` branch.
4293|=============================
4294
Hugo Arèsef8e3202015-01-12 15:09:06 -05004295[[delete-branches-input]]
4296=== DeleteBranchesInput
4297The `DeleteBranchesInput` entity contains information about branches that should
4298be deleted.
4299
4300[options="header",width="50%",cols="1,6"]
4301|==========================
4302|Field Name |Description
4303|`branches` |A list of branch names that identify the branches that should be
4304deleted.
4305|==========================
4306
David Pursehouse467aecb2016-12-02 14:18:42 +09004307[[delete-tags-input]]
4308=== DeleteTagsInput
4309The `DeleteTagsInput` entity contains information about tags that should
4310be deleted.
4311
4312[options="header",width="50%",cols="1,6"]
4313|==========================
4314|Field Name |Description
4315|`tags` |A list of tag names that identify the tags that should be
4316deleted.
4317|==========================
4318
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01004319[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004320=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01004321The `GCInput` entity contains information to run the Git garbage
4322collection.
4323
David Pursehouseae367192014-11-25 17:24:47 +09004324[options="header",cols="1,^2,4"]
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01004325|=============================
4326|Field Name ||Description
4327|`show_progress` |`false` if not set|
4328Whether progress information should be shown.
Christian Halstrick2f94e2e2015-03-11 15:13:31 +01004329|`aggressive` |`false` if not set|
4330Whether an aggressive garbage collection should be done.
Adrian Görler92410a12015-11-03 16:20:56 +01004331|`async` |`false` if not set|
4332Whether the garbage collection should run asynchronously.
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01004333|=============================
4334
Edwin Kempin6b813372013-03-13 17:07:33 +01004335[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004336=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01004337The `HeadInput` entity contains information for setting `HEAD` for a
4338project.
4339
David Pursehouseae367192014-11-25 17:24:47 +09004340[options="header",cols="1,6"]
Edwin Kempin6b813372013-03-13 17:07:33 +01004341|============================
4342|Field Name |Description
4343|`ref` |
4344The ref to which `HEAD` should be set, the `refs/heads` prefix can be
4345omitted.
4346|============================
4347
Patrick Hiesel20d981e2018-07-04 09:48:21 +02004348[[index-project-input]]
4349=== IndexProjectInput
4350The `IndexProjectInput` contains parameters for indexing a project.
4351
4352[options="header",cols="1,^2,4"]
4353|================================
4354|Field Name ||Description
4355|`index_children` ||
4356If children should be indexed recursively.
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02004357|`async` ||
4358If projects should be indexed asynchronously.
Patrick Hiesel20d981e2018-07-04 09:48:21 +02004359|================================
4360
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004361[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004362=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004363A boolean value that can also be inherited.
4364
David Pursehouseae367192014-11-25 17:24:47 +09004365[options="header",cols="1,^2,4"]
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004366|================================
4367|Field Name ||Description
4368|`value` ||
4369The effective boolean value.
4370|`configured_value` ||
Paladox none348de182022-05-23 13:58:03 +00004371The configured value, can be `TRUE`, `FALSE` or `INHERIT`.
Edwin Kempin0cb5a562013-07-12 15:41:04 +02004372|`inherited_value` |optional|
4373The boolean value inherited from the parent. +
4374Not set if there is no parent.
4375|================================
4376
Edwin Kempin44098d02019-10-24 09:22:34 +02004377[[label-definition-info]]
4378=== LabelDefinitionInfo
Edwin Kempin07bd7132019-11-11 13:11:00 +01004379The `LabelDefinitionInfo` entity describes a link:config-labels.html[
Edwin Kempin44098d02019-10-24 09:22:34 +02004380review label].
4381
4382[options="header",cols="1,^2,4"]
4383|=============================
4384|Field Name ||Description
4385|`name` ||
4386The link:config-labels.html#label_name[name] of the label.
Youssef Elghareeb261691a2021-11-17 13:01:08 +01004387|`description` |optional|
4388The description of the label.
Edwin Kempinb5275262019-10-24 16:03:27 +02004389|`project_name` ||
4390The name of the project in which this label is defined.
Edwin Kempin44098d02019-10-24 09:22:34 +02004391|`function` ||
4392The link:config-labels.html#label_function[function] of the label (can be
4393`MaxWithBlock`, `AnyWithBlock`, `MaxNoBlock`, `NoBlock`, `NoOp` and `PatchSetLock`.
4394|`values` ||
4395The link:config-labels.html#label_value[values] of the label as a map of label
4396value to value description. The label values are formatted strings, e.g. "+1"
4397instead of "1", " 0" instead of "0".
4398|`default_value` ||
4399The link:config-labels.html#label_defaultValue[default value] of the label (as
4400integer).
4401|`branches` |optional|
4402A list of link:config-labels.html#label_branch[branches] for which the label
4403applies. A branch can be a ref, a ref pattern or a regular expression. If not
4404set, the label applies for all branches.
4405|`can_override` |`false` if not set|
4406Whether this label can be link:config-labels.html#label_canOverride[overridden]
4407by child projects.
Patrick Hieselc429ff32021-06-01 15:56:30 +02004408|`copy_condition`|optional|
4409See link:config-labels.html#label_copyCondition[copyCondition].
Edwin Kempin44098d02019-10-24 09:22:34 +02004410|`allow_post_submit`|`false` if not set|
4411Whether link:config-labels.html#label_allowPostSubmit[allowPostSubmit] is set
4412on the label.
4413|`ignore_self_approval`|`false` if not set|
4414Whether link:config-labels.html#label_ignoreSelfApproval[ignoreSelfApproval] is
4415set on the label.
4416|=============================
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02004417
Edwin Kempinb5e87452019-10-25 13:28:46 +02004418[[label-definition-input]]
4419=== LabelDefinitionInput
Edwin Kempin07bd7132019-11-11 13:11:00 +01004420The `LabelDefinitionInput` entity describes a link:config-labels.html[
Edwin Kempinb5e87452019-10-25 13:28:46 +02004421review label].
4422
4423[options="header",cols="1,^2,4"]
4424|=============================
4425|Field Name ||Description
4426|`commit_message`|optional|
4427Message that should be used to commit the change of the label in the
Edwin Kempin83d6d222019-10-28 13:45:52 +01004428`project.config` file to the `refs/meta/config` branch.+
4429Must not be set if this `LabelDefinitionInput` entity is contained in a
4430link:#batch-label-input[BatchLabelInput] entity.
Edwin Kempinb5e87452019-10-25 13:28:46 +02004431|`name` |optional|
Edwin Kempin83d6d222019-10-28 13:45:52 +01004432The new link:config-labels.html#label_name[name] of the label.+
4433For label creation the name is required if this `LabelDefinitionInput` entity
4434is contained in a link:#batch-label-input[BatchLabelInput]
4435entity.
Youssef Elghareeb261691a2021-11-17 13:01:08 +01004436|`description` |optional|
4437The new description for the label.
Edwin Kempinb5e87452019-10-25 13:28:46 +02004438|`function` |optional|
4439The new link:config-labels.html#label_function[function] of the label (can be
4440`MaxWithBlock`, `AnyWithBlock`, `MaxNoBlock`, `NoBlock`, `NoOp` and `PatchSetLock`.
4441|`values` |optional|
4442The new link:config-labels.html#label_value[values] of the label as a map of
4443label value to value description. The label values are formatted strings, e.g.
4444"+1" instead of "1", " 0" instead of "0".
4445|`default_value` |optional|
4446The new link:config-labels.html#label_defaultValue[default value] of the label
4447(as integer).
4448|`branches` |optional|
4449The new branches for which the label applies as a list of
4450link:config-labels.html#label_branch[branches]. A branch can be a ref, a ref
4451pattern or a regular expression. If not set, the label applies for all
4452branches.
4453|`can_override` |optional|
4454Whether this label can be link:config-labels.html#label_canOverride[overridden]
4455by child projects.
Patrick Hieselc429ff32021-06-01 15:56:30 +02004456|`copy_condition`|optional|
4457See link:config-labels.html#label_copyCondition[copyCondition].
4458|`unset_copy_condition`|optional|
4459If true, clears the value stored in `copy_condition`.
Edwin Kempinb5e87452019-10-25 13:28:46 +02004460|`allow_post_submit`|optional|
4461Whether link:config-labels.html#label_allowPostSubmit[allowPostSubmit] is set
4462on the label.
4463|`ignore_self_approval`|optional|
4464Whether link:config-labels.html#label_ignoreSelfApproval[ignoreSelfApproval] is
4465set on the label.
4466|=============================
4467
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02004468[[label-type-info]]
4469=== LabelTypeInfo
4470The `LabelTypeInfo` entity contains metadata about the labels that a
4471project has.
4472
4473[options="header",cols="1,^2,4"]
4474|================================
4475|Field Name ||Description
4476|`values` ||Map of the available values to their description.
4477|`default_value` ||The default value of this label.
4478|================================
4479
Edwin Kempin3c99f592013-07-15 10:12:27 +02004480[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004481=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02004482The `MaxObjectSizeLimitInfo` entity contains information about the
4483link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
4484limit] of a project.
4485
David Pursehouseae367192014-11-25 17:24:47 +09004486[options="header",cols="1,^2,4"]
Edwin Kempin3c99f592013-07-15 10:12:27 +02004487|===============================
4488|Field Name ||Description
4489|`value` |optional|
David Pursehouse33f544a2018-08-20 12:20:18 +09004490The effective value in bytes of the max object size limit. +
Edwin Kempin3c99f592013-07-15 10:12:27 +02004491Not set if there is no limit for the object size.
4492|`configured_value`|optional|
4493The max object size limit that is configured on the project as a
4494formatted string. +
4495Not set if there is no limit for the object size configured on project
4496level.
David Pursehouse81f2b5c2018-08-23 14:44:14 +09004497|`summary` |optional|
4498A string describing whether the value was inherited or overridden from
4499the parent project or global config. +
4500Not set if not inherited or overridden.
Edwin Kempin3c99f592013-07-15 10:12:27 +02004501|===============================
4502
Edwin Kempin83d6d222019-10-28 13:45:52 +01004503[[batch-label-input]]
4504=== BatchLabelInput
4505The `BatchLabelInput` entity contains information for batch updating label
4506definitions in a project.
4507
4508[options="header",cols="1,^2,4"]
4509|=============================
4510|Field Name ||Description
4511|`commit_message`|optional|
4512Message that should be used to commit the label updates in the
4513`project.config` file to the `refs/meta/config` branch.
4514|`delete` |optional|
4515List of labels that should be deleted.
4516|`create` |optional|
4517List of link:#label-definition-input[LabelDefinitionInput] entities that
4518describe labels that should be created.
4519|`update` |optional|
4520Map of label names to link:#label-definition-input[LabelDefinitionInput]
4521entities that describe the updates that should be done for the labels.
4522|=============================
4523
Patrick Hiesel21816f12016-04-22 08:53:06 +02004524[[project-access-input]]
4525=== ProjectAccessInput
4526The `ProjectAccessInput` describes changes that should be applied to a project
4527access config.
4528
4529[options="header",cols="1,^2,4"]
4530|=============================
4531|Field Name | |Description
4532|`remove` |optional|
4533A list of deductions to be applied to the project access as
4534link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
4535|`add` |optional|
4536A list of additions to be applied to the project access as
4537link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
4538|`message` |optional|
4539A commit message for this change.
4540|`parent` |optional|
4541A new parent for the project to inherit from. Changing the parent project
4542requires administrative privileges.
4543|=============================
4544
Edwin Kempin57f303c2013-02-13 15:52:22 +01004545[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004546=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01004547The `ProjectDescriptionInput` entity contains information for setting a
4548project description.
4549
David Pursehouseae367192014-11-25 17:24:47 +09004550[options="header",cols="1,^2,4"]
Edwin Kempin57f303c2013-02-13 15:52:22 +01004551|=============================
4552|Field Name ||Description
4553|`description` |optional|The project description. +
4554The project description will be deleted if not set.
4555|`commit_message`|optional|
4556Message that should be used to commit the change of the project
4557description in the `project.config` file to the `refs/meta/config`
4558branch.
4559|=============================
4560
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004561[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004562=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004563The `ProjectInfo` entity contains information about a project.
4564
David Pursehouseae367192014-11-25 17:24:47 +09004565[options="header",cols="1,^2,4"]
Edwin Kempin00cab362023-08-16 14:33:57 +00004566|=============================
4567|Field Name ||Description
4568|`id` ||The URL encoded project name.
4569|`name` |
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004570not set if returned in a map where the project name is used as map key|
4571The name of the project.
Edwin Kempin00cab362023-08-16 14:33:57 +00004572|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004573The name of the parent project. +
4574`?-<n>` if the parent project is not visible (`<n>` is a number which
4575is increased for each non-visible project).
Edwin Kempin00cab362023-08-16 14:33:57 +00004576|`description` |optional|The description of the project.
4577|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
4578|`branches` |optional|Map of branch names to HEAD revisions.
4579|`labels` |optional|
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02004580Map of label names to
4581link:#label-type-info[LabelTypeInfo] entries.
4582This field is filled for link:#create-project[Create Project] and
4583link:#get-project[Get Project] calls.
Edwin Kempin00cab362023-08-16 14:33:57 +00004584|`web_links` |optional|
Edwin Kempinea004752014-04-11 15:56:02 +02004585Links to the project in external sites as a list of
4586link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin00cab362023-08-16 14:33:57 +00004587|`_more_projects`|optional, not set if `false`|
4588Whether the query would deliver more results if not limited. +
4589Only set on the last project that is returned.
4590|=============================
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004591
Bruce Zu798ea122013-02-18 16:55:43 +08004592[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004593=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08004594The `ProjectInput` entity contains information for the creation of
4595a new project.
4596
David Pursehouseae367192014-11-25 17:24:47 +09004597[options="header",cols="1,^2,4"]
Bruce Zu798ea122013-02-18 16:55:43 +08004598|=========================================
4599|Field Name ||Description
4600|`name` |optional|
4601The name of the project (not encoded). +
David Pursehouse8c5ad412015-02-03 14:19:09 +09004602If set, must match the project name in the URL. +
4603If name ends with `.git` the suffix will be automatically removed.
Bruce Zu798ea122013-02-18 16:55:43 +08004604|`parent` |optional|
4605The name of the parent project. +
4606If not set, the `All-Projects` project will be the parent project.
4607|`description` |optional|The description of the project.
4608|`permissions_only` |`false` if not set|
4609Whether a permission-only project should be created.
4610|`create_empty_commit` |`false` if not set|
4611Whether an empty initial commit should be created.
4612|`submit_type` |optional|
4613The submit type that should be set for the project
Gert van Dijka4e49d02017-08-27 22:50:40 +02004614(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`,
4615`FAST_FORWARD_ONLY`, `MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01004616If not set, `MERGE_IF_NECESSARY` is set as submit type unless
4617link:config-gerrit.html#repository.name.defaultSubmitType[
4618repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08004619|`branches` |optional|
4620A list of branches that should be initially created. +
Han-Wen Nienhuys5a0f5cb2020-11-24 19:13:55 +01004621For the branch names the `refs/heads/` prefix can be omitted. +
Marija Savtchouk714fbff2021-03-12 16:02:12 +00004622The first entry of the list will be the
4623link:project-configuration.html#default-branch[default branch]. +
4624If the list is empty, link:config-gerrit.html#gerrit.defaultBranch[host-level default]
4625is used. +
Youssef Elghareeb5b944612021-02-17 14:50:12 +01004626Branches in the Gerrit internal ref space are not allowed, such as
4627refs/groups/, refs/changes/, etc...
Bruce Zu798ea122013-02-18 16:55:43 +08004628|`owners` |optional|
4629A list of groups that should be assigned as project owner. +
4630Each group in the list must be specified as
4631link:rest-api-groups.html#group-id[group-id]. +
4632If not set, the link:config-gerrit.html#repository.name.ownerGroup[
4633groups that are configured as default owners] are set as project
4634owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004635|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004636Whether contributor agreements should be used for the project (`TRUE`,
4637`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02004638|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004639Whether the usage of 'Signed-Off-By' footers is required for the
4640project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02004641|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
4642Whether a new change is created for every commit not in target branch
4643for the project (`TRUE`, `FALSE`, `INHERIT`).
4644|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004645Whether content merge should be enabled for the project (`TRUE`,
4646`FALSE`, `INHERIT`). +
4647`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02004648|`require_change_id` |`INHERIT` if not set|
4649Whether the usage of Change-Ids is required for the project (`TRUE`,
4650`FALSE`, `INHERIT`).
4651This property is deprecated and will be removed in
4652a future release.
David Ostrovsky1c6ff2e2018-09-18 07:52:51 +02004653|`enable_signed_push` |`INHERIT` if not set|
4654Whether signed push validation is enabled on the project (`TRUE`,
4655`FALSE`, `INHERIT`).
4656|`require_signed_push` |`INHERIT` if not set|
4657Whether signed push validation is required on the project (`TRUE`,
4658`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02004659|`max_object_size_limit` |optional|
4660Max allowed Git object size for this project.
4661Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01004662|`plugin_config_values` |optional|
4663Plugin configuration values as map which maps the plugin name to a map
4664of parameter names to values.
Patrick Hieseldc285c72018-01-08 17:20:15 +01004665|`reject_empty_commit` |optional|
4666Whether empty commits should be rejected when a change is merged
4667(`TRUE`, `FALSE`, `INHERIT`).
Bruce Zu798ea122013-02-18 16:55:43 +08004668|=========================================
4669
Edwin Kempinecad88c2013-02-14 12:09:44 +01004670[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004671=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01004672The `ProjectParentInput` entity contains information for setting a
4673project parent.
4674
David Pursehouseae367192014-11-25 17:24:47 +09004675[options="header",cols="1,^2,4"]
Edwin Kempinecad88c2013-02-14 12:09:44 +01004676|=============================
4677|Field Name ||Description
4678|`parent` ||The name of the parent project.
4679|`commit_message`|optional|
4680Message that should be used to commit the change of the project parent
4681in the `project.config` file to the `refs/meta/config` branch.
4682|=============================
4683
Edwin Kempin87504d92014-07-04 12:59:19 +02004684[[reflog-entry-info]]
4685=== ReflogEntryInfo
4686The `ReflogEntryInfo` entity describes an entry in a reflog.
4687
David Pursehouseae367192014-11-25 17:24:47 +09004688[options="header",cols="1,6"]
Edwin Kempin87504d92014-07-04 12:59:19 +02004689|============================
4690|Field Name |Description
4691|`old_id` |The old commit ID.
4692|`new_id` |The new commit ID.
4693|`who` |
4694The user performing the change as a
4695link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
4696|`comment` |Comment of the reflog entry.
4697|============================
4698
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004699[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004700=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004701The `RepositoryStatisticsInfo` entity contains information about
4702statistics of a Git repository.
4703
David Pursehouseae367192014-11-25 17:24:47 +09004704[options="header",cols="1,6"]
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004705|======================================
4706|Field Name |Description
4707|`number_of_loose_objects` |Number of loose objects.
4708|`number_of_loose_refs` |Number of loose refs.
4709|`number_of_pack_files` |Number of pack files.
4710|`number_of_packed_objects`|Number of packed objects.
4711|`number_of_packed_refs` |Number of packed refs.
4712|`size_of_loose_objects` |Size of loose objects in bytes.
4713|`size_of_packed_objects` |Size of packed objects in bytes.
4714|======================================
4715
Youssef Elghareeb859b0522021-05-21 00:34:59 +02004716[[submit-requirement-info]]
4717=== SubmitRequirementInfo
4718The `SubmitRequirementInfo` entity describes a submit requirement.
4719
4720[options="header",cols="1,^1,5"]
4721|===========================
4722|Field Name ||Description
4723|`name`||
4724The submit requirement name.
4725|`description`|optional|
4726Description of the submit requirement.
4727|`applicability_expression`|optional|
4728Query expression that can be evaluated on any change. If evaluated to true on a
4729change, the submit requirement is then applicable for this change.
4730If not specified, the submit requirement is applicable for all changes.
4731|`submittability_expression`||
4732Query expression that can be evaluated on any change. If evaluated to true on a
4733change, the submit requirement is fulfilled and not blocking change submission.
4734|`override_expression`|optional|
4735Query expression that can be evaluated on any change. If evaluated to true on a
4736change, the submit requirement is overridden and not blocking change submission.
4737|`allow_override_in_child_projects`||
4738Whether this submit requirement can be overridden in child projects.
4739|===========================
4740
4741[[submit-requirement-input]]
4742=== SubmitRequirementInput
4743The `SubmitRequirementInput` entity describes a submit requirement.
4744
4745[options="header",cols="1,^1,5"]
4746|===========================
4747|Field Name ||Description
4748|`name`||
4749The submit requirement name.
4750|`description`|optional|
4751Description of the submit requirement.
4752|`applicability_expression`|optional|
4753Query expression that can be evaluated on any change. If evaluated to true on a
4754change, the submit requirement is then applicable for this change.
4755If not specified, the submit requirement is applicable for all changes.
4756|`submittability_expression`||
4757Query expression that can be evaluated on any change. If evaluated to true on a
4758change, the submit requirement is fulfilled and not blocking change submission.
4759|`override_expression`|optional|
4760Query expression that can be evaluated on any change. If evaluated to true on a
4761change, the submit requirement is overridden and not blocking change submission.
4762|`allow_override_in_child_projects`|optional|
4763Whether this submit requirement can be overridden in child projects. Default is
4764`false`.
4765|===========================
4766
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004767[[submit-type-info]]
4768=== SubmitTypeInfo
Changcheng Xiao21885982019-01-15 18:16:51 +01004769Information about the link:config-project-config.html#submit-type[default submit
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004770type of a project], taking into account project inheritance.
4771
4772Valid values for each field are `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
4773`REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or `CHERRY_PICK`, plus
4774`INHERIT` where applicable.
4775
4776[options="header",cols="1,6"]
4777|===============================
4778|Field Name |Description
4779|`value` |
4780The effective submit type value. Never `INHERIT`.
4781|`configured_value` |
4782The configured value, can be one of the submit types, or `INHERIT` to inherit
4783from the parent project.
4784|`inherited_value` |
4785The effective value that would be inherited from the parent. Never `INHERIT`.
4786|===============================
4787
David Pursehouse8cc68902014-10-06 18:17:16 +09004788[[tag-info]]
4789=== TagInfo
4790The `TagInfo` entity contains information about a tag.
4791
David Pursehouseae367192014-11-25 17:24:47 +09004792[options="header",cols="1,^2,4"]
David Pursehouse8cc68902014-10-06 18:17:16 +09004793|=========================
4794|Field Name ||Description
4795|`ref` ||The ref of the tag.
4796|`revision` ||For lightweight tags, the revision of the commit to which the tag
4797points. For annotated tags, the revision of the tag object.
4798|`object`|Only set for annotated tags.|The revision of the object to which the
4799tag points.
4800|`message`|Only set for annotated tags.|The tag message. For signed tags, includes
4801the signature.
David Pursehousec9f5a5a2015-12-07 19:13:16 +09004802|`tagger`|Only set for annotated tags, if present in the tag.|The tagger as a
David Pursehouse8cc68902014-10-06 18:17:16 +09004803link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
David Pursehousec4e4d932017-11-10 10:17:46 +09004804|`created`|optional|The link:rest-api.html#timestamp[timestamp] of when the tag
4805was created. For annotated and signed tags, this is the timestamp of the tag object
4806and is the same as the `date` field in the `tagger`. For lightweight tags, it is
4807the commit timestamp of the commit to which the tag points, when the object is a
4808commit. It is not set when the object is any other type.
David Pursehoused00515e2017-11-10 15:57:41 +09004809|`can_delete`|not set if `false`|
David Pursehouse23669da2017-02-23 13:43:57 +09004810Whether the calling user can delete this tag.
Paladox none34da15c2017-07-01 14:49:10 +00004811|`web_links` |optional|
4812Links to the tag in external sites as a list of
4813link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse8cc68902014-10-06 18:17:16 +09004814|=========================
4815
David Pursehouse6a446192016-06-03 10:00:34 +09004816[[tag-input]]
4817=== TagInput
4818
4819The `TagInput` entity contains information for creating a tag.
4820
4821[options="header",cols="1,^2,4"]
4822|=========================
4823|Field Name ||Description
4824|`ref` ||The name of the tag. The leading `refs/tags/` is optional.
4825|`revision` |optional|The revision to which the tag should point. If not
4826specified, the project's `HEAD` will be used.
4827|`message` |optional|The tag message. When set, the tag will be created
4828as an annotated tag.
4829|=========================
4830
4831
Edwin Kempind0a63922013-01-23 16:32:59 +01004832GERRIT
4833------
4834Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07004835
4836SEARCHBOX
4837---------