blob: fbd3ba5d01315d95481298120ed29e2803aa8ce9 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - /groups/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01002
3This page describes the group related REST endpoints.
4Please also take note of the general information on the
5link:rest-api.html[REST API].
6
Edwin Kempin578fff72013-02-11 08:08:27 +01007[[group-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008== Group Endpoints
Edwin Kempind0a63922013-01-23 16:32:59 +01009
Edwin Kempin76202742013-02-15 13:51:50 +010010[[list-groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080011=== List Groups
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080012--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010013'GET /groups/'
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 groups accessible by the caller. This is the same as
17using the link:cmd-ls-groups.html[ls-groups] command over SSH,
18and accepts the same options as query parameters.
19
Edwin Kempin987d5432013-02-04 10:20:44 +010020As result a map is returned that maps the group names to
21link:#group-info[GroupInfo] entries. The entries in the map are sorted
22by group name.
23
Edwin Kempin37440832013-02-06 11:36:00 +010024.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010025----
26 GET /groups/ 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 "Administrators": {
Edwin Kempind0a63922013-01-23 16:32:59 +010038 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
Edwin Kempine05c9642013-02-11 09:36:21 +010039 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
40 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010041 },
Edwin Kempind0a63922013-01-23 16:32:59 +010042 "description": "Gerrit Site Administrators",
43 "group_id": 1,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010044 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010045 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
46 },
47 "Anonymous Users": {
Edwin Kempind0a63922013-01-23 16:32:59 +010048 "id": "global%3AAnonymous-Users",
Edwin Kempine05c9642013-02-11 09:36:21 +010049 "url": "#/admin/groups/uuid-global%3AAnonymous-Users",
50 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010051 },
Edwin Kempind0a63922013-01-23 16:32:59 +010052 "description": "Any user, signed-in or not",
53 "group_id": 2,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010054 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010055 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
56 },
57 "MyProject_Committers": {
Edwin Kempind0a63922013-01-23 16:32:59 +010058 "id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7",
Edwin Kempine05c9642013-02-11 09:36:21 +010059 "url": "#/admin/groups/uuid-834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7",
60 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010061 "visible_to_all": true,
62 },
Edwin Kempind0a63922013-01-23 16:32:59 +010063 "group_id": 6,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010064 "owner": "MyProject_Committers",
Edwin Kempind0a63922013-01-23 16:32:59 +010065 "owner_id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7"
66 },
67 "Non-Interactive Users": {
Edwin Kempind0a63922013-01-23 16:32:59 +010068 "id": "5057f3cbd3519d6ab69364429a89ffdffba50f73",
Edwin Kempine05c9642013-02-11 09:36:21 +010069 "url": "#/admin/groups/uuid-5057f3cbd3519d6ab69364429a89ffdffba50f73",
70 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010071 },
Edwin Kempind0a63922013-01-23 16:32:59 +010072 "description": "Users who perform batch actions on Gerrit",
73 "group_id": 4,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010074 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010075 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
76 },
77 "Project Owners": {
Edwin Kempind0a63922013-01-23 16:32:59 +010078 "id": "global%3AProject-Owners",
Edwin Kempine05c9642013-02-11 09:36:21 +010079 "url": "#/admin/groups/uuid-global%3AProject-Owners",
80 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010081 },
Edwin Kempind0a63922013-01-23 16:32:59 +010082 "description": "Any owner of the project",
83 "group_id": 5,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010084 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010085 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
86 },
87 "Registered Users": {
Edwin Kempind0a63922013-01-23 16:32:59 +010088 "id": "global%3ARegistered-Users",
Edwin Kempine05c9642013-02-11 09:36:21 +010089 "url": "#/admin/groups/uuid-global%3ARegistered-Users",
90 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +010091 },
Edwin Kempind0a63922013-01-23 16:32:59 +010092 "description": "Any signed-in user",
93 "group_id": 3,
Edwin Kempinc6993fb2013-02-11 12:39:13 +010094 "owner": "Administrators",
Edwin Kempind0a63922013-01-23 16:32:59 +010095 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
96 }
97 }
98----
99
Edwin Kempina64c4b92013-01-23 11:30:40 +0100100.Get all groups
101****
102get::/groups/
103****
104
Edwin Kempinabaab5462013-02-11 15:30:19 +0100105[[group-options]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800106==== Group Options
Edwin Kempinabaab5462013-02-11 15:30:19 +0100107Additional fields can be obtained by adding `o` parameters, each option
108requires more lookups and slows down the query response time to the
109client so they are generally disabled by default. Optional fields are:
110
111[[includes]]
112--
113* `INCLUDES`: include list of directly included groups.
114--
115
116[[members]]
117--
118* `MEMBERS`: include list of direct group members.
119--
120
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800121==== Check if a group is owned by the calling user
Edwin Kempina3b4b632013-02-11 10:33:55 +0100122By setting the option `owned` and specifying a group to inspect with
123the option `q`, it is possible to find out, if this group is owned by
124the calling user.
125
126.Request
127----
128 GET /groups/?owned&q=MyProject-Committers HTTP/1.0
129----
130
131If the group is owned by the calling user, the returned map contains
132this group. If the calling user doesn't own this group an empty map is
133returned.
134
135.Response
136----
137 HTTP/1.1 200 OK
138 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900139 Content-Type: application/json; charset=UTF-8
Edwin Kempina3b4b632013-02-11 10:33:55 +0100140
141 )]}'
142 {
143 "MyProject-Committers": {
Edwin Kempina3b4b632013-02-11 10:33:55 +0100144 "id": "9999c971bb4ab872aab759d8c49833ee6b9ff320",
Edwin Kempina3b4b632013-02-11 10:33:55 +0100145 "url": "#/admin/groups/uuid-9999c971bb4ab872aab759d8c49833ee6b9ff320",
146 "options": {
Edwin Kempina3b4b632013-02-11 10:33:55 +0100147 "visible_to_all": true
148 },
149 "description":"contains all committers for MyProject",
150 "group_id": 551,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100151 "owner": "MyProject-Owners",
Edwin Kempina3b4b632013-02-11 10:33:55 +0100152 "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc"
153 }
154 }
155----
156
Anthony Chindc783292014-04-10 11:14:41 -0400157[[group-limit]]
158==== Group Limit
159The `/groups/` URL also accepts a limit integer in the `n` parameter.
160This limits the results to show `n` groups.
161
162Query the first 25 groups in group list.
163----
164 GET /groups/?n=25 HTTP/1.0
165----
166
167The `/groups/` URL also accepts a start integer in the `S` parameter.
168The results will skip `S` groups from group list.
169
170Query 25 groups starting from index 50.
171----
172 GET /groups/?n=25&S=50 HTTP/1.0
173----
174
Edwin Kempina5cc1122013-02-11 09:26:20 +0100175[[get-group]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800176=== Get Group
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800177--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100178'GET /groups/link:#group-id[\{group-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800179--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100180
Edwin Kempina5cc1122013-02-11 09:26:20 +0100181Retrieves a group.
182
183.Request
184----
185 GET /groups/6a1e70e1a88782771a91808c8af9bbb7a9871389 HTTP/1.0
186----
187
188As response a link:#group-info[GroupInfo] entity is returned that
189describes the group.
190
191.Response
192----
193 HTTP/1.1 200 OK
194 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900195 Content-Type: application/json; charset=UTF-8
Edwin Kempina5cc1122013-02-11 09:26:20 +0100196
197 )]}'
198 {
Edwin Kempina5cc1122013-02-11 09:26:20 +0100199 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
200 "name": "Administrators",
201 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
202 "options": {
Edwin Kempina5cc1122013-02-11 09:26:20 +0100203 },
204 "description": "Gerrit Site Administrators",
205 "group_id": 1,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100206 "owner": "Administrators",
Edwin Kempina5cc1122013-02-11 09:26:20 +0100207 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
208 }
209----
210
Edwin Kempin578fff72013-02-11 08:08:27 +0100211[[create-group]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800212=== Create Group
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800213--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100214'PUT /groups/link:#group-name[\{group-name\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800215--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100216
Edwin Kempin578fff72013-02-11 08:08:27 +0100217Creates a new Gerrit internal group.
218
219In the request body additional data for the group can be provided as
220link:#group-input[GroupInput].
221
222.Request
223----
224 PUT /groups/MyProject-Committers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900225 Content-Type: application/json; charset=UTF-8
Edwin Kempin578fff72013-02-11 08:08:27 +0100226
227 {
228 "description": "contains all committers for MyProject",
229 "visible_to_all": true,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100230 "owner": "MyProject-Owners",
Edwin Kempin578fff72013-02-11 08:08:27 +0100231 "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc"
232 }
233----
234
235As response the link:#group-info[GroupInfo] entity is returned that
236describes the created group.
237
238.Response
239----
240 HTTP/1.1 201 Created
241 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900242 Content-Type: application/json; charset=UTF-8
Edwin Kempin578fff72013-02-11 08:08:27 +0100243
244 )]}'
245 {
Edwin Kempin578fff72013-02-11 08:08:27 +0100246 "id": "9999c971bb4ab872aab759d8c49833ee6b9ff320",
247 "name": "MyProject-Committers",
248 "url": "#/admin/groups/uuid-9999c971bb4ab872aab759d8c49833ee6b9ff320",
249 "options": {
Edwin Kempin578fff72013-02-11 08:08:27 +0100250 "visible_to_all": true
251 },
252 "description":"contains all committers for MyProject",
253 "group_id": 551,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100254 "owner": "MyProject-Owners",
Edwin Kempin578fff72013-02-11 08:08:27 +0100255 "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc"
256 }
257----
258
Edwin Kempin0aa27102013-02-27 16:44:16 +0100259If the group creation fails because the name is already in use the
260response is "`409 Conflict`".
261
Edwin Kempinabaab5462013-02-11 15:30:19 +0100262[[get-group-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800263=== Get Group Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800264--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100265'GET /groups/link:#group-id[\{group-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800266--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100267
Edwin Kempinabaab5462013-02-11 15:30:19 +0100268Retrieves a group with the direct link:#members[members] and the
269directly link:#includes[included groups].
270
271.Request
272----
273 GET /groups/6a1e70e1a88782771a91808c8af9bbb7a9871389/detail HTTP/1.0
274----
275
276As response a link:#group-info[GroupInfo] entity is returned that
277describes the group.
278
279.Response
280----
281 HTTP/1.1 200 OK
282 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900283 Content-Type: application/json; charset=UTF-8
Edwin Kempinabaab5462013-02-11 15:30:19 +0100284
285 )]}'
286 {
Edwin Kempinabaab5462013-02-11 15:30:19 +0100287 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
288 "name": "Administrators",
289 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
290 "options": {
291 },
292 "description": "Gerrit Site Administrators",
293 "group_id": 1,
294 "owner": "Administrators",
295 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
296 "members": [
297 {
Edwin Kempin51284e62013-03-05 15:26:41 +0100298 "_account_id": 1000097,
299 "name": "Jane Roe",
James Ring8e342722013-05-01 01:40:53 -0700300 "email": "jane.roe@example.com",
301 "username": "jane"
Edwin Kempinabaab5462013-02-11 15:30:19 +0100302 },
303 {
Edwin Kempin51284e62013-03-05 15:26:41 +0100304 "_account_id": 1000096,
305 "name": "John Doe",
306 "email": "john.doe@example.com"
James Ring8e342722013-05-01 01:40:53 -0700307 "username": "john"
Edwin Kempinabaab5462013-02-11 15:30:19 +0100308 }
309 ],
310 "includes": []
311 }
312----
313
Edwin Kempin1461c222013-02-11 08:41:08 +0100314[[get-group-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800315=== Get Group Name
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800316--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100317'GET /groups/link:#group-id[\{group-id\}]/name'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800318--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100319
Edwin Kempin1461c222013-02-11 08:41:08 +0100320Retrieves the name of a group.
321
322.Request
323----
324 GET /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/name HTTP/1.0
325----
326
327.Response
328----
329 HTTP/1.1 200 OK
330 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900331 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100332
333 )]}'
334 "MyProject-Committers"
335----
336
337[[rename-group]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800338=== Rename Group
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800339--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100340'PUT /groups/link:#group-id[\{group-id\}]/name'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800341--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100342
Edwin Kempin1461c222013-02-11 08:41:08 +0100343Renames a Gerrit internal group.
344
345The new group name must be provided in the request body.
346
347.Request
348----
349 PUT /groups/MyProject-Committers/name HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900350 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100351
352 {
353 "name": "My-Project-Committers"
354 }
355----
356
357As response the new group name is returned.
358
359.Response
360----
361 HTTP/1.1 200 OK
362 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900363 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100364
365 )]}'
366 "My-Project-Committers"
367----
368
Edwin Kempin0aa27102013-02-27 16:44:16 +0100369If renaming the group fails because the new name is already in use the
370response is "`409 Conflict`".
371
Edwin Kempin1461c222013-02-11 08:41:08 +0100372[[get-group-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800373=== Get Group Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800374--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100375'GET /groups/link:#group-id[\{group-id\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800376--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100377
Edwin Kempin1461c222013-02-11 08:41:08 +0100378Retrieves the description of a group.
379
380.Request
381----
382 GET /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/description HTTP/1.0
383----
384
385.Response
386----
387 HTTP/1.1 200 OK
388 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900389 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100390
391 )]}'
392 "contains all committers for MyProject"
393----
394
Edwin Kempinefec4492013-02-22 10:09:23 +0100395If the group does not have a description an empty string is returned.
396
Edwin Kempin1461c222013-02-11 08:41:08 +0100397[[set-group-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800398=== Set Group Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800399--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100400'PUT /groups/link:#group-id[\{group-id\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800401--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100402
Edwin Kempin1461c222013-02-11 08:41:08 +0100403Sets the description of a Gerrit internal group.
404
405The new group description must be provided in the request body.
406
407.Request
408----
409 PUT /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/description HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900410 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100411
412 {
413 "description": "The committers of MyProject."
414 }
415----
416
417As response the new group description is returned.
418
419.Response
420----
421 HTTP/1.1 200 OK
422 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900423 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100424
425 )]}'
426 "The committers of MyProject."
427----
428
Edwin Kempin114ab162013-02-28 09:25:37 +0100429If the description was deleted the response is "`204 No Content`".
430
Edwin Kempin1461c222013-02-11 08:41:08 +0100431[[delete-group-description]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800432=== Delete Group Description
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800433--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100434'DELETE /groups/link:#group-id[\{group-id\}]/description'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800435--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100436
Edwin Kempin1461c222013-02-11 08:41:08 +0100437Deletes the description of a Gerrit internal group.
438
439.Request
440----
441 DELETE /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/description HTTP/1.0
442----
443
444.Response
445----
446 HTTP/1.1 204 No Content
447----
448
449[[get-group-options]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800450=== Get Group Options
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800451--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100452'GET /groups/link:#group-id[\{group-id\}]/options'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800453--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100454
Edwin Kempin1461c222013-02-11 08:41:08 +0100455Retrieves the options of a group.
456
457.Request
458----
459 GET /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/options HTTP/1.0
460----
461
462As response a link:#group-options-info[GroupOptionsInfo] entity is
463returned that describes the options of the group.
464
465.Response
466----
467 HTTP/1.1 200 OK
468 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900469 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100470
471 )]}'
472 {
Edwin Kempin1461c222013-02-11 08:41:08 +0100473 "visible_to_all": true
474 }
475----
476
477[[set-group-options]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800478=== Set Group Options
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800479--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100480'PUT /groups/link:#group-id[\{group-id\}]/options'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800481--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100482
Edwin Kempin1461c222013-02-11 08:41:08 +0100483Sets the options of a Gerrit internal group.
484
485The new group options must be provided in the request body as a
486link:#group-options-input[GroupOptionsInput] entity.
487
488.Request
489----
490 PUT /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/options HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900491 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100492
493 {
494 "visible_to_all": true
495 }
496----
497
498As response the new group options are returned as a
499link:#group-options-info[GroupOptionsInfo] entity.
500
501.Response
502----
503 HTTP/1.1 200 OK
504 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900505 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100506
507 )]}'
508 {
Edwin Kempin1461c222013-02-11 08:41:08 +0100509 "visible_to_all": true
510 }
511----
512
513[[get-group-owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800514=== Get Group Owner
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800515--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100516'GET /groups/link:#group-id[\{group-id\}]/owner'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800517--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100518
Edwin Kempin1461c222013-02-11 08:41:08 +0100519Retrieves the owner group of a Gerrit internal group.
520
521.Request
522----
523 GET /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/owner HTTP/1.0
524----
525
526As response a link:#group-info[GroupInfo] entity is returned that
527describes the owner group.
528
529.Response
530----
531 HTTP/1.1 200 OK
532 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900533 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100534
535 )]}'
536 {
Edwin Kempin1461c222013-02-11 08:41:08 +0100537 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
538 "name": "Administrators",
539 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
540 "options": {
Edwin Kempin1461c222013-02-11 08:41:08 +0100541 },
542 "description": "Gerrit Site Administrators",
543 "group_id": 1,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100544 "owner": "Administrators",
Edwin Kempin1461c222013-02-11 08:41:08 +0100545 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
546 }
547----
548
549[[set-group-owner]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800550=== Set Group Owner
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800551--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100552'PUT /groups/link:#group-id[\{group-id\}]/owner'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800553--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100554
Edwin Kempin1461c222013-02-11 08:41:08 +0100555Sets the owner group of a Gerrit internal group.
556
557The new owner group must be provided in the request body.
558
Edwin Kempinc9770902013-02-15 15:38:03 +0100559The new owner can be specified by name, by group UUID or by the legacy
560numeric group ID.
561
Edwin Kempin1461c222013-02-11 08:41:08 +0100562.Request
563----
564 PUT /groups/9999c971bb4ab872aab759d8c49833ee6b9ff320/description HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900565 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100566
567 {
568 "owner": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
569 }
570----
571
572As response a link:#group-info[GroupInfo] entity is returned that
573describes the new owner group.
574
575.Response
576----
577 HTTP/1.1 200 OK
578 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900579 Content-Type: application/json; charset=UTF-8
Edwin Kempin1461c222013-02-11 08:41:08 +0100580
581 )]}'
582 {
Edwin Kempin1461c222013-02-11 08:41:08 +0100583 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
584 "name": "Administrators",
585 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
586 "options": {
Edwin Kempin1461c222013-02-11 08:41:08 +0100587 },
588 "description": "Gerrit Site Administrators",
589 "group_id": 1,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100590 "owner": "Administrators",
Edwin Kempin1461c222013-02-11 08:41:08 +0100591 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
592 }
593----
594
Edwin Kempin578fff72013-02-11 08:08:27 +0100595[[group-member-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800596== Group Member Endpoints
Edwin Kempin578fff72013-02-11 08:08:27 +0100597
Edwin Kempind0a63922013-01-23 16:32:59 +0100598[[group-members]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800599=== List Group Members
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800600--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100601'GET /groups/link:#group-id[\{group-id\}]/members/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800602--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100603
Edwin Kempin2dc5edc2013-02-11 15:57:36 +0100604Lists the direct members of a Gerrit internal group.
Edwin Kempind0a63922013-01-23 16:32:59 +0100605
Edwin Kempin963dfd02013-02-27 12:39:32 +0100606As result a list of detailed link:rest-api-accounts.html#account-info[
607AccountInfo] entries is returned. The entries in the list are sorted by
608full name, preferred email and id.
Edwin Kempin4156d6e02013-02-04 15:10:39 +0100609
Edwin Kempin37440832013-02-06 11:36:00 +0100610.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100611----
612 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/members/ HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100613----
Edwin Kempind0a63922013-01-23 16:32:59 +0100614
Edwin Kempin37440832013-02-06 11:36:00 +0100615.Response
616----
Edwin Kempind0a63922013-01-23 16:32:59 +0100617 HTTP/1.1 200 OK
618 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900619 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100620
621 )]}'
622 [
623 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100624 "_account_id": 1000097,
625 "name": "Jane Roe",
James Ring8e342722013-05-01 01:40:53 -0700626 "email": "jane.roe@example.com",
627 "username": "jane"
Edwin Kempind0a63922013-01-23 16:32:59 +0100628 },
629 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100630 "_account_id": 1000096,
631 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700632 "email": "john.doe@example.com",
633 "username": "john"
Edwin Kempind0a63922013-01-23 16:32:59 +0100634 }
635 ]
636----
637
Edwin Kempina64c4b92013-01-23 11:30:40 +0100638.Get all members of the 'Administrators' group (normally group id = 1)
639****
640get::/groups/1/members/
641****
642
Edwin Kempind0a63922013-01-23 16:32:59 +0100643To resolve the included groups of a group recursively and to list all
644members the parameter `recursive` can be set.
645
Edwin Kempind54de1c2013-03-08 16:37:14 +0100646Members from included external groups and from included groups which
647are not visible to the calling user are ignored.
648
Edwin Kempin37440832013-02-06 11:36:00 +0100649.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100650----
651 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/members/?recursive HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100652----
Edwin Kempind0a63922013-01-23 16:32:59 +0100653
Edwin Kempin37440832013-02-06 11:36:00 +0100654.Response
655----
Edwin Kempind0a63922013-01-23 16:32:59 +0100656 HTTP/1.1 200 OK
657 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900658 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100659
660 )]}'
661 [
662 {
Edwin Kempin3e22d482013-03-05 15:35:25 +0100663 "_account_id": 1000097,
664 "name": "Jane Roe",
James Ring8e342722013-05-01 01:40:53 -0700665 "email": "jane.roe@example.com",
666 "username": "jane"
Edwin Kempind0a63922013-01-23 16:32:59 +0100667 },
668 {
Edwin Kempin3e22d482013-03-05 15:35:25 +0100669 "_account_id": 1000096,
670 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700671 "email": "john.doe@example.com",
672 "username": "john"
Edwin Kempind0a63922013-01-23 16:32:59 +0100673 },
674 {
Edwin Kempin3e22d482013-03-05 15:35:25 +0100675 "_account_id": 1000098,
676 "name": "Richard Roe",
James Ring8e342722013-05-01 01:40:53 -0700677 "email": "richard.roe@example.com",
678 "username": "rroe"
Edwin Kempind0a63922013-01-23 16:32:59 +0100679 }
680 ]
681----
682
Edwin Kempina5cc1122013-02-11 09:26:20 +0100683[[get-group-member]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800684=== Get Group Member
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800685--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100686'GET /groups/link:#group-id[\{group-id\}]/members/link:rest-api-accounts.html#account-id[\{account-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800687--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100688
Edwin Kempina5cc1122013-02-11 09:26:20 +0100689Retrieves a group member.
690
691.Request
692----
693 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/members/1000096 HTTP/1.0
694----
695
Edwin Kempin963dfd02013-02-27 12:39:32 +0100696As response a detailed link:rest-api-accounts.html#account-info[
697AccountInfo] entity is returned that describes the group member.
Edwin Kempina5cc1122013-02-11 09:26:20 +0100698
699.Response
700----
701 HTTP/1.1 200 OK
702 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900703 Content-Type: application/json; charset=UTF-8
Edwin Kempina5cc1122013-02-11 09:26:20 +0100704
705 )]}'
706 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100707 "_account_id": 1000096,
708 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700709 "email": "john.doe@example.com",
710 "username": "john"
Edwin Kempina5cc1122013-02-11 09:26:20 +0100711 }
712----
713
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100714[[add-group-member]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800715=== Add Group Member
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800716--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100717'PUT /groups/link:#group-id[\{group-id\}]/members/link:rest-api-accounts.html#account-id[\{account-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800718--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100719
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100720Adds a user as member to a Gerrit internal group.
721
722.Request
723----
724 PUT /groups/MyProject-Committers/members/John%20Doe HTTP/1.0
725----
726
Edwin Kempin963dfd02013-02-27 12:39:32 +0100727As response a detailed link:rest-api-accounts.html#account-info[
728AccountInfo] entity is returned that describes the group member.
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100729
730.Response
731----
732 HTTP/1.1 201 Created
733 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900734 Content-Type: application/json; charset=UTF-8
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100735
736 )]}'
737 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100738 "_account_id": 1000037,
739 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700740 "email": "john.doe@example.com",
741 "username": "john"
Edwin Kempina5d6ead2013-02-06 10:59:06 +0100742 }
743----
744
745The request also succeeds if the user is already a member of this
746group, but then the HTTP response code is `200 OK`.
747
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800748=== Add Group Members
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800749--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100750'POST /groups/link:#group-id[\{group-id\}]/members'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800751--
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100752
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100753OR
754
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800755--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100756'POST /groups/link:#group-id[\{group-id\}]/members.add'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800757--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100758
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100759Adds one or several users to a Gerrit internal group.
760
761The users to be added to the group must be provided in the request body
Sasa Zivkov737e0a32013-03-18 14:21:42 +0100762as a link:#members-input[MembersInput] entity.
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100763
764.Request
765----
766 POST /groups/MyProject-Committers/members.add HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900767 Content-Type: application/json; charset=UTF-8
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100768
769 {
Chris St. Pierreb39fb9e2013-08-06 15:55:00 -0400770 "members": [
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100771 "jane.roe@example.com",
772 "john.doe@example.com"
Chris St. Pierreb39fb9e2013-08-06 15:55:00 -0400773 ]
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100774 }
775----
776
Edwin Kempin963dfd02013-02-27 12:39:32 +0100777As response a list of detailed link:rest-api-accounts.html#account-info[
778AccountInfo] entities is returned that describes the group members that
Sasa Zivkov737e0a32013-03-18 14:21:42 +0100779were specified in the link:#members-input[MembersInput]. An
Edwin Kempin963dfd02013-02-27 12:39:32 +0100780link:rest-api-accounts.html#account-info[AccountInfo] entity
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100781is returned for each user specified in the input, independently of
782whether the user was newly added to the group or whether the user was
783already a member of the group.
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
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100790
791 )]}'
792 [
793 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100794 "_account_id": 1000057,
795 "name": "Jane Roe",
James Ring8e342722013-05-01 01:40:53 -0700796 "email": "jane.roe@example.com",
797 "username": "jane"
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100798 },
799 {
Edwin Kempin963dfd02013-02-27 12:39:32 +0100800 "_account_id": 1000037,
801 "name": "John Doe",
James Ring8e342722013-05-01 01:40:53 -0700802 "email": "john.doe@example.com",
803 "username": "john"
Edwin Kempin2cdef5f2013-02-06 16:50:15 +0100804 }
805 ]
806----
807
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100808[[delete-group-member]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800809=== Delete Group Member
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800810--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100811'DELETE /groups/link:#group-id[\{group-id\}]/members/link:rest-api-accounts.html#account-id[\{account-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800812--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100813
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100814Deletes a user from a Gerrit internal group.
815
816.Request
817----
818 DELETE /groups/MyProject-Committers/members/John%20Doe HTTP/1.0
819----
820
821.Response
822----
823 HTTP/1.1 204 No Content
824----
825
826[[delete-group-members]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800827=== Delete Group Members
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800828--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100829'POST /groups/link:#group-id[\{group-id\}]/members.delete'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800830--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100831
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100832Delete one or several users from a Gerrit internal group.
833
834The users to be deleted from the group must be provided in the request
Sasa Zivkov737e0a32013-03-18 14:21:42 +0100835body as a link:#members-input[MembersInput] entity.
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100836
837.Request
838----
839 POST /groups/MyProject-Committers/members.delete HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900840 Content-Type: application/json; charset=UTF-8
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100841
842 {
Chris St. Pierreb39fb9e2013-08-06 15:55:00 -0400843 "members": [
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100844 "jane.roe@example.com",
845 "john.doe@example.com"
Chris St. Pierreb39fb9e2013-08-06 15:55:00 -0400846 ]
Edwin Kempinacbdfd32013-02-07 12:38:53 +0100847 }
848----
849
850.Response
851----
852 HTTP/1.1 204 No Content
853----
854
Edwin Kempin578fff72013-02-11 08:08:27 +0100855[[group-include-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800856== Group Include Endpoints
Edwin Kempin578fff72013-02-11 08:08:27 +0100857
858[[included-groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800859=== List Included Groups
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800860--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100861'GET /groups/link:#group-id[\{group-id\}]/groups/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800862--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100863
Edwin Kempin578fff72013-02-11 08:08:27 +0100864Lists the directly included groups of a group.
865
866As result a list of link:#group-info[GroupInfo] entries is returned.
867The entries in the list are sorted by group name and UUID.
868
869.Request
870----
871 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/groups/ HTTP/1.0
872----
873
874.Response
875----
876 HTTP/1.1 200 OK
877 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900878 Content-Type: application/json; charset=UTF-8
Edwin Kempin578fff72013-02-11 08:08:27 +0100879
880 )]}'
881 [
882 {
Edwin Kempin578fff72013-02-11 08:08:27 +0100883 "id": "7ca042f4d5847936fcb90ca91057673157fd06fc",
884 "name": "MyProject-Verifiers",
Edwin Kempine05c9642013-02-11 09:36:21 +0100885 "url": "#/admin/groups/uuid-7ca042f4d5847936fcb90ca91057673157fd06fc",
886 "options": {
Edwin Kempine05c9642013-02-11 09:36:21 +0100887 },
Edwin Kempin578fff72013-02-11 08:08:27 +0100888 "group_id": 38,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100889 "owner": "MyProject-Verifiers",
Edwin Kempin578fff72013-02-11 08:08:27 +0100890 "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc"
891 }
892 ]
893----
894
Edwin Kempina5cc1122013-02-11 09:26:20 +0100895[[get-included-group]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800896=== Get Included Group
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800897--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100898'GET /groups/link:#group-id[\{group-id\}]/groups/link:#group-id[\{group-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800899--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100900
Edwin Kempina5cc1122013-02-11 09:26:20 +0100901Retrieves an included group.
902
903.Request
904----
905 GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/groups/7ca042f4d5847936fcb90ca91057673157fd06fc HTTP/1.0
906----
907
908As response a link:#group-info[GroupInfo] entity is returned that
909describes the included group.
910
911.Response
912----
913 HTTP/1.1 200 OK
914 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900915 Content-Type: application/json; charset=UTF-8
Edwin Kempina5cc1122013-02-11 09:26:20 +0100916
917 )]}'
918 {
Edwin Kempina5cc1122013-02-11 09:26:20 +0100919 "id": "7ca042f4d5847936fcb90ca91057673157fd06fc",
920 "name": "MyProject-Verifiers",
921 "url": "#/admin/groups/uuid-7ca042f4d5847936fcb90ca91057673157fd06fc",
922 "options": {
Edwin Kempina5cc1122013-02-11 09:26:20 +0100923 },
924 "group_id": 38,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100925 "owner": "Administrators",
Edwin Kempina5cc1122013-02-11 09:26:20 +0100926 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
927 }
928----
929
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100930[[include-group]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800931=== Include Group
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800932--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100933'PUT /groups/link:#group-id[\{group-id\}]/groups/link:#group-id[\{group-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800934--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100935
Dariusz Lukszaccfa6492013-06-07 11:07:38 +0200936Includes an internal or external group into a Gerrit internal group.
937External groups must be specified using the UUID.
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100938
939.Request
940----
941 PUT /groups/MyProject-Committers/groups/MyGroup HTTP/1.0
942----
943
944As response a link:#group-info[GroupInfo] entity is returned that
945describes the included group.
946
947.Response
948----
949 HTTP/1.1 201 Created
950 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900951 Content-Type: application/json; charset=UTF-8
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100952
953 )]}'
954 {
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100955 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
956 "name": "MyGroup",
957 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
958 "options": {
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100959 },
960 "group_id": 8,
Edwin Kempinc6993fb2013-02-11 12:39:13 +0100961 "owner": "Administrators",
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100962 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
963 }
964----
965
966The request also succeeds if the group is already included in this
967group, but then the HTTP response code is `200 OK`.
968
John Spurlockd25fad12013-03-09 11:48:49 -0500969[[include-groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800970=== Include Groups
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800971--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100972'POST /groups/link:#group-id[\{group-id\}]/groups'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800973--
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100974
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100975OR
976
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800977--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100978'POST /groups/link:#group-id[\{group-id\}]/groups.add'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800979--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100980
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100981Includes one or several groups into a Gerrit internal group.
982
983The groups to be included into the group must be provided in the
984request body as a link:#groups-input[GroupsInput] entity.
985
986.Request
987----
988 POST /groups/MyProject-Committers/groups.add HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900989 Content-Type: application/json; charset=UTF-8
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100990
991 {
Dave Borowitzd2b92172014-04-01 11:15:18 -0700992 "groups": [
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100993 "MyGroup",
994 "MyOtherGroup"
Dave Borowitzd2b92172014-04-01 11:15:18 -0700995 ]
Edwin Kempin2689e3d2013-02-07 15:52:36 +0100996 }
997----
998
999As response a list of link:#group-info[GroupInfo] entities is
1000returned that describes the groups that were specified in the
1001link:#groups-input[GroupsInput]. A link:#group-info[GroupInfo] entity
1002is returned for each group specified in the input, independently of
1003whether the group was newly included into the group or whether the
1004group was already included in the group.
1005
1006.Response
1007----
1008 HTTP/1.1 200 OK
1009 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001010 Content-Type: application/json; charset=UTF-8
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001011
1012 )]}'
1013 [
1014 {
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001015 "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389",
1016 "name": "MyGroup",
1017 "url": "#/admin/groups/uuid-6a1e70e1a88782771a91808c8af9bbb7a9871389",
1018 "options": {
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001019 },
1020 "group_id": 8,
Edwin Kempinc6993fb2013-02-11 12:39:13 +01001021 "owner": "Administrators",
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001022 "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389"
1023 },
1024 {
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001025 "id": "5057f3cbd3519d6ab69364429a89ffdffba50f73",
1026 "name": "MyOtherGroup",
1027 "url": "#/admin/groups/uuid-5057f3cbd3519d6ab69364429a89ffdffba50f73",
1028 "options": {
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001029 },
1030 "group_id": 10,
Edwin Kempinc6993fb2013-02-11 12:39:13 +01001031 "owner": "MyOtherGroup",
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001032 "owner_id": "5057f3cbd3519d6ab69364429a89ffdffba50f73"
1033 }
1034 ]
1035----
1036
1037[[delete-included-group]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001038=== Delete Included Group
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001039--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001040'DELETE /groups/link:#group-id[\{group-id\}]/groups/link:#group-id[\{group-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001041--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001042
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001043Deletes an included group from a Gerrit internal group.
1044
1045.Request
1046----
1047 DELETE /groups/MyProject-Committers/groups/MyGroup HTTP/1.0
1048----
1049
1050.Response
1051----
1052 HTTP/1.1 204 No Content
1053----
1054
1055[[delete-included-groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001056=== Delete Included Groups
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001057--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001058'POST /groups/link:#group-id[\{group-id\}]/groups.delete'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001059--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001060
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001061Delete one or several included groups from a Gerrit internal group.
1062
1063The groups to be deleted from the group must be provided in the request
1064body as a link:#groups-input[GroupsInput] entity.
1065
1066.Request
1067----
1068 POST /groups/MyProject-Committers/groups.delete HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001069 Content-Type: application/json; charset=UTF-8
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001070
1071 {
Edwin Kempin4b77e602014-04-18 08:54:36 +02001072 "groups": [
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001073 "MyGroup",
1074 "MyOtherGroup"
Dave Borowitzd2b92172014-04-01 11:15:18 -07001075 ]
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001076 }
1077----
1078
1079.Response
1080----
1081 HTTP/1.1 204 No Content
1082----
1083
Edwin Kempinaa266ff2013-02-05 12:41:09 +01001084
Edwin Kempin34d83352013-02-06 10:40:17 +01001085[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001086== IDs
Edwin Kempin34d83352013-02-06 10:40:17 +01001087
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001088[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001089=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempin4efe2572013-02-27 10:16:17 +01001090--
1091--
Edwin Kempina5d6ead2013-02-06 10:59:06 +01001092
Edwin Kempin2689e3d2013-02-07 15:52:36 +01001093[[group-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001094=== \{group-id\}
Edwin Kempin34d83352013-02-06 10:40:17 +01001095Identifier for a group.
1096
1097This can be:
1098
1099* the UUID of the group
1100* the legacy numeric ID of the group
1101* the name of the group if it is unique
1102
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001103[[group-name]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001104=== \{group-name\}
Edwin Kempin34d83352013-02-06 10:40:17 +01001105Group name that uniquely identifies one group.
1106
1107
Edwin Kempin987d5432013-02-04 10:20:44 +01001108[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001109== JSON Entities
Edwin Kempin987d5432013-02-04 10:20:44 +01001110
1111[[group-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001112=== GroupInfo
Edwin Kempin987d5432013-02-04 10:20:44 +01001113The `GroupInfo` entity contains information about a group. This can be
1114a Gerrit internal group, or an external group that is known to Gerrit.
1115
David Pursehouseae367192014-11-25 17:24:47 +09001116[options="header",cols="1,^1,5"]
Edwin Kempin987d5432013-02-04 10:20:44 +01001117|===========================
1118|Field Name ||Description
Edwin Kempin987d5432013-02-04 10:20:44 +01001119|`id` ||The URL encoded UUID of the group.
Edwin Kempin5b591d12013-03-08 09:18:35 +01001120|`name` |
1121not set if returned in a map where the group name is used as map key|
1122The name of the group.
Edwin Kempin987d5432013-02-04 10:20:44 +01001123|`url` |optional|
1124URL to information about the group. Typically a URL to a web page that
1125permits users to apply to join the group, or manage their membership.
1126|`options` ||link:#group-options-info[Options of the group]
1127|`description` |only for internal groups|The description of the group.
1128|`group_id` |only for internal groups|The numeric ID of the group.
Edwin Kempinc6993fb2013-02-11 12:39:13 +01001129|`owner` |only for internal groups|The name of the owner group.
Edwin Kempin987d5432013-02-04 10:20:44 +01001130|`owner_id` |only for internal groups|The URL encoded UUID of the owner group.
Edwin Kempinabaab5462013-02-11 15:30:19 +01001131|`members` |optional, only for internal groups|
1132A list of link:rest-api-accounts.html#account-info[AccountInfo]
1133entities describing the direct members. +
1134Only set if link:#members[members] are requested.
1135|`includes` |optional, only for internal groups|
1136A list of link:#group-info[GroupInfo] entities describing the directly
1137included groups. +
1138Only set if link:#includes[included groups] are requested.
Edwin Kempin987d5432013-02-04 10:20:44 +01001139|===========================
1140
Edwin Kempinc42abb92013-02-04 14:52:41 +01001141The type of a group can be deduced from the group's UUID:
Edwin Kempinc42abb92013-02-04 14:52:41 +01001142|============
1143|UUID matches "^[0-9a-f]\{40\}$"|Gerrit internal group
1144|UUID starts with "global:"|Gerrit system group
1145|UUID starts with "ldap:"|LDAP group
1146|UUID starts with "<prefix>:"|other external group
1147|============
1148
Edwin Kempinaa266ff2013-02-05 12:41:09 +01001149[[group-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001150=== GroupInput
Edwin Kempinaa266ff2013-02-05 12:41:09 +01001151The 'GroupInput' entity contains information for the creation of
1152a new internal group.
1153
David Pursehouseae367192014-11-25 17:24:47 +09001154[options="header",cols="1,^1,5"]
Edwin Kempinaa266ff2013-02-05 12:41:09 +01001155|===========================
1156|Field Name ||Description
1157|`name` |optional|The name of the group (not encoded). +
1158If set, must match the group name in the URL.
1159|`description` |optional|The description of the group.
1160|`visible_to_all`|optional|
1161Whether the group is visible to all registered users. +
1162`false` if not set.
1163|`owner_id`|optional|The URL encoded ID of the owner group. +
1164This can be a group UUID, a legacy numeric group ID or a unique group
1165name. +
1166If not set, the new group will be self-owned.
1167|===========================
1168
Edwin Kempin987d5432013-02-04 10:20:44 +01001169[[group-options-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001170=== GroupOptionsInfo
Edwin Kempin987d5432013-02-04 10:20:44 +01001171Options of the group.
1172
David Pursehouseae367192014-11-25 17:24:47 +09001173[options="header",cols="1,^1,5"]
Edwin Kempinf04fc9c2013-02-05 14:09:45 +01001174|=============================
1175|Field Name ||Description
Edwin Kempinf04fc9c2013-02-05 14:09:45 +01001176|`visible_to_all`|not set if `false`|
Edwin Kempin987d5432013-02-04 10:20:44 +01001177Whether the group is visible to all registered users.
Edwin Kempinf04fc9c2013-02-05 14:09:45 +01001178|=============================
Edwin Kempin987d5432013-02-04 10:20:44 +01001179
Edwin Kempin1461c222013-02-11 08:41:08 +01001180[[group-options-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001181=== GroupOptionsInput
Edwin Kempin1461c222013-02-11 08:41:08 +01001182New options for a group.
1183
David Pursehouseae367192014-11-25 17:24:47 +09001184[options="header",cols="1,^1,5"]
Edwin Kempin1461c222013-02-11 08:41:08 +01001185|=============================
1186|Field Name ||Description
1187|`visible_to_all`|not set if `false`|
1188Whether the group is visible to all registered users.
1189|=============================
1190
Edwin Kempin521c1242015-01-23 12:44:44 +01001191[[groups-input]]
1192=== GroupsInput
1193The `GroupsInput` entity contains information about groups that should
1194be included into a group or that should be deleted from a group.
1195
1196[options="header",cols="1,^1,5"]
1197|==========================
1198|Field Name ||Description
1199|`_one_group` |optional|
1200The link:#group-id[id] of one group that should be included or deleted.
1201|`groups` |optional|
1202A list of link:#group-id[group ids] that identify the groups that
1203should be included or deleted.
1204|==========================
1205
Sasa Zivkov737e0a32013-03-18 14:21:42 +01001206[[members-input]]
1207MembersInput
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001208~~~~~~~~~~~
Sasa Zivkov737e0a32013-03-18 14:21:42 +01001209The `MembersInput` entity contains information about accounts that should
Edwin Kempinacbdfd32013-02-07 12:38:53 +01001210be added as members to a group or that should be deleted from the group.
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001211
David Pursehouseae367192014-11-25 17:24:47 +09001212[options="header",cols="1,^1,5"]
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001213|==========================
1214|Field Name ||Description
1215|`_one_member`|optional|
Edwin Kempinacbdfd32013-02-07 12:38:53 +01001216The link:#account-id[id] of one account that should be added or
1217deleted.
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001218|`members` |optional|
1219A list of link:#account-id[account ids] that identify the accounts that
Edwin Kempinacbdfd32013-02-07 12:38:53 +01001220should be added or deleted.
Edwin Kempin2cdef5f2013-02-06 16:50:15 +01001221|==========================
1222
1223
Edwin Kempind0a63922013-01-23 16:32:59 +01001224GERRIT
1225------
1226Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07001227
1228SEARCHBOX
1229---------