JSON Configuration Update

The foglamp-notify-jsonconfig plugin is designed to allow a notification to alter the configuration of one of the JSON configuration items within the local FogLAMP.

The plugin can be used to trigger changes to the way data is collected by altering individual items within a complex JSON configuration items. The delivery plugin allows you to set a value when the notification is raised and a different value when it is cleared.

Once you have created your notification rule and moved on to the delivery mechanism

  • Select the config plugin from the list of plugins

  • Click Next

config_1

  • Configure the delivery plugin

    • Category: The name of the configuration category to be updated.

    • Item: The name of the item within the configuration category to be updated.

    • JSON Path: The JSON path of the object that contains the item to be modified.

    • Property: The name of the JSON property to modify.

    • Trigger Value: The value to set the item to when an notification is triggered.

    • Clear Value: The value to set the item to when the notification is cleared. Note you must set the notification type to toggled if you wish to use a Clear Value.

  • Enable the plugin and click Next

  • Complete your notification setup

JSON Path

A subset of the full JSON Path expressions are supported in this plugins. Each path element is proceeded by a / character and may be one of

  • Literals: A literal object name within the JSON document. E.g. /a/b/c

  • An Array Index: An absolute index within an array. E.g. a[2]

  • A conditional test: A property value to match within an array or object. a[prop==value]

To match the object under the registers element within the map element an expression would be of the form

/map/registers

To match the first element in the array called assets under the exclusions object the expression would be

/exclusions/assets[0]

To match the object that contains a property called id whose values in QTE123 within the connections object the expression would be

/connections[id=="QTE123]