blob: a4e27b3b52ca82eb0dc0597d9e56145da3d5be0c [file] [log] [blame]
Marian Harbachebeb1542019-12-13 10:42:46 +01001:linkattrs:
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002= Gerrit Code Review - /projects/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01003
4This page describes the project related REST endpoints.
5Please also take note of the general information on the
6link:rest-api.html[REST API].
7
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01008[[project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08009== Project Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +010010
Edwin Kempin76202742013-02-15 13:51:50 +010011[[list-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080012=== List Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080013--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010014'GET /projects/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080015--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010016
Edwin Kempind0a63922013-01-23 16:32:59 +010017Lists the projects accessible by the caller. This is the same as
18using the link:cmd-ls-projects.html[ls-projects] command over SSH,
19and accepts the same options as query parameters.
20
Edwin Kempin51a6dc92013-02-04 15:43:59 +010021As result a map is returned that maps the project names to
22link:#project-info[ProjectInfo] entries. The entries in the map are sorted
23by project name.
24
Edwin Kempin37440832013-02-06 11:36:00 +010025.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010026----
27 GET /projects/?d HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010028----
Edwin Kempind0a63922013-01-23 16:32:59 +010029
Edwin Kempin37440832013-02-06 11:36:00 +010030.Response
31----
Edwin Kempind0a63922013-01-23 16:32:59 +010032 HTTP/1.1 200 OK
33 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090034 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010035
36 )]}'
37 {
38 "external/bison": {
Edwin Kempind0a63922013-01-23 16:32:59 +010039 "id": "external%2Fbison",
40 "description": "GNU parser generator"
41 },
42 "external/gcc": {
Edwin Kempin068511b2015-01-20 09:17:12 +010043 "id": "external%2Fgcc"
Edwin Kempind0a63922013-01-23 16:32:59 +010044 },
45 "external/openssl": {
Edwin Kempind0a63922013-01-23 16:32:59 +010046 "id": "external%2Fopenssl",
47 "description": "encryption\ncrypto routines"
48 },
49 "test": {
Edwin Kempind0a63922013-01-23 16:32:59 +010050 "id": "test",
51 "description": "\u003chtml\u003e is escaped"
52 }
53 }
54----
55
Hugo Arèsbdd7f682014-07-08 10:57:52 -040056[[project-options]]
57==== Project Options
58
59Branch(b)::
60Limit the results to the projects having the specified branch and
61include the sha1 of the branch in the results.
62+
63Get projects that have a 'master' branch:
64+
65.Request
66----
67GET /projects/?b=master HTTP/1.0
68----
69+
70.Response
71----
72 HTTP/1.1 200 OK
73 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090074 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -040075
76 )]}'
77 {
78 "some-project": {
79 "id": "some-project",
80 "branches": {
81 "master": "c5ed9dfcbf002ca0e432d788dab6ca2387829ca7"
82 }
83 },
84 "some-other-project": {
85 "id": "some-other-project",
86 "branches": {
87 "master": "ef1c270142f9581ecf768f4193fc8f8a81102ec2"
88 }
89 },
90 }
91----
92
93Description(d)::
94Include project description in the results.
95+
96Get all the projects with their description:
97+
98.Request
99----
100GET /projects/?d HTTP/1.0
101----
102+
103.Response
104----
105 HTTP/1.1 200 OK
106 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900107 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400108
109 )]}'
110 {
111 "some-project": {
112 "id": "some-project",
113 "description": "Description of some project."
114 },
115 "some-other-project": {
116 "id": "some-other-project",
117 "description": "Description of some other project."
118 }
119 },
120 }
121----
122
123Limit(n)::
124Limit the number of projects to be included in the results.
125+
126Query the first project in the project list:
127+
128.Request
129----
130 GET /projects/?n=1 HTTP/1.0
131----
132+
133.Response
134----
135 HTTP/1.1 200 OK
136 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900137 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400138
139 )]}'
140 {
141 "some-project": {
142 "id": "some-project"
143 }
144 }
145----
146
Edwin Kempina64c4b92013-01-23 11:30:40 +0100147
Edwin Kempind0a63922013-01-23 16:32:59 +0100148[[suggest-projects]]
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400149Prefix(p)::
150Limit the results to those projects that start with the specified
Edwin Kempind0a63922013-01-23 16:32:59 +0100151prefix.
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400152+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900153The match is case sensitive. May not be used together with `m` or `r`.
154+
Edwin Kempind0a63922013-01-23 16:32:59 +0100155List all projects that start with `platform/`:
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400156+
Edwin Kempin37440832013-02-06 11:36:00 +0100157.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100158----
159 GET /projects/?p=platform%2F HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100160----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400161+
Edwin Kempin37440832013-02-06 11:36:00 +0100162.Response
163----
Edwin Kempind0a63922013-01-23 16:32:59 +0100164 HTTP/1.1 200 OK
165 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900166 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100167
168 )]}'
169 {
170 "platform/drivers": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100171 "id": "platform%2Fdrivers"
Edwin Kempind0a63922013-01-23 16:32:59 +0100172 },
173 "platform/tools": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100174 "id": "platform%2Ftools"
Edwin Kempind0a63922013-01-23 16:32:59 +0100175 }
176 }
177----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400178+
Edwin Kempind0a63922013-01-23 16:32:59 +0100179E.g. this feature can be used by suggestion client UI's to limit results.
180
Hugo Arèsb8aae412014-07-08 11:04:43 -0400181Regex(r)::
182Limit the results to those projects that match the specified regex.
183+
184Boundary matchers '^' and '$' are implicit. For example: the regex 'test.*' will
185match any projects that start with 'test' and regex '.*test' will match any
186project that end with 'test'.
187+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900188The match is case sensitive. May not be used together with `m` or `p`.
189+
Hugo Arèsb8aae412014-07-08 11:04:43 -0400190List all projects that match regex `test.*project`:
191+
192.Request
193----
194 GET /projects/?r=test.*project HTTP/1.0
195----
196+
197.Response
198----
199 HTTP/1.1 200 OK
200 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900201 Content-Type: application/json; charset=UTF-8
Hugo Arèsb8aae412014-07-08 11:04:43 -0400202
203 )]}'
204 {
205 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100206 "id": "test%2Fsome-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400207 },
208 "test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100209 "id": "test%2Fsome-other-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400210 }
211 }
212
213----
214
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400215Skip(S)::
216Skip the given number of projects from the beginning of the list.
217+
218Query the second project in the project list:
219+
220.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400221----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400222 GET /projects/?n=1&S=1 HTTP/1.0
223----
224+
225.Response
226----
227 HTTP/1.1 200 OK
228 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900229 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400230
231 )]}'
232 {
233 "some-other-project": {
234 "id": "some-other-project"
235 }
236 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400237----
238
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400239Substring(m)::
240Limit the results to those projects that match the specified substring.
241+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900242The match is case insensitive. May not be used together with `r` or `p`.
243+
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400244List all projects that match substring `test/`:
245+
246.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400247----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400248 GET /projects/?m=test%2F HTTP/1.0
249----
250+
251.Response
252----
253 HTTP/1.1 200 OK
254 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900255 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400256
257 )]}'
258 {
259 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100260 "id": "test%2Fsome-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400261 },
262 "some-path/test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100263 "id": "some-path%2Ftest%2Fsome-other-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400264 }
265 }
266----
267
268Tree(t)::
269Get projects inheritance in a tree-like format. This option does
270not work together with the branch option.
271+
272Get all the projects with tree option:
273+
274.Request
275----
276GET /projects/?t HTTP/1.0
277----
278+
279.Response
280----
281 HTTP/1.1 200 OK
282 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900283 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400284
285 )]}'
286 {
287 "All-Projects" {
288 "id": "All-Projects"
289 },
290 "child-project": {
291 "id": "child-project",
Edwin Kempine813c5a2019-03-13 09:51:12 +0100292 "parent": "parent-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400293 },
294 "parent-project": {
295 "id": "parent-project",
Edwin Kempine813c5a2019-03-13 09:51:12 +0100296 "parent": "All-Projects"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400297 }
298 }
299----
300
301Type(type)::
302Get projects with specified type: ALL, CODE, PERMISSIONS.
303+
304Get all the projects of type 'PERMISSIONS':
305+
306.Request
307----
308GET /projects/?type=PERMISSIONS HTTP/1.0
309----
310+
311.Response
312----
313 HTTP/1.1 200 OK
314 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900315 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400316
317 )]}'
318 {
319 "All-Projects" {
320 "id": "All-Projects"
321 },
322 "some-parent-project": {
323 "id": "some-parent-project"
324 }
325 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400326----
327
David Pursehousec141bd32017-11-15 21:42:14 +0900328All::
David Pursehouse54508762017-11-28 13:37:48 +0900329Get all projects, including those whose state is "HIDDEN". May not be used
330together with the `state` option.
David Pursehousec141bd32017-11-15 21:42:14 +0900331+
332.Request
333----
334GET /projects/?all HTTP/1.0
335----
336+
337.Response
338----
339 HTTP/1.1 200 OK
340 Content-Disposition: attachment
341 Content-Type: application/json; charset=UTF-8
342
343 )]}'
344 {
345 "All-Projects" {
346 "id": "All-Projects",
347 "state": "ACTIVE"
348 },
349 "some-other-project": {
350 "id": "some-other-project",
351 "state": "HIDDEN"
352 }
353 }
354----
355
David Pursehouse54508762017-11-28 13:37:48 +0900356State(s)::
357Get all projects with the given state. May not be used together with the
358`all` option.
359+
360.Request
361----
362GET /projects/?state=HIDDEN HTTP/1.0
363----
364+
365.Response
366----
367 HTTP/1.1 200 OK
368 Content-Disposition: attachment
369 Content-Type: application/json; charset=UTF-8
370
371 )]}'
372 {
373 "some-other-project": {
374 "id": "some-other-project",
375 "state": "HIDDEN"
376 }
377 }
378----
379
Xin Sund8dd1532017-07-18 17:13:52 -0700380[[query-projects]]
381=== Query Projects
382--
383'GET /projects/?query=<query>'
384--
385
386Queries projects visible to the caller. The
387link:user-search-projects.html#_search_operators[query string] must be
388provided by the `query` parameter. The `start` and `limit` parameters
389can be used to skip/limit results.
390
391As result a list of link:#project-info[ProjectInfo] entities is returned.
392
393.Request
394----
395 GET /projects/?query=name:test HTTP/1.0
396----
397
398.Response
399----
400 HTTP/1.1 200 OK
401 Content-Disposition: attachment
402 Content-Type: application/json; charset=UTF-8
403
404 )]}'
405 {
406 "test": {
407 "id": "test",
408 "description": "\u003chtml\u003e is escaped"
409 }
410 }
411----
412
413[[project-query-limit]]
414==== Project Limit
415The `/projects/?query=<query>` URL also accepts a limit integer in the
416`limit` parameter. This limits the results to `limit` projects.
417
418Query the first 25 projects in project list.
419----
420 GET /projects/?query=<query>&limit=25 HTTP/1.0
421----
422
423The `/projects/` URL also accepts a start integer in the `start`
424parameter. The results will skip `start` groups from project list.
425
426Query 25 projects starting from index 50.
427----
428 GET /groups/?query=<query>&limit=25&start=50 HTTP/1.0
429----
430
431[[project-query-options]]
432==== Project Options
433Additional fields can be obtained by adding `o` parameters. Each option
434requires more lookups and slows down the query response time to the
435client so they are generally disabled by default. The supported fields
436are described in the context of the link:#project-options[List Projects]
437REST endpoint.
438
Edwin Kempin5c544e22013-03-06 13:35:45 +0100439[[get-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800440=== Get Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800441--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100442'GET /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800443--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100444
445Retrieves a project.
446
447.Request
448----
449 GET /projects/plugins%2Freplication HTTP/1.0
450----
451
452As response a link:#project-info[ProjectInfo] entity is returned that
453describes the project.
454
455.Response
456----
457 HTTP/1.1 200 OK
458 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900459 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c544e22013-03-06 13:35:45 +0100460
461 )]}'
462 {
Edwin Kempin5c544e22013-03-06 13:35:45 +0100463 "id": "plugins%2Freplication",
464 "name": "plugins/replication",
465 "parent": "Public-Plugins",
Shawn Pearce21a6c212014-04-23 12:35:10 -0700466 "description": "Copies to other servers using the Git protocol",
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +0200467 "state": "ACTIVE",
468 "labels": {
469 "Code-Review": {
470 "values": {
471 " 0": "No score",
472 "+1": "Approved"
473 },
474 "default_value": 0
475 }
476 }
Edwin Kempin5c544e22013-03-06 13:35:45 +0100477 }
478----
479
Bruce Zu798ea122013-02-18 16:55:43 +0800480[[create-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800481=== Create Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800482--
Bruce Zu798ea122013-02-18 16:55:43 +0800483'PUT /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800484--
Bruce Zu798ea122013-02-18 16:55:43 +0800485
486Creates a new project.
487
488In the request body additional data for the project can be provided as
489link:#project-input[ProjectInput].
490
491.Request
492----
493 PUT /projects/MyProject HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900494 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800495
496 {
497 "description": "This is a demo project.",
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400498 "submit_type": "INHERIT",
Bruce Zu798ea122013-02-18 16:55:43 +0800499 "owners": [
500 "MyProject-Owners"
501 ]
502 }
503----
504
505As response the link:#project-info[ProjectInfo] entity is returned that
506describes the created project.
507
508.Response
509----
510 HTTP/1.1 201 Created
511 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900512 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800513
514 )]}'
515 {
Bruce Zu798ea122013-02-18 16:55:43 +0800516 "id": "MyProject",
517 "name": "MyProject",
518 "parent": "All-Projects",
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +0200519 "description": "This is a demo project.",
520 "labels": {
521 "Code-Review": {
522 "values": {
523 " 0": "No score",
524 "+1": "Approved"
525 },
526 "default_value": 0
527 }
528 }
Bruce Zu798ea122013-02-18 16:55:43 +0800529 }
530----
531
Edwin Kempin57f303c2013-02-13 15:52:22 +0100532[[get-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800533=== Get Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800534--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100535'GET /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800536--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100537
Edwin Kempin57f303c2013-02-13 15:52:22 +0100538Retrieves the description of a project.
539
540.Request
541----
542 GET /projects/plugins%2Freplication/description HTTP/1.0
543----
544
545.Response
546----
547 HTTP/1.1 200 OK
548 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900549 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100550
551 )]}'
552 "Copies to other servers using the Git protocol"
553----
554
Edwin Kempinefec4492013-02-22 10:09:23 +0100555If the project does not have a description an empty string is returned.
556
Edwin Kempin57f303c2013-02-13 15:52:22 +0100557[[set-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800558=== Set Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800559--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100560'PUT /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800561--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100562
Edwin Kempin57f303c2013-02-13 15:52:22 +0100563Sets the description of a project.
564
565The new project description must be provided in the request body inside
566a link:#project-description-input[ProjectDescriptionInput] entity.
567
568.Request
569----
570 PUT /projects/plugins%2Freplication/description HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900571 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100572
573 {
574 "description": "Plugin for Gerrit that handles the replication.",
575 "commit_message": "Update the project description"
576 }
577----
578
579As response the new project description is returned.
580
581.Response
582----
583 HTTP/1.1 200 OK
584 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900585 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100586
587 )]}'
588 "Plugin for Gerrit that handles the replication."
589----
590
Edwin Kempin114ab162013-02-28 09:25:37 +0100591If the description was deleted the response is "`204 No Content`".
592
Edwin Kempin57f303c2013-02-13 15:52:22 +0100593[[delete-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800594=== Delete Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800595--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100596'DELETE /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800597--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100598
Edwin Kempin57f303c2013-02-13 15:52:22 +0100599Deletes the description of a project.
600
Edwin Kempin57f303c2013-02-13 15:52:22 +0100601.Request
602----
603 DELETE /projects/plugins%2Freplication/description HTTP/1.0
604----
605
606.Response
607----
608 HTTP/1.1 204 No Content
609----
610
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +0200611A commit message can be provided in the request body as a
612link:#project-description-input[ProjectDescriptionInput] entity.
613Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +0100614link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +0200615In this case, use link:#set-project-description[PUT] instead.
616
617.Request
618----
619 PUT /projects/plugins%2Freplication/description HTTP/1.0
620 Content-Type: application/json; charset=UTF-8
621
622 {
623 "commit_message": "Update the project description"
624 }
625----
626
627.Response
628----
629 HTTP/1.1 204 No Content
630----
631
Edwin Kempinecad88c2013-02-14 12:09:44 +0100632[[get-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800633=== Get Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800634--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100635'GET /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800636--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100637
Edwin Kempinecad88c2013-02-14 12:09:44 +0100638Retrieves the name of a project's parent project. For the
639`All-Projects` root project an empty string is returned.
640
641.Request
642----
643 GET /projects/plugins%2Freplication/parent HTTP/1.0
644----
645
646.Response
647----
648 HTTP/1.1 200 OK
649 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900650 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100651
652 )]}'
653 "All-Projects"
654----
655
656[[set-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800657=== Set Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800658--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100659'PUT /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800660--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100661
Edwin Kempinecad88c2013-02-14 12:09:44 +0100662Sets the parent project for a project.
663
664The new name of the parent project must be provided in the request body
665inside a link:#project-parent-input[ProjectParentInput] entity.
666
667.Request
668----
669 PUT /projects/plugins%2Freplication/parent HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900670 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100671
672 {
673 "parent": "Public-Plugins",
674 "commit_message": "Update the project parent"
675 }
676----
677
678As response the new parent project name is returned.
679
680.Response
681----
682 HTTP/1.1 200 OK
683 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900684 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100685
686 )]}'
687 "Public-Plugins"
688----
689
Edwin Kempin6b813372013-03-13 17:07:33 +0100690[[get-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800691=== Get HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800692--
Edwin Kempin6b813372013-03-13 17:07:33 +0100693'GET /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800694--
Edwin Kempin6b813372013-03-13 17:07:33 +0100695
696Retrieves for a project the name of the branch to which `HEAD` points.
697
698.Request
699----
700 GET /projects/plugins%2Freplication/HEAD HTTP/1.0
701----
702
703.Response
704----
705 HTTP/1.1 200 OK
706 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900707 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100708
709 )]}'
710 "refs/heads/master"
711----
712
713[[set-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800714=== Set HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800715--
Edwin Kempin6b813372013-03-13 17:07:33 +0100716'PUT /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800717--
Edwin Kempin6b813372013-03-13 17:07:33 +0100718
719Sets `HEAD` for a project.
720
721The new ref to which `HEAD` should point must be provided in the
722request body inside a link:#head-input[HeadInput] entity.
723
724.Request
725----
726 PUT /projects/plugins%2Freplication/HEAD HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900727 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100728
729 {
730 "ref": "refs/heads/stable"
731 }
732----
733
734As response the new ref to which `HEAD` points is returned.
735
736.Response
737----
738 HTTP/1.1 200 OK
739 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900740 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100741
742 )]}'
743 "refs/heads/stable"
744----
745
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100746[[get-repository-statistics]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800747=== Get Repository Statistics
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800748--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100749'GET /projects/link:#project-name[\{project-name\}]/statistics.git'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800750--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100751
752Return statistics for the repository of a project.
753
754.Request
755----
756 GET /projects/plugins%2Freplication/statistics.git HTTP/1.0
757----
758
759The repository statistics are returned as a
760link:#repository-statistics-info[RepositoryStatisticsInfo] entity.
761
762.Response
763----
764 HTTP/1.1 200 OK
765 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900766 Content-Type: application/json; charset=UTF-8
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100767
768 )]}'
769 {
770 "number_of_loose_objects": 127,
771 "number_of_loose_refs": 15,
772 "number_of_pack_files": 15,
773 "number_of_packed_objects": 67,
774 "number_of_packed_refs": 0,
775 "size_of_loose_objects": 29466,
776 "size_of_packed_objects": 9646
777 }
778----
779
Dave Borowitz237073a2013-04-04 16:52:27 -0700780[[get-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800781=== Get Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800782--
Dave Borowitz237073a2013-04-04 16:52:27 -0700783'GET /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800784--
Dave Borowitz237073a2013-04-04 16:52:27 -0700785
786Gets some configuration information about a project. Note that this
787config info is not simply the contents of `project.config`; it generally
788contains fields that may have been inherited from parent projects.
789
790.Request
791----
792 GET /projects/myproject/config
793----
794
795A link:#config-info[ConfigInfo] entity is returned that describes the
796project configuration. Some fields are only visible to users that have
797read access to `refs/meta/config`.
798
799.Response
800----
801 HTTP/1.1 200 OK
802 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900803 Content-Type: application/json; charset=UTF-8
Dave Borowitz237073a2013-04-04 16:52:27 -0700804
805 )]}'
806 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200807 "description": "demo project",
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200808 "use_contributor_agreements": {
809 "value": true,
810 "configured_value": "TRUE",
811 "inherited_value": false
812 },
813 "use_content_merge": {
814 "value": true,
815 "configured_value": "INHERIT",
816 "inherited_value": true
817 },
818 "use_signed_off_by": {
819 "value": false,
820 "configured_value": "INHERIT",
821 "inherited_value": false
822 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200823 "create_new_change_for_all_not_in_target": {
824 "value": false,
825 "configured_value": "INHERIT",
826 "inherited_value": false
827 },
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200828 "require_change_id": {
829 "value": false,
830 "configured_value": "FALSE",
831 "inherited_value": true
832 },
Edwin Kempin3c99f592013-07-15 10:12:27 +0200833 "max_object_size_limit": {
834 "value": "15m",
835 "configured_value": "15m",
836 "inherited_value": "20m"
837 },
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400838 "submit_type": "INHERIT",
839 "default_submit_type": {
840 "value": "MERGE_IF_NECESSARY",
841 "configured_value": "INHERIT",
842 "inherited_value": "MERGE_IF_NECESSARY"
843 },
Edwin Kempin3c99f592013-07-15 10:12:27 +0200844 "state": "ACTIVE",
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200845 "commentlinks": {},
Edwin Kempin9ce4f552013-11-15 16:00:00 +0100846 "plugin_config": {
847 "helloworld": {
848 "language": {
849 "display_name": "Preferred Language",
850 "type": "STRING",
851 "value": "en"
852 }
853 }
854 },
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200855 "actions": {
856 "cookbook~hello-project": {
857 "method": "POST",
858 "label": "Say hello",
859 "title": "Say hello in different languages",
860 "enabled": true
861 }
862 }
Dave Borowitz237073a2013-04-04 16:52:27 -0700863 }
864----
865
Edwin Kempina23eb102013-07-17 09:10:54 +0200866[[set-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800867=== Set Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800868--
Edwin Kempina23eb102013-07-17 09:10:54 +0200869'PUT /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800870--
Edwin Kempina23eb102013-07-17 09:10:54 +0200871
872Sets the configuration of a project.
873
874The new configuration must be provided in the request body as a
875link:#config-input[ConfigInput] entity.
876
877.Request
878----
879 PUT /projects/myproject/config HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900880 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200881
882 {
883 "description": "demo project",
884 "use_contributor_agreements": "FALSE",
885 "use_content_merge": "INHERIT",
886 "use_signed_off_by": "INHERIT",
Deniz Türkoglu52777272014-09-08 17:02:48 +0200887 "create_new_change_for_all_not_in_target": "INHERIT",
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400888 "enable_signed_push": "INHERIT",
Dave Borowitz0543c732015-10-20 10:35:26 -0400889 "require_signed_push": "INHERIT",
Saša Živkov225b7a72015-11-17 17:37:43 +0100890 "reject_implicit_merges": "INHERIT",
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200891 "require_change_id": "TRUE",
Edwin Kempina23eb102013-07-17 09:10:54 +0200892 "max_object_size_limit": "10m",
893 "submit_type": "REBASE_IF_NECESSARY",
894 "state": "ACTIVE"
895 }
896----
897
898As response the new configuration is returned as a link:#config-info[
899ConfigInfo] entity.
900
901.Response
902----
903 HTTP/1.1 200 OK
904 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900905 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200906
907 )]}'
908 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200909 "use_contributor_agreements": {
910 "value": false,
911 "configured_value": "FALSE",
912 "inherited_value": false
913 },
914 "use_content_merge": {
915 "value": true,
916 "configured_value": "INHERIT",
917 "inherited_value": true
918 },
919 "use_signed_off_by": {
920 "value": false,
921 "configured_value": "INHERIT",
922 "inherited_value": false
923 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200924 "create_new_change_for_all_not_in_target": {
925 "value": true,
926 "configured_value": "INHERIT",
927 "inherited_value": false
928 },
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +0200929 "require_change_id": {
930 "value": true,
931 "configured_value": "TRUE",
932 "inherited_value": true
933 },
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400934 "enable_signed_push": {
935 "value": true,
936 "configured_value": "INHERIT",
937 "inherited_value": false
938 },
Dave Borowitz0543c732015-10-20 10:35:26 -0400939 "require_signed_push": {
940 "value": false,
941 "configured_value": "INHERIT",
942 "inherited_value": false
943 },
Saša Živkov225b7a72015-11-17 17:37:43 +0100944 "reject_implicit_merges": {
945 "value": false,
946 "configured_value": "INHERIT",
947 "inherited_value": false
948 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200949 "max_object_size_limit": {
950 "value": "10m",
951 "configured_value": "10m",
952 "inherited_value": "20m"
953 },
954 "submit_type": "REBASE_IF_NECESSARY",
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -0400955 "default_submit_type": {
956 "value": "REBASE_IF_NECESSARY",
957 "configured_value": "INHERIT",
958 "inherited_value": "REBASE_IF_NECESSARY"
959 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200960 "state": "ACTIVE",
961 "commentlinks": {}
962 }
963----
964
Edwin Kempinef3542f2013-03-19 13:31:49 +0100965[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800966=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800967--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100968'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800969--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100970
971Run the Git garbage collection for the repository of a project.
972
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100973Options for the Git garbage collection can be specified in the
974request body as a link:#gc-input[GCInput] entity.
975
Edwin Kempinef3542f2013-03-19 13:31:49 +0100976.Request
977----
978 POST /projects/plugins%2Freplication/gc HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900979 Content-Type: application/json; charset=UTF-8
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100980
981 {
982 "show_progress": true
983 }
Edwin Kempinef3542f2013-03-19 13:31:49 +0100984----
985
986The response is the streamed output of the garbage collection.
987
988.Response
989----
990 HTTP/1.1 200 OK
991 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900992 Content-Type: text/plain; charset=UTF-8
Edwin Kempinef3542f2013-03-19 13:31:49 +0100993
994 collecting garbage for "plugins/replication":
995 Pack refs: 100% (21/21)
996 Counting objects: 20
997 Finding sources: 100% (20/20)
998 Getting sizes: 100% (13/13)
999 Compressing objects: 83% (5/6)
1000 Writing objects: 100% (20/20)
1001 Selecting commits: 100% (7/7)
1002 Building bitmaps: 100% (7/7)
1003 Finding sources: 100% (41/41)
1004 Getting sizes: 100% (25/25)
1005 Compressing objects: 52% (12/23)
1006 Writing objects: 100% (41/41)
1007 Prune loose objects also found in pack files: 100% (36/36)
1008 Prune loose, unreferenced objects: 100% (36/36)
1009 done.
1010----
1011
Adrian Görler92410a12015-11-03 16:20:56 +01001012==== Asynchronous Execution
1013
1014The option `async` allows to schedule a background task that asynchronously
1015executes a Git garbage collection.
1016
1017The `Location` header of the response refers to the link:rest-api-config.html#get-task[background task]
1018which allows to inspect the progress of its execution. In case of asynchronous
1019execution the `show_progress` option is ignored.
1020
1021.Request
1022----
1023 POST /projects/plugins%2Freplication/gc HTTP/1.0
1024 Content-Type: application/json;charset=UTF-8
1025
1026 {
1027 "async": true
1028 }
1029----
1030
1031The response is empty.
1032
1033.Response
1034----
1035 HTTP/1.1 202 Accepted
1036 Content-Disposition: attachment
1037 Location: https:<host>/a/config/server/tasks/383a0602
1038----
1039
Edwin Kempin62946742014-07-09 11:17:58 +02001040[[ban-commit]]
1041=== Ban Commit
1042--
1043'PUT /projects/link:#project-name[\{project-name\}]/ban'
1044--
1045
1046Marks commits as banned for the project. If a commit is banned Gerrit
1047rejects every push that includes this commit with
1048link:error-contains-banned-commit.html[contains banned commit ...].
1049
1050[NOTE]
1051This REST endpoint only marks the commits as banned, but it does not
1052remove the commits from the history of any central branch. This needs
1053to be done manually.
1054
1055The commits to be banned must be specified in the request body as a
1056link:#ban-input[BanInput] entity.
1057
1058The caller must be project owner.
1059
1060.Request
1061----
1062 PUT /projects/plugins%2Freplication/ban HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001063 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +02001064
1065 {
1066 "commits": [
1067 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
1068 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
1069 ],
1070 "reason": "Violates IP"
1071 }
1072----
1073
1074As response a link:#ban-result-info[BanResultInfo] entity is returned.
1075
1076.Response
1077----
1078 HTTP/1.1 200 OK
1079 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001080 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +02001081
1082 )]}'
1083 {
1084 "newly_banned": [
1085 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
1086 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
1087 ]
1088 }
1089----
1090
Patrick Hiesel21816f12016-04-22 08:53:06 +02001091[[get-access]]
1092=== List Access Rights for Project
1093--
1094'GET /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
1095--
1096
1097Lists the access rights for a single project.
1098
Han-Wen Nienhuysbfd1b352018-01-10 15:02:32 +01001099As result a
1100link:rest-api-access.html#project-access-info[ProjectAccessInfo]
1101entity is returned.
Patrick Hiesel21816f12016-04-22 08:53:06 +02001102
1103.Request
1104----
1105 GET /projects/MyProject/access HTTP/1.0
1106----
1107
1108.Response
1109----
1110 HTTP/1.1 200 OK
1111 Content-Type: application/json; charset=UTF-8
1112
1113 )]}'
1114 {
1115 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1116 "inherits_from": {
1117 "id": "All-Projects",
1118 "name": "All-Projects",
1119 "description": "Access inherited by all other projects."
1120 },
1121 "local": {
1122 "refs/*": {
1123 "permissions": {
1124 "read": {
1125 "rules": {
1126 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1127 "action": "ALLOW",
1128 "force": false
1129 },
1130 "global:Anonymous-Users": {
1131 "action": "ALLOW",
1132 "force": false
1133 }
1134 }
1135 }
1136 }
1137 }
1138 },
1139 "is_owner": true,
1140 "owner_of": [
1141 "refs/*"
1142 ],
1143 "can_upload": true,
1144 "can_add": true,
Marco Millerc2114ac2018-09-10 16:52:54 -04001145 "can_add_tags": true,
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001146 "config_visible": true,
1147 "groups": {
1148 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1149 "url": "#/admin/groups/uuid-c2ce4749a32ceb82cd6adcce65b8216e12afb41c",
1150 "options": {},
1151 "description": "Users who perform batch actions on Gerrit",
1152 "group_id": 2,
1153 "owner": "Administrators",
1154 "owner_id": "d5b7124af4de52924ed397913e2c3b37bf186948",
1155 "created_on": "2009-06-08 23:31:00.000000000",
1156 "name": "Non-Interactive Users"
1157 },
1158 "global:Anonymous-Users": {
1159 "options": {},
1160 "name": "Anonymous Users"
1161 }
1162 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001163 }
1164----
1165
1166[[set-access]]
1167=== Add, Update and Delete Access Rights for Project
1168--
1169'POST /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
1170--
1171
1172Sets access rights for the project using the diff schema provided by
1173link:#project-access-input[ProjectAccessInput]. Deductions are used to
1174remove access sections, permissions or permission rules. The backend will remove
1175the entity with the finest granularity in the request, meaning that if an
1176access section without permissions is posted, the access section will be
1177removed; if an access section with a permission but no permission rules is
1178posted, the permission will be removed; if an access section with a permission
1179and a permission rule is posted, the permission rule will be removed.
1180
1181Additionally, access sections and permissions will be cleaned up after applying
1182the deductions by removing items that have no child elements.
1183
1184After removals have been applied, additions will be applied.
1185
Han-Wen Nienhuysbfd1b352018-01-10 15:02:32 +01001186As result a
1187link:rest-api-access.html#project-access-info[ProjectAccessInfo]
1188entity is returned.
Patrick Hiesel21816f12016-04-22 08:53:06 +02001189
1190.Request
1191----
1192 POST /projects/MyProject/access HTTP/1.0
1193 Content-Type: application/json; charset=UTF-8
1194
1195 {
Florian Ramillien4978ae52018-12-04 11:04:59 +01001196 "remove": {
1197 "refs/*": {
1198 "permissions": {
1199 "read": {
1200 "rules": {
1201 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1202 "action": "ALLOW"
Patrick Hiesel21816f12016-04-22 08:53:06 +02001203 }
1204 }
1205 }
1206 }
1207 }
Florian Ramillien4978ae52018-12-04 11:04:59 +01001208 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001209 }
1210----
1211
1212.Response
1213----
1214 HTTP/1.1 200 OK
1215 Content-Type: application/json; charset=UTF-8
1216
1217 )]}'
1218 {
1219 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1220 "inherits_from": {
1221 "id": "All-Projects",
1222 "name": "All-Projects",
1223 "description": "Access inherited by all other projects."
1224 },
1225 "local": {
1226 "refs/*": {
1227 "permissions": {
1228 "read": {
1229 "rules": {
1230 "global:Anonymous-Users": {
1231 "action": "ALLOW",
1232 "force": false
1233 }
1234 }
1235 }
1236 }
1237 }
1238 },
1239 "is_owner": true,
1240 "owner_of": [
1241 "refs/*"
1242 ],
1243 "can_upload": true,
1244 "can_add": true,
Marco Millerc2114ac2018-09-10 16:52:54 -04001245 "can_add_tags": true,
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001246 "config_visible": true,
1247 "groups": {
1248 "global:Anonymous-Users": {
1249 "options": {},
1250 "name": "Anonymous Users"
1251 }
1252 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001253 }
1254----
1255
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001256[[create-access-change]]
1257=== Create Access Rights Change for review.
1258--
1259'PUT /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access:review
1260--
1261
1262Sets access rights for the project using the diff schema provided by
1263link:#project-access-input[ProjectAccessInput]
1264
1265This takes the same input as link:#set-access[Update Access Rights], but creates a pending
1266change for review. Like link:#create-change[Create Change], it returns
1267a link:#change-info[ChangeInfo] entity describing the resulting change.
1268
1269.Request
1270----
1271 PUT /projects/MyProject/access:review HTTP/1.0
1272 Content-Type: application/json; charset=UTF-8
1273
1274 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01001275 "add": {
1276 "refs/heads/*": {
1277 "permissions": {
1278 "read": {
1279 "rules": {
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001280 "global:Anonymous-Users": {
Edwin Kempine813c5a2019-03-13 09:51:12 +01001281 "action": "DENY",
1282 "force": false
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001283 }
1284 }
1285 }
1286 }
1287 }
1288 }
1289 }
1290----
1291
1292.Response
1293----
1294 HTTP/1.1 200 OK
1295 Content-Type: application/json; charset=UTF-8
1296
1297 )]}'
1298 {
1299 "id": "testproj~refs%2Fmeta%2Fconfig~Ieaf185bf90a1fc3b58461e399385e158a20b31a2",
1300 "project": "testproj",
1301 "branch": "refs/meta/config",
1302 "hashtags": [],
1303 "change_id": "Ieaf185bf90a1fc3b58461e399385e158a20b31a2",
1304 "subject": "Review access change",
1305 "status": "NEW",
1306 "created": "2017-09-07 14:31:11.852000000",
1307 "updated": "2017-09-07 14:31:11.852000000",
1308 "submit_type": "CHERRY_PICK",
1309 "mergeable": true,
1310 "insertions": 2,
1311 "deletions": 0,
1312 "unresolved_comment_count": 0,
1313 "has_review_started": true,
1314 "_number": 7,
1315 "owner": {
1316 "_account_id": 1000000
1317 }
1318 }
1319----
1320
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001321[[check-access]]
1322=== Check Access
1323--
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001324'GET /projects/MyProject/check.access?account=1000098&ref=refs%2Fheads%2Fsecret%2Fbla'
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001325--
1326
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001327This command runs access checks for other users. This requires the
1328link:access-control.html#capability_viewAccess[View Access] global
1329capability.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001330
1331The result is a link:#access-check-info[AccessCheckInfo] entity
Han-Wen Nienhuys8a4a6822018-01-18 19:27:46 +01001332detailing the access of the given user for the given project,
1333project-ref, or project-permission-ref combination.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001334
1335.Response
1336----
1337 HTTP/1.1 200 OK
1338 Content-Type: application/json; charset=UTF-8
1339
1340 )]}'
1341 {
1342 "message": "user Kristen Burns \u003cKristen.Burns@gerritcodereview.com\u003e (1000098) cannot see ref refs/heads/secret/bla in project MyProject",
1343 "status": 403
1344 }
1345----
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001346
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001347[[check-access-options]]
1348==== Check Access Options
Han-Wen Nienhuys5b089f22018-04-17 16:26:44 +02001349
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001350Account(account)::
1351The account for which to check access. Mandatory.
Han-Wen Nienhuys5b089f22018-04-17 16:26:44 +02001352
Han-Wen Nienhuys751e8242018-10-01 16:43:05 +02001353Permission(perm)::
1354The ref permission for which to check access. If not specified, read
1355access to at least branch is checked.
1356
1357Ref(ref)::
1358The branch for which to check access. This must be given if `perm` is specified.
1359
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001360[[index]]
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001361=== Index project
1362
1363Adds or updates the current project (and children, if specified) in the secondary index.
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02001364The indexing task is executed asynchronously in background and this command returns
1365immediately if `async` is specified in the input.
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001366
1367As an input, a link:#index-project-input[IndexProjectInput] entity can be provided.
1368
1369.Request
1370----
1371 POST /projects/MyProject/index HTTP/1.0
1372 Content-Type: application/json; charset=UTF-8
1373
1374 {
1375 "index_children": "true"
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02001376 "async": "true"
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001377 }
1378----
1379
1380.Response
1381----
1382 HTTP/1.1 202 Accepted
1383 Content-Disposition: attachment
1384----
1385
1386[[index.changes]]
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001387=== Index all changes in a project
1388
1389Adds or updates all the changes belonging to a project in the secondary index.
1390The indexing task is executed asynchronously in background, so this command
1391returns immediately.
1392
1393.Request
1394----
Patrick Hiesel20d981e2018-07-04 09:48:21 +02001395 POST /projects/MyProject/index.changes HTTP/1.0
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001396----
1397
1398.Response
1399----
Edwin Kempin4145f972018-01-12 16:30:44 +01001400 HTTP/1.1 202 Accepted
1401 Content-Disposition: attachment
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001402----
1403
Edwin Kempinbf9df392018-01-12 15:20:48 +01001404[[check]]
1405=== Check project consistency
1406
1407Performs consistency checks on the project.
1408
1409Which consistency checks should be performed is controlled by the
1410link:#check-project-input[CheckProjectInput] entity in the request
1411body.
1412
1413The following consistency checks are supported:
1414
1415[[auto-closeable-changes-check]]
1416--
1417* AutoCloseableChangesCheck: Searches for open changes that can be
1418 auto-closed because a patch set of the change is already contained in
1419 the destination branch or because the destination branch contains a
1420 commit with the same Change-Id. Normally Gerrit auto-closes such
1421 changes when the corresponding commits are pushed directly to the
1422 repository. However if a branch is updated behind Gerrit's back or if
1423 auto-closing changes fails (and the push is still successful) change
1424 states can get inconsistent (changes that are already part of the
1425 destination branch are still open). This consistency check is
1426 intended to detect and repair this situation.
1427--
1428
1429To fix any problems that can be fixed automatically set the `fix` field
1430in the inputs for the consistency checks to `true`.
1431
1432This REST endpoint requires the
1433link:access-control.html#capability_administrateServer[Administrate Server]
1434global capability.
1435
1436.Request
1437----
1438 POST /projects/MyProject/check HTTP/1.0
1439 Content-Type: application/json; charset=UTF-8
1440
1441 {
1442 "auto_closeable_changes_check": {
1443 "fix": true,
1444 "branch": "refs/heads/master",
1445 "max_commits": 100
1446 }
1447 }
1448----
1449
1450As response a link:#check-project-result-info[CheckProjectResultInfo]
1451entity is returned that results for the consistency checks.
1452
1453.Response
1454----
1455 HTTP/1.1 200 OK
1456 Content-Disposition: attachment
1457 Content-Type: application/json; charset=UTF-8
1458
1459 )]}'
1460 {
1461 "auto_closeable_changes_check_result": {
1462 "auto_closeable_changes": {
1463 "refs/heads/master": [
1464 {
1465 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1466 "project": "myProject",
1467 "branch": "master",
1468 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1469 "subject": "Implementing Feature X",
1470 "status": "NEW",
1471 "created": "2013-02-01 09:59:32.126000000",
1472 "updated": "2013-02-21 11:16:36.775000000",
1473 "insertions": 34,
1474 "deletions": 101,
1475 "_number": 3965,
1476 "owner": {
1477 "name": "John Doe"
1478 },
1479 "problems": [
1480 {
1481 "message": "Patch set 1 (2f15e416237ed9b561199f24184f5f5d2708c584) is merged into destination ref refs/heads/master (2f15e416237ed9b561199f24184f5f5d2708c584), but change status is NEW",
1482 "status": "FIXED",
1483 "outcome": "Marked change as merged"
1484 }
1485 ]
1486 }
1487 ]
1488 }
1489 }
1490 }
1491----
1492
Edwin Kempina686de92013-05-09 15:12:34 +02001493[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001494== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +02001495
1496[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001497=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001498--
Edwin Kempina686de92013-05-09 15:12:34 +02001499'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001500--
Edwin Kempina686de92013-05-09 15:12:34 +02001501
1502List the branches of a project.
1503
1504As result a list of link:#branch-info[BranchInfo] entries is
1505returned.
1506
1507.Request
1508----
1509 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
1510----
1511
1512.Response
1513----
1514 HTTP/1.1 200 OK
1515 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001516 Content-Type: application/json; charset=UTF-8
Edwin Kempina686de92013-05-09 15:12:34 +02001517
1518 )]}'
1519 [
1520 {
1521 "ref": "HEAD",
1522 "revision": "master"
1523 },
1524 {
1525 "ref": "refs/meta/config",
1526 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1527 },
1528 {
1529 "ref": "refs/heads/master",
1530 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1531 },
1532 {
1533 "ref": "refs/heads/stable",
1534 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
1535 "can_delete": true
1536 }
1537 ]
1538----
1539
Hugo Arès3133b4b2014-10-14 14:05:10 -04001540[[branch-options]]
1541==== Branch Options
1542
Hugo Arès15856622014-10-14 14:19:01 -04001543Limit(n)::
1544Limit the number of branches to be included in the results.
1545+
1546.Request
1547----
1548 GET /projects/testproject/branches?n=1 HTTP/1.0
1549----
1550+
1551.Response
1552----
1553 HTTP/1.1 200 OK
1554 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001555 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001556
1557 )]}'
1558 [
1559 {
1560 "ref": "HEAD",
1561 "revision": "master",
Hugo Arès15856622014-10-14 14:19:01 -04001562 }
1563 ]
1564----
1565
David Pursehouse5cb38192017-07-28 16:11:33 +01001566Skip(S)::
Hugo Arès15856622014-10-14 14:19:01 -04001567Skip the given number of branches from the beginning of the list.
1568+
1569.Request
1570----
1571 GET /projects/testproject/branches?n=1&s=0 HTTP/1.0
1572----
1573+
1574.Response
1575----
1576 HTTP/1.1 200 OK
1577 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001578 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001579
1580 )]}'
1581 [
1582 {
1583 "ref": "HEAD",
1584 "revision": "master",
Hugo Arès15856622014-10-14 14:19:01 -04001585 }
1586 ]
1587----
1588
Hugo Arès3133b4b2014-10-14 14:05:10 -04001589Substring(m)::
David Pursehouse1d4d67d2017-07-13 09:58:10 +09001590Limit the results to those branches that match the specified substring.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001591+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09001592The match is case insensitive. May not be used together with `r`.
David Pursehouse5851bfe2017-07-13 09:56:26 +09001593+
David Pursehouse1d4d67d2017-07-13 09:58:10 +09001594List all branches that match substring `test`:
Hugo Arès3133b4b2014-10-14 14:05:10 -04001595+
1596.Request
1597----
1598 GET /projects/testproject/branches?m=test HTTP/1.0
1599----
1600+
1601.Response
1602----
1603 HTTP/1.1 200 OK
1604 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001605 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001606
1607 )]}'
1608 [
1609 {
1610 "ref": "refs/heads/test1",
1611 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1612 "can_delete": true
1613 }
1614 ]
1615----
1616
1617Regex(r)::
1618Limit the results to those branches that match the specified regex.
1619Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
David Pursehousea6cd67f2017-07-13 16:40:58 +09001620match any branches that start with 't' and regex '*t' will match any
1621branches that end with 't'.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001622+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09001623The match is case sensitive. May not be used together with `m`.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001624+
1625List all branches that match regex `t.*1`:
1626+
1627.Request
1628----
1629 GET /projects/testproject/branches?r=t.*1 HTTP/1.0
1630----
1631+
1632.Response
1633----
1634 HTTP/1.1 200 OK
1635 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001636 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001637
1638 )]}'
1639 [
1640 {
1641 "ref": "refs/heads/test1",
1642 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1643 "can_delete": true
1644 }
1645 ]
1646----
1647
Edwin Kempin196e1732013-05-09 15:12:34 +02001648[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001649=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001650--
Edwin Kempin196e1732013-05-09 15:12:34 +02001651'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001652--
Edwin Kempin196e1732013-05-09 15:12:34 +02001653
1654Retrieves a branch of a project.
1655
1656.Request
1657----
1658 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
1659----
1660
1661As response a link:#branch-info[BranchInfo] entity is returned that
1662describes the branch.
1663
1664.Response
1665----
1666 HTTP/1.1 200 OK
1667 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001668 Content-Type: application/json; charset=UTF-8
Edwin Kempin196e1732013-05-09 15:12:34 +02001669
1670 )]}'
1671 {
1672 "ref": "refs/heads/master",
1673 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1674 }
1675----
1676
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001677[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001678=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001679--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001680'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001681--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001682
1683Creates a new branch.
1684
1685In the request body additional data for the branch can be provided as
1686link:#branch-input[BranchInput].
1687
1688.Request
1689----
1690 PUT /projects/MyProject/branches/stable HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001691 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001692
1693 {
1694 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1695 }
1696----
1697
1698As response a link:#branch-info[BranchInfo] entity is returned that
1699describes the created branch.
1700
1701.Response
1702----
1703 HTTP/1.1 201 Created
1704 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001705 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001706
1707 )]}'
1708 {
1709 "ref": "refs/heads/stable",
1710 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
1711 "can_delete": true
1712 }
1713----
1714
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001715[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001716=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001717--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001718'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001719--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001720
1721Deletes a branch.
1722
1723.Request
1724----
1725 DELETE /projects/MyProject/branches/stable HTTP/1.0
1726----
1727
1728.Response
1729----
1730 HTTP/1.1 204 No Content
1731----
1732
Hugo Arèsef8e3202015-01-12 15:09:06 -05001733[[delete-branches]]
1734=== Delete Branches
1735--
1736'POST /projects/link:#project-name[\{project-name\}]/branches:delete'
1737--
1738
1739Delete one or more branches.
1740
1741The branches to be deleted must be provided in the request body as a
1742link:#delete-branches-input[DeleteBranchesInput] entity.
1743
1744.Request
1745----
1746 POST /projects/MyProject/branches:delete HTTP/1.0
1747 Content-Type: application/json;charset=UTF-8
1748
1749 {
1750 "branches": [
1751 "stable-1.0",
1752 "stable-2.0"
1753 ]
1754 }
1755----
1756
1757.Response
1758----
1759 HTTP/1.1 204 No Content
1760----
1761
1762If some branches could not be deleted, the response is "`409 Conflict`" and the
1763error message is contained in the response body.
1764
Edwin Kempind31e5582013-11-30 12:07:08 +01001765[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001766=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001767--
1768'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1769--
1770
1771Gets the content of a file from the HEAD revision of a certain branch.
1772
1773.Request
1774----
1775 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1776----
1777
1778The content is returned as base64 encoded string.
1779
1780.Response
1781----
1782 HTTP/1.1 200 OK
1783 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001784 Content-Type: text/plain; charset=UTF-8
Edwin Kempind31e5582013-11-30 12:07:08 +01001785
1786 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1787----
1788
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001789
1790[[get-mergeable-info]]
1791=== Get Mergeable Information
1792--
1793'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/mergeable'
1794--
1795
1796Gets whether the source is mergeable with the target branch.
1797
Zhen Chen8f00d552016-07-26 16:54:59 -07001798The `source` query parameter is required, which can be anything that could be
1799resolved to a commit, see examples of the `source` attribute in
1800link:rest-api-changes.html#merge-input[MergeInput].
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001801
1802Also takes an optional parameter `strategy`, which can be `recursive`, `resolve`,
1803`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
1804
1805.Request
1806----
1807 GET /projects/test/branches/master/mergeable?source=testbranch&strategy=recursive HTTP/1.0
1808----
1809
Zhen Chen8f00d552016-07-26 16:54:59 -07001810As response a link:rest-api-changes.html#mergeable-info[MergeableInfo] entity is returned.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001811
1812.Response
1813----
1814 HTTP/1.1 200 OK
1815 Content-Disposition: attachment
1816 Content-Type: application/json; charset=UTF-8
1817
1818 )]}'
1819 {
Zhen Chen8f00d552016-07-26 16:54:59 -07001820 "submit_type": "MERGE_IF_NECESSARY",
1821 "strategy": "recursive",
1822 "mergeable": true,
1823 "commit_merged": false,
1824 "content_merged": false
1825 }
1826----
1827
1828or when there were conflicts.
1829
1830.Response
1831----
1832 HTTP/1.1 200 OK
1833 Content-Disposition: attachment
1834 Content-Type: application/json; charset=UTF-8
1835
1836 )]}'
1837 {
1838 "submit_type": "MERGE_IF_NECESSARY",
1839 "strategy": "recursive",
1840 "mergeable": false,
1841 "conflicts": [
1842 "common.txt",
1843 "shared.txt"
1844 ]
1845 }
1846----
1847
1848or when the 'testbranch' has been already merged.
1849
1850.Response
1851----
1852 HTTP/1.1 200 OK
1853 Content-Disposition: attachment
1854 Content-Type: application/json; charset=UTF-8
1855
1856 )]}'
1857 {
1858 "submit_type": "MERGE_IF_NECESSARY",
1859 "strategy": "recursive",
1860 "mergeable": true,
1861 "commit_merged": true,
1862 "content_merged": true
1863 }
1864----
1865
1866or when only the content of 'testbranch' has been merged.
1867
1868.Response
1869----
1870 HTTP/1.1 200 OK
1871 Content-Disposition: attachment
1872 Content-Type: application/json; charset=UTF-8
1873
1874 )]}'
1875 {
1876 "submit_type": "MERGE_IF_NECESSARY",
1877 "strategy": "recursive",
1878 "mergeable": true,
1879 "commit_merged": false,
1880 "content_merged": true
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001881 }
1882----
1883
Edwin Kempin87504d92014-07-04 12:59:19 +02001884[[get-reflog]]
1885=== Get Reflog
1886--
1887'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
1888--
1889
1890Gets the reflog of a certain branch.
1891
1892The caller must be project owner.
1893
1894.Request
1895----
1896 GET /projects/gerrit/branches/master/reflog HTTP/1.0
1897----
1898
1899As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
1900is returned that describe the reflog entries. The reflog entries are
1901returned in reverse order.
1902
1903.Response
1904----
1905 HTTP/1.1 200 OK
1906 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001907 Content-Type: application/json; charset=UTF-8
Edwin Kempin87504d92014-07-04 12:59:19 +02001908
1909 )]}'
1910 [
1911 {
1912 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1913 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
1914 "who": {
1915 "name": "Jane Roe",
1916 "email": "jane.roe@example.com",
1917 "date": "2014-06-30 11:53:43.000000000",
1918 "tz": 120
1919 },
1920 "comment": "merged: fast forward"
1921 },
1922 {
1923 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1924 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1925 "who": {
1926 "name": "John Doe",
1927 "email": "john.doe@example.com",
1928 "date": "2013-10-02 10:45:26.000000000",
1929 "tz": 120
1930 },
1931 "comment": "merged: fast forward"
1932 },
1933 {
1934 "old_id": "0000000000000000000000000000000000000000",
1935 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1936 "who": {
1937 "name": "John Doe",
1938 "email": "john.doe@example.com",
1939 "date": "2013-09-30 19:08:44.000000000",
1940 "tz": 120
1941 },
1942 "comment": ""
1943 }
1944 ]
1945----
1946
1947The get reflog endpoint also accepts a limit integer in the `n`
1948parameter. This limits the results to show the last `n` reflog entries.
1949
1950Query the last 25 reflog entries.
1951----
1952 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
1953----
1954
Edwin Kempin2a581fd2014-07-04 14:04:54 +02001955The reflog can also be filtered by timestamp by specifying the `from`
1956and `to` parameters. The timestamp for `from` and `to` must be given as
1957UTC in the following format: `yyyyMMdd_HHmm`.
1958
1959----
1960 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
1961----
1962
Edwin Kempin4425c742013-03-18 13:23:00 +01001963[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001964== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01001965
1966[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001967=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001968--
Edwin Kempin4425c742013-03-18 13:23:00 +01001969'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001970--
Edwin Kempin4425c742013-03-18 13:23:00 +01001971
1972List the direct child projects of a project.
1973
1974.Request
1975----
1976 GET /projects/Public-Plugins/children/ HTTP/1.0
1977----
1978
1979As result a list of link:#project-info[ProjectInfo] entries is
1980returned that describe the child projects.
1981
1982.Response
1983----
1984 HTTP/1.1 200 OK
1985 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001986 Content-Type: application/json; charset=UTF-8
Edwin Kempin4425c742013-03-18 13:23:00 +01001987
1988 )]}'
1989 [
1990 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001991 "id": "plugins%2Freplication",
1992 "name": "plugins/replication",
1993 "parent": "Public-Plugins",
1994 "description": "Copies to other servers using the Git protocol"
1995 },
1996 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001997 "id": "plugins%2Freviewnotes",
1998 "name": "plugins/reviewnotes",
1999 "parent": "Public-Plugins",
2000 "description": "Annotates merged commits using notes on refs/notes/review."
2001 },
2002 {
Edwin Kempin4425c742013-03-18 13:23:00 +01002003 "id": "plugins%2Fsingleusergroup",
2004 "name": "plugins/singleusergroup",
2005 "parent": "Public-Plugins",
2006 "description": "GroupBackend enabling users to be directly added to access rules"
2007 }
2008 ]
2009----
2010
Edwin Kempinf95bd172013-03-19 11:10:57 +01002011To resolve the child projects of a project recursively the parameter
2012`recursive` can be set.
2013
2014Child projects that are not visible to the calling user are ignored and
2015are not resolved further.
2016
2017.Request
2018----
2019 GET /projects/Public-Projects/children/?recursive HTTP/1.0
2020----
2021
2022.Response
2023----
2024 HTTP/1.1 200 OK
2025 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002026 Content-Type: application/json; charset=UTF-8
Edwin Kempinf95bd172013-03-19 11:10:57 +01002027
2028 )]}'
2029 [
2030 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002031 "id": "gerrit",
2032 "name": "gerrit",
2033 "parent": "Public-Projects",
2034 "description": "Gerrit Code Review"
2035 },
2036 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002037 "id": "plugins%2Freplication",
2038 "name": "plugins/replication",
2039 "parent": "Public-Plugins",
2040 "description": "Copies to other servers using the Git protocol"
2041 },
2042 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002043 "id": "plugins%2Freviewnotes",
2044 "name": "plugins/reviewnotes",
2045 "parent": "Public-Plugins",
2046 "description": "Annotates merged commits using notes on refs/notes/review."
2047 },
2048 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002049 "id": "plugins%2Fsingleusergroup",
2050 "name": "plugins/singleusergroup",
2051 "parent": "Public-Plugins",
2052 "description": "GroupBackend enabling users to be directly added to access rules"
2053 },
2054 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01002055 "id": "Public-Plugins",
2056 "name": "Public-Plugins",
2057 "parent": "Public-Projects",
2058 "description": "Parent project for plugins/*"
2059 }
2060 ]
2061----
2062
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002063[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002064=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002065--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002066'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002067--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002068
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01002069Retrieves a child project. If a non-direct child project should be
2070retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002071
2072.Request
2073----
2074 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
2075----
2076
2077As response a link:#project-info[ProjectInfo] entity is returned that
2078describes the child project.
2079
2080.Response
2081----
2082 HTTP/1.1 200 OK
2083 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002084 Content-Type: application/json; charset=UTF-8
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002085
2086 )]}'
2087 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01002088 "id": "plugins%2Freplication",
2089 "name": "plugins/replication",
2090 "parent": "Public-Plugins",
2091 "description": "Copies to other servers using the Git protocol"
2092 }
2093----
2094
David Pursehouse8cc68902014-10-06 18:17:16 +09002095[[tag-endpoints]]
2096== Tag Endpoints
2097
David Pursehouse6a446192016-06-03 10:00:34 +09002098[[create-tag]]
2099=== Create Tag
2100
2101--
2102'PUT /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2103--
2104
2105Create a new tag on the project.
2106
2107In the request body additional data for the tag can be provided as
2108link:#tag-input[TagInput].
2109
2110If a message is provided in the input, the tag is created as an
2111annotated tag with the current user as tagger. Signed tags are not
2112supported.
2113
2114.Request
2115----
2116 PUT /projects/MyProject/tags/v1.0 HTTP/1.0
2117 Content-Type: application/json; charset=UTF-8
2118
2119 {
2120 "message": "annotation",
2121 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
2122 }
2123----
2124
2125As response a link:#tag-info[TagInfo] entity is returned that describes
2126the created tag.
2127
2128.Response
2129----
2130 HTTP/1.1 201 Created
2131 Content-Disposition: attachment
2132 Content-Type: application/json; charset=UTF-8
2133
2134 )]}'
2135
2136 "object": "d48d304adc4b6674e11dc2c018ea05fcbdda32fd",
2137 "message": "annotation",
2138 "tagger": {
2139 "name": "David Pursehouse",
2140 "email": "dpursehouse@collab.net",
2141 "date": "2016-06-06 01:22:03.000000000",
2142 "tz": 540
2143 },
2144 "ref": "refs/tags/v1.0",
2145 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
2146 }
2147----
2148
David Pursehouse8cc68902014-10-06 18:17:16 +09002149[[list-tags]]
2150=== List Tags
2151--
2152'GET /projects/link:#project-name[\{project-name\}]/tags/'
2153--
2154
2155List the tags of a project.
2156
2157As result a list of link:#tag-info[TagInfo] entries is returned.
2158
2159Only includes tags under the `refs/tags/` namespace.
2160
2161.Request
2162----
2163 GET /projects/work%2Fmy-project/tags/ HTTP/1.0
2164----
2165
2166.Response
2167----
2168 HTTP/1.1 200 OK
2169 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002170 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09002171
2172 )]}'
2173 [
2174 {
2175 "ref": "refs/tags/v1.0",
2176 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2177 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2178 "message": "Annotated tag",
2179 "tagger": {
2180 "name": "David Pursehouse",
2181 "email": "david.pursehouse@sonymobile.com",
2182 "date": "2014-10-06 07:35:03.000000000",
2183 "tz": 540
2184 }
2185 },
2186 {
2187 "ref": "refs/tags/v2.0",
2188 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2189 },
2190 {
2191 "ref": "refs/tags/v3.0",
2192 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2193 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2194 "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-----",
2195 "tagger": {
2196 "name": "David Pursehouse",
2197 "email": "david.pursehouse@sonymobile.com",
2198 "date": "2014-10-06 09:02:16.000000000",
2199 "tz": 540
2200 }
2201 }
2202 ]
2203----
2204
David Pursehouseb0ba1512015-09-10 14:17:05 +09002205[[tag-options]]
2206==== Tag Options
2207
2208Limit(n)::
2209Limit the number of tags to be included in the results.
2210+
2211.Request
2212----
2213 GET /projects/work%2Fmy-project/tags?n=2 HTTP/1.0
2214----
2215+
2216.Response
2217----
2218 HTTP/1.1 200 OK
2219 Content-Disposition: attachment
2220 Content-Type: application/json; charset=UTF-8
2221
2222 )]}'
2223 [
2224 {
2225 "ref": "refs/tags/v1.0",
2226 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2227 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2228 "message": "Annotated tag",
2229 "tagger": {
2230 "name": "David Pursehouse",
2231 "email": "david.pursehouse@sonymobile.com",
2232 "date": "2014-10-06 07:35:03.000000000",
2233 "tz": 540
2234 }
2235 },
2236 {
2237 "ref": "refs/tags/v2.0",
2238 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2239 }
2240 ]
2241----
2242
David Pursehouse5cb38192017-07-28 16:11:33 +01002243Skip(S)::
David Pursehouseb0ba1512015-09-10 14:17:05 +09002244Skip the given number of tags from the beginning of the list.
2245+
2246.Request
2247----
2248 GET /projects/work%2Fmy-project/tags?n=2&s=1 HTTP/1.0
2249----
2250+
2251.Response
2252----
2253 HTTP/1.1 200 OK
2254 Content-Disposition: attachment
2255 Content-Type: application/json; charset=UTF-8
2256
2257 )]}'
2258 [
2259 {
2260 "ref": "refs/tags/v2.0",
2261 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2262 },
2263 {
2264 "ref": "refs/tags/v3.0",
2265 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2266 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2267 "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-----",
2268 "tagger": {
2269 "name": "David Pursehouse",
2270 "email": "david.pursehouse@sonymobile.com",
2271 "date": "2014-10-06 09:02:16.000000000",
2272 "tz": 540
2273 }
2274 }
2275 ]
2276----
2277
David Pursehousecf1ed062017-07-13 10:05:43 +09002278Substring(m)::
2279Limit the results to those tags that match the specified substring.
2280+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09002281The match is case insensitive. May not be used together with `r`.
David Pursehousecf1ed062017-07-13 10:05:43 +09002282+
2283List all tags that match substring `v2`:
2284
2285+
2286.Request
2287----
2288 GET /projects/testproject/tags?m=v2 HTTP/1.0
2289----
2290+
2291.Response
2292----
2293 HTTP/1.1 200 OK
2294 Content-Disposition: attachment
2295 Content-Type: application/json; charset=UTF-8
2296
2297 )]}'
2298 [
2299 {
2300 "ref": "refs/tags/v2.0",
2301 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2302 },
2303 ]
2304----
2305
2306Regex(r)::
2307Limit the results to those tags that match the specified regex.
2308Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
2309match any tags that start with 't' and regex '*t' will match any
2310tags that end with 't'.
2311+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09002312The match is case sensitive. May not be used together with `m`.
David Pursehousef648e042017-07-13 10:08:46 +09002313+
David Pursehousecf1ed062017-07-13 10:05:43 +09002314List all tags that match regex `v.*0`:
2315+
2316.Request
2317----
2318 GET /projects/testproject/tags?r=v.*0 HTTP/1.0
2319----
2320+
2321.Response
2322----
2323 HTTP/1.1 200 OK
2324 Content-Disposition: attachment
2325 Content-Type: application/json; charset=UTF-8
2326
2327 )]}'
2328 [
2329 {
2330 "ref": "refs/tags/v1.0",
2331 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2332 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2333 "message": "Annotated tag",
2334 "tagger": {
2335 "name": "David Pursehouse",
2336 "email": "david.pursehouse@sonymobile.com",
2337 "date": "2014-10-06 07:35:03.000000000",
2338 "tz": 540
2339 }
2340 },
2341 {
2342 "ref": "refs/tags/v2.0",
2343 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2344 },
2345 {
2346 "ref": "refs/tags/v3.0",
2347 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2348 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2349 "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-----",
2350 "tagger": {
2351 "name": "David Pursehouse",
2352 "email": "david.pursehouse@sonymobile.com",
2353 "date": "2014-10-06 09:02:16.000000000",
2354 "tz": 540
2355 }
2356 }
2357 ]
2358----
David Pursehouseb0ba1512015-09-10 14:17:05 +09002359
David Pursehouse8cc68902014-10-06 18:17:16 +09002360[[get-tag]]
2361=== Get Tag
2362--
2363'GET /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2364--
2365
2366Retrieves a tag of a project.
2367
2368.Request
2369----
2370 GET /projects/work%2Fmy-project/tags/v1.0 HTTP/1.0
2371----
2372
2373As response a link:#tag-info[TagInfo] entity is returned that describes the tag.
2374
2375.Response
2376----
2377 HTTP/1.1 200 OK
2378 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002379 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09002380
2381 )]}'
2382 {
2383 "ref": "refs/tags/v1.0",
2384 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2385 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2386 "message": "Annotated tag",
2387 "tagger": {
2388 "name": "David Pursehouse",
2389 "email": "david.pursehouse@sonymobile.com",
2390 "date": "2014-10-06 07:35:03.000000000",
2391 "tz": 540
2392 }
2393 }
2394----
2395
David Pursehousee1132162016-11-30 20:42:33 +09002396[[delete-tag]]
2397=== Delete Tag
2398--
2399'DELETE /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2400--
2401
2402Deletes a tag.
2403
2404.Request
2405----
2406 DELETE /projects/MyProject/tags/v1.0 HTTP/1.0
2407----
2408
2409.Response
2410----
2411 HTTP/1.1 204 No Content
2412----
David Pursehouse8cc68902014-10-06 18:17:16 +09002413
David Pursehouse467aecb2016-12-02 14:18:42 +09002414[[delete-tags]]
2415=== Delete Tags
2416--
2417'POST /projects/link:#project-name[\{project-name\}]/tags:delete'
2418--
2419
2420Delete one or more tags.
2421
2422The tags to be deleted must be provided in the request body as a
2423link:#delete-tags-input[DeleteTagsInput] entity.
2424
2425.Request
2426----
2427 POST /projects/MyProject/tags:delete HTTP/1.0
2428 Content-Type: application/json;charset=UTF-8
2429
2430 {
2431 "tags": [
2432 "v1.0",
2433 "v2.0"
2434 ]
2435 }
2436----
2437
2438.Response
2439----
2440 HTTP/1.1 204 No Content
2441----
2442
2443If some tags could not be deleted, the response is "`409 Conflict`" and the
2444error message is contained in the response body.
2445
Edwin Kempin1b993602014-07-08 16:18:45 +02002446[[commit-endpoints]]
2447== Commit Endpoints
2448
2449[[get-commit]]
2450=== Get Commit
2451--
2452'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
2453--
2454
2455Retrieves a commit of a project.
2456
2457The commit must be visible to the caller.
2458
2459.Request
2460----
2461 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
2462----
2463
2464As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
2465is returned that describes the commit.
2466
2467.Response
2468----
2469 HTTP/1.1 200 OK
2470 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002471 Content-Type: application/json; charset=UTF-8
Edwin Kempin1b993602014-07-08 16:18:45 +02002472
2473 )]}'
2474 {
2475 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
2476 "parents": [
2477 {
2478 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2479 "subject": "Migrate contributor agreements to All-Projects."
2480 }
2481 ],
2482 "author": {
2483 "name": "Shawn O. Pearce",
2484 "email": "sop@google.com",
2485 "date": "2012-04-24 18:08:08.000000000",
2486 "tz": -420
2487 },
2488 "committer": {
2489 "name": "Shawn O. Pearce",
2490 "email": "sop@google.com",
2491 "date": "2012-04-24 18:08:08.000000000",
2492 "tz": -420
2493 },
2494 "subject": "Use an EventBus to manage star icons",
2495 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2496 }
2497----
2498
Gustaf Lundh1386d592016-10-19 23:19:08 +02002499[[get-included-in]]
2500=== Get Included In
2501--
2502'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/in'
2503--
2504
2505Retrieves the branches and tags in which a change is included. As result
2506an link:rest-api-changes.html#included-in-info[IncludedInInfo] entity is returned.
2507
2508.Request
2509----
2510 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/in HTTP/1.0
2511----
2512
2513.Response
2514----
2515 HTTP/1.1 200 OK
2516 Content-Disposition: attachment
2517 Content-Type: application/json;charset=UTF-8
2518
2519 )]}'
2520 {
2521 "branches": [
2522 "master"
2523 ],
2524 "tags": []
2525 }
2526----
2527
Zhen Chend1462d82016-05-12 13:55:37 -07002528[[get-content-from-commit]]
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002529=== Get Content
2530--
2531'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
2532--
2533
2534Gets the content of a file from a certain commit.
2535
2536.Request
2537----
2538 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
2539----
2540
2541The content is returned as base64 encoded string.
2542
2543.Response
2544----
2545 HTTP/1.1 200 OK
2546 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002547 Content-Type: text/plain; charset=UTF-8
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002548
2549 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
2550----
2551
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002552
2553[[cherry-pick-commit]]
2554=== Cherry Pick Commit
2555--
2556'POST /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/cherrypick'
2557--
2558
2559Cherry-picks a commit of a project to a destination branch.
2560
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02002561To cherry pick a change revision, see link:rest-api-changes.html#cherry-pick[CherryPick].
2562
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002563The destination branch must be provided in the request body inside a
2564link:rest-api-changes.html#cherrypick-input[CherryPickInput] entity.
2565If the commit message is not set, the commit message of the source
2566commit will be used.
2567
2568.Request
2569----
2570 POST /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/cherrypick HTTP/1.0
2571 Content-Type: application/json; charset=UTF-8
2572
2573 {
2574 "message" : "Implementing Feature X",
2575 "destination" : "release-branch"
2576 }
2577----
2578
Edwin Kempinaab27d32020-01-29 13:17:04 +01002579As response a link:rest-api-changes.html#change-info[ChangeInfo] entity
2580is returned that describes the resulting cherry-picked change.
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002581
2582.Response
2583----
2584 HTTP/1.1 200 OK
2585 Content-Disposition: attachment
2586 Content-Type: application/json; charset=UTF-8
2587
2588 )]}'
2589 {
2590 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
2591 "project": "myProject",
2592 "branch": "release-branch",
2593 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
2594 "subject": "Implementing Feature X",
2595 "status": "NEW",
2596 "created": "2013-02-01 09:59:32.126000000",
2597 "updated": "2013-02-21 11:16:36.775000000",
2598 "mergeable": true,
2599 "insertions": 12,
2600 "deletions": 11,
2601 "_number": 3965,
2602 "owner": {
2603 "name": "John Doe"
2604 }
2605 }
2606----
2607
Makson Lee7824f302018-07-20 10:33:56 +08002608[[list-files]]
2609=== List Files
2610--
2611'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/'
2612--
2613
2614Lists the files that were modified, added or deleted in a commit.
2615
2616.Request
2617----
2618 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/ HTTP/1.0
2619----
2620
2621As result a map is returned that maps the link:rest-api-changes.html#file-id[file path] to a
2622link:rest-api-changes.html#file-info[FileInfo] entry. The entries in the map are
2623sorted by file path.
2624
2625.Response
2626----
2627 HTTP/1.1 200 OK
2628 Content-Disposition: attachment
2629 Content-Type: application/json; charset=UTF-8
2630
2631 )]}'
2632 {
2633 "/COMMIT_MSG": {
2634 "status": "A",
2635 "lines_inserted": 7,
2636 "size_delta": 551,
2637 "size": 551
2638 },
2639 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
2640 "lines_inserted": 5,
2641 "lines_deleted": 3,
2642 "size_delta": 98,
2643 "size": 23348
2644 }
2645 }
2646----
2647
2648The integer-valued request parameter `parent` changes the response to return a
2649list of the files which are different in this commit compared to the given
2650parent commit. This is useful for supporting review of merge commits. The value
2651is the 1-based index of the parent's position in the commit object.
2652
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002653[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002654== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002655
Edwin Kempin76202742013-02-15 13:51:50 +01002656[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002657=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002658--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002659'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002660--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002661
Edwin Kempind0a63922013-01-23 16:32:59 +01002662List custom dashboards for a project.
2663
Edwin Kempin55367622013-02-05 09:09:23 +01002664As result a list of link:#dashboard-info[DashboardInfo] entries is
2665returned.
2666
Edwin Kempind0a63922013-01-23 16:32:59 +01002667List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01002668
2669.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002670----
2671 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002672----
Edwin Kempind0a63922013-01-23 16:32:59 +01002673
Edwin Kempin37440832013-02-06 11:36:00 +01002674.Response
2675----
Edwin Kempind0a63922013-01-23 16:32:59 +01002676 HTTP/1.1 200 OK
2677 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002678 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002679
2680 )]}'
2681 [
2682 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002683 "id": "main:closed",
2684 "ref": "main",
2685 "path": "closed",
2686 "description": "Merged and abandoned changes in last 7 weeks",
2687 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002688 "is_default": true,
Edwin Kempind0a63922013-01-23 16:32:59 +01002689 "title": "Closed changes",
2690 "sections": [
2691 {
2692 "name": "Merged",
2693 "query": "status:merged age:7w"
2694 },
2695 {
2696 "name": "Abandoned",
2697 "query": "status:abandoned age:7w"
2698 }
2699 ]
2700 }
2701 ]
2702----
2703
Edwin Kempina64c4b92013-01-23 11:30:40 +01002704.Get all dashboards of the 'All-Projects' project
2705****
2706get::/projects/All-Projects/dashboards/
2707****
2708
Edwin Kempin67e923c2013-02-14 13:57:12 +01002709[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002710=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002711--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002712'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002713--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002714
Edwin Kempin67e923c2013-02-14 13:57:12 +01002715Retrieves a project dashboard. The dashboard can be defined on that
2716project or be inherited from a parent project.
2717
2718.Request
2719----
2720 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
2721----
2722
2723As response a link:#dashboard-info[DashboardInfo] entity is returned
2724that describes the dashboard.
2725
2726.Response
2727----
2728 HTTP/1.1 200 OK
2729 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002730 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002731
2732 )]}'
2733 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002734 "id": "main:closed",
2735 "ref": "main",
2736 "path": "closed",
2737 "description": "Merged and abandoned changes in last 7 weeks",
2738 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002739 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002740 "title": "Closed changes",
2741 "sections": [
2742 {
2743 "name": "Merged",
2744 "query": "status:merged age:7w"
2745 },
2746 {
2747 "name": "Abandoned",
2748 "query": "status:abandoned age:7w"
2749 }
2750 ]
2751 }
2752----
2753
2754To retrieve the default dashboard of a project use `default` as
2755dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01002756
2757.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002758----
2759 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002760----
Edwin Kempind0a63922013-01-23 16:32:59 +01002761
Edwin Kempin37440832013-02-06 11:36:00 +01002762.Response
2763----
Edwin Kempind0a63922013-01-23 16:32:59 +01002764 HTTP/1.1 200 OK
2765 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002766 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002767
2768 )]}'
2769 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002770 "id": "main:closed",
2771 "ref": "main",
2772 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01002773 "description": "Merged and abandoned changes in last 7 weeks",
2774 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002775 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002776 "title": "Closed changes",
2777 "sections": [
2778 {
2779 "name": "Merged",
2780 "query": "status:merged age:7w"
2781 },
2782 {
2783 "name": "Abandoned",
2784 "query": "status:abandoned age:7w"
2785 }
2786 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01002787 }
2788----
2789
Edwin Kempin339cb312019-08-05 15:59:58 +02002790[[create-dashboard]]
2791=== Create Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002792--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002793'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002794--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002795
Edwin Kempin339cb312019-08-05 15:59:58 +02002796Creates a project dashboard, if a project dashboard with the given
2797dashboard ID doesn't exist yet.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002798
2799Currently only supported for the `default` dashboard.
2800
Edwin Kempin339cb312019-08-05 15:59:58 +02002801The creation information for the dashboard must be provided in
Edwin Kempin67e923c2013-02-14 13:57:12 +01002802the request body as a link:#dashboard-input[DashboardInput] entity.
2803
2804.Request
2805----
2806 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002807 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002808
2809 {
2810 "id": "main:closed",
2811 "commit_message": "Define the default dashboard"
2812 }
2813----
2814
Edwin Kempin339cb312019-08-05 15:59:58 +02002815As response the new dashboard is returned as a link:#dashboard-info[
2816DashboardInfo] entity.
2817
2818.Response
2819----
2820 HTTP/1.1 201 Created
2821 Content-Disposition: attachment
2822 Content-Type: application/json; charset=UTF-8
2823
2824 )]}'
2825 {
2826 "id": "main:closed",
2827 "ref": "main",
2828 "path": "closed",
2829 "description": "Merged and abandoned changes in last 7 weeks",
2830 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
2831 "is_default": true,
2832 "title": "Closed changes",
2833 "sections": [
2834 {
2835 "name": "Merged",
2836 "query": "status:merged age:7w"
2837 },
2838 {
2839 "name": "Abandoned",
2840 "query": "status:abandoned age:7w"
2841 }
2842 ]
2843 }
2844----
2845
2846[[update-dashboard]]
2847=== Update Dashboard
2848--
2849'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
2850--
2851
2852Updates a project dashboard, if a project dashboard with the given
2853dashboard ID already exists.
2854
2855Currently only supported for the `default` dashboard.
2856
2857The update information for the dashboard must be provided in
2858the request body as a link:#dashboard-input[DashboardInput] entity.
2859
2860.Request
2861----
2862 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
2863 Content-Type: application/json; charset=UTF-8
2864
2865 {
2866 "id": "main:closed",
2867 "commit_message": "Update the default dashboard"
2868 }
2869----
2870
2871As response the updated dashboard is returned as a
Edwin Kempin67e923c2013-02-14 13:57:12 +01002872link:#dashboard-info[DashboardInfo] entity.
2873
2874.Response
2875----
2876 HTTP/1.1 200 OK
2877 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002878 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002879
2880 )]}'
2881 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002882 "id": "main:closed",
2883 "ref": "main",
2884 "path": "closed",
2885 "description": "Merged and abandoned changes in last 7 weeks",
2886 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002887 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002888 "title": "Closed changes",
2889 "sections": [
2890 {
2891 "name": "Merged",
2892 "query": "status:merged age:7w"
2893 },
2894 {
2895 "name": "Abandoned",
2896 "query": "status:abandoned age:7w"
2897 }
2898 ]
2899 }
2900----
2901
2902[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002903=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002904--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002905'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002906--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002907
Edwin Kempin67e923c2013-02-14 13:57:12 +01002908Deletes a project dashboard.
2909
2910Currently only supported for the `default` dashboard.
2911
Edwin Kempinefec4492013-02-22 10:09:23 +01002912The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05002913DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002914
2915Please note that some proxies prohibit request bodies for DELETE
2916requests.
2917
2918.Request
2919----
2920 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
2921----
2922
2923.Response
2924----
2925 HTTP/1.1 204 No Content
2926----
2927
Edwin Kempin44098d02019-10-24 09:22:34 +02002928[[label-endpoints]]
2929== Label Endpoints
2930
2931[[list-labels]]
2932=== List Labels
2933--
2934'GET /projects/link:#project-name[\{project-name\}]/labels/'
2935--
2936
2937Lists the labels that are defined in this project.
2938
2939The calling user must have read access to the `refs/meta/config` branch of the
2940project.
2941
2942.Request
2943----
2944 GET /projects/All-Projects/labels/ HTTP/1.0
2945----
2946
2947As result a list of link:#label-definition-info[LabelDefinitionInfo] entities
2948is returned that describe the labels that are defined in this project
Edwin Kempinb5275262019-10-24 16:03:27 +02002949(inherited labels are not returned unless the `inherited` parameter is set, see
2950link:#list-with-inherited-labels[below]). The returned labels are sorted by
2951label name.
Edwin Kempin44098d02019-10-24 09:22:34 +02002952
2953.Response
2954----
2955 HTTP/1.1 200 OK
2956 Content-Disposition: attachment
2957 Content-Type: application/json; charset=UTF-8
2958
2959 )]}'
2960 [
2961 {
2962 "name": "Code-Review",
Edwin Kempinb5275262019-10-24 16:03:27 +02002963 "project": "All-Projects",
Edwin Kempin44098d02019-10-24 09:22:34 +02002964 "function": "MaxWithBlock",
2965 "values": {
2966 " 0": "No score",
2967 "-1": "I would prefer this is not merged as is",
2968 "-2": "This shall not be merged",
2969 "+1": "Looks good to me, but someone else must approve",
2970 "+2": "Looks good to me, approved"
2971 },
2972 "default_value": 0,
2973 "can_override": true,
2974 "copy_min_score": true,
2975 "copy_all_scores_if_no_change": true,
2976 "copy_all_scores_on_trivial_rebase": true,
2977 "allow_post_submit": true
2978 }
2979 ]
2980----
2981
Edwin Kempinb5275262019-10-24 16:03:27 +02002982[[list-with-inherited-labels]]
2983To include inherited labels from all parent projects the parameter `inherited`
2984can be set.
2985
2986The calling user must have read access to the `refs/meta/config` branch of the
2987project and all its parent projects.
2988
2989.Request
2990----
2991 GET /projects/My-Project/labels/?inherited HTTP/1.0
2992----
2993
2994As result a list of link:#label-definition-info[LabelDefinitionInfo] entities
2995is returned that describe the labels that are defined in this project and in
2996all its parent projects. The returned labels are sorted by parent projects
2997in-order from `All-Projects` through the project hierarchy to this project.
2998Labels that belong to the same project are sorted by label name.
2999
3000.Response
3001----
3002 HTTP/1.1 200 OK
3003 Content-Disposition: attachment
3004 Content-Type: application/json; charset=UTF-8
3005
3006 )]}'
3007 [
3008 {
3009 "name": "Code-Review",
3010 "project": "All-Projects",
3011 "function": "MaxWithBlock",
3012 "values": {
3013 " 0": "No score",
3014 "-1": "I would prefer this is not merged as is",
3015 "-2": "This shall not be merged",
3016 "+1": "Looks good to me, but someone else must approve",
3017 "+2": "Looks good to me, approved"
3018 },
3019 "default_value": 0,
3020 "can_override": true,
3021 "copy_min_score": true,
3022 "copy_all_scores_if_no_change": true,
3023 "copy_all_scores_on_trivial_rebase": true,
3024 "allow_post_submit": true
3025 },
3026 {
3027 "name": "Foo-Review",
3028 "project": "My-Project",
3029 "function": "MaxWithBlock",
3030 "values": {
3031 " 0": "No score",
3032 "-1": "I would prefer this is not merged as is",
3033 "-2": "This shall not be merged",
3034 "+1": "Looks good to me, but someone else must approve",
3035 "+2": "Looks good to me, approved"
3036 },
3037 "default_value": 0,
3038 "can_override": true,
3039 "copy_any_score": true,
3040 "allow_post_submit": true
3041 }
3042 ]
3043----
3044
Edwin Kempinaa56f442019-10-25 08:40:24 +02003045[[get-label]]
3046=== Get Label
3047--
3048'GET /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3049--
3050
3051Retrieves the definition of a label that is defined in this project.
3052
3053The calling user must have read access to the `refs/meta/config` branch of the
3054project.
3055
3056.Request
3057----
3058 GET /projects/All-Projects/labels/Code-Review HTTP/1.0
3059----
3060
3061As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3062returned that describes the label.
3063
3064.Response
3065----
3066 HTTP/1.1 200 OK
3067 Content-Disposition: attachment
3068 Content-Type: application/json; charset=UTF-8
3069
3070 )]}'
3071 {
3072 "name": "Code-Review",
3073 "project": "All-Projects",
3074 "function": "MaxWithBlock",
3075 "values": {
3076 " 0": "No score",
3077 "-1": "I would prefer this is not merged as is",
3078 "-2": "This shall not be merged",
3079 "+1": "Looks good to me, but someone else must approve",
3080 "+2": "Looks good to me, approved"
3081 },
3082 "default_value": 0,
3083 "can_override": true,
3084 "copy_min_score": true,
3085 "copy_all_scores_if_no_change": true,
3086 "copy_all_scores_on_trivial_rebase": true,
3087 "allow_post_submit": true
3088 }
3089----
3090
Edwin Kempina020d262019-10-25 16:36:45 +02003091[[create-label]]
3092=== Create Label
3093--
3094'PUT /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3095--
3096
3097Creates a new label definition in this project.
3098
3099The calling user must have write access to the `refs/meta/config` branch of the
3100project.
3101
3102If a label with this name is already defined in this project, this label
3103definition is updated (see link:#set-label[Set Label]).
3104
3105.Request
3106----
3107 PUT /projects/My-Project/labels/Foo HTTP/1.0
3108 Content-Type: application/json; charset=UTF-8
3109
3110 {
3111 "commit_message": "Create Foo Label",
3112 "values": {
3113 " 0": "No score",
3114 "-1": "I would prefer this is not merged as is",
3115 "-2": "This shall not be merged",
3116 "+1": "Looks good to me, but someone else must approve",
3117 "+2": "Looks good to me, approved"
3118 }
3119 }
3120----
3121
3122As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3123returned that describes the created label.
3124
3125.Response
3126----
3127 HTTP/1.1 200 OK
3128 Content-Disposition: attachment
3129 Content-Type: application/json; charset=UTF-8
3130
3131 )]}'
3132 {
3133 "name": "Foo",
3134 "project_name": "My-Project",
3135 "function": "MaxWithBlock",
3136 "values": {
3137 " 0": "No score",
3138 "-1": "I would prefer this is not merged as is",
3139 "-2": "This shall not be merged",
3140 "+1": "Looks good to me, but someone else must approve",
3141 "+2": "Looks good to me, approved"
3142 },
3143 "default_value": 0,
3144 "can_override": true,
3145 "copy_all_scores_if_no_change": true,
3146 "allow_post_submit": true
3147 }
3148----
3149
Edwin Kempinb5e87452019-10-25 13:28:46 +02003150[[set-label]]
3151=== Set Label
3152--
3153'PUT /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3154--
3155
3156Updates the definition of a label that is defined in this project.
3157
3158The calling user must have write access to the `refs/meta/config` branch of the
3159project.
3160
3161Properties which are not set in the input entity are not modified.
3162
3163.Request
3164----
3165 PUT /projects/All-Projects/labels/Code-Review HTTP/1.0
3166 Content-Type: application/json; charset=UTF-8
3167
3168 {
3169 "commit_message": "Ignore self approvals for Code-Review label",
3170 "ignore_self_approval": true
3171 }
3172----
3173
3174As response a link:#label-definition-info[LabelDefinitionInfo] entity is
3175returned that describes the updated label.
3176
3177.Response
3178----
3179 HTTP/1.1 200 OK
3180 Content-Disposition: attachment
3181 Content-Type: application/json; charset=UTF-8
3182
3183 )]}'
3184 {
3185 "name": "Code-Review",
3186 "project": "All-Projects",
3187 "function": "MaxWithBlock",
3188 "values": {
3189 " 0": "No score",
3190 "-1": "I would prefer this is not merged as is",
3191 "-2": "This shall not be merged",
3192 "+1": "Looks good to me, but someone else must approve",
3193 "+2": "Looks good to me, approved"
3194 },
3195 "default_value": 0,
3196 "can_override": true,
3197 "copy_min_score": true,
3198 "copy_all_scores_if_no_change": true,
3199 "copy_all_scores_on_trivial_rebase": true,
3200 "allow_post_submit": true,
3201 "ignore_self_approval": true
3202 }
3203----
3204
Edwin Kempin920f6f82019-10-28 10:43:13 +01003205[[delete-label]]
3206=== Delete Label
3207--
3208'DELETE /projects/link:#project-name[\{project-name\}]/labels/link:#label-name[\{label-name\}]'
3209--
3210
3211Deletes the definition of a label that is defined in this project.
3212
3213The calling user must have write access to the `refs/meta/config` branch of the
3214project.
3215
3216The request body does not need to include a link:#delete-label-input[
3217DeleteLabelInput] entity if no commit message is specified.
3218
3219.Request
3220----
Edwin Kempin6b96af62019-10-28 13:55:14 +01003221 DELETE /projects/My-Project/labels/Foo-Review HTTP/1.0
Edwin Kempin920f6f82019-10-28 10:43:13 +01003222 Content-Type: application/json; charset=UTF-8
3223
3224 {
3225 "commit_message": "Delete Foo-Review label",
3226 }
3227----
3228
3229If a label was deleted the response is "`204 No Content`".
3230
3231.Response
3232----
3233 HTTP/1.1 204 No Content
3234----
3235
Edwin Kempin83d6d222019-10-28 13:45:52 +01003236[[batch-update-labels]]
3237=== Batch Update Labels
3238--
3239'POST /projects/link:#project-name[\{project-name\}]/labels/'
3240--
3241
3242Creates/updates/deletes multiple label definitions in this project at once.
3243
3244The calling user must have write access to the `refs/meta/config` branch of the
3245project.
3246
3247The updates must be specified in the request body as
3248link:#batch-label-input[BatchLabelInput] entity.
3249
3250The updates are processed in the following order:
3251
32521. label deletions
32532. label creations
32543. label updates
3255
3256.Request
3257----
3258 POST /projects/My-Project/labels/ HTTP/1.0
3259 Content-Type: application/json; charset=UTF-8
3260
3261 {
3262 "commit_message": "Update Labels",
3263 "delete": [
3264 "Old-Review",
3265 "Unused-Review"
3266 ],
3267 "create": [
3268 {
3269 "name": "Foo-Review",
3270 "values": {
3271 " 0": "No score",
3272 "-1": "I would prefer this is not merged as is",
3273 "-2": "This shall not be merged",
3274 "+1": "Looks good to me, but someone else must approve",
3275 "+2": "Looks good to me, approved"
3276 }
3277 ],
3278 "update:" {
3279 "Bar-Review": {
3280 "function": "MaxWithBlock"
3281 },
3282 "Baz-Review": {
3283 "copy_min_score": true
3284 }
3285 }
3286 }
3287----
3288
3289If the label updates were done successfully the response is "`200 OK`".
3290
3291.Response
3292----
3293 HTTP/1.1 200 OK
3294----
3295
Edwin Kempin34d83352013-02-06 10:40:17 +01003296
3297[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003298== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01003299
Edwin Kempin196e1732013-05-09 15:12:34 +02003300[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003301=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02003302The name of a branch or `HEAD`. The prefix `refs/heads/` can be
3303omitted.
3304
Edwin Kempin1b993602014-07-08 16:18:45 +02003305[[commit-id]]
3306=== \{commit-id\}
3307Commit ID.
3308
David Pursehouse8cc68902014-10-06 18:17:16 +09003309[[tag-id]]
3310=== \{tag-id\}
3311The name of a tag. The prefix `refs/tags/` can be omitted.
3312
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003313[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003314=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01003315The ID of a dashboard in the format '<ref>:<path>'.
3316
3317A special dashboard ID is `default` which represents the default
3318dashboard of a project.
3319
Edwin Kempinaa56f442019-10-25 08:40:24 +02003320[[label-name]]
3321=== \{label-name\}
3322The name of a review label.
3323
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003324[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003325=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01003326The name of the project.
3327
Edwin Kempina9e94ab2015-03-06 10:35:39 +01003328If the name ends with `.git`, the suffix will be automatically removed.
3329
Edwin Kempin34d83352013-02-06 10:40:17 +01003330
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003331[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003332== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003333
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02003334[[access-check-info]]
3335=== AccessCheckInfo
3336
3337The `AccessCheckInfo` entity is the result of an access check.
3338
3339[options="header",cols="1,^1,5"]
3340|=========================================
3341|Field Name ||Description
3342|`status` ||The HTTP status code for the access.
Han-Wen Nienhuys3364c472018-10-01 16:49:42 +02003343200 means success and 403 means denied.
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02003344|`message` |optional|A clarifying message if `status` is not 200.
3345|=========================================
3346
Edwin Kempinbf9df392018-01-12 15:20:48 +01003347[[auto_closeable_changes_check_input]]
3348=== AutoCloseableChangesCheckInput
3349The `AutoCloseableChangesCheckInput` entity contains options for running
3350the link:#auto-closeable-changes-check[AutoCloseableChangesCheck].
3351
3352[options="header",cols="1,^2,4"]
3353|=============================
3354|Field Name ||Description
3355|`fix` |optional|
3356Whether auto-closeable changes should be closed automatically.
3357|`branch` ||
3358The branch for which the link:#auto-closeable-changes-check[
3359AutoCloseableChangesCheck] should be performed. The 'refs/heads/'
3360prefix for the branch name can be omitted.
3361|`skip_commits` |optional|
3362Number of commits that should be skipped when walking the commits of
3363the branch.
3364|`max_commits` |optional|
3365Maximum number of commits to walk. If not specified this defaults to
336610,000 commits. 10,000 is also the maximum that can be set.
3367Auto-closing changes is an expensive operation and the more commits
3368are walked the slower it gets. This is why you should avoid walking too
3369many commits.
3370|=============================
3371
3372[[auto_closeable_changes_check_result]]
3373=== AutoCloseableChangesCheckResult
3374The `AutoCloseableChangesCheckResult` entity contains the results of
3375running the link:#auto-closeable-changes-check[AutoCloseableChangesCheck]
3376on a project.
3377
3378[options="header",cols="1,6"]
3379|====================================
3380|Field Name |Description
3381|`auto_closeable_changes`|
3382Changes that can be auto-closed as list of
3383link:rest-api-changes.html#change-info[ChangeInfo] entities. For each
3384returned link:rest-api-changes.html#change-info[ChangeInfo] entity the
3385`problems` field is populated that includes details about the detected
3386issues. If `fix` in the link:#auto_closeable_changes_check_input[
3387AutoCloseableChangesCheckInput] was set to `true`, `status` and
3388`outcome` in link:rest-api-changes.html#problem-info[ProblemInfo] are
3389populated. If the status says `FIXED` Gerrit was able to auto-close the
3390change now.
3391|====================================
3392
Edwin Kempin62946742014-07-09 11:17:58 +02003393[[ban-input]]
3394=== BanInput
3395The `BanInput` entity contains information for banning commits in a
3396project.
3397
David Pursehouseae367192014-11-25 17:24:47 +09003398[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02003399|=======================
3400|Field Name||Description
3401|`commits` ||List of commits to be banned.
3402|`reason` |optional|Reason for banning the commits.
3403|=======================
3404
3405[[ban-result-info]]
3406=== BanResultInfo
3407The `BanResultInfo` entity describes the result of banning commits.
3408
David Pursehouseae367192014-11-25 17:24:47 +09003409[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02003410|=============================
3411|Field Name ||Description
3412|`newly_banned` |optional|List of newly banned commits.
3413|`already_banned`|optional|List of commits that were already banned.
3414|`ignored` |optional|List of object IDs that were ignored.
3415|=============================
3416
Edwin Kempin521c1242015-01-23 12:44:44 +01003417[[branch-info]]
3418=== BranchInfo
3419The `BranchInfo` entity contains information about a branch.
3420
3421[options="header",cols="1,^2,4"]
3422|=========================
3423|Field Name ||Description
3424|`ref` ||The ref of the branch.
3425|`revision` ||The revision to which the branch points.
David Pursehoused00515e2017-11-10 15:57:41 +09003426|`can_delete`|not set if `false`|
Edwin Kempin521c1242015-01-23 12:44:44 +01003427Whether the calling user can delete this branch.
3428|`web_links` |optional|
3429Links to the branch in external sites as a list of
3430link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
3431|=========================
3432
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003433[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003434=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003435The `BranchInput` entity contains information for the creation of
3436a new branch.
3437
David Pursehouseae367192014-11-25 17:24:47 +09003438[options="header",cols="1,^2,4"]
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02003439|=======================
3440|Field Name||Description
3441|`ref` |optional|
3442The name of the branch. The prefix `refs/heads/` can be
3443omitted. +
3444If set, must match the branch ID in the URL.
3445|`revision`|optional|
3446The base revision of the new branch. +
3447If not set, `HEAD` will be used as base revision.
3448|=======================
3449
Edwin Kempinbf9df392018-01-12 15:20:48 +01003450[[check-project-input]]
3451=== CheckProjectInput
3452The `CheckProjectInput` entity contains information about which
3453consistency checks should be run on a project.
3454
3455[options="header",cols="1,^2,4"]
3456|===========================================
3457|Field Name ||Description
3458|`auto_closeable_changes_check`|optional|
3459Parameters for the link:#auto-closeable-changes-check[
3460AutoCloseableChangesCheck] as
3461link:rest-api-changes.html#auto_closeable_changes_check_input[
3462AutoCloseableChangesCheckInput] entity.
3463|===========================================
3464
3465[[check-project-result-info]]
3466=== CheckProjectResultInfo
3467The `CheckProjectResultInfo` entity contains results for consistency
3468checks that have been run on a project.
3469
3470[options="header",cols="1,^2,4"]
3471|==================================================
3472|Field Name ||Description
3473|`auto_closeable_changes_check_result`|optional|
3474Results for the link:#auto-closeable-changes-check[
3475AutoCloseableChangesCheck] as
3476link:rest-api-changes.html#auto_closeable_changes_check_result[
3477AutoCloseableChangesCheckResult] entity.
3478|==================================================
3479
Edwin Kempin043436d2018-10-17 12:23:22 +02003480[[commentlink-info]]
3481=== CommentLinkInfo
3482The `CommentLinkInfo` entity describes a
3483link:config-gerrit.html#commentlink[commentlink].
3484
3485[options="header",cols="1,^2,4"]
3486|==================================================
3487|Field Name | |Description
3488|`match` | |A JavaScript regular expression to match
3489positions to be replaced with a hyperlink, as documented in
Gal Paikin86367472019-08-02 09:59:42 +02003490link:config-gerrit.html#commentlink.name.match[commentlink.name.match].
Edwin Kempin043436d2018-10-17 12:23:22 +02003491|`link` | |The URL to direct the user to whenever the
3492regular expression is matched, as documented in
Gal Paikin86367472019-08-02 09:59:42 +02003493link:config-gerrit.html#commentlink.name.link[commentlink.name.link].
Edwin Kempin043436d2018-10-17 12:23:22 +02003494|`enabled` |optional|Whether the commentlink is enabled, as documented
Gal Paikin86367472019-08-02 09:59:42 +02003495in link:config-gerrit.html#commentlink.name.enabled[
Edwin Kempin043436d2018-10-17 12:23:22 +02003496commentlink.name.enabled]. If not set the commentlink is enabled.
David Pursehouse67c8f142018-10-14 14:01:29 +09003497
3498[[commentlink-input]]
3499=== CommentLinkInput
3500The `CommentLinkInput` entity describes the input for a
3501link:config-gerrit.html#commentlink[commentlink].
3502
3503|==================================================
3504[options="header",cols="1,^2,4"]
3505|==================================================
3506|Field Name | |Description
3507|`match` | |A JavaScript regular expression to match
3508positions to be replaced with a hyperlink, as documented in
3509link:config-gerrit.html#commentlink.name.match[commentlink.name.match].
3510|`link` | |The URL to direct the user to whenever the
3511regular expression is matched, as documented in
3512link:config-gerrit.html#commentlink.name.link[commentlink.name.link].
3513|`enabled` |optional|Whether the commentlink is enabled, as documented
3514in link:config-gerrit.html#commentlink.name.enabled[
3515commentlink.name.enabled]. If not set the commentlink is enabled.
Edwin Kempin043436d2018-10-17 12:23:22 +02003516|==================================================
3517
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003518[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003519=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003520The `ConfigInfo` entity contains information about the effective project
3521configuration.
3522
David Pursehouseae367192014-11-25 17:24:47 +09003523[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02003524|=======================================================
3525|Field Name ||Description
3526|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003527The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003528|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003529link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3530authors must complete a contributor agreement on the site before
3531pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003532|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003533link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3534Gerrit will try to perform a 3-way merge of text file content when a
3535file has been modified by both the destination branch and the change
3536being submitted. This option only takes effect if submit type is not
3537FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003538|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003539link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3540each change must contain a Signed-off-by line from either the author or
3541the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003542|`create_new_change_for_all_not_in_target` |optional|
3543link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3544a new change is created for every commit not in target branch.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02003545|`require_change_id` |optional|
3546link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
3547valid link:user-changeid.html[Change-Id] footer in any commit uploaded
3548for review is required. This does not apply to commits pushed directly
3549to a branch or tag. This property is deprecated and will be removed in
3550a future release.
Doug Claar1b0f76252016-03-23 13:34:55 -07003551|`enable_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz5170e0f2015-06-18 21:05:29 -04003552link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3553signed push validation is enabled on the project.
Doug Claar1b0f76252016-03-23 13:34:55 -07003554|`require_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz0543c732015-10-20 10:35:26 -04003555link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3556signed push validation is required on the project.
Saša Živkov225b7a72015-11-17 17:37:43 +01003557|`reject_implicit_merges`|optional|
3558link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3559implicit merges should be rejected on changes pushed to the project.
David Ostrovsky96909942018-06-10 08:30:33 +02003560|`private_by_default` ||
Changcheng Xiaod089b4a2017-08-10 14:05:22 +02003561link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3562all new changes are set as private by default.
David Ostrovsky96909942018-06-10 08:30:33 +02003563|`work_in_progress_by_default`||
3564link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3565all new changes are set as work-in-progress by default.
3566|`max_object_size_limit` ||
Edwin Kempin3c99f592013-07-15 10:12:27 +02003567The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
3568limit] of this project as a link:#max-object-size-limit-info[
3569MaxObjectSizeLimitInfo] entity.
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04003570|`default_submit_type` ||
3571link:#submit-type-info[SubmitTypeInfo] that describes the default submit type of
3572the project, when not overridden at the change level.
Edwin Kempin3c99f592013-07-15 10:12:27 +02003573|`submit_type` ||
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04003574Deprecated; equivalent to link:#submit-type-info[`value`] in
3575`default_submit_type`.
Patrick Hiesel5a316352017-06-22 15:38:06 +02003576|`match_author_to_committer_date` |optional|
3577link:#inherited-boolean-info[InheritedBooleanInfo] that indicates whether
3578a change's author date will be changed to match its submitter date upon submit.
Edwin Kempin3c99f592013-07-15 10:12:27 +02003579|`state` |optional|
3580The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
3581Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02003582|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02003583Map with the comment link configurations of the project. The name of
Edwin Kempin043436d2018-10-17 12:23:22 +02003584the comment link configuration is mapped to a link:#commentlink-info[
3585CommentlinkInfo] entity.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003586|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003587Plugin configuration as map which maps the plugin name to a map of
3588parameter names to link:#config-parameter-info[ConfigParameterInfo]
3589entities.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003590|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02003591Actions the caller might be able to perform on this project. The
3592information is a map of view names to
Patrick Hieseldc285c72018-01-08 17:20:15 +01003593|`reject_empty_commit` |optional|
3594link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
3595empty commits should be rejected when a change is merged.
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02003596link:rest-api-changes.html#action-info[ActionInfo] entities.
David Pursehouse510b87d2014-11-25 16:46:28 +09003597|=======================================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003598
Edwin Kempina23eb102013-07-17 09:10:54 +02003599[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003600=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02003601The `ConfigInput` entity describes a new project configuration.
3602
David Pursehouseae367192014-11-25 17:24:47 +09003603[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02003604|======================================================
3605|Field Name ||Description
3606|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003607The new description of the project. +
3608If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003609|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003610Whether authors must complete a contributor agreement on the site
3611before pushing any commits or changes to this project. +
3612Can be `TRUE`, `FALSE` or `INHERIT`. +
3613If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003614|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003615Whether Gerrit will try to perform a 3-way merge of text file content
3616when a file has been modified by both the destination branch and the
3617change being submitted. This option only takes effect if submit type is
3618not FAST_FORWARD_ONLY. +
3619Can be `TRUE`, `FALSE` or `INHERIT`. +
3620If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003621|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003622Whether each change must contain a Signed-off-by line from either the
3623author or the uploader in the commit message. +
3624Can be `TRUE`, `FALSE` or `INHERIT`. +
3625If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003626|`create_new_change_for_all_not_in_target` |optional|
3627Whether a new change will be created for every commit not in target
3628branch. +
3629Can be `TRUE`, `FALSE` or `INHERIT`. +
3630If not set, this setting is not updated.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02003631|`require_change_id` |optional|
3632Whether a valid link:user-changeid.html[Change-Id] footer in any commit
3633uploaded for review is required. This does not apply to commits pushed
3634directly to a branch or tag. +
3635Can be `TRUE`, `FALSE` or `INHERIT`. +
3636If not set, this setting is not updated.
3637This property is deprecated and will be removed in
3638a future release.
Saša Živkov225b7a72015-11-17 17:37:43 +01003639|`reject_implicit_merges` |optional|
3640Whether a check for implicit merges will be performed when changes
3641are pushed for review. +
3642Can be `TRUE`, `FALSE` or `INHERIT`. +
3643If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003644|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003645The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
3646limit] of this project as a link:#max-object-size-limit-info[
3647MaxObjectSizeLimitInfo] entity. +
3648If set to `0`, the max object size limit is removed. +
3649If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003650|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003651The default submit type of the project, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02003652`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Edwin Kempina23eb102013-07-17 09:10:54 +02003653`CHERRY_PICK`. +
3654If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003655|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02003656The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
3657Not set if the project state is `ACTIVE`. +
3658If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003659|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003660Plugin configuration values as map which maps the plugin name to a map
3661of parameter names to values.
Patrick Hieseldc285c72018-01-08 17:20:15 +01003662|`reject_empty_commit` |optional|
3663Whether empty commits should be rejected when a change is merged.
3664Can be `TRUE`, `FALSE` or `INHERIT`. +
3665If not set, this setting is not updated.
David Pursehouse67c8f142018-10-14 14:01:29 +09003666|commentlinks |optional|
3667Map of commentlink names to link:#commentlink-input[CommentLinkInput]
3668entities to add or update on the project. If the given commentlink
3669already exists, it will be updated with the given values, otherwise
3670it will be created. If the value is null, that entry is deleted.
David Pursehouse510b87d2014-11-25 16:46:28 +09003671|======================================================
Edwin Kempina23eb102013-07-17 09:10:54 +02003672
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003673[[config-parameter-info]]
David Pursehouseb10c2662016-12-06 08:41:33 +09003674=== ConfigParameterInfo
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003675The `ConfigParameterInfo` entity describes a project configuration
3676parameter.
3677
David Pursehouseae367192014-11-25 17:24:47 +09003678[options="header",cols="1,^2,4"]
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003679|===============================
3680|Field Name ||Description
3681|`display_name` |optional|
3682The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01003683|`description` |optional|
3684The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01003685|`warning` |optional|
3686Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003687|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01003688The type of the configuration parameter. Can be `STRING`, `INT`,
3689`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003690|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01003691The value of the configuration parameter as string. If the parameter
3692is inheritable this is the effective value which is deduced from
3693`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01003694|`values` |optional|
3695The list of values. Only set if the `type` is `ARRAY`.
Doug Claar1b0f76252016-03-23 13:34:55 -07003696|`editable` |`false` if not set|
Edwin Kempin0d485232013-11-17 18:55:48 +01003697Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01003698|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01003699The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01003700|`inheritable` |`false` if not set|
3701Whether the configuration parameter can be inherited.
3702|`configured_value`|optional|
3703The value of the configuration parameter that is configured on this
3704project, only set if `inheritable` is true.
3705|`inherited_value` |optional|
3706The inherited value of the configuration parameter, only set if
3707`inheritable` is true.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01003708|===============================
3709
Edwin Kempin55367622013-02-05 09:09:23 +01003710[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003711=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01003712The `DashboardInfo` entity contains information about a project
3713dashboard.
3714
David Pursehouseae367192014-11-25 17:24:47 +09003715[options="header",cols="1,^2,4"]
Edwin Kempin55367622013-02-05 09:09:23 +01003716|===============================
3717|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01003718|`id` ||
3719The ID of the dashboard. The ID has the format '<ref>:<path>',
3720where ref and path are URL encoded.
3721|`project` ||
3722The name of the project for which this dashboard is returned.
3723|`defining_project`||
3724The name of the project in which this dashboard is defined.
3725This is different from `project` if the dashboard is inherited from a
3726parent project.
3727|`ref` ||
3728The name of the ref in which the dashboard is defined, without the
3729`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
3730|`path` ||
3731The path of the file in which the dashboard is defined.
3732|`description` |optional|The description of the dashboard.
3733|`foreach` |optional|
3734Subquery that applies to all sections in the dashboard. +
3735Tokens such as `${project}` are not resolved.
3736|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09003737The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01003738The URL is relative to the canonical web URL. +
3739Tokens in the queries such as `${project}` are resolved.
David Pursehouse8edc1992017-09-15 17:12:09 +09003740|`is_default` |not set if `false`|
Edwin Kempin55367622013-02-05 09:09:23 +01003741Whether this is the default dashboard of the project.
3742|`title` |optional|The title of the dashboard.
3743|`sections` ||
3744The list of link:#dashboard-section-info[sections] in the dashboard.
3745|===============================
3746
Edwin Kempin67e923c2013-02-14 13:57:12 +01003747[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003748=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01003749The `DashboardInput` entity contains information to create/update a
3750project dashboard.
3751
David Pursehouseae367192014-11-25 17:24:47 +09003752[options="header",cols="1,^2,4"]
Edwin Kempin67e923c2013-02-14 13:57:12 +01003753|=============================
3754|Field Name ||Description
3755|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01003756URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01003757|`commit_message`|optional|
3758Message that should be used to commit the change of the dashboard.
3759|=============================
3760
Edwin Kempin55367622013-02-05 09:09:23 +01003761[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003762=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01003763The `DashboardSectionInfo` entity contains information about a section
3764in a dashboard.
3765
David Pursehouseae367192014-11-25 17:24:47 +09003766[options="header",cols="1,6"]
Edwin Kempin55367622013-02-05 09:09:23 +01003767|===========================
3768|Field Name |Description
3769|`name` |The title of the section.
3770|`query` |The query of the section. +
3771Tokens such as `${project}` are not resolved.
3772|===========================
3773
Edwin Kempin920f6f82019-10-28 10:43:13 +01003774[[delete-label-input]]
3775=== DeleteLabelInput
3776The `DeleteLabelInput` entity contains information for deleting a label
3777definition in a project.
3778
3779[options="header",cols="1,^2,4"]
3780|=============================
3781|Field Name ||Description
3782|`commit_message`|optional|
3783Message that should be used to commit the deletion of the label in the
3784`project.config` file to the `refs/meta/config` branch.
3785|=============================
3786
Hugo Arèsef8e3202015-01-12 15:09:06 -05003787[[delete-branches-input]]
3788=== DeleteBranchesInput
3789The `DeleteBranchesInput` entity contains information about branches that should
3790be deleted.
3791
3792[options="header",width="50%",cols="1,6"]
3793|==========================
3794|Field Name |Description
3795|`branches` |A list of branch names that identify the branches that should be
3796deleted.
3797|==========================
3798
David Pursehouse467aecb2016-12-02 14:18:42 +09003799[[delete-tags-input]]
3800=== DeleteTagsInput
3801The `DeleteTagsInput` entity contains information about tags that should
3802be deleted.
3803
3804[options="header",width="50%",cols="1,6"]
3805|==========================
3806|Field Name |Description
3807|`tags` |A list of tag names that identify the tags that should be
3808deleted.
3809|==========================
3810
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01003811[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003812=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01003813The `GCInput` entity contains information to run the Git garbage
3814collection.
3815
David Pursehouseae367192014-11-25 17:24:47 +09003816[options="header",cols="1,^2,4"]
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01003817|=============================
3818|Field Name ||Description
3819|`show_progress` |`false` if not set|
3820Whether progress information should be shown.
Christian Halstrick2f94e2e2015-03-11 15:13:31 +01003821|`aggressive` |`false` if not set|
3822Whether an aggressive garbage collection should be done.
Adrian Görler92410a12015-11-03 16:20:56 +01003823|`async` |`false` if not set|
3824Whether the garbage collection should run asynchronously.
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01003825|=============================
3826
Edwin Kempin6b813372013-03-13 17:07:33 +01003827[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003828=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01003829The `HeadInput` entity contains information for setting `HEAD` for a
3830project.
3831
David Pursehouseae367192014-11-25 17:24:47 +09003832[options="header",cols="1,6"]
Edwin Kempin6b813372013-03-13 17:07:33 +01003833|============================
3834|Field Name |Description
3835|`ref` |
3836The ref to which `HEAD` should be set, the `refs/heads` prefix can be
3837omitted.
3838|============================
3839
Patrick Hiesel20d981e2018-07-04 09:48:21 +02003840[[index-project-input]]
3841=== IndexProjectInput
3842The `IndexProjectInput` contains parameters for indexing a project.
3843
3844[options="header",cols="1,^2,4"]
3845|================================
3846|Field Name ||Description
3847|`index_children` ||
3848If children should be indexed recursively.
Patrick Hiesel6b7d9b12018-07-10 14:11:35 +02003849|`async` ||
3850If projects should be indexed asynchronously.
Patrick Hiesel20d981e2018-07-04 09:48:21 +02003851|================================
3852
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003853[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003854=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003855A boolean value that can also be inherited.
3856
David Pursehouseae367192014-11-25 17:24:47 +09003857[options="header",cols="1,^2,4"]
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003858|================================
3859|Field Name ||Description
3860|`value` ||
3861The effective boolean value.
3862|`configured_value` ||
3863The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
3864|`inherited_value` |optional|
3865The boolean value inherited from the parent. +
3866Not set if there is no parent.
3867|================================
3868
Edwin Kempin44098d02019-10-24 09:22:34 +02003869[[label-definition-info]]
3870=== LabelDefinitionInfo
Edwin Kempin07bd7132019-11-11 13:11:00 +01003871The `LabelDefinitionInfo` entity describes a link:config-labels.html[
Edwin Kempin44098d02019-10-24 09:22:34 +02003872review label].
3873
3874[options="header",cols="1,^2,4"]
3875|=============================
3876|Field Name ||Description
3877|`name` ||
3878The link:config-labels.html#label_name[name] of the label.
Edwin Kempinb5275262019-10-24 16:03:27 +02003879|`project_name` ||
3880The name of the project in which this label is defined.
Edwin Kempin44098d02019-10-24 09:22:34 +02003881|`function` ||
3882The link:config-labels.html#label_function[function] of the label (can be
3883`MaxWithBlock`, `AnyWithBlock`, `MaxNoBlock`, `NoBlock`, `NoOp` and `PatchSetLock`.
3884|`values` ||
3885The link:config-labels.html#label_value[values] of the label as a map of label
3886value to value description. The label values are formatted strings, e.g. "+1"
3887instead of "1", " 0" instead of "0".
3888|`default_value` ||
3889The link:config-labels.html#label_defaultValue[default value] of the label (as
3890integer).
3891|`branches` |optional|
3892A list of link:config-labels.html#label_branch[branches] for which the label
3893applies. A branch can be a ref, a ref pattern or a regular expression. If not
3894set, the label applies for all branches.
3895|`can_override` |`false` if not set|
3896Whether this label can be link:config-labels.html#label_canOverride[overridden]
3897by child projects.
3898|`copy_any_score`|`false` if not set|
3899Whether link:config-labels.html#label_copyAnyScore[copyAnyScore] is set on the
3900label.
3901|`copy_min_score`|`false` if not set|
3902Whether link:config-labels.html#label_copyMinScore[copyMinScore] is set on the
3903label.
3904|`copy_max_score`|`false` if not set|
3905Whether link:config-labels.html#label_copyMaxScore[copyMaxScore] is set on the
3906label.
3907|`copy_all_scores_if_no_change`|`false` if not set|
3908Whether link:config-labels.html#label_copyAllScoresIfNoChange[
3909copyAllScoresIfNoChange] is set on the label.
3910|`copy_all_scores_if_no_code_change`|`false` if not set|
3911Whether link:config-labels.html#label_copyAllScoresIfNoCodeChange[
3912copyAllScoresIfNoCodeChange] is set on the label.
3913|`copy_all_scores_on_trivial_rebase`|`false` if not set|
3914Whether link:config-labels.html#label_copyAllScoresOnTrivialRebase[
3915copyAllScoresOnTrivialRebase] is set on the label.
3916|`copy_all_scores_on_merge_first_parent_update`|`false` if not set|
3917Whether link:config-labels.html#label_copyAllScoresOnMergeFirstParentUpdate[
3918copyAllScoresOnMergeFirstParentUpdate] is set on the label.
Edwin Kempin33c13a42020-01-10 11:38:06 +01003919|`copy_values` |optional|
3920List of values that should be copied forward when a new patch set is uploaded.
Edwin Kempin44098d02019-10-24 09:22:34 +02003921|`allow_post_submit`|`false` if not set|
3922Whether link:config-labels.html#label_allowPostSubmit[allowPostSubmit] is set
3923on the label.
3924|`ignore_self_approval`|`false` if not set|
3925Whether link:config-labels.html#label_ignoreSelfApproval[ignoreSelfApproval] is
3926set on the label.
3927|=============================
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02003928
Edwin Kempinb5e87452019-10-25 13:28:46 +02003929[[label-definition-input]]
3930=== LabelDefinitionInput
Edwin Kempin07bd7132019-11-11 13:11:00 +01003931The `LabelDefinitionInput` entity describes a link:config-labels.html[
Edwin Kempinb5e87452019-10-25 13:28:46 +02003932review label].
3933
3934[options="header",cols="1,^2,4"]
3935|=============================
3936|Field Name ||Description
3937|`commit_message`|optional|
3938Message that should be used to commit the change of the label in the
Edwin Kempin83d6d222019-10-28 13:45:52 +01003939`project.config` file to the `refs/meta/config` branch.+
3940Must not be set if this `LabelDefinitionInput` entity is contained in a
3941link:#batch-label-input[BatchLabelInput] entity.
Edwin Kempinb5e87452019-10-25 13:28:46 +02003942|`name` |optional|
Edwin Kempin83d6d222019-10-28 13:45:52 +01003943The new link:config-labels.html#label_name[name] of the label.+
3944For label creation the name is required if this `LabelDefinitionInput` entity
3945is contained in a link:#batch-label-input[BatchLabelInput]
3946entity.
Edwin Kempinb5e87452019-10-25 13:28:46 +02003947|`function` |optional|
3948The new link:config-labels.html#label_function[function] of the label (can be
3949`MaxWithBlock`, `AnyWithBlock`, `MaxNoBlock`, `NoBlock`, `NoOp` and `PatchSetLock`.
3950|`values` |optional|
3951The new link:config-labels.html#label_value[values] of the label as a map of
3952label value to value description. The label values are formatted strings, e.g.
3953"+1" instead of "1", " 0" instead of "0".
3954|`default_value` |optional|
3955The new link:config-labels.html#label_defaultValue[default value] of the label
3956(as integer).
3957|`branches` |optional|
3958The new branches for which the label applies as a list of
3959link:config-labels.html#label_branch[branches]. A branch can be a ref, a ref
3960pattern or a regular expression. If not set, the label applies for all
3961branches.
3962|`can_override` |optional|
3963Whether this label can be link:config-labels.html#label_canOverride[overridden]
3964by child projects.
3965|`copy_any_score`|optional|
3966Whether link:config-labels.html#label_copyAnyScore[copyAnyScore] is set on the
3967label.
3968|`copy_min_score`|optional|
3969Whether link:config-labels.html#label_copyMinScore[copyMinScore] is set on the
3970label.
3971|`copy_max_score`|optional|
3972Whether link:config-labels.html#label_copyMaxScore[copyMaxScore] is set on the
3973label.
3974|`copy_all_scores_if_no_change`|optional|
3975Whether link:config-labels.html#label_copyAllScoresIfNoChange[
3976copyAllScoresIfNoChange] is set on the label.
3977|`copy_all_scores_if_no_code_change`|optional|
3978Whether link:config-labels.html#label_copyAllScoresIfNoCodeChange[
3979copyAllScoresIfNoCodeChange] is set on the label.
3980|`copy_all_scores_on_trivial_rebase`|optional|
3981Whether link:config-labels.html#label_copyAllScoresOnTrivialRebase[
3982copyAllScoresOnTrivialRebase] is set on the label.
3983|`copy_all_scores_on_merge_first_parent_update`|optional|
3984Whether link:config-labels.html#label_copyAllScoresOnMergeFirstParentUpdate[
3985copyAllScoresOnMergeFirstParentUpdate] is set on the label.
Edwin Kempin33c13a42020-01-10 11:38:06 +01003986|`copy_values` |optional|
3987List of values that should be copied forward when a new patch set is uploaded.
Edwin Kempinb5e87452019-10-25 13:28:46 +02003988|`allow_post_submit`|optional|
3989Whether link:config-labels.html#label_allowPostSubmit[allowPostSubmit] is set
3990on the label.
3991|`ignore_self_approval`|optional|
3992Whether link:config-labels.html#label_ignoreSelfApproval[ignoreSelfApproval] is
3993set on the label.
3994|=============================
3995
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02003996[[label-type-info]]
3997=== LabelTypeInfo
3998The `LabelTypeInfo` entity contains metadata about the labels that a
3999project has.
4000
4001[options="header",cols="1,^2,4"]
4002|================================
4003|Field Name ||Description
4004|`values` ||Map of the available values to their description.
4005|`default_value` ||The default value of this label.
4006|================================
4007
Edwin Kempin3c99f592013-07-15 10:12:27 +02004008[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004009=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02004010The `MaxObjectSizeLimitInfo` entity contains information about the
4011link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
4012limit] of a project.
4013
David Pursehouseae367192014-11-25 17:24:47 +09004014[options="header",cols="1,^2,4"]
Edwin Kempin3c99f592013-07-15 10:12:27 +02004015|===============================
4016|Field Name ||Description
4017|`value` |optional|
David Pursehouse33f544a2018-08-20 12:20:18 +09004018The effective value in bytes of the max object size limit. +
Edwin Kempin3c99f592013-07-15 10:12:27 +02004019Not set if there is no limit for the object size.
4020|`configured_value`|optional|
4021The max object size limit that is configured on the project as a
4022formatted string. +
4023Not set if there is no limit for the object size configured on project
4024level.
David Pursehouse81f2b5c2018-08-23 14:44:14 +09004025|`summary` |optional|
4026A string describing whether the value was inherited or overridden from
4027the parent project or global config. +
4028Not set if not inherited or overridden.
Edwin Kempin3c99f592013-07-15 10:12:27 +02004029|===============================
4030
Edwin Kempin83d6d222019-10-28 13:45:52 +01004031[[batch-label-input]]
4032=== BatchLabelInput
4033The `BatchLabelInput` entity contains information for batch updating label
4034definitions in a project.
4035
4036[options="header",cols="1,^2,4"]
4037|=============================
4038|Field Name ||Description
4039|`commit_message`|optional|
4040Message that should be used to commit the label updates in the
4041`project.config` file to the `refs/meta/config` branch.
4042|`delete` |optional|
4043List of labels that should be deleted.
4044|`create` |optional|
4045List of link:#label-definition-input[LabelDefinitionInput] entities that
4046describe labels that should be created.
4047|`update` |optional|
4048Map of label names to link:#label-definition-input[LabelDefinitionInput]
4049entities that describe the updates that should be done for the labels.
4050|=============================
4051
Patrick Hiesel21816f12016-04-22 08:53:06 +02004052[[project-access-input]]
4053=== ProjectAccessInput
4054The `ProjectAccessInput` describes changes that should be applied to a project
4055access config.
4056
4057[options="header",cols="1,^2,4"]
4058|=============================
4059|Field Name | |Description
4060|`remove` |optional|
4061A list of deductions to be applied to the project access as
4062link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
4063|`add` |optional|
4064A list of additions to be applied to the project access as
4065link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
4066|`message` |optional|
4067A commit message for this change.
4068|`parent` |optional|
4069A new parent for the project to inherit from. Changing the parent project
4070requires administrative privileges.
4071|=============================
4072
Edwin Kempin57f303c2013-02-13 15:52:22 +01004073[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004074=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01004075The `ProjectDescriptionInput` entity contains information for setting a
4076project description.
4077
David Pursehouseae367192014-11-25 17:24:47 +09004078[options="header",cols="1,^2,4"]
Edwin Kempin57f303c2013-02-13 15:52:22 +01004079|=============================
4080|Field Name ||Description
4081|`description` |optional|The project description. +
4082The project description will be deleted if not set.
4083|`commit_message`|optional|
4084Message that should be used to commit the change of the project
4085description in the `project.config` file to the `refs/meta/config`
4086branch.
4087|=============================
4088
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004089[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004090=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004091The `ProjectInfo` entity contains information about a project.
4092
David Pursehouseae367192014-11-25 17:24:47 +09004093[options="header",cols="1,^2,4"]
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004094|===========================
4095|Field Name ||Description
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004096|`id` ||The URL encoded project name.
4097|`name` |
4098not set if returned in a map where the project name is used as map key|
4099The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01004100|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004101The name of the parent project. +
4102`?-<n>` if the parent project is not visible (`<n>` is a number which
4103is increased for each non-visible project).
4104|`description` |optional|The description of the project.
Shawn Pearce21a6c212014-04-23 12:35:10 -07004105|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004106|`branches` |optional|Map of branch names to HEAD revisions.
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02004107|`labels` |optional|
4108Map of label names to
4109link:#label-type-info[LabelTypeInfo] entries.
4110This field is filled for link:#create-project[Create Project] and
4111link:#get-project[Get Project] calls.
Edwin Kempin26c95a42014-11-25 16:29:47 +01004112|`web_links` |optional|
Edwin Kempinea004752014-04-11 15:56:02 +02004113Links to the project in external sites as a list of
4114link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01004115|===========================
4116
Bruce Zu798ea122013-02-18 16:55:43 +08004117[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004118=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08004119The `ProjectInput` entity contains information for the creation of
4120a new project.
4121
David Pursehouseae367192014-11-25 17:24:47 +09004122[options="header",cols="1,^2,4"]
Bruce Zu798ea122013-02-18 16:55:43 +08004123|=========================================
4124|Field Name ||Description
4125|`name` |optional|
4126The name of the project (not encoded). +
David Pursehouse8c5ad412015-02-03 14:19:09 +09004127If set, must match the project name in the URL. +
4128If name ends with `.git` the suffix will be automatically removed.
Bruce Zu798ea122013-02-18 16:55:43 +08004129|`parent` |optional|
4130The name of the parent project. +
4131If not set, the `All-Projects` project will be the parent project.
4132|`description` |optional|The description of the project.
4133|`permissions_only` |`false` if not set|
4134Whether a permission-only project should be created.
4135|`create_empty_commit` |`false` if not set|
4136Whether an empty initial commit should be created.
4137|`submit_type` |optional|
4138The submit type that should be set for the project
Gert van Dijka4e49d02017-08-27 22:50:40 +02004139(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`,
4140`FAST_FORWARD_ONLY`, `MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01004141If not set, `MERGE_IF_NECESSARY` is set as submit type unless
4142link:config-gerrit.html#repository.name.defaultSubmitType[
4143repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08004144|`branches` |optional|
4145A list of branches that should be initially created. +
4146For the branch names the `refs/heads/` prefix can be omitted.
4147|`owners` |optional|
4148A list of groups that should be assigned as project owner. +
4149Each group in the list must be specified as
4150link:rest-api-groups.html#group-id[group-id]. +
4151If not set, the link:config-gerrit.html#repository.name.ownerGroup[
4152groups that are configured as default owners] are set as project
4153owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02004154|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004155Whether contributor agreements should be used for the project (`TRUE`,
4156`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02004157|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004158Whether the usage of 'Signed-Off-By' footers is required for the
4159project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02004160|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
4161Whether a new change is created for every commit not in target branch
4162for the project (`TRUE`, `FALSE`, `INHERIT`).
4163|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08004164Whether content merge should be enabled for the project (`TRUE`,
4165`FALSE`, `INHERIT`). +
4166`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Han-Wen Nienhuyscdde7a302019-07-24 12:19:16 +02004167|`require_change_id` |`INHERIT` if not set|
4168Whether the usage of Change-Ids is required for the project (`TRUE`,
4169`FALSE`, `INHERIT`).
4170This property is deprecated and will be removed in
4171a future release.
David Ostrovsky1c6ff2e2018-09-18 07:52:51 +02004172|`enable_signed_push` |`INHERIT` if not set|
4173Whether signed push validation is enabled on the project (`TRUE`,
4174`FALSE`, `INHERIT`).
4175|`require_signed_push` |`INHERIT` if not set|
4176Whether signed push validation is required on the project (`TRUE`,
4177`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02004178|`max_object_size_limit` |optional|
4179Max allowed Git object size for this project.
4180Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01004181|`plugin_config_values` |optional|
4182Plugin configuration values as map which maps the plugin name to a map
4183of parameter names to values.
Patrick Hieseldc285c72018-01-08 17:20:15 +01004184|`reject_empty_commit` |optional|
4185Whether empty commits should be rejected when a change is merged
4186(`TRUE`, `FALSE`, `INHERIT`).
Bruce Zu798ea122013-02-18 16:55:43 +08004187|=========================================
4188
Edwin Kempinecad88c2013-02-14 12:09:44 +01004189[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004190=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01004191The `ProjectParentInput` entity contains information for setting a
4192project parent.
4193
David Pursehouseae367192014-11-25 17:24:47 +09004194[options="header",cols="1,^2,4"]
Edwin Kempinecad88c2013-02-14 12:09:44 +01004195|=============================
4196|Field Name ||Description
4197|`parent` ||The name of the parent project.
4198|`commit_message`|optional|
4199Message that should be used to commit the change of the project parent
4200in the `project.config` file to the `refs/meta/config` branch.
4201|=============================
4202
Edwin Kempin87504d92014-07-04 12:59:19 +02004203[[reflog-entry-info]]
4204=== ReflogEntryInfo
4205The `ReflogEntryInfo` entity describes an entry in a reflog.
4206
David Pursehouseae367192014-11-25 17:24:47 +09004207[options="header",cols="1,6"]
Edwin Kempin87504d92014-07-04 12:59:19 +02004208|============================
4209|Field Name |Description
4210|`old_id` |The old commit ID.
4211|`new_id` |The new commit ID.
4212|`who` |
4213The user performing the change as a
4214link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
4215|`comment` |Comment of the reflog entry.
4216|============================
4217
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004218[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004219=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004220The `RepositoryStatisticsInfo` entity contains information about
4221statistics of a Git repository.
4222
David Pursehouseae367192014-11-25 17:24:47 +09004223[options="header",cols="1,6"]
Edwin Kempin19ea9b92013-03-20 13:20:26 +01004224|======================================
4225|Field Name |Description
4226|`number_of_loose_objects` |Number of loose objects.
4227|`number_of_loose_refs` |Number of loose refs.
4228|`number_of_pack_files` |Number of pack files.
4229|`number_of_packed_objects`|Number of packed objects.
4230|`number_of_packed_refs` |Number of packed refs.
4231|`size_of_loose_objects` |Size of loose objects in bytes.
4232|`size_of_packed_objects` |Size of packed objects in bytes.
4233|======================================
4234
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004235[[submit-type-info]]
4236=== SubmitTypeInfo
Changcheng Xiao21885982019-01-15 18:16:51 +01004237Information about the link:config-project-config.html#submit-type[default submit
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004238type of a project], taking into account project inheritance.
4239
4240Valid values for each field are `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`,
4241`REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or `CHERRY_PICK`, plus
4242`INHERIT` where applicable.
4243
4244[options="header",cols="1,6"]
4245|===============================
4246|Field Name |Description
4247|`value` |
4248The effective submit type value. Never `INHERIT`.
4249|`configured_value` |
4250The configured value, can be one of the submit types, or `INHERIT` to inherit
4251from the parent project.
4252|`inherited_value` |
4253The effective value that would be inherited from the parent. Never `INHERIT`.
4254|===============================
4255
David Pursehouse8cc68902014-10-06 18:17:16 +09004256[[tag-info]]
4257=== TagInfo
4258The `TagInfo` entity contains information about a tag.
4259
David Pursehouseae367192014-11-25 17:24:47 +09004260[options="header",cols="1,^2,4"]
David Pursehouse8cc68902014-10-06 18:17:16 +09004261|=========================
4262|Field Name ||Description
4263|`ref` ||The ref of the tag.
4264|`revision` ||For lightweight tags, the revision of the commit to which the tag
4265points. For annotated tags, the revision of the tag object.
4266|`object`|Only set for annotated tags.|The revision of the object to which the
4267tag points.
4268|`message`|Only set for annotated tags.|The tag message. For signed tags, includes
4269the signature.
David Pursehousec9f5a5a2015-12-07 19:13:16 +09004270|`tagger`|Only set for annotated tags, if present in the tag.|The tagger as a
David Pursehouse8cc68902014-10-06 18:17:16 +09004271link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
David Pursehousec4e4d932017-11-10 10:17:46 +09004272|`created`|optional|The link:rest-api.html#timestamp[timestamp] of when the tag
4273was created. For annotated and signed tags, this is the timestamp of the tag object
4274and is the same as the `date` field in the `tagger`. For lightweight tags, it is
4275the commit timestamp of the commit to which the tag points, when the object is a
4276commit. It is not set when the object is any other type.
David Pursehoused00515e2017-11-10 15:57:41 +09004277|`can_delete`|not set if `false`|
David Pursehouse23669da2017-02-23 13:43:57 +09004278Whether the calling user can delete this tag.
Paladox none34da15c2017-07-01 14:49:10 +00004279|`web_links` |optional|
4280Links to the tag in external sites as a list of
4281link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse8cc68902014-10-06 18:17:16 +09004282|=========================
4283
David Pursehouse6a446192016-06-03 10:00:34 +09004284[[tag-input]]
4285=== TagInput
4286
4287The `TagInput` entity contains information for creating a tag.
4288
4289[options="header",cols="1,^2,4"]
4290|=========================
4291|Field Name ||Description
4292|`ref` ||The name of the tag. The leading `refs/tags/` is optional.
4293|`revision` |optional|The revision to which the tag should point. If not
4294specified, the project's `HEAD` will be used.
4295|`message` |optional|The tag message. When set, the tag will be created
4296as an annotated tag.
4297|=========================
4298
4299
Edwin Kempind0a63922013-01-23 16:32:59 +01004300GERRIT
4301------
4302Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07004303
4304SEARCHBOX
4305---------