GET /api/usergroups 200 { "total": 1, "subtotal": 1, "page": 1, "per_page": 20, "search": null, "sort": { "by": null, "order": null }, "results": [ { "admin": false, "created_at": "2018-07-24 13:18:42 UTC", "updated_at": "2018-07-24 13:18:42 UTC", "name": "usergroup361", "id": 18 } ] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
search optional |
filter results Validations:
|
order optional |
Sort field and order, eg. ‘id DESC’ Validations:
|
page optional |
paginate results Validations:
|
per_page optional |
number of entries per request Validations:
|
Field name | Type | Possible values |
---|---|---|
name | string | |
role | string | |
role_id | integer |
GET /api/usergroups/25-usergroup367 200 { "admin": false, "created_at": "2018-07-24 13:18:43 UTC", "updated_at": "2018-07-24 13:18:43 UTC", "name": "usergroup367", "id": 25, "external_usergroups": [], "usergroups": [], "users": [], "roles": [] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
POST /api/usergroups { "usergroup": { "name": "test_usergroup", "user_ids": [ 980190962, 298486374, 200482051 ] } } 201 { "admin": false, "created_at": "2018-07-24 13:18:41 UTC", "updated_at": "2018-07-24 13:18:41 UTC", "name": "test_usergroup", "id": 2, "external_usergroups": [], "usergroups": [], "users": [ { "id": 980190962, "login": "one", "description": null }, { "id": 298486374, "login": "two", "description": null }, { "id": 200482051, "login": "test", "description": null } ], "roles": [] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
usergroup required |
Validations:
|
usergroup[name] required |
Validations:
|
usergroup[admin] optional , nil allowed |
is an admin user group Validations:
|
usergroup[user_ids] optional , nil allowed |
Validations:
|
usergroup[usergroup_ids] optional , nil allowed |
Validations:
|
usergroup[role_ids] optional , nil allowed |
Validations:
|
User groups linked to external groups (LDAP) are automatically synced with these groups on update. Remember this synchronization will remove any LDAP users manually added to the Foreman user group. Only LDAP users in the external groups will remain. Internal users can be added or removed freely.
PUT /api/usergroups/4 { "usergroup": { "name": "usergroup350" } } 422 { "error": { "id": 4, "errors": { "name": [ "has already been taken" ] }, "full_messages": [ "Name has already been taken" ] } }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
usergroup required |
Validations:
|
usergroup[name] optional |
Validations:
|
usergroup[admin] optional , nil allowed |
is an admin user group Validations:
|
usergroup[user_ids] optional , nil allowed |
Validations:
|
usergroup[usergroup_ids] optional , nil allowed |
Validations:
|
usergroup[role_ids] optional , nil allowed |
Validations:
|
DELETE /api/usergroups/19-usergroup362 { "usergroup": {} } 200 { "id": 19, "name": "usergroup362", "created_at": "2018-07-24T13:18:42.158Z", "updated_at": "2018-07-24T13:18:42.158Z", "admin": false }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|