blob: 9e8e9c5904492c0ce2fe3e205ba96d2f96962988 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - /projects/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01002
3This page describes the project related REST endpoints.
4Please also take note of the general information on the
5link:rest-api.html[REST API].
6
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01007[[project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008== Project Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01009
Edwin Kempin76202742013-02-15 13:51:50 +010010[[list-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080011=== List Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080012--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010013'GET /projects/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080014--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010015
Edwin Kempind0a63922013-01-23 16:32:59 +010016Lists the projects accessible by the caller. This is the same as
17using the link:cmd-ls-projects.html[ls-projects] command over SSH,
18and accepts the same options as query parameters.
19
Edwin Kempin51a6dc92013-02-04 15:43:59 +010020As result a map is returned that maps the project names to
21link:#project-info[ProjectInfo] entries. The entries in the map are sorted
22by project name.
23
Edwin Kempin37440832013-02-06 11:36:00 +010024.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010025----
26 GET /projects/?d HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010027----
Edwin Kempind0a63922013-01-23 16:32:59 +010028
Edwin Kempin37440832013-02-06 11:36:00 +010029.Response
30----
Edwin Kempind0a63922013-01-23 16:32:59 +010031 HTTP/1.1 200 OK
32 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090033 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010034
35 )]}'
36 {
37 "external/bison": {
Edwin Kempind0a63922013-01-23 16:32:59 +010038 "id": "external%2Fbison",
39 "description": "GNU parser generator"
40 },
41 "external/gcc": {
Edwin Kempin068511b2015-01-20 09:17:12 +010042 "id": "external%2Fgcc"
Edwin Kempind0a63922013-01-23 16:32:59 +010043 },
44 "external/openssl": {
Edwin Kempind0a63922013-01-23 16:32:59 +010045 "id": "external%2Fopenssl",
46 "description": "encryption\ncrypto routines"
47 },
48 "test": {
Edwin Kempind0a63922013-01-23 16:32:59 +010049 "id": "test",
50 "description": "\u003chtml\u003e is escaped"
51 }
52 }
53----
54
Hugo Arèsbdd7f682014-07-08 10:57:52 -040055[[project-options]]
56==== Project Options
57
58Branch(b)::
59Limit the results to the projects having the specified branch and
60include the sha1 of the branch in the results.
61+
62Get projects that have a 'master' branch:
63+
64.Request
65----
66GET /projects/?b=master HTTP/1.0
67----
68+
69.Response
70----
71 HTTP/1.1 200 OK
72 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090073 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -040074
75 )]}'
76 {
77 "some-project": {
78 "id": "some-project",
79 "branches": {
80 "master": "c5ed9dfcbf002ca0e432d788dab6ca2387829ca7"
81 }
82 },
83 "some-other-project": {
84 "id": "some-other-project",
85 "branches": {
86 "master": "ef1c270142f9581ecf768f4193fc8f8a81102ec2"
87 }
88 },
89 }
90----
91
92Description(d)::
93Include project description in the results.
94+
95Get all the projects with their description:
96+
97.Request
98----
99GET /projects/?d HTTP/1.0
100----
101+
102.Response
103----
104 HTTP/1.1 200 OK
105 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900106 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400107
108 )]}'
109 {
110 "some-project": {
111 "id": "some-project",
112 "description": "Description of some project."
113 },
114 "some-other-project": {
115 "id": "some-other-project",
116 "description": "Description of some other project."
117 }
118 },
119 }
120----
121
122Limit(n)::
123Limit the number of projects to be included in the results.
124+
125Query the first project in the project list:
126+
127.Request
128----
129 GET /projects/?n=1 HTTP/1.0
130----
131+
132.Response
133----
134 HTTP/1.1 200 OK
135 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900136 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400137
138 )]}'
139 {
140 "some-project": {
141 "id": "some-project"
142 }
143 }
144----
145
Edwin Kempina64c4b92013-01-23 11:30:40 +0100146
Edwin Kempind0a63922013-01-23 16:32:59 +0100147[[suggest-projects]]
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400148Prefix(p)::
149Limit the results to those projects that start with the specified
Edwin Kempind0a63922013-01-23 16:32:59 +0100150prefix.
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400151+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900152The match is case sensitive. May not be used together with `m` or `r`.
153+
Edwin Kempind0a63922013-01-23 16:32:59 +0100154List all projects that start with `platform/`:
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400155+
Edwin Kempin37440832013-02-06 11:36:00 +0100156.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100157----
158 GET /projects/?p=platform%2F HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100159----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400160+
Edwin Kempin37440832013-02-06 11:36:00 +0100161.Response
162----
Edwin Kempind0a63922013-01-23 16:32:59 +0100163 HTTP/1.1 200 OK
164 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900165 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100166
167 )]}'
168 {
169 "platform/drivers": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100170 "id": "platform%2Fdrivers"
Edwin Kempind0a63922013-01-23 16:32:59 +0100171 },
172 "platform/tools": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100173 "id": "platform%2Ftools"
Edwin Kempind0a63922013-01-23 16:32:59 +0100174 }
175 }
176----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400177+
Edwin Kempind0a63922013-01-23 16:32:59 +0100178E.g. this feature can be used by suggestion client UI's to limit results.
179
Hugo Arèsb8aae412014-07-08 11:04:43 -0400180Regex(r)::
181Limit the results to those projects that match the specified regex.
182+
183Boundary matchers '^' and '$' are implicit. For example: the regex 'test.*' will
184match any projects that start with 'test' and regex '.*test' will match any
185project that end with 'test'.
186+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900187The match is case sensitive. May not be used together with `m` or `p`.
188+
Hugo Arèsb8aae412014-07-08 11:04:43 -0400189List all projects that match regex `test.*project`:
190+
191.Request
192----
193 GET /projects/?r=test.*project HTTP/1.0
194----
195+
196.Response
197----
198 HTTP/1.1 200 OK
199 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900200 Content-Type: application/json; charset=UTF-8
Hugo Arèsb8aae412014-07-08 11:04:43 -0400201
202 )]}'
203 {
204 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100205 "id": "test%2Fsome-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400206 },
207 "test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100208 "id": "test%2Fsome-other-project"
Hugo Arèsb8aae412014-07-08 11:04:43 -0400209 }
210 }
211
212----
213
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400214Skip(S)::
215Skip the given number of projects from the beginning of the list.
216+
217Query the second project in the project list:
218+
219.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400220----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400221 GET /projects/?n=1&S=1 HTTP/1.0
222----
223+
224.Response
225----
226 HTTP/1.1 200 OK
227 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900228 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400229
230 )]}'
231 {
232 "some-other-project": {
233 "id": "some-other-project"
234 }
235 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400236----
237
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400238Substring(m)::
239Limit the results to those projects that match the specified substring.
240+
David Pursehouse0c2e4b82017-07-13 10:28:37 +0900241The match is case insensitive. May not be used together with `r` or `p`.
242+
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400243List all projects that match substring `test/`:
244+
245.Request
Anthony Chin5f44cc52014-03-12 10:37:10 -0400246----
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400247 GET /projects/?m=test%2F HTTP/1.0
248----
249+
250.Response
251----
252 HTTP/1.1 200 OK
253 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900254 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400255
256 )]}'
257 {
258 "test/some-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100259 "id": "test%2Fsome-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400260 },
261 "some-path/test/some-other-project": {
Edwin Kempin068511b2015-01-20 09:17:12 +0100262 "id": "some-path%2Ftest%2Fsome-other-project"
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400263 }
264 }
265----
266
267Tree(t)::
268Get projects inheritance in a tree-like format. This option does
269not work together with the branch option.
270+
271Get all the projects with tree option:
272+
273.Request
274----
275GET /projects/?t HTTP/1.0
276----
277+
278.Response
279----
280 HTTP/1.1 200 OK
281 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900282 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400283
284 )]}'
285 {
286 "All-Projects" {
287 "id": "All-Projects"
288 },
289 "child-project": {
290 "id": "child-project",
291 "parent":"parent-project"
292 },
293 "parent-project": {
294 "id": "parent-project",
295 "parent":"All-Projects"
296 }
297 }
298----
299
300Type(type)::
301Get projects with specified type: ALL, CODE, PERMISSIONS.
302+
303Get all the projects of type 'PERMISSIONS':
304+
305.Request
306----
307GET /projects/?type=PERMISSIONS HTTP/1.0
308----
309+
310.Response
311----
312 HTTP/1.1 200 OK
313 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900314 Content-Type: application/json; charset=UTF-8
Hugo Arèsbdd7f682014-07-08 10:57:52 -0400315
316 )]}'
317 {
318 "All-Projects" {
319 "id": "All-Projects"
320 },
321 "some-parent-project": {
322 "id": "some-parent-project"
323 }
324 }
Anthony Chin5f44cc52014-03-12 10:37:10 -0400325----
326
David Pursehousec141bd32017-11-15 21:42:14 +0900327All::
David Pursehouse54508762017-11-28 13:37:48 +0900328Get all projects, including those whose state is "HIDDEN". May not be used
329together with the `state` option.
David Pursehousec141bd32017-11-15 21:42:14 +0900330+
331.Request
332----
333GET /projects/?all HTTP/1.0
334----
335+
336.Response
337----
338 HTTP/1.1 200 OK
339 Content-Disposition: attachment
340 Content-Type: application/json; charset=UTF-8
341
342 )]}'
343 {
344 "All-Projects" {
345 "id": "All-Projects",
346 "state": "ACTIVE"
347 },
348 "some-other-project": {
349 "id": "some-other-project",
350 "state": "HIDDEN"
351 }
352 }
353----
354
David Pursehouse54508762017-11-28 13:37:48 +0900355State(s)::
356Get all projects with the given state. May not be used together with the
357`all` option.
358+
359.Request
360----
361GET /projects/?state=HIDDEN HTTP/1.0
362----
363+
364.Response
365----
366 HTTP/1.1 200 OK
367 Content-Disposition: attachment
368 Content-Type: application/json; charset=UTF-8
369
370 )]}'
371 {
372 "some-other-project": {
373 "id": "some-other-project",
374 "state": "HIDDEN"
375 }
376 }
377----
378
Xin Sund8dd1532017-07-18 17:13:52 -0700379[[query-projects]]
380=== Query Projects
381--
382'GET /projects/?query=<query>'
383--
384
385Queries projects visible to the caller. The
386link:user-search-projects.html#_search_operators[query string] must be
387provided by the `query` parameter. The `start` and `limit` parameters
388can be used to skip/limit results.
389
390As result a list of link:#project-info[ProjectInfo] entities is returned.
391
392.Request
393----
394 GET /projects/?query=name:test HTTP/1.0
395----
396
397.Response
398----
399 HTTP/1.1 200 OK
400 Content-Disposition: attachment
401 Content-Type: application/json; charset=UTF-8
402
403 )]}'
404 {
405 "test": {
406 "id": "test",
407 "description": "\u003chtml\u003e is escaped"
408 }
409 }
410----
411
412[[project-query-limit]]
413==== Project Limit
414The `/projects/?query=<query>` URL also accepts a limit integer in the
415`limit` parameter. This limits the results to `limit` projects.
416
417Query the first 25 projects in project list.
418----
419 GET /projects/?query=<query>&limit=25 HTTP/1.0
420----
421
422The `/projects/` URL also accepts a start integer in the `start`
423parameter. The results will skip `start` groups from project list.
424
425Query 25 projects starting from index 50.
426----
427 GET /groups/?query=<query>&limit=25&start=50 HTTP/1.0
428----
429
430[[project-query-options]]
431==== Project Options
432Additional fields can be obtained by adding `o` parameters. Each option
433requires more lookups and slows down the query response time to the
434client so they are generally disabled by default. The supported fields
435are described in the context of the link:#project-options[List Projects]
436REST endpoint.
437
Edwin Kempin5c544e22013-03-06 13:35:45 +0100438[[get-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800439=== Get Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800440--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100441'GET /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800442--
Edwin Kempin5c544e22013-03-06 13:35:45 +0100443
444Retrieves a project.
445
446.Request
447----
448 GET /projects/plugins%2Freplication HTTP/1.0
449----
450
451As response a link:#project-info[ProjectInfo] entity is returned that
452describes the project.
453
454.Response
455----
456 HTTP/1.1 200 OK
457 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900458 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c544e22013-03-06 13:35:45 +0100459
460 )]}'
461 {
Edwin Kempin5c544e22013-03-06 13:35:45 +0100462 "id": "plugins%2Freplication",
463 "name": "plugins/replication",
464 "parent": "Public-Plugins",
Shawn Pearce21a6c212014-04-23 12:35:10 -0700465 "description": "Copies to other servers using the Git protocol",
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +0200466 "state": "ACTIVE",
467 "labels": {
468 "Code-Review": {
469 "values": {
470 " 0": "No score",
471 "+1": "Approved"
472 },
473 "default_value": 0
474 }
475 }
Edwin Kempin5c544e22013-03-06 13:35:45 +0100476 }
477----
478
Bruce Zu798ea122013-02-18 16:55:43 +0800479[[create-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800480=== Create Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800481--
Bruce Zu798ea122013-02-18 16:55:43 +0800482'PUT /projects/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800483--
Bruce Zu798ea122013-02-18 16:55:43 +0800484
485Creates a new project.
486
487In the request body additional data for the project can be provided as
488link:#project-input[ProjectInput].
489
490.Request
491----
492 PUT /projects/MyProject HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900493 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800494
495 {
496 "description": "This is a demo project.",
497 "submit_type": "CHERRY_PICK",
498 "owners": [
499 "MyProject-Owners"
500 ]
501 }
502----
503
504As response the link:#project-info[ProjectInfo] entity is returned that
505describes the created project.
506
507.Response
508----
509 HTTP/1.1 201 Created
510 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900511 Content-Type: application/json; charset=UTF-8
Bruce Zu798ea122013-02-18 16:55:43 +0800512
513 )]}'
514 {
Bruce Zu798ea122013-02-18 16:55:43 +0800515 "id": "MyProject",
516 "name": "MyProject",
517 "parent": "All-Projects",
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +0200518 "description": "This is a demo project.",
519 "labels": {
520 "Code-Review": {
521 "values": {
522 " 0": "No score",
523 "+1": "Approved"
524 },
525 "default_value": 0
526 }
527 }
Bruce Zu798ea122013-02-18 16:55:43 +0800528 }
529----
530
Edwin Kempin57f303c2013-02-13 15:52:22 +0100531[[get-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800532=== Get Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800533--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100534'GET /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800535--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100536
Edwin Kempin57f303c2013-02-13 15:52:22 +0100537Retrieves the description of a project.
538
539.Request
540----
541 GET /projects/plugins%2Freplication/description HTTP/1.0
542----
543
544.Response
545----
546 HTTP/1.1 200 OK
547 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900548 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100549
550 )]}'
551 "Copies to other servers using the Git protocol"
552----
553
Edwin Kempinefec4492013-02-22 10:09:23 +0100554If the project does not have a description an empty string is returned.
555
Edwin Kempin57f303c2013-02-13 15:52:22 +0100556[[set-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800557=== Set Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800558--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100559'PUT /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800560--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100561
Edwin Kempin57f303c2013-02-13 15:52:22 +0100562Sets the description of a project.
563
564The new project description must be provided in the request body inside
565a link:#project-description-input[ProjectDescriptionInput] entity.
566
567.Request
568----
569 PUT /projects/plugins%2Freplication/description HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900570 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100571
572 {
573 "description": "Plugin for Gerrit that handles the replication.",
574 "commit_message": "Update the project description"
575 }
576----
577
578As response the new project description is returned.
579
580.Response
581----
582 HTTP/1.1 200 OK
583 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900584 Content-Type: application/json; charset=UTF-8
Edwin Kempin57f303c2013-02-13 15:52:22 +0100585
586 )]}'
587 "Plugin for Gerrit that handles the replication."
588----
589
Edwin Kempin114ab162013-02-28 09:25:37 +0100590If the description was deleted the response is "`204 No Content`".
591
Edwin Kempin57f303c2013-02-13 15:52:22 +0100592[[delete-project-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800593=== Delete Project Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800594--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100595'DELETE /projects/link:#project-name[\{project-name\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800596--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100597
Edwin Kempin57f303c2013-02-13 15:52:22 +0100598Deletes the description of a project.
599
Edwin Kempinefec4492013-02-22 10:09:23 +0100600The request body does not need to include a
601link:#project-description-input[ProjectDescriptionInput] entity if no
602commit message is specified.
Edwin Kempin57f303c2013-02-13 15:52:22 +0100603
Edwin Kempinefec4492013-02-22 10:09:23 +0100604Please note that some proxies prohibit request bodies for DELETE
Edwin Kempin57f303c2013-02-13 15:52:22 +0100605requests. In this case, if you want to specify a commit message, use
606link:#set-project-description[PUT] to delete the description.
607
608.Request
609----
610 DELETE /projects/plugins%2Freplication/description HTTP/1.0
611----
612
613.Response
614----
615 HTTP/1.1 204 No Content
616----
617
Edwin Kempinecad88c2013-02-14 12:09:44 +0100618[[get-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800619=== Get Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800620--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100621'GET /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800622--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100623
Edwin Kempinecad88c2013-02-14 12:09:44 +0100624Retrieves the name of a project's parent project. For the
625`All-Projects` root project an empty string is returned.
626
627.Request
628----
629 GET /projects/plugins%2Freplication/parent HTTP/1.0
630----
631
632.Response
633----
634 HTTP/1.1 200 OK
635 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900636 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100637
638 )]}'
639 "All-Projects"
640----
641
642[[set-project-parent]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800643=== Set Project Parent
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800644--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100645'PUT /projects/link:#project-name[\{project-name\}]/parent'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800646--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100647
Edwin Kempinecad88c2013-02-14 12:09:44 +0100648Sets the parent project for a project.
649
650The new name of the parent project must be provided in the request body
651inside a link:#project-parent-input[ProjectParentInput] entity.
652
653.Request
654----
655 PUT /projects/plugins%2Freplication/parent HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900656 Content-Type: application/json; charset=UTF-8
Edwin Kempinecad88c2013-02-14 12:09:44 +0100657
658 {
659 "parent": "Public-Plugins",
660 "commit_message": "Update the project parent"
661 }
662----
663
664As response the new parent project name is returned.
665
666.Response
667----
668 HTTP/1.1 200 OK
669 Content-Disposition: attachment
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 "Public-Plugins"
674----
675
Edwin Kempin6b813372013-03-13 17:07:33 +0100676[[get-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800677=== Get HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800678--
Edwin Kempin6b813372013-03-13 17:07:33 +0100679'GET /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800680--
Edwin Kempin6b813372013-03-13 17:07:33 +0100681
682Retrieves for a project the name of the branch to which `HEAD` points.
683
684.Request
685----
686 GET /projects/plugins%2Freplication/HEAD HTTP/1.0
687----
688
689.Response
690----
691 HTTP/1.1 200 OK
692 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900693 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100694
695 )]}'
696 "refs/heads/master"
697----
698
699[[set-head]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800700=== Set HEAD
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800701--
Edwin Kempin6b813372013-03-13 17:07:33 +0100702'PUT /projects/link:#project-name[\{project-name\}]/HEAD'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800703--
Edwin Kempin6b813372013-03-13 17:07:33 +0100704
705Sets `HEAD` for a project.
706
707The new ref to which `HEAD` should point must be provided in the
708request body inside a link:#head-input[HeadInput] entity.
709
710.Request
711----
712 PUT /projects/plugins%2Freplication/HEAD HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900713 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100714
715 {
716 "ref": "refs/heads/stable"
717 }
718----
719
720As response the new ref to which `HEAD` points is returned.
721
722.Response
723----
724 HTTP/1.1 200 OK
725 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900726 Content-Type: application/json; charset=UTF-8
Edwin Kempin6b813372013-03-13 17:07:33 +0100727
728 )]}'
729 "refs/heads/stable"
730----
731
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100732[[get-repository-statistics]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800733=== Get Repository Statistics
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800734--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100735'GET /projects/link:#project-name[\{project-name\}]/statistics.git'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800736--
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100737
738Return statistics for the repository of a project.
739
740.Request
741----
742 GET /projects/plugins%2Freplication/statistics.git HTTP/1.0
743----
744
745The repository statistics are returned as a
746link:#repository-statistics-info[RepositoryStatisticsInfo] entity.
747
748.Response
749----
750 HTTP/1.1 200 OK
751 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900752 Content-Type: application/json; charset=UTF-8
Edwin Kempin19ea9b92013-03-20 13:20:26 +0100753
754 )]}'
755 {
756 "number_of_loose_objects": 127,
757 "number_of_loose_refs": 15,
758 "number_of_pack_files": 15,
759 "number_of_packed_objects": 67,
760 "number_of_packed_refs": 0,
761 "size_of_loose_objects": 29466,
762 "size_of_packed_objects": 9646
763 }
764----
765
Dave Borowitz237073a2013-04-04 16:52:27 -0700766[[get-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800767=== Get Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800768--
Dave Borowitz237073a2013-04-04 16:52:27 -0700769'GET /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800770--
Dave Borowitz237073a2013-04-04 16:52:27 -0700771
772Gets some configuration information about a project. Note that this
773config info is not simply the contents of `project.config`; it generally
774contains fields that may have been inherited from parent projects.
775
776.Request
777----
778 GET /projects/myproject/config
779----
780
781A link:#config-info[ConfigInfo] entity is returned that describes the
782project configuration. Some fields are only visible to users that have
783read access to `refs/meta/config`.
784
785.Response
786----
787 HTTP/1.1 200 OK
788 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900789 Content-Type: application/json; charset=UTF-8
Dave Borowitz237073a2013-04-04 16:52:27 -0700790
791 )]}'
792 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200793 "description": "demo project",
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200794 "use_contributor_agreements": {
795 "value": true,
796 "configured_value": "TRUE",
797 "inherited_value": false
798 },
799 "use_content_merge": {
800 "value": true,
801 "configured_value": "INHERIT",
802 "inherited_value": true
803 },
804 "use_signed_off_by": {
805 "value": false,
806 "configured_value": "INHERIT",
807 "inherited_value": false
808 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200809 "create_new_change_for_all_not_in_target": {
810 "value": false,
811 "configured_value": "INHERIT",
812 "inherited_value": false
813 },
Edwin Kempin0cb5a562013-07-12 15:41:04 +0200814 "require_change_id": {
815 "value": false,
816 "configured_value": "FALSE",
817 "inherited_value": true
Edwin Kempin3c99f592013-07-15 10:12:27 +0200818 },
819 "max_object_size_limit": {
820 "value": "15m",
821 "configured_value": "15m",
822 "inherited_value": "20m"
823 },
824 "submit_type": "MERGE_IF_NECESSARY",
825 "state": "ACTIVE",
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200826 "commentlinks": {},
Edwin Kempin9ce4f552013-11-15 16:00:00 +0100827 "plugin_config": {
828 "helloworld": {
829 "language": {
830 "display_name": "Preferred Language",
831 "type": "STRING",
832 "value": "en"
833 }
834 }
835 },
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +0200836 "actions": {
837 "cookbook~hello-project": {
838 "method": "POST",
839 "label": "Say hello",
840 "title": "Say hello in different languages",
841 "enabled": true
842 }
843 }
Dave Borowitz237073a2013-04-04 16:52:27 -0700844 }
845----
846
Edwin Kempina23eb102013-07-17 09:10:54 +0200847[[set-config]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800848=== Set Config
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800849--
Edwin Kempina23eb102013-07-17 09:10:54 +0200850'PUT /projects/link:#project-name[\{project-name\}]/config'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800851--
Edwin Kempina23eb102013-07-17 09:10:54 +0200852
853Sets the configuration of a project.
854
855The new configuration must be provided in the request body as a
856link:#config-input[ConfigInput] entity.
857
858.Request
859----
860 PUT /projects/myproject/config HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900861 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200862
863 {
864 "description": "demo project",
865 "use_contributor_agreements": "FALSE",
866 "use_content_merge": "INHERIT",
867 "use_signed_off_by": "INHERIT",
Deniz Türkoglu52777272014-09-08 17:02:48 +0200868 "create_new_change_for_all_not_in_target": "INHERIT",
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400869 "enable_signed_push": "INHERIT",
Dave Borowitz0543c732015-10-20 10:35:26 -0400870 "require_signed_push": "INHERIT",
Saša Živkov225b7a72015-11-17 17:37:43 +0100871 "reject_implicit_merges": "INHERIT",
Edwin Kempina23eb102013-07-17 09:10:54 +0200872 "require_change_id": "TRUE",
873 "max_object_size_limit": "10m",
874 "submit_type": "REBASE_IF_NECESSARY",
875 "state": "ACTIVE"
876 }
877----
878
879As response the new configuration is returned as a link:#config-info[
880ConfigInfo] entity.
881
882.Response
883----
884 HTTP/1.1 200 OK
885 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900886 Content-Type: application/json; charset=UTF-8
Edwin Kempina23eb102013-07-17 09:10:54 +0200887
888 )]}'
889 {
Edwin Kempina23eb102013-07-17 09:10:54 +0200890 "use_contributor_agreements": {
891 "value": false,
892 "configured_value": "FALSE",
893 "inherited_value": false
894 },
895 "use_content_merge": {
896 "value": true,
897 "configured_value": "INHERIT",
898 "inherited_value": true
899 },
900 "use_signed_off_by": {
901 "value": false,
902 "configured_value": "INHERIT",
903 "inherited_value": false
904 },
Deniz Türkoglu52777272014-09-08 17:02:48 +0200905 "create_new_change_for_all_not_in_target": {
906 "value": true,
907 "configured_value": "INHERIT",
908 "inherited_value": false
909 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200910 "require_change_id": {
911 "value": true,
912 "configured_value": "TRUE",
913 "inherited_value": true
914 },
Dave Borowitz5170e0f2015-06-18 21:05:29 -0400915 "enable_signed_push": {
916 "value": true,
917 "configured_value": "INHERIT",
918 "inherited_value": false
919 },
Dave Borowitz0543c732015-10-20 10:35:26 -0400920 "require_signed_push": {
921 "value": false,
922 "configured_value": "INHERIT",
923 "inherited_value": false
924 },
Saša Živkov225b7a72015-11-17 17:37:43 +0100925 "reject_implicit_merges": {
926 "value": false,
927 "configured_value": "INHERIT",
928 "inherited_value": false
929 },
Edwin Kempina23eb102013-07-17 09:10:54 +0200930 "max_object_size_limit": {
931 "value": "10m",
932 "configured_value": "10m",
933 "inherited_value": "20m"
934 },
935 "submit_type": "REBASE_IF_NECESSARY",
936 "state": "ACTIVE",
937 "commentlinks": {}
938 }
939----
940
Edwin Kempinef3542f2013-03-19 13:31:49 +0100941[[run-gc]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800942=== Run GC
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800943--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100944'POST /projects/link:#project-name[\{project-name\}]/gc'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800945--
Edwin Kempinef3542f2013-03-19 13:31:49 +0100946
947Run the Git garbage collection for the repository of a project.
948
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100949Options for the Git garbage collection can be specified in the
950request body as a link:#gc-input[GCInput] entity.
951
Edwin Kempinef3542f2013-03-19 13:31:49 +0100952.Request
953----
954 POST /projects/plugins%2Freplication/gc HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900955 Content-Type: application/json; charset=UTF-8
Edwin Kempin4bdc72d2013-11-13 13:30:49 +0100956
957 {
958 "show_progress": true
959 }
Edwin Kempinef3542f2013-03-19 13:31:49 +0100960----
961
962The response is the streamed output of the garbage collection.
963
964.Response
965----
966 HTTP/1.1 200 OK
967 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900968 Content-Type: text/plain; charset=UTF-8
Edwin Kempinef3542f2013-03-19 13:31:49 +0100969
970 collecting garbage for "plugins/replication":
971 Pack refs: 100% (21/21)
972 Counting objects: 20
973 Finding sources: 100% (20/20)
974 Getting sizes: 100% (13/13)
975 Compressing objects: 83% (5/6)
976 Writing objects: 100% (20/20)
977 Selecting commits: 100% (7/7)
978 Building bitmaps: 100% (7/7)
979 Finding sources: 100% (41/41)
980 Getting sizes: 100% (25/25)
981 Compressing objects: 52% (12/23)
982 Writing objects: 100% (41/41)
983 Prune loose objects also found in pack files: 100% (36/36)
984 Prune loose, unreferenced objects: 100% (36/36)
985 done.
986----
987
Adrian Görler92410a12015-11-03 16:20:56 +0100988==== Asynchronous Execution
989
990The option `async` allows to schedule a background task that asynchronously
991executes a Git garbage collection.
992
993The `Location` header of the response refers to the link:rest-api-config.html#get-task[background task]
994which allows to inspect the progress of its execution. In case of asynchronous
995execution the `show_progress` option is ignored.
996
997.Request
998----
999 POST /projects/plugins%2Freplication/gc HTTP/1.0
1000 Content-Type: application/json;charset=UTF-8
1001
1002 {
1003 "async": true
1004 }
1005----
1006
1007The response is empty.
1008
1009.Response
1010----
1011 HTTP/1.1 202 Accepted
1012 Content-Disposition: attachment
1013 Location: https:<host>/a/config/server/tasks/383a0602
1014----
1015
Edwin Kempin62946742014-07-09 11:17:58 +02001016[[ban-commit]]
1017=== Ban Commit
1018--
1019'PUT /projects/link:#project-name[\{project-name\}]/ban'
1020--
1021
1022Marks commits as banned for the project. If a commit is banned Gerrit
1023rejects every push that includes this commit with
1024link:error-contains-banned-commit.html[contains banned commit ...].
1025
1026[NOTE]
1027This REST endpoint only marks the commits as banned, but it does not
1028remove the commits from the history of any central branch. This needs
1029to be done manually.
1030
1031The commits to be banned must be specified in the request body as a
1032link:#ban-input[BanInput] entity.
1033
1034The caller must be project owner.
1035
1036.Request
1037----
1038 PUT /projects/plugins%2Freplication/ban HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001039 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +02001040
1041 {
1042 "commits": [
1043 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
1044 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
1045 ],
1046 "reason": "Violates IP"
1047 }
1048----
1049
1050As response a link:#ban-result-info[BanResultInfo] entity is returned.
1051
1052.Response
1053----
1054 HTTP/1.1 200 OK
1055 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001056 Content-Type: application/json; charset=UTF-8
Edwin Kempin62946742014-07-09 11:17:58 +02001057
1058 )]}'
1059 {
1060 "newly_banned": [
1061 "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96",
1062 "cf5b56541f84b8b57e16810b18daca9c3adc377b"
1063 ]
1064 }
1065----
1066
Patrick Hiesel21816f12016-04-22 08:53:06 +02001067[[get-access]]
1068=== List Access Rights for Project
1069--
1070'GET /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
1071--
1072
1073Lists the access rights for a single project.
1074
1075As result a link:#project-access-info[ProjectAccessInfo] entity is returned.
1076
1077.Request
1078----
1079 GET /projects/MyProject/access HTTP/1.0
1080----
1081
1082.Response
1083----
1084 HTTP/1.1 200 OK
1085 Content-Type: application/json; charset=UTF-8
1086
1087 )]}'
1088 {
1089 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1090 "inherits_from": {
1091 "id": "All-Projects",
1092 "name": "All-Projects",
1093 "description": "Access inherited by all other projects."
1094 },
1095 "local": {
1096 "refs/*": {
1097 "permissions": {
1098 "read": {
1099 "rules": {
1100 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1101 "action": "ALLOW",
1102 "force": false
1103 },
1104 "global:Anonymous-Users": {
1105 "action": "ALLOW",
1106 "force": false
1107 }
1108 }
1109 }
1110 }
1111 }
1112 },
1113 "is_owner": true,
1114 "owner_of": [
1115 "refs/*"
1116 ],
1117 "can_upload": true,
1118 "can_add": true,
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001119 "config_visible": true,
1120 "groups": {
1121 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1122 "url": "#/admin/groups/uuid-c2ce4749a32ceb82cd6adcce65b8216e12afb41c",
1123 "options": {},
1124 "description": "Users who perform batch actions on Gerrit",
1125 "group_id": 2,
1126 "owner": "Administrators",
1127 "owner_id": "d5b7124af4de52924ed397913e2c3b37bf186948",
1128 "created_on": "2009-06-08 23:31:00.000000000",
1129 "name": "Non-Interactive Users"
1130 },
1131 "global:Anonymous-Users": {
1132 "options": {},
1133 "name": "Anonymous Users"
1134 }
1135 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001136 }
1137----
1138
1139[[set-access]]
1140=== Add, Update and Delete Access Rights for Project
1141--
1142'POST /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access'
1143--
1144
1145Sets access rights for the project using the diff schema provided by
1146link:#project-access-input[ProjectAccessInput]. Deductions are used to
1147remove access sections, permissions or permission rules. The backend will remove
1148the entity with the finest granularity in the request, meaning that if an
1149access section without permissions is posted, the access section will be
1150removed; if an access section with a permission but no permission rules is
1151posted, the permission will be removed; if an access section with a permission
1152and a permission rule is posted, the permission rule will be removed.
1153
1154Additionally, access sections and permissions will be cleaned up after applying
1155the deductions by removing items that have no child elements.
1156
1157After removals have been applied, additions will be applied.
1158
1159As result a link:#project-access-info[ProjectAccessInfo] entity is returned.
1160
1161.Request
1162----
1163 POST /projects/MyProject/access HTTP/1.0
1164 Content-Type: application/json; charset=UTF-8
1165
1166 {
1167 "remove": [
Hugo Arès0c4dabf2017-12-18 15:00:40 -05001168 {
1169 "refs/*": {
1170 "permissions": {
1171 "read": {
1172 "rules": {
1173 "c2ce4749a32ceb82cd6adcce65b8216e12afb41c": {
1174 "action": "ALLOW"
1175 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001176 }
1177 }
1178 }
1179 }
1180 }
1181 ]
1182 }
1183----
1184
1185.Response
1186----
1187 HTTP/1.1 200 OK
1188 Content-Type: application/json; charset=UTF-8
1189
1190 )]}'
1191 {
1192 "revision": "61157ed63e14d261b6dca40650472a9b0bd88474",
1193 "inherits_from": {
1194 "id": "All-Projects",
1195 "name": "All-Projects",
1196 "description": "Access inherited by all other projects."
1197 },
1198 "local": {
1199 "refs/*": {
1200 "permissions": {
1201 "read": {
1202 "rules": {
1203 "global:Anonymous-Users": {
1204 "action": "ALLOW",
1205 "force": false
1206 }
1207 }
1208 }
1209 }
1210 }
1211 },
1212 "is_owner": true,
1213 "owner_of": [
1214 "refs/*"
1215 ],
1216 "can_upload": true,
1217 "can_add": true,
Han-Wen Nienhuyse2258f6e2017-08-08 15:38:18 -03001218 "config_visible": true,
1219 "groups": {
1220 "global:Anonymous-Users": {
1221 "options": {},
1222 "name": "Anonymous Users"
1223 }
1224 }
Patrick Hiesel21816f12016-04-22 08:53:06 +02001225 }
1226----
1227
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001228[[create-access-change]]
1229=== Create Access Rights Change for review.
1230--
1231'PUT /projects/link:rest-api-projects.html#project-name[\{project-name\}]/access:review
1232--
1233
1234Sets access rights for the project using the diff schema provided by
1235link:#project-access-input[ProjectAccessInput]
1236
1237This takes the same input as link:#set-access[Update Access Rights], but creates a pending
1238change for review. Like link:#create-change[Create Change], it returns
1239a link:#change-info[ChangeInfo] entity describing the resulting change.
1240
1241.Request
1242----
1243 PUT /projects/MyProject/access:review HTTP/1.0
1244 Content-Type: application/json; charset=UTF-8
1245
1246 {
1247 "add":{
1248 "refs/heads/*":{
1249 "permissions":{
1250 "read":{
1251 "rules":{
1252 "global:Anonymous-Users": {
1253 "action":"DENY",
1254 "force":false
1255 }
1256 }
1257 }
1258 }
1259 }
1260 }
1261 }
1262----
1263
1264.Response
1265----
1266 HTTP/1.1 200 OK
1267 Content-Type: application/json; charset=UTF-8
1268
1269 )]}'
1270 {
1271 "id": "testproj~refs%2Fmeta%2Fconfig~Ieaf185bf90a1fc3b58461e399385e158a20b31a2",
1272 "project": "testproj",
1273 "branch": "refs/meta/config",
1274 "hashtags": [],
1275 "change_id": "Ieaf185bf90a1fc3b58461e399385e158a20b31a2",
1276 "subject": "Review access change",
1277 "status": "NEW",
1278 "created": "2017-09-07 14:31:11.852000000",
1279 "updated": "2017-09-07 14:31:11.852000000",
1280 "submit_type": "CHERRY_PICK",
1281 "mergeable": true,
1282 "insertions": 2,
1283 "deletions": 0,
1284 "unresolved_comment_count": 0,
1285 "has_review_started": true,
1286 "_number": 7,
1287 "owner": {
1288 "_account_id": 1000000
1289 }
1290 }
1291----
1292
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02001293[[check-access]]
1294=== Check Access
1295--
1296'POST /projects/MyProject/check.access'
1297--
1298
1299Runs access checks for other users. This requires the
1300link:access-control.html#capability_administrateServer[Administrate Server]
1301global capability.
1302
1303Input for the access checks that should be run must be provided in
1304the request body inside a
1305link:#access-check-input[AccessCheckInput] entity.
1306
1307.Request
1308----
1309 POST /projects/MyProject/check.access HTTP/1.0
1310 Content-Type: application/json; charset=UTF-8
1311
1312 {
1313 "account": "Kristen.Burns@gerritcodereview.com",
1314 "ref": "refs/heads/secret/bla"
1315 }
1316----
1317
1318The result is a link:#access-check-info[AccessCheckInfo] entity
1319detailing the read access of the given user for the given project (or
1320project-ref combination).
1321
1322.Response
1323----
1324 HTTP/1.1 200 OK
1325 Content-Type: application/json; charset=UTF-8
1326
1327 )]}'
1328 {
1329 "message": "user Kristen Burns \u003cKristen.Burns@gerritcodereview.com\u003e (1000098) cannot see ref refs/heads/secret/bla in project MyProject",
1330 "status": 403
1331 }
1332----
Han-Wen Nienhuys4f6fab32017-09-07 15:26:54 +02001333
Hector Oswaldo Caballero2b4239a2017-02-13 07:40:33 -05001334[[index]]
1335=== Index all changes in a project
1336
1337Adds or updates all the changes belonging to a project in the secondary index.
1338The indexing task is executed asynchronously in background, so this command
1339returns immediately.
1340
1341.Request
1342----
1343 POST /projects/MyProject/index HTTP/1.0
1344----
1345
1346.Response
1347----
1348HTTP/1.1 202 Accepted
1349Content-Disposition: attachment
1350----
1351
Edwin Kempina686de92013-05-09 15:12:34 +02001352[[branch-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001353== Branch Endpoints
Edwin Kempina686de92013-05-09 15:12:34 +02001354
1355[[list-branches]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001356=== List Branches
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001357--
Edwin Kempina686de92013-05-09 15:12:34 +02001358'GET /projects/link:#project-name[\{project-name\}]/branches/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001359--
Edwin Kempina686de92013-05-09 15:12:34 +02001360
1361List the branches of a project.
1362
1363As result a list of link:#branch-info[BranchInfo] entries is
1364returned.
1365
1366.Request
1367----
1368 GET /projects/work%2Fmy-project/branches/ HTTP/1.0
1369----
1370
1371.Response
1372----
1373 HTTP/1.1 200 OK
1374 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001375 Content-Type: application/json; charset=UTF-8
Edwin Kempina686de92013-05-09 15:12:34 +02001376
1377 )]}'
1378 [
1379 {
1380 "ref": "HEAD",
1381 "revision": "master"
1382 },
1383 {
1384 "ref": "refs/meta/config",
1385 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1386 },
1387 {
1388 "ref": "refs/heads/master",
1389 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1390 },
1391 {
1392 "ref": "refs/heads/stable",
1393 "revision": "64ca533bd0eb5252d2fee83f63da67caae9b4674",
1394 "can_delete": true
1395 }
1396 ]
1397----
1398
Hugo Arès3133b4b2014-10-14 14:05:10 -04001399[[branch-options]]
1400==== Branch Options
1401
Hugo Arès15856622014-10-14 14:19:01 -04001402Limit(n)::
1403Limit the number of branches to be included in the results.
1404+
1405.Request
1406----
1407 GET /projects/testproject/branches?n=1 HTTP/1.0
1408----
1409+
1410.Response
1411----
1412 HTTP/1.1 200 OK
1413 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001414 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001415
1416 )]}'
1417 [
1418 {
1419 "ref": "HEAD",
1420 "revision": "master",
Hugo Arès15856622014-10-14 14:19:01 -04001421 }
1422 ]
1423----
1424
David Pursehouse5cb38192017-07-28 16:11:33 +01001425Skip(S)::
Hugo Arès15856622014-10-14 14:19:01 -04001426Skip the given number of branches from the beginning of the list.
1427+
1428.Request
1429----
1430 GET /projects/testproject/branches?n=1&s=0 HTTP/1.0
1431----
1432+
1433.Response
1434----
1435 HTTP/1.1 200 OK
1436 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001437 Content-Type: application/json; charset=UTF-8
Hugo Arès15856622014-10-14 14:19:01 -04001438
1439 )]}'
1440 [
1441 {
1442 "ref": "HEAD",
1443 "revision": "master",
Hugo Arès15856622014-10-14 14:19:01 -04001444 }
1445 ]
1446----
1447
Hugo Arès3133b4b2014-10-14 14:05:10 -04001448Substring(m)::
David Pursehouse1d4d67d2017-07-13 09:58:10 +09001449Limit the results to those branches that match the specified substring.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001450+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09001451The match is case insensitive. May not be used together with `r`.
David Pursehouse5851bfe2017-07-13 09:56:26 +09001452+
David Pursehouse1d4d67d2017-07-13 09:58:10 +09001453List all branches that match substring `test`:
Hugo Arès3133b4b2014-10-14 14:05:10 -04001454+
1455.Request
1456----
1457 GET /projects/testproject/branches?m=test HTTP/1.0
1458----
1459+
1460.Response
1461----
1462 HTTP/1.1 200 OK
1463 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001464 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001465
1466 )]}'
1467 [
1468 {
1469 "ref": "refs/heads/test1",
1470 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1471 "can_delete": true
1472 }
1473 ]
1474----
1475
1476Regex(r)::
1477Limit the results to those branches that match the specified regex.
1478Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
David Pursehousea6cd67f2017-07-13 16:40:58 +09001479match any branches that start with 't' and regex '*t' will match any
1480branches that end with 't'.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001481+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09001482The match is case sensitive. May not be used together with `m`.
Hugo Arès3133b4b2014-10-14 14:05:10 -04001483+
1484List all branches that match regex `t.*1`:
1485+
1486.Request
1487----
1488 GET /projects/testproject/branches?r=t.*1 HTTP/1.0
1489----
1490+
1491.Response
1492----
1493 HTTP/1.1 200 OK
1494 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001495 Content-Type: application/json; charset=UTF-8
Hugo Arès3133b4b2014-10-14 14:05:10 -04001496
1497 )]}'
1498 [
1499 {
1500 "ref": "refs/heads/test1",
1501 "revision": "9c9d08a438e55e52f33b608415e6dddd9b18550d",
1502 "can_delete": true
1503 }
1504 ]
1505----
1506
Edwin Kempin196e1732013-05-09 15:12:34 +02001507[[get-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001508=== Get Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001509--
Edwin Kempin196e1732013-05-09 15:12:34 +02001510'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001511--
Edwin Kempin196e1732013-05-09 15:12:34 +02001512
1513Retrieves a branch of a project.
1514
1515.Request
1516----
1517 GET /projects/work%2Fmy-project/branches/master HTTP/1.0
1518----
1519
1520As response a link:#branch-info[BranchInfo] entity is returned that
1521describes the branch.
1522
1523.Response
1524----
1525 HTTP/1.1 200 OK
1526 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001527 Content-Type: application/json; charset=UTF-8
Edwin Kempin196e1732013-05-09 15:12:34 +02001528
1529 )]}'
1530 {
1531 "ref": "refs/heads/master",
1532 "revision": "67ebf73496383c6777035e374d2d664009e2aa5c"
1533 }
1534----
1535
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001536[[create-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001537=== Create Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001538--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001539'PUT /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001540--
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001541
1542Creates a new branch.
1543
1544In the request body additional data for the branch can be provided as
1545link:#branch-input[BranchInput].
1546
1547.Request
1548----
1549 PUT /projects/MyProject/branches/stable HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001550 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001551
1552 {
1553 "revision": "76016386a0d8ecc7b6be212424978bb45959d668"
1554 }
1555----
1556
1557As response a link:#branch-info[BranchInfo] entity is returned that
1558describes the created branch.
1559
1560.Response
1561----
1562 HTTP/1.1 201 Created
1563 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001564 Content-Type: application/json; charset=UTF-8
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02001565
1566 )]}'
1567 {
1568 "ref": "refs/heads/stable",
1569 "revision": "76016386a0d8ecc7b6be212424978bb45959d668",
1570 "can_delete": true
1571 }
1572----
1573
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001574[[delete-branch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001575=== Delete Branch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001576--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001577'DELETE /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001578--
Edwin Kempin6ce96a12013-06-06 13:20:01 +02001579
1580Deletes a branch.
1581
1582.Request
1583----
1584 DELETE /projects/MyProject/branches/stable HTTP/1.0
1585----
1586
1587.Response
1588----
1589 HTTP/1.1 204 No Content
1590----
1591
Hugo Arèsef8e3202015-01-12 15:09:06 -05001592[[delete-branches]]
1593=== Delete Branches
1594--
1595'POST /projects/link:#project-name[\{project-name\}]/branches:delete'
1596--
1597
1598Delete one or more branches.
1599
1600The branches to be deleted must be provided in the request body as a
1601link:#delete-branches-input[DeleteBranchesInput] entity.
1602
1603.Request
1604----
1605 POST /projects/MyProject/branches:delete HTTP/1.0
1606 Content-Type: application/json;charset=UTF-8
1607
1608 {
1609 "branches": [
1610 "stable-1.0",
1611 "stable-2.0"
1612 ]
1613 }
1614----
1615
1616.Response
1617----
1618 HTTP/1.1 204 No Content
1619----
1620
1621If some branches could not be deleted, the response is "`409 Conflict`" and the
1622error message is contained in the response body.
1623
Edwin Kempind31e5582013-11-30 12:07:08 +01001624[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001625=== Get Content
Edwin Kempind31e5582013-11-30 12:07:08 +01001626--
1627'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
1628--
1629
1630Gets the content of a file from the HEAD revision of a certain branch.
1631
1632.Request
1633----
1634 GET /projects/gerrit/branches/master/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
1635----
1636
1637The content is returned as base64 encoded string.
1638
1639.Response
1640----
1641 HTTP/1.1 200 OK
1642 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001643 Content-Type: text/plain; charset=UTF-8
Edwin Kempind31e5582013-11-30 12:07:08 +01001644
1645 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
1646----
1647
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001648
1649[[get-mergeable-info]]
1650=== Get Mergeable Information
1651--
1652'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/mergeable'
1653--
1654
1655Gets whether the source is mergeable with the target branch.
1656
Zhen Chen8f00d552016-07-26 16:54:59 -07001657The `source` query parameter is required, which can be anything that could be
1658resolved to a commit, see examples of the `source` attribute in
1659link:rest-api-changes.html#merge-input[MergeInput].
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001660
1661Also takes an optional parameter `strategy`, which can be `recursive`, `resolve`,
1662`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
1663
1664.Request
1665----
1666 GET /projects/test/branches/master/mergeable?source=testbranch&strategy=recursive HTTP/1.0
1667----
1668
Zhen Chen8f00d552016-07-26 16:54:59 -07001669As response a link:rest-api-changes.html#mergeable-info[MergeableInfo] entity is returned.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001670
1671.Response
1672----
1673 HTTP/1.1 200 OK
1674 Content-Disposition: attachment
1675 Content-Type: application/json; charset=UTF-8
1676
1677 )]}'
1678 {
Zhen Chen8f00d552016-07-26 16:54:59 -07001679 "submit_type": "MERGE_IF_NECESSARY",
1680 "strategy": "recursive",
1681 "mergeable": true,
1682 "commit_merged": false,
1683 "content_merged": false
1684 }
1685----
1686
1687or when there were conflicts.
1688
1689.Response
1690----
1691 HTTP/1.1 200 OK
1692 Content-Disposition: attachment
1693 Content-Type: application/json; charset=UTF-8
1694
1695 )]}'
1696 {
1697 "submit_type": "MERGE_IF_NECESSARY",
1698 "strategy": "recursive",
1699 "mergeable": false,
1700 "conflicts": [
1701 "common.txt",
1702 "shared.txt"
1703 ]
1704 }
1705----
1706
1707or when the 'testbranch' has been already merged.
1708
1709.Response
1710----
1711 HTTP/1.1 200 OK
1712 Content-Disposition: attachment
1713 Content-Type: application/json; charset=UTF-8
1714
1715 )]}'
1716 {
1717 "submit_type": "MERGE_IF_NECESSARY",
1718 "strategy": "recursive",
1719 "mergeable": true,
1720 "commit_merged": true,
1721 "content_merged": true
1722 }
1723----
1724
1725or when only the content of 'testbranch' has been merged.
1726
1727.Response
1728----
1729 HTTP/1.1 200 OK
1730 Content-Disposition: attachment
1731 Content-Type: application/json; charset=UTF-8
1732
1733 )]}'
1734 {
1735 "submit_type": "MERGE_IF_NECESSARY",
1736 "strategy": "recursive",
1737 "mergeable": true,
1738 "commit_merged": false,
1739 "content_merged": true
Zhen Chenf7d85ea2016-05-02 15:14:43 -07001740 }
1741----
1742
Edwin Kempin87504d92014-07-04 12:59:19 +02001743[[get-reflog]]
1744=== Get Reflog
1745--
1746'GET /projects/link:#project-name[\{project-name\}]/branches/link:#branch-id[\{branch-id\}]/reflog'
1747--
1748
1749Gets the reflog of a certain branch.
1750
1751The caller must be project owner.
1752
1753.Request
1754----
1755 GET /projects/gerrit/branches/master/reflog HTTP/1.0
1756----
1757
1758As response a list of link:#reflog-entry-info[ReflogEntryInfo] entities
1759is returned that describe the reflog entries. The reflog entries are
1760returned in reverse order.
1761
1762.Response
1763----
1764 HTTP/1.1 200 OK
1765 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001766 Content-Type: application/json; charset=UTF-8
Edwin Kempin87504d92014-07-04 12:59:19 +02001767
1768 )]}'
1769 [
1770 {
1771 "old_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1772 "new_id": "2eaa94bac536654eb592c941e33b91f925698d16",
1773 "who": {
1774 "name": "Jane Roe",
1775 "email": "jane.roe@example.com",
1776 "date": "2014-06-30 11:53:43.000000000",
1777 "tz": 120
1778 },
1779 "comment": "merged: fast forward"
1780 },
1781 {
1782 "old_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1783 "new_id": "976ced8f4fc0909d7e1584d18455299545881d60",
1784 "who": {
1785 "name": "John Doe",
1786 "email": "john.doe@example.com",
1787 "date": "2013-10-02 10:45:26.000000000",
1788 "tz": 120
1789 },
1790 "comment": "merged: fast forward"
1791 },
1792 {
1793 "old_id": "0000000000000000000000000000000000000000",
1794 "new_id": "c271c6a7161b74f85560c5899c8c73ee89ca5e29",
1795 "who": {
1796 "name": "John Doe",
1797 "email": "john.doe@example.com",
1798 "date": "2013-09-30 19:08:44.000000000",
1799 "tz": 120
1800 },
1801 "comment": ""
1802 }
1803 ]
1804----
1805
1806The get reflog endpoint also accepts a limit integer in the `n`
1807parameter. This limits the results to show the last `n` reflog entries.
1808
1809Query the last 25 reflog entries.
1810----
1811 GET /projects/gerrit/branches/master/reflog?n=25 HTTP/1.0
1812----
1813
Edwin Kempin2a581fd2014-07-04 14:04:54 +02001814The reflog can also be filtered by timestamp by specifying the `from`
1815and `to` parameters. The timestamp for `from` and `to` must be given as
1816UTC in the following format: `yyyyMMdd_HHmm`.
1817
1818----
1819 GET /projects/gerrit/branches/master/reflog?from=20130101_0000&to=20140101_0000=25 HTTP/1.0
1820----
1821
Edwin Kempin4425c742013-03-18 13:23:00 +01001822[[child-project-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001823== Child Project Endpoints
Edwin Kempin4425c742013-03-18 13:23:00 +01001824
1825[[list-child-projects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001826=== List Child Projects
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001827--
Edwin Kempin4425c742013-03-18 13:23:00 +01001828'GET /projects/link:#project-name[\{project-name\}]/children/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001829--
Edwin Kempin4425c742013-03-18 13:23:00 +01001830
1831List the direct child projects of a project.
1832
1833.Request
1834----
1835 GET /projects/Public-Plugins/children/ HTTP/1.0
1836----
1837
1838As result a list of link:#project-info[ProjectInfo] entries is
1839returned that describe the child projects.
1840
1841.Response
1842----
1843 HTTP/1.1 200 OK
1844 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001845 Content-Type: application/json; charset=UTF-8
Edwin Kempin4425c742013-03-18 13:23:00 +01001846
1847 )]}'
1848 [
1849 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001850 "id": "plugins%2Freplication",
1851 "name": "plugins/replication",
1852 "parent": "Public-Plugins",
1853 "description": "Copies to other servers using the Git protocol"
1854 },
1855 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001856 "id": "plugins%2Freviewnotes",
1857 "name": "plugins/reviewnotes",
1858 "parent": "Public-Plugins",
1859 "description": "Annotates merged commits using notes on refs/notes/review."
1860 },
1861 {
Edwin Kempin4425c742013-03-18 13:23:00 +01001862 "id": "plugins%2Fsingleusergroup",
1863 "name": "plugins/singleusergroup",
1864 "parent": "Public-Plugins",
1865 "description": "GroupBackend enabling users to be directly added to access rules"
1866 }
1867 ]
1868----
1869
Edwin Kempinf95bd172013-03-19 11:10:57 +01001870To resolve the child projects of a project recursively the parameter
1871`recursive` can be set.
1872
1873Child projects that are not visible to the calling user are ignored and
1874are not resolved further.
1875
1876.Request
1877----
1878 GET /projects/Public-Projects/children/?recursive HTTP/1.0
1879----
1880
1881.Response
1882----
1883 HTTP/1.1 200 OK
1884 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001885 Content-Type: application/json; charset=UTF-8
Edwin Kempinf95bd172013-03-19 11:10:57 +01001886
1887 )]}'
1888 [
1889 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001890 "id": "gerrit",
1891 "name": "gerrit",
1892 "parent": "Public-Projects",
1893 "description": "Gerrit Code Review"
1894 },
1895 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001896 "id": "plugins%2Freplication",
1897 "name": "plugins/replication",
1898 "parent": "Public-Plugins",
1899 "description": "Copies to other servers using the Git protocol"
1900 },
1901 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001902 "id": "plugins%2Freviewnotes",
1903 "name": "plugins/reviewnotes",
1904 "parent": "Public-Plugins",
1905 "description": "Annotates merged commits using notes on refs/notes/review."
1906 },
1907 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001908 "id": "plugins%2Fsingleusergroup",
1909 "name": "plugins/singleusergroup",
1910 "parent": "Public-Plugins",
1911 "description": "GroupBackend enabling users to be directly added to access rules"
1912 },
1913 {
Edwin Kempinf95bd172013-03-19 11:10:57 +01001914 "id": "Public-Plugins",
1915 "name": "Public-Plugins",
1916 "parent": "Public-Projects",
1917 "description": "Parent project for plugins/*"
1918 }
1919 ]
1920----
1921
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001922[[get-child-project]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001923=== Get Child Project
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001924--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001925'GET /projects/link:#project-name[\{project-name\}]/children/link:#project-name[\{project-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001926--
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001927
Edwin Kempin8a3fb5b2013-03-21 15:02:22 +01001928Retrieves a child project. If a non-direct child project should be
1929retrieved the parameter `recursive` must be set.
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001930
1931.Request
1932----
1933 GET /projects/Public-Plugins/children/plugins%2Freplication HTTP/1.0
1934----
1935
1936As response a link:#project-info[ProjectInfo] entity is returned that
1937describes the child project.
1938
1939.Response
1940----
1941 HTTP/1.1 200 OK
1942 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001943 Content-Type: application/json; charset=UTF-8
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001944
1945 )]}'
1946 {
Edwin Kempin5b6c4062013-03-19 09:26:03 +01001947 "id": "plugins%2Freplication",
1948 "name": "plugins/replication",
1949 "parent": "Public-Plugins",
1950 "description": "Copies to other servers using the Git protocol"
1951 }
1952----
1953
David Pursehouse8cc68902014-10-06 18:17:16 +09001954[[tag-endpoints]]
1955== Tag Endpoints
1956
David Pursehouse6a446192016-06-03 10:00:34 +09001957[[create-tag]]
1958=== Create Tag
1959
1960--
1961'PUT /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
1962--
1963
1964Create a new tag on the project.
1965
1966In the request body additional data for the tag can be provided as
1967link:#tag-input[TagInput].
1968
1969If a message is provided in the input, the tag is created as an
1970annotated tag with the current user as tagger. Signed tags are not
1971supported.
1972
1973.Request
1974----
1975 PUT /projects/MyProject/tags/v1.0 HTTP/1.0
1976 Content-Type: application/json; charset=UTF-8
1977
1978 {
1979 "message": "annotation",
1980 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
1981 }
1982----
1983
1984As response a link:#tag-info[TagInfo] entity is returned that describes
1985the created tag.
1986
1987.Response
1988----
1989 HTTP/1.1 201 Created
1990 Content-Disposition: attachment
1991 Content-Type: application/json; charset=UTF-8
1992
1993 )]}'
1994
1995 "object": "d48d304adc4b6674e11dc2c018ea05fcbdda32fd",
1996 "message": "annotation",
1997 "tagger": {
1998 "name": "David Pursehouse",
1999 "email": "dpursehouse@collab.net",
2000 "date": "2016-06-06 01:22:03.000000000",
2001 "tz": 540
2002 },
2003 "ref": "refs/tags/v1.0",
2004 "revision": "c83117624b5b5d8a7f86093824e2f9c1ed309d63"
2005 }
2006----
2007
David Pursehouse8cc68902014-10-06 18:17:16 +09002008[[list-tags]]
2009=== List Tags
2010--
2011'GET /projects/link:#project-name[\{project-name\}]/tags/'
2012--
2013
2014List the tags of a project.
2015
2016As result a list of link:#tag-info[TagInfo] entries is returned.
2017
2018Only includes tags under the `refs/tags/` namespace.
2019
2020.Request
2021----
2022 GET /projects/work%2Fmy-project/tags/ HTTP/1.0
2023----
2024
2025.Response
2026----
2027 HTTP/1.1 200 OK
2028 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002029 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09002030
2031 )]}'
2032 [
2033 {
2034 "ref": "refs/tags/v1.0",
2035 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2036 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2037 "message": "Annotated tag",
2038 "tagger": {
2039 "name": "David Pursehouse",
2040 "email": "david.pursehouse@sonymobile.com",
2041 "date": "2014-10-06 07:35:03.000000000",
2042 "tz": 540
2043 }
2044 },
2045 {
2046 "ref": "refs/tags/v2.0",
2047 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2048 },
2049 {
2050 "ref": "refs/tags/v3.0",
2051 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2052 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2053 "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-----",
2054 "tagger": {
2055 "name": "David Pursehouse",
2056 "email": "david.pursehouse@sonymobile.com",
2057 "date": "2014-10-06 09:02:16.000000000",
2058 "tz": 540
2059 }
2060 }
2061 ]
2062----
2063
David Pursehouseb0ba1512015-09-10 14:17:05 +09002064[[tag-options]]
2065==== Tag Options
2066
2067Limit(n)::
2068Limit the number of tags to be included in the results.
2069+
2070.Request
2071----
2072 GET /projects/work%2Fmy-project/tags?n=2 HTTP/1.0
2073----
2074+
2075.Response
2076----
2077 HTTP/1.1 200 OK
2078 Content-Disposition: attachment
2079 Content-Type: application/json; charset=UTF-8
2080
2081 )]}'
2082 [
2083 {
2084 "ref": "refs/tags/v1.0",
2085 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2086 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2087 "message": "Annotated tag",
2088 "tagger": {
2089 "name": "David Pursehouse",
2090 "email": "david.pursehouse@sonymobile.com",
2091 "date": "2014-10-06 07:35:03.000000000",
2092 "tz": 540
2093 }
2094 },
2095 {
2096 "ref": "refs/tags/v2.0",
2097 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2098 }
2099 ]
2100----
2101
David Pursehouse5cb38192017-07-28 16:11:33 +01002102Skip(S)::
David Pursehouseb0ba1512015-09-10 14:17:05 +09002103Skip the given number of tags from the beginning of the list.
2104+
2105.Request
2106----
2107 GET /projects/work%2Fmy-project/tags?n=2&s=1 HTTP/1.0
2108----
2109+
2110.Response
2111----
2112 HTTP/1.1 200 OK
2113 Content-Disposition: attachment
2114 Content-Type: application/json; charset=UTF-8
2115
2116 )]}'
2117 [
2118 {
2119 "ref": "refs/tags/v2.0",
2120 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2121 },
2122 {
2123 "ref": "refs/tags/v3.0",
2124 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2125 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2126 "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-----",
2127 "tagger": {
2128 "name": "David Pursehouse",
2129 "email": "david.pursehouse@sonymobile.com",
2130 "date": "2014-10-06 09:02:16.000000000",
2131 "tz": 540
2132 }
2133 }
2134 ]
2135----
2136
David Pursehousecf1ed062017-07-13 10:05:43 +09002137Substring(m)::
2138Limit the results to those tags that match the specified substring.
2139+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09002140The match is case insensitive. May not be used together with `r`.
David Pursehousecf1ed062017-07-13 10:05:43 +09002141+
2142List all tags that match substring `v2`:
2143
2144+
2145.Request
2146----
2147 GET /projects/testproject/tags?m=v2 HTTP/1.0
2148----
2149+
2150.Response
2151----
2152 HTTP/1.1 200 OK
2153 Content-Disposition: attachment
2154 Content-Type: application/json; charset=UTF-8
2155
2156 )]}'
2157 [
2158 {
2159 "ref": "refs/tags/v2.0",
2160 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2161 },
2162 ]
2163----
2164
2165Regex(r)::
2166Limit the results to those tags that match the specified regex.
2167Boundary matchers '^' and '$' are implicit. For example: the regex 't*' will
2168match any tags that start with 't' and regex '*t' will match any
2169tags that end with 't'.
2170+
David Pursehouse16a1a4b2017-07-13 10:22:28 +09002171The match is case sensitive. May not be used together with `m`.
David Pursehousef648e042017-07-13 10:08:46 +09002172+
David Pursehousecf1ed062017-07-13 10:05:43 +09002173List all tags that match regex `v.*0`:
2174+
2175.Request
2176----
2177 GET /projects/testproject/tags?r=v.*0 HTTP/1.0
2178----
2179+
2180.Response
2181----
2182 HTTP/1.1 200 OK
2183 Content-Disposition: attachment
2184 Content-Type: application/json; charset=UTF-8
2185
2186 )]}'
2187 [
2188 {
2189 "ref": "refs/tags/v1.0",
2190 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2191 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2192 "message": "Annotated tag",
2193 "tagger": {
2194 "name": "David Pursehouse",
2195 "email": "david.pursehouse@sonymobile.com",
2196 "date": "2014-10-06 07:35:03.000000000",
2197 "tz": 540
2198 }
2199 },
2200 {
2201 "ref": "refs/tags/v2.0",
2202 "revision": "1624f5af8ae89148d1a3730df8c290413e3dcf30"
2203 },
2204 {
2205 "ref": "refs/tags/v3.0",
2206 "revision": "c628685b3c5a3614571ecb5c8fceb85db9112313",
2207 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2208 "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-----",
2209 "tagger": {
2210 "name": "David Pursehouse",
2211 "email": "david.pursehouse@sonymobile.com",
2212 "date": "2014-10-06 09:02:16.000000000",
2213 "tz": 540
2214 }
2215 }
2216 ]
2217----
David Pursehouseb0ba1512015-09-10 14:17:05 +09002218
David Pursehouse8cc68902014-10-06 18:17:16 +09002219[[get-tag]]
2220=== Get Tag
2221--
2222'GET /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2223--
2224
2225Retrieves a tag of a project.
2226
2227.Request
2228----
2229 GET /projects/work%2Fmy-project/tags/v1.0 HTTP/1.0
2230----
2231
2232As response a link:#tag-info[TagInfo] entity is returned that describes the tag.
2233
2234.Response
2235----
2236 HTTP/1.1 200 OK
2237 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002238 Content-Type: application/json; charset=UTF-8
David Pursehouse8cc68902014-10-06 18:17:16 +09002239
2240 )]}'
2241 {
2242 "ref": "refs/tags/v1.0",
2243 "revision": "49ce77fdcfd3398dc0dedbe016d1a425fd52d666",
2244 "object": "1624f5af8ae89148d1a3730df8c290413e3dcf30",
2245 "message": "Annotated tag",
2246 "tagger": {
2247 "name": "David Pursehouse",
2248 "email": "david.pursehouse@sonymobile.com",
2249 "date": "2014-10-06 07:35:03.000000000",
2250 "tz": 540
2251 }
2252 }
2253----
2254
David Pursehousee1132162016-11-30 20:42:33 +09002255[[delete-tag]]
2256=== Delete Tag
2257--
2258'DELETE /projects/link:#project-name[\{project-name\}]/tags/link:#tag-id[\{tag-id\}]'
2259--
2260
2261Deletes a tag.
2262
2263.Request
2264----
2265 DELETE /projects/MyProject/tags/v1.0 HTTP/1.0
2266----
2267
2268.Response
2269----
2270 HTTP/1.1 204 No Content
2271----
David Pursehouse8cc68902014-10-06 18:17:16 +09002272
David Pursehouse467aecb2016-12-02 14:18:42 +09002273[[delete-tags]]
2274=== Delete Tags
2275--
2276'POST /projects/link:#project-name[\{project-name\}]/tags:delete'
2277--
2278
2279Delete one or more tags.
2280
2281The tags to be deleted must be provided in the request body as a
2282link:#delete-tags-input[DeleteTagsInput] entity.
2283
2284.Request
2285----
2286 POST /projects/MyProject/tags:delete HTTP/1.0
2287 Content-Type: application/json;charset=UTF-8
2288
2289 {
2290 "tags": [
2291 "v1.0",
2292 "v2.0"
2293 ]
2294 }
2295----
2296
2297.Response
2298----
2299 HTTP/1.1 204 No Content
2300----
2301
2302If some tags could not be deleted, the response is "`409 Conflict`" and the
2303error message is contained in the response body.
2304
Edwin Kempin1b993602014-07-08 16:18:45 +02002305[[commit-endpoints]]
2306== Commit Endpoints
2307
2308[[get-commit]]
2309=== Get Commit
2310--
2311'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]'
2312--
2313
2314Retrieves a commit of a project.
2315
2316The commit must be visible to the caller.
2317
2318.Request
2319----
2320 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96 HTTP/1.0
2321----
2322
2323As response a link:rest-api-changes.html#commit-info[CommitInfo] entity
2324is returned that describes the commit.
2325
2326.Response
2327----
2328 HTTP/1.1 200 OK
2329 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002330 Content-Type: application/json; charset=UTF-8
Edwin Kempin1b993602014-07-08 16:18:45 +02002331
2332 )]}'
2333 {
2334 "commit": "184ebe53805e102605d11f6b143486d15c23a09c",
2335 "parents": [
2336 {
2337 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2338 "subject": "Migrate contributor agreements to All-Projects."
2339 }
2340 ],
2341 "author": {
2342 "name": "Shawn O. Pearce",
2343 "email": "sop@google.com",
2344 "date": "2012-04-24 18:08:08.000000000",
2345 "tz": -420
2346 },
2347 "committer": {
2348 "name": "Shawn O. Pearce",
2349 "email": "sop@google.com",
2350 "date": "2012-04-24 18:08:08.000000000",
2351 "tz": -420
2352 },
2353 "subject": "Use an EventBus to manage star icons",
2354 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2355 }
2356----
2357
Gustaf Lundh1386d592016-10-19 23:19:08 +02002358[[get-included-in]]
2359=== Get Included In
2360--
2361'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/in'
2362--
2363
2364Retrieves the branches and tags in which a change is included. As result
2365an link:rest-api-changes.html#included-in-info[IncludedInInfo] entity is returned.
2366
2367.Request
2368----
2369 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/in HTTP/1.0
2370----
2371
2372.Response
2373----
2374 HTTP/1.1 200 OK
2375 Content-Disposition: attachment
2376 Content-Type: application/json;charset=UTF-8
2377
2378 )]}'
2379 {
2380 "branches": [
2381 "master"
2382 ],
2383 "tags": []
2384 }
2385----
2386
Zhen Chend1462d82016-05-12 13:55:37 -07002387[[get-content-from-commit]]
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002388=== Get Content
2389--
2390'GET /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/files/link:rest-api-changes.html#file-id[\{file-id\}]/content'
2391--
2392
2393Gets the content of a file from a certain commit.
2394
2395.Request
2396----
2397 GET /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
2398----
2399
2400The content is returned as base64 encoded string.
2401
2402.Response
2403----
2404 HTTP/1.1 200 OK
2405 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002406 Content-Type: text/plain; charset=UTF-8
Edwin Kempin6f7410a2014-07-09 15:46:22 +02002407
2408 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
2409----
2410
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002411
2412[[cherry-pick-commit]]
2413=== Cherry Pick Commit
2414--
2415'POST /projects/link:#project-name[\{project-name\}]/commits/link:#commit-id[\{commit-id\}]/cherrypick'
2416--
2417
2418Cherry-picks a commit of a project to a destination branch.
2419
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02002420To cherry pick a change revision, see link:rest-api-changes.html#cherry-pick[CherryPick].
2421
Changcheng Xiao9d2ec042017-03-22 17:16:57 +01002422The destination branch must be provided in the request body inside a
2423link:rest-api-changes.html#cherrypick-input[CherryPickInput] entity.
2424If the commit message is not set, the commit message of the source
2425commit will be used.
2426
2427.Request
2428----
2429 POST /projects/work%2Fmy-project/commits/a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96/cherrypick HTTP/1.0
2430 Content-Type: application/json; charset=UTF-8
2431
2432 {
2433 "message" : "Implementing Feature X",
2434 "destination" : "release-branch"
2435 }
2436----
2437
2438As response a link:rest-api-changes.html#change-info[ChangeInfo] entity is returned that
2439describes the resulting cherry-picked change.
2440
2441.Response
2442----
2443 HTTP/1.1 200 OK
2444 Content-Disposition: attachment
2445 Content-Type: application/json; charset=UTF-8
2446
2447 )]}'
2448 {
2449 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
2450 "project": "myProject",
2451 "branch": "release-branch",
2452 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
2453 "subject": "Implementing Feature X",
2454 "status": "NEW",
2455 "created": "2013-02-01 09:59:32.126000000",
2456 "updated": "2013-02-21 11:16:36.775000000",
2457 "mergeable": true,
2458 "insertions": 12,
2459 "deletions": 11,
2460 "_number": 3965,
2461 "owner": {
2462 "name": "John Doe"
2463 }
2464 }
2465----
2466
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002467[[dashboard-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002468== Dashboard Endpoints
Edwin Kempinc3fe3cb2013-02-13 15:09:23 +01002469
Edwin Kempin76202742013-02-15 13:51:50 +01002470[[list-dashboards]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002471=== List Dashboards
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002472--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002473'GET /projects/link:#project-name[\{project-name\}]/dashboards/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002474--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002475
Edwin Kempind0a63922013-01-23 16:32:59 +01002476List custom dashboards for a project.
2477
Edwin Kempin55367622013-02-05 09:09:23 +01002478As result a list of link:#dashboard-info[DashboardInfo] entries is
2479returned.
2480
Edwin Kempind0a63922013-01-23 16:32:59 +01002481List all dashboards for the `work/my-project` project:
Edwin Kempin37440832013-02-06 11:36:00 +01002482
2483.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002484----
2485 GET /projects/work%2Fmy-project/dashboards/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002486----
Edwin Kempind0a63922013-01-23 16:32:59 +01002487
Edwin Kempin37440832013-02-06 11:36:00 +01002488.Response
2489----
Edwin Kempind0a63922013-01-23 16:32:59 +01002490 HTTP/1.1 200 OK
2491 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002492 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002493
2494 )]}'
2495 [
2496 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002497 "id": "main:closed",
2498 "ref": "main",
2499 "path": "closed",
2500 "description": "Merged and abandoned changes in last 7 weeks",
2501 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002502 "is_default": true,
Edwin Kempind0a63922013-01-23 16:32:59 +01002503 "title": "Closed changes",
2504 "sections": [
2505 {
2506 "name": "Merged",
2507 "query": "status:merged age:7w"
2508 },
2509 {
2510 "name": "Abandoned",
2511 "query": "status:abandoned age:7w"
2512 }
2513 ]
2514 }
2515 ]
2516----
2517
Edwin Kempina64c4b92013-01-23 11:30:40 +01002518.Get all dashboards of the 'All-Projects' project
2519****
2520get::/projects/All-Projects/dashboards/
2521****
2522
Edwin Kempin67e923c2013-02-14 13:57:12 +01002523[[get-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002524=== Get Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002525--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002526'GET /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002527--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002528
Edwin Kempin67e923c2013-02-14 13:57:12 +01002529Retrieves a project dashboard. The dashboard can be defined on that
2530project or be inherited from a parent project.
2531
2532.Request
2533----
2534 GET /projects/work%2Fmy-project/dashboards/main:closed HTTP/1.0
2535----
2536
2537As response a link:#dashboard-info[DashboardInfo] entity is returned
2538that describes the dashboard.
2539
2540.Response
2541----
2542 HTTP/1.1 200 OK
2543 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002544 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002545
2546 )]}'
2547 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002548 "id": "main:closed",
2549 "ref": "main",
2550 "path": "closed",
2551 "description": "Merged and abandoned changes in last 7 weeks",
2552 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002553 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002554 "title": "Closed changes",
2555 "sections": [
2556 {
2557 "name": "Merged",
2558 "query": "status:merged age:7w"
2559 },
2560 {
2561 "name": "Abandoned",
2562 "query": "status:abandoned age:7w"
2563 }
2564 ]
2565 }
2566----
2567
2568To retrieve the default dashboard of a project use `default` as
2569dashboard-id.
Edwin Kempin37440832013-02-06 11:36:00 +01002570
2571.Request
Edwin Kempind0a63922013-01-23 16:32:59 +01002572----
2573 GET /projects/work%2Fmy-project/dashboards/default HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +01002574----
Edwin Kempind0a63922013-01-23 16:32:59 +01002575
Edwin Kempin37440832013-02-06 11:36:00 +01002576.Response
2577----
Edwin Kempind0a63922013-01-23 16:32:59 +01002578 HTTP/1.1 200 OK
2579 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002580 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +01002581
2582 )]}'
2583 {
Edwin Kempind0a63922013-01-23 16:32:59 +01002584 "id": "main:closed",
2585 "ref": "main",
2586 "path": "closed",
Edwin Kempin67e923c2013-02-14 13:57:12 +01002587 "description": "Merged and abandoned changes in last 7 weeks",
2588 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002589 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002590 "title": "Closed changes",
2591 "sections": [
2592 {
2593 "name": "Merged",
2594 "query": "status:merged age:7w"
2595 },
2596 {
2597 "name": "Abandoned",
2598 "query": "status:abandoned age:7w"
2599 }
2600 ]
Edwin Kempind0a63922013-01-23 16:32:59 +01002601 }
2602----
2603
Edwin Kempin67e923c2013-02-14 13:57:12 +01002604[[set-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002605=== Set Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002606--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002607'PUT /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002608--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002609
Edwin Kempin67e923c2013-02-14 13:57:12 +01002610Updates/Creates a project dashboard.
2611
2612Currently only supported for the `default` dashboard.
2613
2614The creation/update information for the dashboard must be provided in
2615the request body as a link:#dashboard-input[DashboardInput] entity.
2616
2617.Request
2618----
2619 PUT /projects/work%2Fmy-project/dashboards/default HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002620 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002621
2622 {
2623 "id": "main:closed",
2624 "commit_message": "Define the default dashboard"
2625 }
2626----
2627
2628As response the new/updated dashboard is returned as a
2629link:#dashboard-info[DashboardInfo] entity.
2630
2631.Response
2632----
2633 HTTP/1.1 200 OK
2634 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002635 Content-Type: application/json; charset=UTF-8
Edwin Kempin67e923c2013-02-14 13:57:12 +01002636
2637 )]}'
2638 {
Edwin Kempin67e923c2013-02-14 13:57:12 +01002639 "id": "main:closed",
2640 "ref": "main",
2641 "path": "closed",
2642 "description": "Merged and abandoned changes in last 7 weeks",
2643 "url": "/dashboard/?title\u003dClosed+changes\u0026Merged\u003dstatus:merged+age:7w\u0026Abandoned\u003dstatus:abandoned+age:7w",
David Pursehouse8edc1992017-09-15 17:12:09 +09002644 "is_default": true,
Edwin Kempin67e923c2013-02-14 13:57:12 +01002645 "title": "Closed changes",
2646 "sections": [
2647 {
2648 "name": "Merged",
2649 "query": "status:merged age:7w"
2650 },
2651 {
2652 "name": "Abandoned",
2653 "query": "status:abandoned age:7w"
2654 }
2655 ]
2656 }
2657----
2658
2659[[delete-dashboard]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002660=== Delete Dashboard
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002661--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002662'DELETE /projects/link:#project-name[\{project-name\}]/dashboards/link:#dashboard-id[\{dashboard-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002663--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002664
Edwin Kempin67e923c2013-02-14 13:57:12 +01002665Deletes a project dashboard.
2666
2667Currently only supported for the `default` dashboard.
2668
Edwin Kempinefec4492013-02-22 10:09:23 +01002669The request body does not need to include a link:#dashboard-input[
John Spurlockd25fad12013-03-09 11:48:49 -05002670DashboardInput] entity if no commit message is specified.
Edwin Kempin67e923c2013-02-14 13:57:12 +01002671
2672Please note that some proxies prohibit request bodies for DELETE
2673requests.
2674
2675.Request
2676----
2677 DELETE /projects/work%2Fmy-project/dashboards/default HTTP/1.0
2678----
2679
2680.Response
2681----
2682 HTTP/1.1 204 No Content
2683----
2684
Edwin Kempin34d83352013-02-06 10:40:17 +01002685
2686[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002687== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01002688
Edwin Kempin196e1732013-05-09 15:12:34 +02002689[[branch-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002690=== \{branch-id\}
Edwin Kempin196e1732013-05-09 15:12:34 +02002691The name of a branch or `HEAD`. The prefix `refs/heads/` can be
2692omitted.
2693
Edwin Kempin1b993602014-07-08 16:18:45 +02002694[[commit-id]]
2695=== \{commit-id\}
2696Commit ID.
2697
David Pursehouse8cc68902014-10-06 18:17:16 +09002698[[tag-id]]
2699=== \{tag-id\}
2700The name of a tag. The prefix `refs/tags/` can be omitted.
2701
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002702[[dashboard-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002703=== \{dashboard-id\}
Edwin Kempin67e923c2013-02-14 13:57:12 +01002704The ID of a dashboard in the format '<ref>:<path>'.
2705
2706A special dashboard ID is `default` which represents the default
2707dashboard of a project.
2708
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002709[[project-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002710=== \{project-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01002711The name of the project.
2712
Edwin Kempina9e94ab2015-03-06 10:35:39 +01002713If the name ends with `.git`, the suffix will be automatically removed.
2714
Edwin Kempin34d83352013-02-06 10:40:17 +01002715
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002716[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002717== JSON Entities
Edwin Kempin51a6dc92013-02-04 15:43:59 +01002718
Han-Wen Nienhuysd1ed08d2017-09-04 18:13:23 +02002719[[access-check-info]]
2720=== AccessCheckInfo
2721
2722The `AccessCheckInfo` entity is the result of an access check.
2723
2724[options="header",cols="1,^1,5"]
2725|=========================================
2726|Field Name ||Description
2727|`status` ||The HTTP status code for the access.
2728200 means success, 403 means denied and 404 means the project does not exist.
2729|`message` |optional|A clarifying message if `status` is not 200.
2730|=========================================
2731
2732[[access-check-input]]
2733=== AccessCheckInput
2734The `AccessCheckInput` entity is either an account or
2735(account, ref) tuple for which we want to check access.
2736
2737[options="header",cols="1,^1,5"]
2738|=========================================
2739|Field Name ||Description
2740|`account` ||The account for which to check access
2741|`ref` |optional|The refname for which to check access
2742|=========================================
2743
Edwin Kempin62946742014-07-09 11:17:58 +02002744[[ban-input]]
2745=== BanInput
2746The `BanInput` entity contains information for banning commits in a
2747project.
2748
David Pursehouseae367192014-11-25 17:24:47 +09002749[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02002750|=======================
2751|Field Name||Description
2752|`commits` ||List of commits to be banned.
2753|`reason` |optional|Reason for banning the commits.
2754|=======================
2755
2756[[ban-result-info]]
2757=== BanResultInfo
2758The `BanResultInfo` entity describes the result of banning commits.
2759
David Pursehouseae367192014-11-25 17:24:47 +09002760[options="header",cols="1,^2,4"]
Edwin Kempin62946742014-07-09 11:17:58 +02002761|=============================
2762|Field Name ||Description
2763|`newly_banned` |optional|List of newly banned commits.
2764|`already_banned`|optional|List of commits that were already banned.
2765|`ignored` |optional|List of object IDs that were ignored.
2766|=============================
2767
Edwin Kempin521c1242015-01-23 12:44:44 +01002768[[branch-info]]
2769=== BranchInfo
2770The `BranchInfo` entity contains information about a branch.
2771
2772[options="header",cols="1,^2,4"]
2773|=========================
2774|Field Name ||Description
2775|`ref` ||The ref of the branch.
2776|`revision` ||The revision to which the branch points.
David Pursehoused00515e2017-11-10 15:57:41 +09002777|`can_delete`|not set if `false`|
Edwin Kempin521c1242015-01-23 12:44:44 +01002778Whether the calling user can delete this branch.
2779|`web_links` |optional|
2780Links to the branch in external sites as a list of
2781link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
2782|=========================
2783
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002784[[branch-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002785=== BranchInput
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002786The `BranchInput` entity contains information for the creation of
2787a new branch.
2788
David Pursehouseae367192014-11-25 17:24:47 +09002789[options="header",cols="1,^2,4"]
Edwin Kempin5c0d6b32013-05-09 19:54:37 +02002790|=======================
2791|Field Name||Description
2792|`ref` |optional|
2793The name of the branch. The prefix `refs/heads/` can be
2794omitted. +
2795If set, must match the branch ID in the URL.
2796|`revision`|optional|
2797The base revision of the new branch. +
2798If not set, `HEAD` will be used as base revision.
2799|=======================
2800
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002801[[config-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002802=== ConfigInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002803The `ConfigInfo` entity contains information about the effective project
2804configuration.
2805
David Pursehouseae367192014-11-25 17:24:47 +09002806[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02002807|=======================================================
2808|Field Name ||Description
2809|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002810The description of the project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002811|`use_contributor_agreements` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002812link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2813authors must complete a contributor agreement on the site before
2814pushing any commits or changes to this project.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002815|`use_content_merge` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002816link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2817Gerrit will try to perform a 3-way merge of text file content when a
2818file has been modified by both the destination branch and the change
2819being submitted. This option only takes effect if submit type is not
2820FAST_FORWARD_ONLY.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002821|`use_signed_off_by` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002822link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2823each change must contain a Signed-off-by line from either the author or
2824the uploader in the commit message.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002825|`create_new_change_for_all_not_in_target` |optional|
2826link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2827a new change is created for every commit not in target branch.
2828|`require_change_id` |optional|
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002829link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether a
2830valid link:user-changeid.html[Change-Id] footer in any commit uploaded
2831for review is required. This does not apply to commits pushed directly
2832to a branch or tag.
Doug Claar1b0f76252016-03-23 13:34:55 -07002833|`enable_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz5170e0f2015-06-18 21:05:29 -04002834link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2835signed push validation is enabled on the project.
Doug Claar1b0f76252016-03-23 13:34:55 -07002836|`require_signed_push`|optional, not set if signed push is disabled|
Dave Borowitz0543c732015-10-20 10:35:26 -04002837link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2838signed push validation is required on the project.
Saša Živkov225b7a72015-11-17 17:37:43 +01002839|`reject_implicit_merges`|optional|
2840link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2841implicit merges should be rejected on changes pushed to the project.
Changcheng Xiaod089b4a2017-08-10 14:05:22 +02002842|`private_by_default` ||
2843link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2844all new changes are set as private by default.
Edwin Kempin3c99f592013-07-15 10:12:27 +02002845|`max_object_size_limit` ||
2846The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2847limit] of this project as a link:#max-object-size-limit-info[
2848MaxObjectSizeLimitInfo] entity.
2849|`submit_type` ||
2850The default submit type of the project, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02002851`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Edwin Kempin3c99f592013-07-15 10:12:27 +02002852`CHERRY_PICK`.
Patrick Hiesel5a316352017-06-22 15:38:06 +02002853|`match_author_to_committer_date` |optional|
2854link:#inherited-boolean-info[InheritedBooleanInfo] that indicates whether
2855a change's author date will be changed to match its submitter date upon submit.
Edwin Kempin3c99f592013-07-15 10:12:27 +02002856|`state` |optional|
2857The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
2858Not set if the project state is `ACTIVE`.
Edwin Kempin3660c132013-07-16 08:03:11 +02002859|`commentlinks` ||
Edwin Kempin8aa53af2013-07-15 10:43:15 +02002860Map with the comment link configurations of the project. The name of
2861the comment link configuration is mapped to the comment link
2862configuration, which has the same format as the
2863link:config-gerrit.html#_a_id_commentlink_a_section_commentlink[
2864commentlink section] of `gerrit.config`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002865|`theme` |optional|
Edwin Kempin272402e2013-07-15 11:17:36 +02002866The theme that is configured for the project as a link:#theme-info[
2867ThemeInfo] entity.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002868|`plugin_config` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002869Plugin configuration as map which maps the plugin name to a map of
2870parameter names to link:#config-parameter-info[ConfigParameterInfo]
2871entities.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002872|`actions` |optional|
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02002873Actions the caller might be able to perform on this project. The
2874information is a map of view names to
Patrick Hieseldc285c72018-01-08 17:20:15 +01002875|`reject_empty_commit` |optional|
2876link:#inherited-boolean-info[InheritedBooleanInfo] that tells whether
2877empty commits should be rejected when a change is merged.
David Ostrovsky9e8b2fb2013-08-30 08:09:53 +02002878link:rest-api-changes.html#action-info[ActionInfo] entities.
David Pursehouse510b87d2014-11-25 16:46:28 +09002879|=======================================================
Edwin Kempin0cb5a562013-07-12 15:41:04 +02002880
Edwin Kempina23eb102013-07-17 09:10:54 +02002881[[config-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002882=== ConfigInput
Edwin Kempina23eb102013-07-17 09:10:54 +02002883The `ConfigInput` entity describes a new project configuration.
2884
David Pursehouseae367192014-11-25 17:24:47 +09002885[options="header",cols="1,^2,4"]
Deniz Türkoglu52777272014-09-08 17:02:48 +02002886|======================================================
2887|Field Name ||Description
2888|`description` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002889The new description of the project. +
2890If not set, the description is removed.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002891|`use_contributor_agreements` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002892Whether authors must complete a contributor agreement on the site
2893before pushing any commits or changes to this project. +
2894Can be `TRUE`, `FALSE` or `INHERIT`. +
2895If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002896|`use_content_merge` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002897Whether Gerrit will try to perform a 3-way merge of text file content
2898when a file has been modified by both the destination branch and the
2899change being submitted. This option only takes effect if submit type is
2900not FAST_FORWARD_ONLY. +
2901Can be `TRUE`, `FALSE` or `INHERIT`. +
2902If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002903|`use_signed_off_by` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002904Whether each change must contain a Signed-off-by line from either the
2905author or the uploader in the commit message. +
2906Can be `TRUE`, `FALSE` or `INHERIT`. +
2907If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002908|`create_new_change_for_all_not_in_target` |optional|
2909Whether a new change will be created for every commit not in target
2910branch. +
2911Can be `TRUE`, `FALSE` or `INHERIT`. +
2912If not set, this setting is not updated.
2913|`require_change_id` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002914Whether a valid link:user-changeid.html[Change-Id] footer in any commit
2915uploaded for review is required. This does not apply to commits pushed
2916directly to a branch or tag. +
2917Can be `TRUE`, `FALSE` or `INHERIT`. +
2918If not set, this setting is not updated.
Saša Živkov225b7a72015-11-17 17:37:43 +01002919|`reject_implicit_merges` |optional|
2920Whether a check for implicit merges will be performed when changes
2921are pushed for review. +
2922Can be `TRUE`, `FALSE` or `INHERIT`. +
2923If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002924|`max_object_size_limit` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002925The link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
2926limit] of this project as a link:#max-object-size-limit-info[
2927MaxObjectSizeLimitInfo] entity. +
2928If set to `0`, the max object size limit is removed. +
2929If not set, this setting is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002930|`submit_type` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002931The default submit type of the project, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02002932`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Edwin Kempina23eb102013-07-17 09:10:54 +02002933`CHERRY_PICK`. +
2934If not set, the submit type is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002935|`state` |optional|
Edwin Kempina23eb102013-07-17 09:10:54 +02002936The state of the project, can be `ACTIVE`, `READ_ONLY` or `HIDDEN`. +
2937Not set if the project state is `ACTIVE`. +
2938If not set, the project state is not updated.
Deniz Türkoglu52777272014-09-08 17:02:48 +02002939|`plugin_config_values` |optional|
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002940Plugin configuration values as map which maps the plugin name to a map
2941of parameter names to values.
Patrick Hieseldc285c72018-01-08 17:20:15 +01002942|`reject_empty_commit` |optional|
2943Whether empty commits should be rejected when a change is merged.
2944Can be `TRUE`, `FALSE` or `INHERIT`. +
2945If not set, this setting is not updated.
David Pursehouse510b87d2014-11-25 16:46:28 +09002946|======================================================
Edwin Kempina23eb102013-07-17 09:10:54 +02002947
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002948[[config-parameter-info]]
David Pursehouseb10c2662016-12-06 08:41:33 +09002949=== ConfigParameterInfo
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002950The `ConfigParameterInfo` entity describes a project configuration
2951parameter.
2952
David Pursehouseae367192014-11-25 17:24:47 +09002953[options="header",cols="1,^2,4"]
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002954|===============================
2955|Field Name ||Description
2956|`display_name` |optional|
2957The display name of the configuration parameter.
Edwin Kempind92196d2014-01-27 21:55:46 +01002958|`description` |optional|
2959The description of the configuration parameter.
Edwin Kempinaec61322014-01-28 12:59:22 +01002960|`warning` |optional|
2961Warning message for the configuration parameter.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002962|`type` ||
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002963The type of the configuration parameter. Can be `STRING`, `INT`,
2964`LONG`, `BOOLEAN`, `LIST` or `ARRAY`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002965|`value` |optional|
Edwin Kempind32beef2013-11-28 20:36:33 +01002966The value of the configuration parameter as string. If the parameter
2967is inheritable this is the effective value which is deduced from
2968`configured_value` and `inherited_value`.
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002969|`values` |optional|
2970The list of values. Only set if the `type` is `ARRAY`.
Doug Claar1b0f76252016-03-23 13:34:55 -07002971|`editable` |`false` if not set|
Edwin Kempin0d485232013-11-17 18:55:48 +01002972Whether the value is editable.
Edwin Kempin20f256fb2013-11-28 19:56:15 +01002973|`permitted_values`|optional|
David Ostrovskyc6dd2172014-02-01 19:13:27 +01002974The list of permitted values. Only set if the `type` is `LIST`.
Edwin Kempind32beef2013-11-28 20:36:33 +01002975|`inheritable` |`false` if not set|
2976Whether the configuration parameter can be inherited.
2977|`configured_value`|optional|
2978The value of the configuration parameter that is configured on this
2979project, only set if `inheritable` is true.
2980|`inherited_value` |optional|
2981The inherited value of the configuration parameter, only set if
2982`inheritable` is true.
2983|`permitted_values` |optional|
2984The list of permitted values, only set if the `type` is `LIST`.
Edwin Kempin9ce4f552013-11-15 16:00:00 +01002985|===============================
2986
Edwin Kempin55367622013-02-05 09:09:23 +01002987[[dashboard-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002988=== DashboardInfo
Edwin Kempin55367622013-02-05 09:09:23 +01002989The `DashboardInfo` entity contains information about a project
2990dashboard.
2991
David Pursehouseae367192014-11-25 17:24:47 +09002992[options="header",cols="1,^2,4"]
Edwin Kempin55367622013-02-05 09:09:23 +01002993|===============================
2994|Field Name ||Description
Edwin Kempin55367622013-02-05 09:09:23 +01002995|`id` ||
2996The ID of the dashboard. The ID has the format '<ref>:<path>',
2997where ref and path are URL encoded.
2998|`project` ||
2999The name of the project for which this dashboard is returned.
3000|`defining_project`||
3001The name of the project in which this dashboard is defined.
3002This is different from `project` if the dashboard is inherited from a
3003parent project.
3004|`ref` ||
3005The name of the ref in which the dashboard is defined, without the
3006`refs/meta/dashboards/` prefix, which is common for all dashboard refs.
3007|`path` ||
3008The path of the file in which the dashboard is defined.
3009|`description` |optional|The description of the dashboard.
3010|`foreach` |optional|
3011Subquery that applies to all sections in the dashboard. +
3012Tokens such as `${project}` are not resolved.
3013|`url` ||
David Pursehousea1d633b2014-05-02 17:21:02 +09003014The URL under which the dashboard can be opened in the Gerrit Web UI. +
Edwin Kempin55367622013-02-05 09:09:23 +01003015The URL is relative to the canonical web URL. +
3016Tokens in the queries such as `${project}` are resolved.
David Pursehouse8edc1992017-09-15 17:12:09 +09003017|`is_default` |not set if `false`|
Edwin Kempin55367622013-02-05 09:09:23 +01003018Whether this is the default dashboard of the project.
3019|`title` |optional|The title of the dashboard.
3020|`sections` ||
3021The list of link:#dashboard-section-info[sections] in the dashboard.
3022|===============================
3023
Edwin Kempin67e923c2013-02-14 13:57:12 +01003024[[dashboard-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003025=== DashboardInput
Edwin Kempin67e923c2013-02-14 13:57:12 +01003026The `DashboardInput` entity contains information to create/update a
3027project dashboard.
3028
David Pursehouseae367192014-11-25 17:24:47 +09003029[options="header",cols="1,^2,4"]
Edwin Kempin67e923c2013-02-14 13:57:12 +01003030|=============================
3031|Field Name ||Description
3032|`id` |optional|
Edwin Kempinc95c5082013-03-12 16:56:25 +01003033URL encoded ID of a dashboard to which this dashboard should link to.
Edwin Kempin67e923c2013-02-14 13:57:12 +01003034|`commit_message`|optional|
3035Message that should be used to commit the change of the dashboard.
3036|=============================
3037
Edwin Kempin55367622013-02-05 09:09:23 +01003038[[dashboard-section-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003039=== DashboardSectionInfo
Edwin Kempin55367622013-02-05 09:09:23 +01003040The `DashboardSectionInfo` entity contains information about a section
3041in a dashboard.
3042
David Pursehouseae367192014-11-25 17:24:47 +09003043[options="header",cols="1,6"]
Edwin Kempin55367622013-02-05 09:09:23 +01003044|===========================
3045|Field Name |Description
3046|`name` |The title of the section.
3047|`query` |The query of the section. +
3048Tokens such as `${project}` are not resolved.
3049|===========================
3050
Hugo Arèsef8e3202015-01-12 15:09:06 -05003051[[delete-branches-input]]
3052=== DeleteBranchesInput
3053The `DeleteBranchesInput` entity contains information about branches that should
3054be deleted.
3055
3056[options="header",width="50%",cols="1,6"]
3057|==========================
3058|Field Name |Description
3059|`branches` |A list of branch names that identify the branches that should be
3060deleted.
3061|==========================
3062
David Pursehouse467aecb2016-12-02 14:18:42 +09003063[[delete-tags-input]]
3064=== DeleteTagsInput
3065The `DeleteTagsInput` entity contains information about tags that should
3066be deleted.
3067
3068[options="header",width="50%",cols="1,6"]
3069|==========================
3070|Field Name |Description
3071|`tags` |A list of tag names that identify the tags that should be
3072deleted.
3073|==========================
3074
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01003075[[gc-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003076=== GCInput
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01003077The `GCInput` entity contains information to run the Git garbage
3078collection.
3079
David Pursehouseae367192014-11-25 17:24:47 +09003080[options="header",cols="1,^2,4"]
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01003081|=============================
3082|Field Name ||Description
3083|`show_progress` |`false` if not set|
3084Whether progress information should be shown.
Christian Halstrick2f94e2e2015-03-11 15:13:31 +01003085|`aggressive` |`false` if not set|
3086Whether an aggressive garbage collection should be done.
Adrian Görler92410a12015-11-03 16:20:56 +01003087|`async` |`false` if not set|
3088Whether the garbage collection should run asynchronously.
Edwin Kempin4bdc72d2013-11-13 13:30:49 +01003089|=============================
3090
Edwin Kempin6b813372013-03-13 17:07:33 +01003091[[head-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003092=== HeadInput
Edwin Kempin6b813372013-03-13 17:07:33 +01003093The `HeadInput` entity contains information for setting `HEAD` for a
3094project.
3095
David Pursehouseae367192014-11-25 17:24:47 +09003096[options="header",cols="1,6"]
Edwin Kempin6b813372013-03-13 17:07:33 +01003097|============================
3098|Field Name |Description
3099|`ref` |
3100The ref to which `HEAD` should be set, the `refs/heads` prefix can be
3101omitted.
3102|============================
3103
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003104[[inherited-boolean-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003105=== InheritedBooleanInfo
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003106A boolean value that can also be inherited.
3107
David Pursehouseae367192014-11-25 17:24:47 +09003108[options="header",cols="1,^2,4"]
Edwin Kempin0cb5a562013-07-12 15:41:04 +02003109|================================
3110|Field Name ||Description
3111|`value` ||
3112The effective boolean value.
3113|`configured_value` ||
3114The configured value, can be `TRUE`, `FALSE` or `INHERITED`.
3115|`inherited_value` |optional|
3116The boolean value inherited from the parent. +
3117Not set if there is no parent.
3118|================================
3119
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02003120
3121[[label-type-info]]
3122=== LabelTypeInfo
3123The `LabelTypeInfo` entity contains metadata about the labels that a
3124project has.
3125
3126[options="header",cols="1,^2,4"]
3127|================================
3128|Field Name ||Description
3129|`values` ||Map of the available values to their description.
3130|`default_value` ||The default value of this label.
3131|================================
3132
Edwin Kempin3c99f592013-07-15 10:12:27 +02003133[[max-object-size-limit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003134=== MaxObjectSizeLimitInfo
Edwin Kempin3c99f592013-07-15 10:12:27 +02003135The `MaxObjectSizeLimitInfo` entity contains information about the
3136link:config-gerrit.html#receive.maxObjectSizeLimit[max object size
3137limit] of a project.
3138
David Pursehouseae367192014-11-25 17:24:47 +09003139[options="header",cols="1,^2,4"]
Edwin Kempin3c99f592013-07-15 10:12:27 +02003140|===============================
3141|Field Name ||Description
3142|`value` |optional|
3143The effective value of the max object size limit as a formatted string. +
3144Not set if there is no limit for the object size.
3145|`configured_value`|optional|
3146The max object size limit that is configured on the project as a
3147formatted string. +
3148Not set if there is no limit for the object size configured on project
3149level.
3150|`inherited_value` |optional|
3151The max object size limit that is inherited as a formatted string. +
3152Not set if there is no global limit for the object size.
3153|===============================
3154
Patrick Hiesel21816f12016-04-22 08:53:06 +02003155[[project-access-input]]
3156=== ProjectAccessInput
3157The `ProjectAccessInput` describes changes that should be applied to a project
3158access config.
3159
3160[options="header",cols="1,^2,4"]
3161|=============================
3162|Field Name | |Description
3163|`remove` |optional|
3164A list of deductions to be applied to the project access as
3165link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
3166|`add` |optional|
3167A list of additions to be applied to the project access as
3168link:rest-api-access.html#project-access-info[ProjectAccessInfo] entities.
3169|`message` |optional|
3170A commit message for this change.
3171|`parent` |optional|
3172A new parent for the project to inherit from. Changing the parent project
3173requires administrative privileges.
3174|=============================
3175
Edwin Kempin57f303c2013-02-13 15:52:22 +01003176[[project-description-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003177=== ProjectDescriptionInput
Edwin Kempin57f303c2013-02-13 15:52:22 +01003178The `ProjectDescriptionInput` entity contains information for setting a
3179project description.
3180
David Pursehouseae367192014-11-25 17:24:47 +09003181[options="header",cols="1,^2,4"]
Edwin Kempin57f303c2013-02-13 15:52:22 +01003182|=============================
3183|Field Name ||Description
3184|`description` |optional|The project description. +
3185The project description will be deleted if not set.
3186|`commit_message`|optional|
3187Message that should be used to commit the change of the project
3188description in the `project.config` file to the `refs/meta/config`
3189branch.
3190|=============================
3191
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003192[[project-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003193=== ProjectInfo
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003194The `ProjectInfo` entity contains information about a project.
3195
David Pursehouseae367192014-11-25 17:24:47 +09003196[options="header",cols="1,^2,4"]
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003197|===========================
3198|Field Name ||Description
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003199|`id` ||The URL encoded project name.
3200|`name` |
3201not set if returned in a map where the project name is used as map key|
3202The name of the project.
Edwin Kempinf3611822013-03-19 08:23:09 +01003203|`parent` |optional|
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003204The name of the parent project. +
3205`?-<n>` if the parent project is not visible (`<n>` is a number which
3206is increased for each non-visible project).
3207|`description` |optional|The description of the project.
Shawn Pearce21a6c212014-04-23 12:35:10 -07003208|`state` |optional|`ACTIVE`, `READ_ONLY` or `HIDDEN`.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003209|`branches` |optional|Map of branch names to HEAD revisions.
Han-Wen Nienhuys22f27742017-06-27 18:01:07 +02003210|`labels` |optional|
3211Map of label names to
3212link:#label-type-info[LabelTypeInfo] entries.
3213This field is filled for link:#create-project[Create Project] and
3214link:#get-project[Get Project] calls.
Edwin Kempin26c95a42014-11-25 16:29:47 +01003215|`web_links` |optional|
Edwin Kempinea004752014-04-11 15:56:02 +02003216Links to the project in external sites as a list of
3217link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
Edwin Kempin51a6dc92013-02-04 15:43:59 +01003218|===========================
3219
Bruce Zu798ea122013-02-18 16:55:43 +08003220[[project-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003221=== ProjectInput
Bruce Zu798ea122013-02-18 16:55:43 +08003222The `ProjectInput` entity contains information for the creation of
3223a new project.
3224
David Pursehouseae367192014-11-25 17:24:47 +09003225[options="header",cols="1,^2,4"]
Bruce Zu798ea122013-02-18 16:55:43 +08003226|=========================================
3227|Field Name ||Description
3228|`name` |optional|
3229The name of the project (not encoded). +
David Pursehouse8c5ad412015-02-03 14:19:09 +09003230If set, must match the project name in the URL. +
3231If name ends with `.git` the suffix will be automatically removed.
Bruce Zu798ea122013-02-18 16:55:43 +08003232|`parent` |optional|
3233The name of the parent project. +
3234If not set, the `All-Projects` project will be the parent project.
3235|`description` |optional|The description of the project.
3236|`permissions_only` |`false` if not set|
3237Whether a permission-only project should be created.
3238|`create_empty_commit` |`false` if not set|
3239Whether an empty initial commit should be created.
3240|`submit_type` |optional|
3241The submit type that should be set for the project
Gert van Dijka4e49d02017-08-27 22:50:40 +02003242(`MERGE_IF_NECESSARY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`,
3243`FAST_FORWARD_ONLY`, `MERGE_ALWAYS`, `CHERRY_PICK`). +
Edwin Kempina79ea552013-11-19 11:24:37 +01003244If not set, `MERGE_IF_NECESSARY` is set as submit type unless
3245link:config-gerrit.html#repository.name.defaultSubmitType[
3246repository.<name>.defaultSubmitType] is set to a different value.
Bruce Zu798ea122013-02-18 16:55:43 +08003247|`branches` |optional|
3248A list of branches that should be initially created. +
3249For the branch names the `refs/heads/` prefix can be omitted.
3250|`owners` |optional|
3251A list of groups that should be assigned as project owner. +
3252Each group in the list must be specified as
3253link:rest-api-groups.html#group-id[group-id]. +
3254If not set, the link:config-gerrit.html#repository.name.ownerGroup[
3255groups that are configured as default owners] are set as project
3256owners.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003257|`use_contributor_agreements` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08003258Whether contributor agreements should be used for the project (`TRUE`,
3259`FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02003260|`use_signed_off_by` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08003261Whether the usage of 'Signed-Off-By' footers is required for the
3262project (`TRUE`, `FALSE`, `INHERIT`).
Deniz Türkoglu52777272014-09-08 17:02:48 +02003263|`create_new_change_for_all_not_in_target` |`INHERIT` if not set|
3264Whether a new change is created for every commit not in target branch
3265for the project (`TRUE`, `FALSE`, `INHERIT`).
3266|`use_content_merge` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08003267Whether content merge should be enabled for the project (`TRUE`,
3268`FALSE`, `INHERIT`). +
3269`FALSE`, if the `submit_type` is `FAST_FORWARD_ONLY`.
Deniz Türkoglu52777272014-09-08 17:02:48 +02003270|`require_change_id` |`INHERIT` if not set|
Bruce Zu798ea122013-02-18 16:55:43 +08003271Whether the usage of Change-Ids is required for the project (`TRUE`,
3272`FALSE`, `INHERIT`).
Sasa Zivkov6b40cb42013-07-01 15:28:22 +02003273|`max_object_size_limit` |optional|
3274Max allowed Git object size for this project.
3275Common unit suffixes of 'k', 'm', or 'g' are supported.
Edwin Kempinfb053c32013-12-04 20:32:41 +01003276|`plugin_config_values` |optional|
3277Plugin configuration values as map which maps the plugin name to a map
3278of parameter names to values.
Patrick Hieseldc285c72018-01-08 17:20:15 +01003279|`reject_empty_commit` |optional|
3280Whether empty commits should be rejected when a change is merged
3281(`TRUE`, `FALSE`, `INHERIT`).
Bruce Zu798ea122013-02-18 16:55:43 +08003282|=========================================
3283
Edwin Kempinecad88c2013-02-14 12:09:44 +01003284[[project-parent-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003285=== ProjectParentInput
Edwin Kempinecad88c2013-02-14 12:09:44 +01003286The `ProjectParentInput` entity contains information for setting a
3287project parent.
3288
David Pursehouseae367192014-11-25 17:24:47 +09003289[options="header",cols="1,^2,4"]
Edwin Kempinecad88c2013-02-14 12:09:44 +01003290|=============================
3291|Field Name ||Description
3292|`parent` ||The name of the parent project.
3293|`commit_message`|optional|
3294Message that should be used to commit the change of the project parent
3295in the `project.config` file to the `refs/meta/config` branch.
3296|=============================
3297
Edwin Kempin87504d92014-07-04 12:59:19 +02003298[[reflog-entry-info]]
3299=== ReflogEntryInfo
3300The `ReflogEntryInfo` entity describes an entry in a reflog.
3301
David Pursehouseae367192014-11-25 17:24:47 +09003302[options="header",cols="1,6"]
Edwin Kempin87504d92014-07-04 12:59:19 +02003303|============================
3304|Field Name |Description
3305|`old_id` |The old commit ID.
3306|`new_id` |The new commit ID.
3307|`who` |
3308The user performing the change as a
3309link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
3310|`comment` |Comment of the reflog entry.
3311|============================
3312
Edwin Kempin19ea9b92013-03-20 13:20:26 +01003313[[repository-statistics-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003314=== RepositoryStatisticsInfo
Edwin Kempin19ea9b92013-03-20 13:20:26 +01003315The `RepositoryStatisticsInfo` entity contains information about
3316statistics of a Git repository.
3317
David Pursehouseae367192014-11-25 17:24:47 +09003318[options="header",cols="1,6"]
Edwin Kempin19ea9b92013-03-20 13:20:26 +01003319|======================================
3320|Field Name |Description
3321|`number_of_loose_objects` |Number of loose objects.
3322|`number_of_loose_refs` |Number of loose refs.
3323|`number_of_pack_files` |Number of pack files.
3324|`number_of_packed_objects`|Number of packed objects.
3325|`number_of_packed_refs` |Number of packed refs.
3326|`size_of_loose_objects` |Size of loose objects in bytes.
3327|`size_of_packed_objects` |Size of packed objects in bytes.
3328|======================================
3329
David Pursehouse8cc68902014-10-06 18:17:16 +09003330[[tag-info]]
3331=== TagInfo
3332The `TagInfo` entity contains information about a tag.
3333
David Pursehouseae367192014-11-25 17:24:47 +09003334[options="header",cols="1,^2,4"]
David Pursehouse8cc68902014-10-06 18:17:16 +09003335|=========================
3336|Field Name ||Description
3337|`ref` ||The ref of the tag.
3338|`revision` ||For lightweight tags, the revision of the commit to which the tag
3339points. For annotated tags, the revision of the tag object.
3340|`object`|Only set for annotated tags.|The revision of the object to which the
3341tag points.
3342|`message`|Only set for annotated tags.|The tag message. For signed tags, includes
3343the signature.
David Pursehousec9f5a5a2015-12-07 19:13:16 +09003344|`tagger`|Only set for annotated tags, if present in the tag.|The tagger as a
David Pursehouse8cc68902014-10-06 18:17:16 +09003345link:rest-api-changes.html#git-person-info[GitPersonInfo] entity.
David Pursehousec4e4d932017-11-10 10:17:46 +09003346|`created`|optional|The link:rest-api.html#timestamp[timestamp] of when the tag
3347was created. For annotated and signed tags, this is the timestamp of the tag object
3348and is the same as the `date` field in the `tagger`. For lightweight tags, it is
3349the commit timestamp of the commit to which the tag points, when the object is a
3350commit. It is not set when the object is any other type.
David Pursehoused00515e2017-11-10 15:57:41 +09003351|`can_delete`|not set if `false`|
David Pursehouse23669da2017-02-23 13:43:57 +09003352Whether the calling user can delete this tag.
Paladox none34da15c2017-07-01 14:49:10 +00003353|`web_links` |optional|
3354Links to the tag in external sites as a list of
3355link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse8cc68902014-10-06 18:17:16 +09003356|=========================
3357
David Pursehouse6a446192016-06-03 10:00:34 +09003358[[tag-input]]
3359=== TagInput
3360
3361The `TagInput` entity contains information for creating a tag.
3362
3363[options="header",cols="1,^2,4"]
3364|=========================
3365|Field Name ||Description
3366|`ref` ||The name of the tag. The leading `refs/tags/` is optional.
3367|`revision` |optional|The revision to which the tag should point. If not
3368specified, the project's `HEAD` will be used.
3369|`message` |optional|The tag message. When set, the tag will be created
3370as an annotated tag.
3371|=========================
3372
3373
Edwin Kempin272402e2013-07-15 11:17:36 +02003374[[theme-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003375=== ThemeInfo
Edwin Kempin272402e2013-07-15 11:17:36 +02003376The `ThemeInfo` entity describes a theme.
3377
David Pursehouseae367192014-11-25 17:24:47 +09003378[options="header",cols="1,^2,4"]
Edwin Kempin272402e2013-07-15 11:17:36 +02003379|=============================
3380|Field Name ||Description
3381|`css` |optional|
3382The path to the `GerritSite.css` file.
3383|`header` |optional|
3384The path to the `GerritSiteHeader.html` file.
3385|`footer` |optional|
3386The path to the `GerritSiteFooter.html` file.
3387|=============================
3388
Patrick Hiesel5a3475f2016-04-21 11:44:29 +02003389----
Edwin Kempind0a63922013-01-23 16:32:59 +01003390
3391GERRIT
3392------
3393Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07003394
3395SEARCHBOX
3396---------