Skip to content

Commit eebe581

Browse files
Jeny SadadiaJenySadadia
authored andcommitted
doc/api-details: add documentation for user group endpoints
Signed-off-by: Jeny Sadadia <[email protected]>
1 parent 2d92c96 commit eebe581

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

doc/api-details.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,53 @@ $ curl -X 'DELETE' \
250250
```
251251

252252

253+
## User groups
254+
255+
User accounts can be added to different user groups. This section
256+
explains different API endpoints for user group management operations.
257+
258+
### Create a user group (Admin only)
259+
260+
Admin users can create user groups using `POST /group` endpoint:
261+
```
262+
$ curl -X 'POST' \
263+
'http://localhost:8001/group' \
264+
-H 'accept: application/json' \
265+
-H 'Content-Type: application/json' \
266+
-H 'Authorization: Bearer <ADMIN-USER-AUTHORIZATION-TOKEN>' \
267+
-d '{"name": "test-user-group"}'
268+
```
269+
270+
271+
### Get all existing user groups
272+
273+
Get all existing user groups using `GET /groups` endpoint:
274+
```
275+
$ curl 'http://localhost:8001/groups'
276+
{"items":[{"id":"648ff894bd39930355ed16ad","name":"kernelci"},{"id":"6704f354ffaa8f6fa017faa3","name":"test"}],"total":2,"limit":50,"offset":0}
277+
```
278+
279+
280+
### Get user group matching ID
281+
282+
To get user group by ID, use `/group` endpoint with group ID as a path parameter:
283+
```
284+
$ curl 'http://localhost:8001/group/648ff894bd39930355ed16ad'
285+
{"id":"648ff894bd39930355ed16ad","name":"kernelci"}
286+
```
287+
288+
289+
### Delete user group matching ID (Admin only)
290+
291+
Only admin users can delete existing user groups by providing group ID to
292+
`DELETE /group/<group-id>` endpoint:
293+
```
294+
$ curl -X 'DELETE' \
295+
'http://localhost:8001/group/6704f354ffaa8f6fa017faa3' \
296+
-H 'Authorization: Bearer <ADMIN-USER-AUTHORIZATION-TOKEN>'
297+
```
298+
299+
253300
## Nodes
254301

255302
`Node` objects form the basis of the API models to represent tests runs,

0 commit comments

Comments
 (0)