blob: 2f73fc7debf50dc86099abc18aaceacd0a5d6d51 [file] [log] [blame]
Edwin Kempin2eebd142013-03-06 15:28:34 +01001Gerrit Code Review - /groups/ REST API
2======================================
Edwin Kempind0a63922013-01-23 16:32:59 +01003
4This page describes the group related REST endpoints.
5Please also take note of the general information on the
6link:rest-api.html[REST API].
7
Edwin Kempin578fff72013-02-11 08:08:27 +01008[[group-endpoints]]
9Group Endpoints
10---------------
Edwin Kempind0a63922013-01-23 16:32:59 +010011
Edwin Kempin76202742013-02-15 13:51:50 +010012[[list-groups]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010013List Groups
14~~~~~~~~~~~
15[verse]
16'GET /groups/'
17
Edwin Kempind0a63922013-01-23 16:32:59 +010018Lists the groups accessible by the caller. This is the same as
19using the link:cmd-ls-groups.html[ls-groups] command over SSH,
20and accepts the same options as query parameters.
21
Edwin Kempin987d5432013-02-04 10:20:44 +010022As result a map is returned that maps the group names to
23link:#group-info[GroupInfo] entries. The entries in the map are sorted
24by group name.
25
Edwin Kempin37440832013-02-06 11:36:00 +010026.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010027----
28 GET /groups/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010029----
Edwin Kempind0a63922013-01-23 16:32:59 +010030
Edwin Kempin37440832013-02-06 11:36:00 +010031.Response
32----
Edwin Kempind0a63922013-01-23 16:32:59 +010033 HTTP/1.1 200 OK
34 Content-Disposition: attachment
35 Content-Type: application/json;charset=UTF-8
36
37 )]}'
38 {
39 "Administrators": {
40 "kind": "gerritcodereview#group",
41 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
Edwin Kempine05c9642013-02-11 09:36:21 +010042 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
43 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010044 },
Edwin Kempind0a63922013-01-23 16:32:59 +010045 "description": "Gerrit Site Administrators",
46 "group_id": 1,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010047 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010048 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
49 },
50 "Anonymous Users": {
51 "kind": "gerritcodereview#group",
52 "id": "global%3AAnonymous-Users",
Edwin Kempine05c9642013-02-11 09:36:21 +010053 "url": "#/admin/groups/uuid-global%3AAnonymous-Users",
54 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010055 },
Edwin Kempind0a63922013-01-23 16:32:59 +010056 "description": "Any user, signed-in or not",
57 "group_id": 2,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010058 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010059 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
60 },
61 "MyProject_Committers": {
62 "kind": "gerritcodereview#group",
63 "id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7",
Edwin Kempine05c9642013-02-11 09:36:21 +010064 "url": "#/admin/groups/uuid-834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7",
65 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010066 "visible_to_all": true,
67 },
Edwin Kempind0a63922013-01-23 16:32:59 +010068 "group_id": 6,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010069 "owner": "MyProject_Committers",
Edwin Kempind0a63922013-01-23 16:32:59 +010070 "owner_id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7"
71 },
72 "Non-Interactive Users": {
73 "kind": "gerritcodereview#group",
74 "id": "5057f3cbd3519d6ab69364429a89ffdffba50f73",
Edwin Kempine05c9642013-02-11 09:36:21 +010075 "url": "#/admin/groups/uuid-5057f3cbd3519d6ab69364429a89ffdffba50f73",
76 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010077 },
Edwin Kempind0a63922013-01-23 16:32:59 +010078 "description": "Users who perform batch actions on Gerrit",
79 "group_id": 4,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010080 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010081 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
82 },
83 "Project Owners": {
84 "kind": "gerritcodereview#group",
85 "id": "global%3AProject-Owners",
Edwin Kempine05c9642013-02-11 09:36:21 +010086 "url": "#/admin/groups/uuid-global%3AProject-Owners",
87 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010088 },
Edwin Kempind0a63922013-01-23 16:32:59 +010089 "description": "Any owner of the project",
90 "group_id": 5,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010091 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010092 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
93 },
94 "Registered Users": {
95 "kind": "gerritcodereview#group",
96 "id": "global%3ARegistered-Users",
Edwin Kempine05c9642013-02-11 09:36:21 +010097 "url": "#/admin/groups/uuid-global%3ARegistered-Users",
98 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010099 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100100 "description": "Any signed-in user",
101 "group_id": 3,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100102 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +0100103 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
104 }
105 }
106----
107
Edwin Kempina64c4b92013-01-23 11:30:40 +0100108.Get all groups
109****
110get::/groups/
111****
112
Edwin Kempinabaab5462013-02-11 15:30:19 +0100113[[group-options]]
114Group Options
115^^^^^^^^^^^^^
116Additional fields can be obtained by adding `o` parameters, each option
117requires more lookups and slows down the query response time to the
118client so they are generally disabled by default. Optional fields are:
119
120[[includes]]
121--
122* `INCLUDES`: include list of directly included groups.
123--
124
125[[members]]
126--
127* `MEMBERS`: include list of direct group members.
128--
129
Edwin Kempina3b4b632013-02-11 10:33:55 +0100130Check if a group is owned by the calling user
131^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132By setting the option `owned` and specifying a group to inspect with
133the option `q`, it is possible to find out, if this group is owned by
134the calling user.
135
136.Request
137----
138 GET /groups/?owned&q=MyProject-Committers HTTP/1.0
139----
140
141If the group is owned by the calling user, the returned map contains
142this group. If the calling user doesn't own this group an empty map is
143returned.
144
145.Response
146----
147 HTTP/1.1 200 OK
148 Content-Disposition: attachment
149 Content-Type: application/json;charset=UTF-8
150
151 )]}'
152 {
153 "MyProject-Committers": {
154 "kind": "gerritcodereview#group",
155 "id": "9999c971bb4ab872aab759d8c49833ee6b9ff320",
Edwin Kempina3b4b632013-02-11 10:33:55 +0100156 "url": "#/admin/groups/uuid-9999c971bb4ab872aab759d8c49833ee6b9ff320",
157 "options": {
Edwin Kempina3b4b632013-02-11 10:33:55 +0100158 "visible_to_all": true
159 },
160 "description":"contains all committers for MyProject",
161 "group_id": 551,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100162 "owner": "MyProject-Owners",
Edwin Kempina3b4b632013-02-11 10:33:55 +0100163 "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc"
164 }
165 }
166----
167
Anthony Chindc783292014-04-10 11:14:41 -0400168[[group-limit]]
169==== Group Limit
170The `/groups/` URL also accepts a limit integer in the `n` parameter.
171This limits the results to show `n` groups.
172
173Query the first 25 groups in group list.
174----
175 GET /groups/?n=25 HTTP/1.0
176----
177
178The `/groups/` URL also accepts a start integer in the `S` parameter.
179The results will skip `S` groups from group list.
180
181Query 25 groups starting from index 50.
182----
183 GET /groups/?n=25&S=50 HTTP/1.0
184----
185
Edwin Kempina5cc1122013-02-11 09:26:20 +0100186[[get-group]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100187Get Group
188~~~~~~~~~
189[verse]
190'GET /groups/link:#group-id[\{group-id\}]'
191
Edwin Kempina5cc1122013-02-11 09:26:20 +0100192Retrieves a group.
193
194.Request
195----
196 GET /groups/6a1e70e1a88782771a91808c8af9bbb7a9871389 HTTP/1.0
197----
198
199As response a link:#group-info[GroupInfo] entity is returned that
200describes the group.
201
202.Response
203----
204 HTTP/1.1 200 OK
205 Content-Disposition: attachment
206 Content-Type: application/json;charset=UTF-8
207
208 )]}'
209 {
210 "kind": "gerritcodereview#group",
211 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
212 "name": "Administrators",
213 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
214 "options": {
Edwin Kempina5cc1122013-02-11 09:26:20 +0100215 },
216 "description": "Gerrit Site Administrators",
217 "group_id": 1,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100218 "owner": "Administrators",
Edwin Kempina5cc1122013-02-11 09:26:20 +0100219 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
220 }
221----
222
Edwin Kempin578fff72013-02-11 08:08:27 +0100223[[create-group]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100224Create Group
225~~~~~~~~~~~~
226[verse]
227'PUT /groups/link:#group-name[\{group-name\}]'
228
Edwin Kempin578fff72013-02-11 08:08:27 +0100229Creates a new Gerrit internal group.
230
231In the request body additional data for the group can be provided as
232link:#group-input[GroupInput].
233
234.Request
235----
236 PUT /groups/MyProject-Committers HTTP/1.0
237 Content-Type: application/json;charset=UTF-8
238
239 {
240 "description": "contains all committers for MyProject",
241 "visible_to_all": true,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100242 "owner": "MyProject-Owners",
Edwin Kempin578fff72013-02-11 08:08:27 +0100243 "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc"
244 }
245----
246
247As response the link:#group-info[GroupInfo] entity is returned that
248describes the created group.
249
250.Response
251----
252 HTTP/1.1 201 Created
253 Content-Disposition: attachment
254 Content-Type: application/json;charset=UTF-8
255
256 )]}'
257 {
258 "kind": "gerritcodereview#group",
259 "id": "9999c971bb4ab872aab759d8c49833ee6b9ff320",
260 "name": "MyProject-Committers",
261 "url": "#/admin/groups/uuid-9999c971bb4ab872aab759d8c49833ee6b9ff320",
262 "options": {
Edwin Kempin578fff72013-02-11 08:08:27 +0100263 "visible_to_all": true
264 },
265 "description":"contains all committers for MyProject",
266 "group_id": 551,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100267 "owner": "MyProject-Owners",
Edwin Kempin578fff72013-02-11 08:08:27 +0100268 "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc"
269 }
270----
271
Edwin Kempin0aa27102013-02-27 16:44:16 +0100272If the group creation fails because the name is already in use the
273response is "`409 Conflict`".
274
Edwin Kempinabaab5462013-02-11 15:30:19 +0100275[[get-group-detail]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100276Get Group Detail
277~~~~~~~~~~~~~~~~
278[verse]
279'GET /groups/link:#group-id[\{group-id\}]/detail'
280
Edwin Kempinabaab5462013-02-11 15:30:19 +0100281Retrieves a group with the direct link:#members[members] and the
282directly link:#includes[included groups].
283
284.Request
285----
286 GET /groups/6a1e70e1a88782771a91808c8af9bbb7a9871389/detail HTTP/1.0
287----
288
289As response a link:#group-info[GroupInfo] entity is returned that
290describes the group.
291
292.Response
293----
294 HTTP/1.1 200 OK
295 Content-Disposition: attachment
296 Content-Type: application/json;charset=UTF-8
297
298 )]}'
299 {
300 "kind": "gerritcodereview#group",
301 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
302 "name": "Administrators",
303 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
304 "options": {
305 },
306 "description": "Gerrit Site Administrators",
307 "group_id": 1,
308 "owner": "Administrators",
309 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
310 "members": [
311 {
Edwin Kempin51284e62013-03-05 15:26:41 +0100312 "_account_id": 1000097,
313 "name": "Jane Roe",
James Ring8e342722013-05-01 01:40:53 -0700314 "email": "jane.roe@example.com",
315 "username": "jane"
Edwin Kempinabaab5462013-02-11 15:30:19 +0100316 },
317 {
Edwin Kempin51284e62013-03-05 15:26:41 +0100318 "_account_id": 1000096,
319 "name": "John Doe",
320 "email": "john.doe@example.com"
James Ring8e342722013-05-01 01:40:53 -0700321 "username": "john"
Edwin Kempinabaab5462013-02-11 15:30:19 +0100322 }
323 ],
324 "includes": []
325 }
326----
327
Edwin Kempin1461c222013-02-11 08:41:08 +0100328[[get-group-name]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100329Get Group Name
330~~~~~~~~~~~~~~
331[verse]
332'GET /groups/link:#group-id[\{group-id\}]/name'
333
Edwin Kempin1461c222013-02-11 08:41:08 +0100334Retrieves the name of a group.
335
336.Request
337----
338 GET /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/name HTTP/1.0
339----
340
341.Response
342----
343 HTTP/1.1 200 OK
344 Content-Disposition: attachment
345 Content-Type: application/json;charset=UTF-8
346
347 )]}'
348 "MyProject-Committers"
349----
350
351[[rename-group]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100352Rename Group
353~~~~~~~~~~~~
354[verse]
355'PUT /groups/link:#group-id[\{group-id\}]/name'
356
Edwin Kempin1461c222013-02-11 08:41:08 +0100357Renames a Gerrit internal group.
358
359The new group name must be provided in the request body.
360
361.Request
362----
363 PUT /groups/MyProject-Committers/name HTTP/1.0
364 Content-Type: application/json;charset=UTF-8
365
366 {
367 "name": "My-Project-Committers"
368 }
369----
370
371As response the new group name is returned.
372
373.Response
374----
375 HTTP/1.1 200 OK
376 Content-Disposition: attachment
377 Content-Type: application/json;charset=UTF-8
378
379 )]}'
380 "My-Project-Committers"
381----
382
Edwin Kempin0aa27102013-02-27 16:44:16 +0100383If renaming the group fails because the new name is already in use the
384response is "`409 Conflict`".
385
Edwin Kempin1461c222013-02-11 08:41:08 +0100386[[get-group-description]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100387Get Group Description
388~~~~~~~~~~~~~~~~~~~~~
389[verse]
390'GET /groups/link:#group-id[\{group-id\}]/description'
391
Edwin Kempin1461c222013-02-11 08:41:08 +0100392Retrieves the description of a group.
393
394.Request
395----
396 GET /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/description HTTP/1.0
397----
398
399.Response
400----
401 HTTP/1.1 200 OK
402 Content-Disposition: attachment
403 Content-Type: application/json;charset=UTF-8
404
405 )]}'
406 "contains all committers for MyProject"
407----
408
Edwin Kempinefec4492013-02-22 10:09:23 +0100409If the group does not have a description an empty string is returned.
410
Edwin Kempin1461c222013-02-11 08:41:08 +0100411[[set-group-description]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100412Set Group Description
413~~~~~~~~~~~~~~~~~~~~~
414[verse]
415'PUT /groups/link:#group-id[\{group-id\}]/description'
416
Edwin Kempin1461c222013-02-11 08:41:08 +0100417Sets the description of a Gerrit internal group.
418
419The new group description must be provided in the request body.
420
421.Request
422----
423 PUT /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/description HTTP/1.0
424 Content-Type: application/json;charset=UTF-8
425
426 {
427 "description": "The committers of MyProject."
428 }
429----
430
431As response the new group description is returned.
432
433.Response
434----
435 HTTP/1.1 200 OK
436 Content-Disposition: attachment
437 Content-Type: application/json;charset=UTF-8
438
439 )]}'
440 "The committers of MyProject."
441----
442
Edwin Kempin114ab162013-02-28 09:25:37 +0100443If the description was deleted the response is "`204 No Content`".
444
Edwin Kempin1461c222013-02-11 08:41:08 +0100445[[delete-group-description]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100446Delete Group Description
447~~~~~~~~~~~~~~~~~~~~~~~~
448[verse]
449'DELETE /groups/link:#group-id[\{group-id\}]/description'
450
Edwin Kempin1461c222013-02-11 08:41:08 +0100451Deletes the description of a Gerrit internal group.
452
453.Request
454----
455 DELETE /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/description HTTP/1.0
456----
457
458.Response
459----
460 HTTP/1.1 204 No Content
461----
462
463[[get-group-options]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100464Get Group Options
465~~~~~~~~~~~~~~~~~
466[verse]
467'GET /groups/link:#group-id[\{group-id\}]/options'
468
Edwin Kempin1461c222013-02-11 08:41:08 +0100469Retrieves the options of a group.
470
471.Request
472----
473 GET /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/options HTTP/1.0
474----
475
476As response a link:#group-options-info[GroupOptionsInfo] entity is
477returned that describes the options of the group.
478
479.Response
480----
481 HTTP/1.1 200 OK
482 Content-Disposition: attachment
483 Content-Type: application/json;charset=UTF-8
484
485 )]}'
486 {
Edwin Kempin1461c222013-02-11 08:41:08 +0100487 "visible_to_all": true
488 }
489----
490
491[[set-group-options]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100492Set Group Options
493~~~~~~~~~~~~~~~~~
494[verse]
495'PUT /groups/link:#group-id[\{group-id\}]/options'
496
Edwin Kempin1461c222013-02-11 08:41:08 +0100497Sets the options of a Gerrit internal group.
498
499The new group options must be provided in the request body as a
500link:#group-options-input[GroupOptionsInput] entity.
501
502.Request
503----
504 PUT /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/options HTTP/1.0
505 Content-Type: application/json;charset=UTF-8
506
507 {
508 "visible_to_all": true
509 }
510----
511
512As response the new group options are returned as a
513link:#group-options-info[GroupOptionsInfo] entity.
514
515.Response
516----
517 HTTP/1.1 200 OK
518 Content-Disposition: attachment
519 Content-Type: application/json;charset=UTF-8
520
521 )]}'
522 {
Edwin Kempin1461c222013-02-11 08:41:08 +0100523 "visible_to_all": true
524 }
525----
526
527[[get-group-owner]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100528Get Group Owner
529~~~~~~~~~~~~~~~
530[verse]
531'GET /groups/link:#group-id[\{group-id\}]/owner'
532
Edwin Kempin1461c222013-02-11 08:41:08 +0100533Retrieves the owner group of a Gerrit internal group.
534
535.Request
536----
537 GET /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/owner HTTP/1.0
538----
539
540As response a link:#group-info[GroupInfo] entity is returned that
541describes the owner group.
542
543.Response
544----
545 HTTP/1.1 200 OK
546 Content-Disposition: attachment
547 Content-Type: application/json;charset=UTF-8
548
549 )]}'
550 {
551 "kind": "gerritcodereview#group",
552 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
553 "name": "Administrators",
554 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
555 "options": {
Edwin Kempin1461c222013-02-11 08:41:08 +0100556 },
557 "description": "Gerrit Site Administrators",
558 "group_id": 1,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100559 "owner": "Administrators",
Edwin Kempin1461c222013-02-11 08:41:08 +0100560 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
561 }
562----
563
564[[set-group-owner]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100565Set Group Owner
566~~~~~~~~~~~~~~~
567[verse]
568'PUT /groups/link:#group-id[\{group-id\}]/owner'
569
Edwin Kempin1461c222013-02-11 08:41:08 +0100570Sets the owner group of a Gerrit internal group.
571
572The new owner group must be provided in the request body.
573
Edwin Kempinc9770902013-02-15 15:38:03 +0100574The new owner can be specified by name, by group UUID or by the legacy
575numeric group ID.
576
Edwin Kempin1461c222013-02-11 08:41:08 +0100577.Request
578----
579 PUT /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/description HTTP/1.0
580 Content-Type: application/json;charset=UTF-8
581
582 {
583 "owner": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
584 }
585----
586
587As response a link:#group-info[GroupInfo] entity is returned that
588describes the new owner group.
589
590.Response
591----
592 HTTP/1.1 200 OK
593 Content-Disposition: attachment
594 Content-Type: application/json;charset=UTF-8
595
596 )]}'
597 {
598 "kind": "gerritcodereview#group",
599 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
600 "name": "Administrators",
601 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
602 "options": {
Edwin Kempin1461c222013-02-11 08:41:08 +0100603 },
604 "description": "Gerrit Site Administrators",
605 "group_id": 1,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100606 "owner": "Administrators",
Edwin Kempin1461c222013-02-11 08:41:08 +0100607 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
608 }
609----
610
Edwin Kempin578fff72013-02-11 08:08:27 +0100611[[group-member-endpoints]]
612Group Member Endpoints
613----------------------
614
Edwin Kempind0a63922013-01-23 16:32:59 +0100615[[group-members]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100616List Group Members
617~~~~~~~~~~~~~~~~~~
618[verse]
619'GET /groups/link:#group-id[\{group-id\}]/members/'
620
Edwin Kempin2dc5edc2013-02-11 15:57:36 +0100621Lists the direct members of a Gerrit internal group.
Edwin Kempind0a63922013-01-23 16:32:59 +0100622
Edwin Kempin963dfd02013-02-27 12:39:32 +0100623As result a list of detailed link:rest-api-accounts.html#account-info[
624AccountInfo] entries is returned. The entries in the list are sorted by
625full name, preferred email and id.
Edwin Kempin4156d6e02013-02-04 15:10:39 +0100626
Edwin Kempin37440832013-02-06 11:36:00 +0100627.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100628----
629 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/members/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100630----
Edwin Kempind0a63922013-01-23 16:32:59 +0100631
Edwin Kempin37440832013-02-06 11:36:00 +0100632.Response
633----
Edwin Kempind0a63922013-01-23 16:32:59 +0100634 HTTP/1.1 200 OK
635 Content-Disposition: attachment
636 Content-Type: application/json;charset=UTF-8
637
638 )]}'
639 [
640 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100641 "_account_id": 1000097,
642 "name": "Jane Roe",
James Ring8e342722013-05-01 01:40:53 -0700643 "email": "jane.roe@example.com",
644 "username": "jane"
Edwin Kempind0a63922013-01-23 16:32:59 +0100645 },
646 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100647 "_account_id": 1000096,
648 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700649 "email": "john.doe@example.com",
650 "username": "john"
Edwin Kempind0a63922013-01-23 16:32:59 +0100651 }
652 ]
653----
654
Edwin Kempina64c4b92013-01-23 11:30:40 +0100655.Get all members of the 'Administrators' group (normally group id = 1)
656****
657get::/groups/1/members/
658****
659
Edwin Kempind0a63922013-01-23 16:32:59 +0100660To resolve the included groups of a group recursively and to list all
661members the parameter `recursive` can be set.
662
Edwin Kempind54de1c2013-03-08 16:37:14 +0100663Members from included external groups and from included groups which
664are not visible to the calling user are ignored.
665
Edwin Kempin37440832013-02-06 11:36:00 +0100666.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100667----
668 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/members/?recursive HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100669----
Edwin Kempind0a63922013-01-23 16:32:59 +0100670
Edwin Kempin37440832013-02-06 11:36:00 +0100671.Response
672----
Edwin Kempind0a63922013-01-23 16:32:59 +0100673 HTTP/1.1 200 OK
674 Content-Disposition: attachment
675 Content-Type: application/json;charset=UTF-8
676
677 )]}'
678 [
679 {
Edwin Kempin3e22d482013-03-05 15:35:25 +0100680 "_account_id": 1000097,
681 "name": "Jane Roe",
James Ring8e342722013-05-01 01:40:53 -0700682 "email": "jane.roe@example.com",
683 "username": "jane"
Edwin Kempind0a63922013-01-23 16:32:59 +0100684 },
685 {
Edwin Kempin3e22d482013-03-05 15:35:25 +0100686 "_account_id": 1000096,
687 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700688 "email": "john.doe@example.com",
689 "username": "john"
Edwin Kempind0a63922013-01-23 16:32:59 +0100690 },
691 {
Edwin Kempin3e22d482013-03-05 15:35:25 +0100692 "_account_id": 1000098,
693 "name": "Richard Roe",
James Ring8e342722013-05-01 01:40:53 -0700694 "email": "richard.roe@example.com",
695 "username": "rroe"
Edwin Kempind0a63922013-01-23 16:32:59 +0100696 }
697 ]
698----
699
Edwin Kempina5cc1122013-02-11 09:26:20 +0100700[[get-group-member]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100701Get Group Member
702~~~~~~~~~~~~~~~~
703[verse]
704'GET /groups/link:#group-id[\{group-id\}]/members/link:rest-api-accounts.html#account-id[\{account-id\}]'
705
Edwin Kempina5cc1122013-02-11 09:26:20 +0100706Retrieves a group member.
707
708.Request
709----
710 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/members/1000096 HTTP/1.0
711----
712
Edwin Kempin963dfd02013-02-27 12:39:32 +0100713As response a detailed link:rest-api-accounts.html#account-info[
714AccountInfo] entity is returned that describes the group member.
Edwin Kempina5cc1122013-02-11 09:26:20 +0100715
716.Response
717----
718 HTTP/1.1 200 OK
719 Content-Disposition: attachment
720 Content-Type: application/json;charset=UTF-8
721
722 )]}'
723 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100724 "_account_id": 1000096,
725 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700726 "email": "john.doe@example.com",
727 "username": "john"
Edwin Kempina5cc1122013-02-11 09:26:20 +0100728 }
729----
730
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100731[[add-group-member]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100732Add Group Member
733~~~~~~~~~~~~~~~~
734[verse]
735'PUT /groups/link:#group-id[\{group-id\}]/members/link:rest-api-accounts.html#account-id[\{account-id\}]'
736
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100737Adds a user as member to a Gerrit internal group.
738
739.Request
740----
741 PUT /groups/MyProject-Committers/members/John%20Doe HTTP/1.0
742----
743
Edwin Kempin963dfd02013-02-27 12:39:32 +0100744As response a detailed link:rest-api-accounts.html#account-info[
745AccountInfo] entity is returned that describes the group member.
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100746
747.Response
748----
749 HTTP/1.1 201 Created
750 Content-Disposition: attachment
751 Content-Type: application/json;charset=UTF-8
752
753 )]}'
754 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100755 "_account_id": 1000037,
756 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700757 "email": "john.doe@example.com",
758 "username": "john"
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100759 }
760----
761
762The request also succeeds if the user is already a member of this
763group, but then the HTTP response code is `200 OK`.
764
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100765Add Group Members
766~~~~~~~~~~~~~~~~~
767[verse]
768'POST /groups/link:#group-id[\{group-id\}]/members'
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100769
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100770OR
771
772[verse]
773'POST /groups/link:#group-id[\{group-id\}]/members.add'
774
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100775Adds one or several users to a Gerrit internal group.
776
777The users to be added to the group must be provided in the request body
Sasa Zivkov737e0a32013-03-18 14:21:42 +0100778as a link:#members-input[MembersInput] entity.
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100779
780.Request
781----
782 POST /groups/MyProject-Committers/members.add HTTP/1.0
783 Content-Type: application/json;charset=UTF-8
784
785 {
Chris St. Pierreb39fb9e2013-08-06 15:55:00 -0400786 "members": [
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100787 "jane.roe@example.com",
788 "john.doe@example.com"
Chris St. Pierreb39fb9e2013-08-06 15:55:00 -0400789 ]
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100790 }
791----
792
Edwin Kempin963dfd02013-02-27 12:39:32 +0100793As response a list of detailed link:rest-api-accounts.html#account-info[
794AccountInfo] entities is returned that describes the group members that
Sasa Zivkov737e0a32013-03-18 14:21:42 +0100795were specified in the link:#members-input[MembersInput]. An
Edwin Kempin963dfd02013-02-27 12:39:32 +0100796link:rest-api-accounts.html#account-info[AccountInfo] entity
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100797is returned for each user specified in the input, independently of
798whether the user was newly added to the group or whether the user was
799already a member of the group.
800
801.Response
802----
803 HTTP/1.1 200 OK
804 Content-Disposition: attachment
805 Content-Type: application/json;charset=UTF-8
806
807 )]}'
808 [
809 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100810 "_account_id": 1000057,
811 "name": "Jane Roe",
James Ring8e342722013-05-01 01:40:53 -0700812 "email": "jane.roe@example.com",
813 "username": "jane"
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100814 },
815 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100816 "_account_id": 1000037,
817 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700818 "email": "john.doe@example.com",
819 "username": "john"
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100820 }
821 ]
822----
823
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100824[[delete-group-member]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100825Delete Group Member
826~~~~~~~~~~~~~~~~~~~
827[verse]
828'DELETE /groups/link:#group-id[\{group-id\}]/members/link:rest-api-accounts.html#account-id[\{account-id\}]'
829
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100830Deletes a user from a Gerrit internal group.
831
832.Request
833----
834 DELETE /groups/MyProject-Committers/members/John%20Doe HTTP/1.0
835----
836
837.Response
838----
839 HTTP/1.1 204 No Content
840----
841
842[[delete-group-members]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100843Delete Group Members
844~~~~~~~~~~~~~~~~~~~~
845[verse]
846'POST /groups/link:#group-id[\{group-id\}]/members.delete'
847
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100848Delete one or several users from a Gerrit internal group.
849
850The users to be deleted from the group must be provided in the request
Sasa Zivkov737e0a32013-03-18 14:21:42 +0100851body as a link:#members-input[MembersInput] entity.
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100852
853.Request
854----
855 POST /groups/MyProject-Committers/members.delete HTTP/1.0
856 Content-Type: application/json;charset=UTF-8
857
858 {
Chris St. Pierreb39fb9e2013-08-06 15:55:00 -0400859 "members": [
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100860 "jane.roe@example.com",
861 "john.doe@example.com"
Chris St. Pierreb39fb9e2013-08-06 15:55:00 -0400862 ]
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100863 }
864----
865
866.Response
867----
868 HTTP/1.1 204 No Content
869----
870
Edwin Kempin578fff72013-02-11 08:08:27 +0100871[[group-include-endpoints]]
872Group Include Endpoints
873-----------------------
874
875[[included-groups]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100876List Included Groups
877~~~~~~~~~~~~~~~~~~~~
878[verse]
879'GET /groups/link:#group-id[\{group-id\}]/groups/'
880
Edwin Kempin578fff72013-02-11 08:08:27 +0100881Lists the directly included groups of a group.
882
883As result a list of link:#group-info[GroupInfo] entries is returned.
884The entries in the list are sorted by group name and UUID.
885
886.Request
887----
888 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/groups/ HTTP/1.0
889----
890
891.Response
892----
893 HTTP/1.1 200 OK
894 Content-Disposition: attachment
895 Content-Type: application/json;charset=UTF-8
896
897 )]}'
898 [
899 {
900 "kind": "gerritcodereview#group",
901 "id": "7ca042f4d5847936fcb90ca91057673157fd06fc",
902 "name": "MyProject-Verifiers",
Edwin Kempine05c9642013-02-11 09:36:21 +0100903 "url": "#/admin/groups/uuid-7ca042f4d5847936fcb90ca91057673157fd06fc",
904 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +0100905 },
Edwin Kempin578fff72013-02-11 08:08:27 +0100906 "group_id": 38,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100907 "owner": "MyProject-Verifiers",
Edwin Kempin578fff72013-02-11 08:08:27 +0100908 "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc"
909 }
910 ]
911----
912
Edwin Kempina5cc1122013-02-11 09:26:20 +0100913[[get-included-group]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100914Get Included Group
915~~~~~~~~~~~~~~~~~~
916[verse]
917'GET /groups/link:#group-id[\{group-id\}]/groups/link:#group-id[\{group-id\}]'
918
Edwin Kempina5cc1122013-02-11 09:26:20 +0100919Retrieves an included group.
920
921.Request
922----
923 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/groups/7ca042f4d5847936fcb90ca91057673157fd06fc HTTP/1.0
924----
925
926As response a link:#group-info[GroupInfo] entity is returned that
927describes the included group.
928
929.Response
930----
931 HTTP/1.1 200 OK
932 Content-Disposition: attachment
933 Content-Type: application/json;charset=UTF-8
934
935 )]}'
936 {
937 "kind": "gerritcodereview#group",
938 "id": "7ca042f4d5847936fcb90ca91057673157fd06fc",
939 "name": "MyProject-Verifiers",
940 "url": "#/admin/groups/uuid-7ca042f4d5847936fcb90ca91057673157fd06fc",
941 "options": {
Edwin Kempina5cc1122013-02-11 09:26:20 +0100942 },
943 "group_id": 38,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100944 "owner": "Administrators",
Edwin Kempina5cc1122013-02-11 09:26:20 +0100945 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
946 }
947----
948
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100949[[include-group]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100950Include Group
951~~~~~~~~~~~~~
952[verse]
953'PUT /groups/link:#group-id[\{group-id\}]/groups/link:#group-id[\{group-id\}]'
954
Dariusz Lukszaccfa6492013-06-07 11:07:38 +0200955Includes an internal or external group into a Gerrit internal group.
956External groups must be specified using the UUID.
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100957
958.Request
959----
960 PUT /groups/MyProject-Committers/groups/MyGroup HTTP/1.0
961----
962
963As response a link:#group-info[GroupInfo] entity is returned that
964describes the included group.
965
966.Response
967----
968 HTTP/1.1 201 Created
969 Content-Disposition: attachment
970 Content-Type: application/json;charset=UTF-8
971
972 )]}'
973 {
974 "kind": "gerritcodereview#group",
975 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
976 "name": "MyGroup",
977 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
978 "options": {
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100979 },
980 "group_id": 8,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100981 "owner": "Administrators",
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100982 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
983 }
984----
985
986The request also succeeds if the group is already included in this
987group, but then the HTTP response code is `200 OK`.
988
John Spurlockd25fad12013-03-09 11:48:49 -0500989[[include-groups]]
Edwin Kempin7722cc62013-03-08 09:03:15 +0100990Include Groups
991~~~~~~~~~~~~~~
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100992[verse]
993'POST /groups/link:#group-id[\{group-id\}]/groups'
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100994
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100995OR
996
997[verse]
998'POST /groups/link:#group-id[\{group-id\}]/groups.add'
999
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001000Includes one or several groups into a Gerrit internal group.
1001
1002The groups to be included into the group must be provided in the
1003request body as a link:#groups-input[GroupsInput] entity.
1004
1005.Request
1006----
1007 POST /groups/MyProject-Committers/groups.add HTTP/1.0
1008 Content-Type: application/json;charset=UTF-8
1009
1010 {
1011 "groups": {
1012 "MyGroup",
1013 "MyOtherGroup"
1014 }
1015 }
1016----
1017
1018As response a list of link:#group-info[GroupInfo] entities is
1019returned that describes the groups that were specified in the
1020link:#groups-input[GroupsInput]. A link:#group-info[GroupInfo] entity
1021is returned for each group specified in the input, independently of
1022whether the group was newly included into the group or whether the
1023group was already included in the group.
1024
1025.Response
1026----
1027 HTTP/1.1 200 OK
1028 Content-Disposition: attachment
1029 Content-Type: application/json;charset=UTF-8
1030
1031 )]}'
1032 [
1033 {
1034 "kind": "gerritcodereview#group",
1035 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
1036 "name": "MyGroup",
1037 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
1038 "options": {
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001039 },
1040 "group_id": 8,
Edwin Kempinc6993fb2013-02-11 12:39:13 +01001041 "owner": "Administrators",
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001042 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
1043 },
1044 {
1045 "kind": "gerritcodereview#group",
1046 "id": "5057f3cbd3519d6ab69364429a89ffdffba50f73",
1047 "name": "MyOtherGroup",
1048 "url": "#/admin/groups/uuid-5057f3cbd3519d6ab69364429a89ffdffba50f73",
1049 "options": {
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001050 },
1051 "group_id": 10,
Edwin Kempinc6993fb2013-02-11 12:39:13 +01001052 "owner": "MyOtherGroup",
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001053 "owner_id": "5057f3cbd3519d6ab69364429a89ffdffba50f73"
1054 }
1055 ]
1056----
1057
1058[[delete-included-group]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001059Delete Included Group
1060~~~~~~~~~~~~~~~~~~~~~
1061[verse]
1062'DELETE /groups/link:#group-id[\{group-id\}]/groups/link:#group-id[\{group-id\}]'
1063
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001064Deletes an included group from a Gerrit internal group.
1065
1066.Request
1067----
1068 DELETE /groups/MyProject-Committers/groups/MyGroup HTTP/1.0
1069----
1070
1071.Response
1072----
1073 HTTP/1.1 204 No Content
1074----
1075
1076[[delete-included-groups]]
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001077Delete Included Groups
1078~~~~~~~~~~~~~~~~~~~~~~
1079[verse]
1080'POST /groups/link:#group-id[\{group-id\}]/groups.delete'
1081
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001082Delete one or several included groups from a Gerrit internal group.
1083
1084The groups to be deleted from the group must be provided in the request
1085body as a link:#groups-input[GroupsInput] entity.
1086
1087.Request
1088----
1089 POST /groups/MyProject-Committers/groups.delete HTTP/1.0
1090 Content-Type: application/json;charset=UTF-8
1091
1092 {
1093 "members": {
1094 "MyGroup",
1095 "MyOtherGroup"
1096 }
1097 }
1098----
1099
1100.Response
1101----
1102 HTTP/1.1 204 No Content
1103----
1104
Edwin Kempinaa266ff2013-02-05 12:41:09 +01001105
Edwin Kempin34d83352013-02-06 10:40:17 +01001106[[ids]]
1107IDs
1108---
1109
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001110[[account-id]]
Edwin Kempin4efe2572013-02-27 10:16:17 +01001111link:rest-api-accounts.html#account-id[\{account-id\}]
1112~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1113--
1114--
Edwin Kempina5d6ead2013-02-06 10:59:06 +01001115
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001116[[group-id]]
Edwin Kempin34d83352013-02-06 10:40:17 +01001117\{group-id\}
1118~~~~~~~~~~~~
1119Identifier for a group.
1120
1121This can be:
1122
1123* the UUID of the group
1124* the legacy numeric ID of the group
1125* the name of the group if it is unique
1126
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001127[[group-name]]
Edwin Kempin34d83352013-02-06 10:40:17 +01001128\{group-name\}
1129~~~~~~~~~~~~~~
1130Group name that uniquely identifies one group.
1131
1132
Edwin Kempin987d5432013-02-04 10:20:44 +01001133[[json-entities]]
1134JSON Entities
1135-------------
1136
1137[[group-info]]
1138GroupInfo
1139~~~~~~~~~
1140The `GroupInfo` entity contains information about a group. This can be
1141a Gerrit internal group, or an external group that is known to Gerrit.
1142
1143[options="header",width="50%",cols="1,^1,5"]
1144|===========================
1145|Field Name ||Description
1146|`kind` ||`gerritcodereview#group`
1147|`id` ||The URL encoded UUID of the group.
Edwin Kempin5b591d12013-03-08 09:18:35 +01001148|`name` |
1149not set if returned in a map where the group name is used as map key|
1150The name of the group.
Edwin Kempin987d5432013-02-04 10:20:44 +01001151|`url` |optional|
1152URL to information about the group. Typically a URL to a web page that
1153permits users to apply to join the group, or manage their membership.
1154|`options` ||link:#group-options-info[Options of the group]
1155|`description` |only for internal groups|The description of the group.
1156|`group_id` |only for internal groups|The numeric ID of the group.
Edwin Kempinc6993fb2013-02-11 12:39:13 +01001157|`owner` |only for internal groups|The name of the owner group.
Edwin Kempin987d5432013-02-04 10:20:44 +01001158|`owner_id` |only for internal groups|The URL encoded UUID of the owner group.
Edwin Kempinabaab5462013-02-11 15:30:19 +01001159|`members` |optional, only for internal groups|
1160A list of link:rest-api-accounts.html#account-info[AccountInfo]
1161entities describing the direct members. +
1162Only set if link:#members[members] are requested.
1163|`includes` |optional, only for internal groups|
1164A list of link:#group-info[GroupInfo] entities describing the directly
1165included groups. +
1166Only set if link:#includes[included groups] are requested.
Edwin Kempin987d5432013-02-04 10:20:44 +01001167|===========================
1168
Edwin Kempinc42abb92013-02-04 14:52:41 +01001169The type of a group can be deduced from the group's UUID:
1170[width="50%"]
1171|============
1172|UUID matches "^[0-9a-f]\{40\}$"|Gerrit internal group
1173|UUID starts with "global:"|Gerrit system group
1174|UUID starts with "ldap:"|LDAP group
1175|UUID starts with "<prefix>:"|other external group
1176|============
1177
Edwin Kempinaa266ff2013-02-05 12:41:09 +01001178[[group-input]]
1179GroupInput
1180~~~~~~~~~~
1181The 'GroupInput' entity contains information for the creation of
1182a new internal group.
1183
1184[options="header",width="50%",cols="1,^1,5"]
1185|===========================
1186|Field Name ||Description
1187|`name` |optional|The name of the group (not encoded). +
1188If set, must match the group name in the URL.
1189|`description` |optional|The description of the group.
1190|`visible_to_all`|optional|
1191Whether the group is visible to all registered users. +
1192`false` if not set.
1193|`owner_id`|optional|The URL encoded ID of the owner group. +
1194This can be a group UUID, a legacy numeric group ID or a unique group
1195name. +
1196If not set, the new group will be self-owned.
1197|===========================
1198
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001199[[groups-input]]
1200GroupsInput
1201~~~~~~~~~~~
1202The `GroupsInput` entity contains information about groups that should
1203be included into a group or that should be deleted from a group.
1204
1205[options="header",width="50%",cols="1,^1,5"]
1206|==========================
1207|Field Name ||Description
1208|`_one_group` |optional|
1209The link:#group-id[id] of one group that should be included or deleted.
1210|`groups` |optional|
1211A list of link:#group-id[group ids] that identify the groups that
1212should be included or deleted.
1213|==========================
1214
Edwin Kempin987d5432013-02-04 10:20:44 +01001215[[group-options-info]]
1216GroupOptionsInfo
1217~~~~~~~~~~~~~~~~
1218Options of the group.
1219
1220[options="header",width="50%",cols="1,^1,5"]
Edwin Kempinf04fc9c2013-02-05 14:09:45 +01001221|=============================
1222|Field Name ||Description
Edwin Kempinf04fc9c2013-02-05 14:09:45 +01001223|`visible_to_all`|not set if `false`|
Edwin Kempin987d5432013-02-04 10:20:44 +01001224Whether the group is visible to all registered users.
Edwin Kempinf04fc9c2013-02-05 14:09:45 +01001225|=============================
Edwin Kempin987d5432013-02-04 10:20:44 +01001226
Edwin Kempin1461c222013-02-11 08:41:08 +01001227[[group-options-input]]
1228GroupOptionsInput
1229~~~~~~~~~~~~~~~~~
1230New options for a group.
1231
1232[options="header",width="50%",cols="1,^1,5"]
1233|=============================
1234|Field Name ||Description
1235|`visible_to_all`|not set if `false`|
1236Whether the group is visible to all registered users.
1237|=============================
1238
Sasa Zivkov737e0a32013-03-18 14:21:42 +01001239[[members-input]]
1240MembersInput
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001241~~~~~~~~~~~
Sasa Zivkov737e0a32013-03-18 14:21:42 +01001242The `MembersInput` entity contains information about accounts that should
Edwin Kempinacbdfd32013-02-07 12:38:53 +01001243be added as members to a group or that should be deleted from the group.
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001244
1245[options="header",width="50%",cols="1,^1,5"]
1246|==========================
1247|Field Name ||Description
1248|`_one_member`|optional|
Edwin Kempinacbdfd32013-02-07 12:38:53 +01001249The link:#account-id[id] of one account that should be added or
1250deleted.
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001251|`members` |optional|
1252A list of link:#account-id[account ids] that identify the accounts that
Edwin Kempinacbdfd32013-02-07 12:38:53 +01001253should be added or deleted.
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001254|==========================
1255
1256
Edwin Kempind0a63922013-01-23 16:32:59 +01001257GERRIT
1258------
1259Part of link:index.html[Gerrit Code Review]