...
Code Block |
---|
{attribute}=[operator]{value} |
Include
When requesting the details fo a resource (a device), if the request is JSON based only the 'system' table will be returned. NOT all the related tables. There will be links for these tables in the data->links section. If you would like the system tabel AND the bios table (for example) in a JSON request, you can use the 'include' keyword. An example would be a GET request with accept header as JSON to http://server/open-audit/index.php/devices?include=bios. For a HTML (web browser) formatted request, by default all related tables are included so the web page can render the device details as it has always done.
Code Block |
---|
include={sub_resource} |
Version
To request a different version of the API (currently only v1 exists), use the url /api/{version}/devices or /v1/devices.
...
Request Method | id | action | sub_resource | sub_resource_id | Resulting Action | Notes | URL Example |
---|---|---|---|---|---|---|---|
GET | N | <empty> | collection | /devices | |||
GET | N | create | create_form | /devices?action=create | |||
GET | Y/N | create | Y | sub_resource_create_form | /devices?action=create&sub_resource=credentials | ||
GET | N | import | import_form | /devices?action=import | |||
GET | Y | read | /devices/{id} | ||||
GET | Y | update | update_form | /devices/{id}?action=update | |||
GET | Y | download | download | /scripts/{id}?action=download | |||
GET | N | update | bulk_update_form | Should provide attribute "ids" which is a comma seperated list of ID's upon which to bulk update. | /devices?action=update&ids=1,2,3,4 | ||
POST | N | create | /devices | ||||
POST | N | import | import | /devices?action=import | |||
POST / PUT / PATCH | Y | <empty> | update | /devices/{id}?action=update | |||
POST | Y | Y | sub_resource_create | /devices/{id}?sub_resource=credential | |||
DELETE | Y | N | delete | /scripts/{id} | |||
DELETE | Y | Y | Y | sub_resource_delete | /devices/{id}/credential/{sub_resource_id} | ||
ALL | <empty> / list | collection | |||||
Devices
Route Examples
Verb | Accept | URL | Result | |
---|---|---|---|---|
GET | JSON | /devices | Get a list of all devices | |
GET | JSON | /devices/1 | Get the system table of device with id = 1. | |
GET | JSON | /devices/1&include=bios | Get the system table and bios table for device with ID = 1 |
Device sub_resource Names
NAME | NAME | NAME |
---|---|---|
audit_log | netstat | service |