GET /api/roles 200 { "total": 12, "subtotal": 12, "page": 1, "per_page": 20, "search": null, "sort": { "by": "name", "order": "ASC" }, "results": [ { "builtin": 0, "cloned_from_id": null, "name": "Create hosts", "id": 9, "description": null, "origin": "" }, { "builtin": 0, "cloned_from_id": null, "name": "CRUD hosts", "id": 12, "description": null, "origin": "" }, { "builtin": 2, "cloned_from_id": null, "name": "Default role", "id": 7, "description": null, "origin": "foreman" }, { "builtin": 0, "cloned_from_id": null, "name": "Destroy hosts", "id": 8, "description": null, "origin": "" }, { "builtin": 0, "cloned_from_id": null, "name": "Edit hosts", "id": 4, "description": null, "origin": "foreman" }, { "builtin": 0, "cloned_from_id": null, "name": "Edit partition tables", "id": 2, "description": null, "origin": "foreman" }, { "builtin": 0, "cloned_from_id": null, "name": "Manager", "id": 1, "description": null, "origin": "foreman" }, { "builtin": 0, "cloned_from_id": null, "name": "No rights", "id": 10, "description": null, "origin": "" }, { "builtin": 0, "cloned_from_id": null, "name": "Organization admin", "id": 13, "description": null, "origin": "foreman" }, { "builtin": 0, "cloned_from_id": null, "name": "View compute resources", "id": 11, "description": null, "origin": "" }, { "builtin": 0, "cloned_from_id": null, "name": "Viewer", "id": 5, "description": null, "origin": "foreman" }, { "builtin": 0, "cloned_from_id": null, "name": "View hosts", "id": 3, "description": null, "origin": "foreman" } ] }
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 |
---|---|---|
builtin | true, false | |
description | text | |
name | string | |
permission | string |
GET /api/roles/1-Manager 200 { "builtin": 0, "cloned_from_id": null, "name": "Manager", "id": 1, "description": null, "origin": "foreman", "filters": [ { "id": 139728896 }, { "id": 169533705 }, { "id": 170801529 }, { "id": 222559602 }, { "id": 225912082 }, { "id": 255448041 }, { "id": 291325508 }, { "id": 321349837 }, { "id": 340438230 }, { "id": 343831726 }, { "id": 372277853 }, { "id": 503111935 }, { "id": 528928374 }, { "id": 557298380 }, { "id": 592288835 }, { "id": 595149887 }, { "id": 643462867 }, { "id": 679608033 }, { "id": 721145960 }, { "id": 943645556 }, { "id": 977587707 }, { "id": 980424071 }, { "id": 1026099682 }, { "id": 1062414187 } ], "locations": [], "organizations": [] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
description optional |
Validations:
|
PUT /api/roles { "role": { "name": "newrole" } } 403 { "error": { "message": "Access denied", "details": "Missing one of the required permissions: create_roles" } }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
role required |
Validations:
|
role[name] required |
Validations:
|
role[description] optional , nil allowed |
Role description Validations:
|
role[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
role[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|
PUT /api/roles/8-Destroy%20hosts { "role": { "name": "staff" } } 200 { "builtin": 0, "cloned_from_id": null, "name": "staff", "id": 8, "description": null, "origin": "", "filters": [ { "id": 10997177 } ], "locations": [], "organizations": [] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
role required |
Validations:
|
role[name] optional |
Validations:
|
role[description] optional , nil allowed |
Role description Validations:
|
role[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
role[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|
DELETE /api/roles/8-Destroy%20hosts { "role": {} } 200 { "id": 8, "name": "Destroy hosts", "builtin": 0, "description": null, "cloned_from_id": null, "origin": "" }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
POST /api/roles/14/clone { "name": "New Role", "role": { "location_ids": [], "organization_ids": [], "name": "New Role" } } 201 { "id": 15, "name": "New Role", "builtin": 0, "description": "default description", "cloned_from_id": 14, "origin": null }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
role required |
Validations:
|
role[name] optional |
Validations:
|
role[description] optional , nil allowed |
Role description Validations:
|
role[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
role[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|