By Mark Unwin, Open-AudIT Founder and Product Architect, Opmantek.

Introduction

Adding fields that are specific to your requirements is an extremely simple process with Open-AudIT. You can then populate these fields with whatever data you would like recorded.  Asset Numbers, Cost Codes, specific attributes, etc.

Fields can be one of two types. A freeform text field or a selectable list of values. A log is kept of any changes to a field – when it was changed, what it previously was and who changed it.

We have a quick video showing this process, here:

Community Requests

As always, if you have a field that is not already in Open-AudIT and you think would be useful to the community at large, please do send us your idea. We’re only too happy to incorporate new fields into Open-AudIT when the community requests them.

The GUI

Creating a field is simply a matter of menu -> Manage -> Fields -> Create Fields. Provide it a name (as a minimum) and you’re done. Easy! Now the field will appear on the Device Details pages.

You can change the type to

The API

As with all collections within Open-AudIT, fields are also accessible via the JSON API. Simply send a GET request to /fields for a list. The standard POST, DELETE and PATCH requests also work as expected.

More specific details are available on the Open-AudIT wiki, https://community.opmantek.com/display/OA/Fields.

Updating the value of a device’s custom field is also available via the API. Send a PATCH to /devices/{id} with a JSON formatted, URL encoded payload of data.

An example of the JSON formatted, URL encoded data payload is below. In this instance, we are changing the value of “My select field” for device #1.

data=%7B%22data%22%3A%7B%22id%22%3A%221%22%2C%22type%22%3A%22devices%22%2C%22attributes%22%3A%7B%22My+select+field%22%3A%226%22%7D%7D%7D

When it’s not URL encoded, it looks thus:

{"data":{"id":"1","type":"devices","attributes":{"My select field":"6"}}}

And nicely formatted for human consumption, it looks thus:

{ 
    "data": {
        "id": "1",
        "type": "devices",
        "attributes": {
            "My select field": "6"
        }
    }
}

 


About the author

marku

Mark Unwin is the Founder and Product Architect of Open-AudIT. He is a champion of open standards and has an interest in open source software as an effective mechanism to enable standards adoption. Open-AudIT has been a passion of his for the last 15 years and leverages his 20 years experience in IT.