| Edwin Kempin | d0a6392 | 2013-01-23 16:32:59 +0100 | [diff] [blame^] | 1 | Gerrit Code Review - '/groups/' REST API |
| 2 | ======================================== |
| 3 | |
| 4 | This page describes the group related REST endpoints. |
| 5 | Please also take note of the general information on the |
| 6 | link:rest-api.html[REST API]. |
| 7 | |
| 8 | Endpoints |
| 9 | --------- |
| 10 | |
| 11 | /groups/ (List Groups) |
| 12 | ~~~~~~~~~~~~~~~~~~~~~~ |
| 13 | Lists the groups accessible by the caller. This is the same as |
| 14 | using the link:cmd-ls-groups.html[ls-groups] command over SSH, |
| 15 | and accepts the same options as query parameters. |
| 16 | |
| 17 | ---- |
| 18 | GET /groups/ HTTP/1.0 |
| 19 | |
| 20 | HTTP/1.1 200 OK |
| 21 | Content-Disposition: attachment |
| 22 | Content-Type: application/json;charset=UTF-8 |
| 23 | |
| 24 | )]}' |
| 25 | { |
| 26 | "Administrators": { |
| 27 | "kind": "gerritcodereview#group", |
| 28 | "id": "6a1e70e1a88782771a91808c8af9bbb7a9871389", |
| 29 | "description": "Gerrit Site Administrators", |
| 30 | "group_id": 1, |
| 31 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389" |
| 32 | }, |
| 33 | "Anonymous Users": { |
| 34 | "kind": "gerritcodereview#group", |
| 35 | "id": "global%3AAnonymous-Users", |
| 36 | "description": "Any user, signed-in or not", |
| 37 | "group_id": 2, |
| 38 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389" |
| 39 | }, |
| 40 | "MyProject_Committers": { |
| 41 | "kind": "gerritcodereview#group", |
| 42 | "id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7", |
| 43 | "visible_to_all": true, |
| 44 | "group_id": 6, |
| 45 | "owner_id": "834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7" |
| 46 | }, |
| 47 | "Non-Interactive Users": { |
| 48 | "kind": "gerritcodereview#group", |
| 49 | "id": "5057f3cbd3519d6ab69364429a89ffdffba50f73", |
| 50 | "description": "Users who perform batch actions on Gerrit", |
| 51 | "group_id": 4, |
| 52 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389" |
| 53 | }, |
| 54 | "Project Owners": { |
| 55 | "kind": "gerritcodereview#group", |
| 56 | "id": "global%3AProject-Owners", |
| 57 | "description": "Any owner of the project", |
| 58 | "group_id": 5, |
| 59 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389" |
| 60 | }, |
| 61 | "Registered Users": { |
| 62 | "kind": "gerritcodereview#group", |
| 63 | "id": "global%3ARegistered-Users", |
| 64 | "description": "Any signed-in user", |
| 65 | "group_id": 3, |
| 66 | "owner_id": "6a1e70e1a88782771a91808c8af9bbb7a9871389" |
| 67 | } |
| 68 | } |
| 69 | ---- |
| 70 | |
| 71 | [[group-members]] |
| 72 | /groups/*/members/ (List Group Members) |
| 73 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 74 | Lists the direct members of a group. |
| 75 | |
| 76 | ---- |
| 77 | GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/members/ HTTP/1.0 |
| 78 | |
| 79 | HTTP/1.1 200 OK |
| 80 | Content-Disposition: attachment |
| 81 | Content-Type: application/json;charset=UTF-8 |
| 82 | |
| 83 | )]}' |
| 84 | [ |
| 85 | { |
| 86 | "kind": "gerritcodereview#member", |
| 87 | "full_name": "Jane Roe", |
| 88 | "id": "1000097", |
| 89 | "account_id": 1000097, |
| 90 | "preferred_email": "jane.roe@example.com", |
| 91 | "user_name": "jane" |
| 92 | }, |
| 93 | { |
| 94 | "kind": "gerritcodereview#member", |
| 95 | "full_name": "John Doe", |
| 96 | "id": "1000096", |
| 97 | "account_id": 1000096, |
| 98 | "preferred_email": "john.doe@example.com", |
| 99 | "user_name": "doe" |
| 100 | } |
| 101 | ] |
| 102 | ---- |
| 103 | |
| 104 | To resolve the included groups of a group recursively and to list all |
| 105 | members the parameter `recursive` can be set. |
| 106 | |
| 107 | ---- |
| 108 | GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/members/?recursive HTTP/1.0 |
| 109 | |
| 110 | HTTP/1.1 200 OK |
| 111 | Content-Disposition: attachment |
| 112 | Content-Type: application/json;charset=UTF-8 |
| 113 | |
| 114 | )]}' |
| 115 | [ |
| 116 | { |
| 117 | "kind": "gerritcodereview#member", |
| 118 | "full_name": "Jane Roe", |
| 119 | "id": "1000097", |
| 120 | "account_id": 1000097, |
| 121 | "preferred_email": "jane.roe@example.com", |
| 122 | "user_name": "jane" |
| 123 | }, |
| 124 | { |
| 125 | "kind": "gerritcodereview#member", |
| 126 | "full_name": "John Doe", |
| 127 | "id": "1000096", |
| 128 | "account_id": 1000096, |
| 129 | "preferred_email": "john.doe@example.com", |
| 130 | "user_name": "doe" |
| 131 | }, |
| 132 | { |
| 133 | "kind": "gerritcodereview#member", |
| 134 | "full_name": "Richard Roe", |
| 135 | "id": "1000098", |
| 136 | "account_id": 1000098, |
| 137 | "preferred_email": "richard.roe@example.com", |
| 138 | "user_name": "richard" |
| 139 | } |
| 140 | ] |
| 141 | ---- |
| 142 | |
| 143 | [[included-groups]] |
| 144 | /groups/*/groups/ (List Included Groups) |
| 145 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 146 | Lists the directly included groups of a group. |
| 147 | |
| 148 | ---- |
| 149 | GET /groups/834ec36dd5e0ed21a2ff5d7e2255da082d63bbd7/groups/ HTTP/1.0 |
| 150 | |
| 151 | HTTP/1.1 200 OK |
| 152 | Content-Disposition: attachment |
| 153 | Content-Type: application/json;charset=UTF-8 |
| 154 | |
| 155 | )]}' |
| 156 | [ |
| 157 | { |
| 158 | "kind": "gerritcodereview#group", |
| 159 | "id": "7ca042f4d5847936fcb90ca91057673157fd06fc", |
| 160 | "name": "MyProject-Verifiers", |
| 161 | "group_id": 38, |
| 162 | "owner_id": "7ca042f4d5847936fcb90ca91057673157fd06fc" |
| 163 | } |
| 164 | ] |
| 165 | ---- |
| 166 | |
| 167 | |
| 168 | GERRIT |
| 169 | ------ |
| 170 | Part of link:index.html[Gerrit Code Review] |