...
NOTE - This API is not ready for a full release as yet and items below are subject to change.As at 1.12.6 8 though, this is how it stands. We don't envision big breaking changes going forward, but until such time as we give the official "released" stamp of approval, items are subject to (and indeed WILL) change.
NOTE - This page is incomplete and is being updated as we work towards a released verion version of the API.
Open-AudIT's API
...
Code Block |
---|
http://{server}/open-audit/index.php/loginomk/oae/login_auth |
The Endpoints
At present we have endpoints for:
devices - The devices, bg surprise.
orgs - The organisations setup within.
networks - The networks detected by Open-AudIT. This also doubles as our "blessed subnets" listbig surprise.
Collections to be introduced
...
When using the API the default action is determined according to the format and URL. You can override this by providing the 'action' option in the URL. An example of this is when creating a new item. You would normally use POST to /item but in the case of a web user, you need a web form to be able to fill out the item details. In that case there is no facility for this in a typical JSON restful API. We work around this by providing action=create in a GET request for the URL. IE - http://{server}/open-audit/index.phpomk/oae/networks?action=create. The default action if noting matches below is to return a collection of items.
Request | Name | ID | Result | Implemented | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GET | Return a collection of items | Y | ||||||||||||
ANY | list | Return a collection of items. | Y | |||||||||||
GET | create | Show a HTML form to create a new item. | N | |||||||||||
GET | import | N | ||||||||||||
GET | read | Y | Show the details of an item. | Y | ||||||||||
GET | edit | Y | Show a form to edit an item's details. | Y | PATCH | Y | Update an item's details. | Y | DELETE | Y | Delete an item (not supported for /devices) | Y | ||
POST | Y|N | Create a new item. If ID is supplied (mainly for /devices) an item is updated. | ||||||||||||
Sort
To sort by a database column, user "sort={attribute}". To reverse sort, insert a minus, thus "sort=-{attribute}".
...
Code Block |
---|
{attribute}=[operator]{value} |
Version
...
} |
...
End Points
All endpoints URLs are of the format http://{server}/open-audit/index.phpomk/oae/{endpoint}
NOTE - The below examples use SQL column names from 1.12.68. This are in the process of being revised for our next release.
...
Type | Endpoint | ||||||
---|---|---|---|---|---|---|---|
GET | /devices | Return a collection of devices with the default set of columns from the system table (system.system_id, system.icon, system.man_type, system.hostname, system.domain, system.man_ip_address, system.man_description, system.man_os_family, system.man_status) | |||||
GET | /devices/{id} | Return an individual devices details. | |||||
GET | /devices?sub_resource={sub_resource name} | To return all items in a sub_resource for a collection of devices. If you wanted all software you would use http://{server}/open-audit/index.php/devices?sub_resource=software | |||||
GET | /devices/{id}?sub_resource={sub_resource name} | To return all items in a sub_resource for a specific device. | |||||
GET | /devices?sub_resource={sub_resource name}&sub_resource_id={sub_resource id} | To return a specific item in a sub_resource for a collection of devices - not especially useful. You would more likely use the below (request a sub_resource items from a specific device) | |||||
GET | /devices{id}?sub_resource={sub_resource name}&sub_resource_id={sub_resource id} | To return a specific sub_resource item for a specific device. | POST | PUT | PATCH | /devices/{id} | To update a device attribute. The body of the POST should be JSON formatted using the attribute name 'data'.An example post updating the description is below. Code Block | | |
|
Device sub_resource Names
NAME | NAME | NAME |
---|---|---|
audit_log | netstat | service |
...
Code Block |
---|
GET http://{server}/open-audit/index.phpomk/oae/devices |
Retrieve all devices running Windows.
Code Block |
---|
GET http://{server}/open-audit/index.phpomk/oae/devices?os_group=Windows |
...
Code Block |
---|
GET http://{server}/open-audit/index.phpomk/oae/devices?os_group=Windows&limit=10&sort=hostname |
...
Code Block |
---|
GET http://{server}/open-audit/index.phpomk/oae/devices?properties=system_id,man_ip_address,hostname,domain,man_type |
...
Code Block |
---|
GET http://{server}/open-audit/index.phpomk/oae/devices/88 |
Retrieve a list of devices in the 192.168.1.0/24 subnet
Code Block |
---|
GET http://{server}/open-audit/index.phpomk/oae/devices?sub_resource=ip&ip.network=192.168.1.0/24&properties=system.system_id,system.hostname,system.domain,ip.ip |
...
Code Block |
---|
GET http://{server}/open-audit/index.phpomk/oae/devices?os_name=likeWindows 2008 |
Networks
Orgs
...