Value accessor

A value accessor allows, as its name implies, to access the different fields that compose a value but can also be used to define a constant.

It is used by :

  • Alarms outputs to extract the content of the value to set the content of the alarm to generate.

  • Alarms value error handler to extract the content of the value to set the content of the alarm to generate.

  • IP-RCT alarm owner to extract the content of the received alarm to trigger an action.

Usage

Any value accessor allows to define the following elements:

  • CONSTANT: To define a constant.

    {
        "type": "CONSTANT"
        "value": "text"
    }
    
  • FIELD: To access a field of the value.

    {
        "type": "FIELD"
        "field": "ID"
    }
    

    The possible fields are:

    • ID : The id of the value

    • TIMESTAMP : The timestamp of the value

    • CONTENT : The content of the value

    • TYPE : The type of the value

    • ERROR : The error of the value

    • NAME : The name of the value

    • DESCRIPTION : The description of the value

    An optional fieldParser is available to extract data from a Json content.

    {
        "type": "FIELD"
        "field": "CONTENT",
        "fieldParser": "tni.ip"
    }
    

    Warning

    The content of the field must be parsable as JSON.

  • LIST: To define a list. It is composed of value accessor.

    {
        "type": "LIST",
        "values": [
            {
                "type": "FIELD"
                "field": "ID"
            },
            {
                "type": "FIELD"
                "field": "CONTENT",
                "fieldParser": "tni.ip"
            },
            {
                "type": "CONSTANT"
                "value": "42"
            }
        ]
    }
    
  • PROPERTIES: To define a map. It is composed of value accessor.

    {
        "type": "PROPERTIES",
        "properties": {
            "identifier": {
                "type": "FIELD"
                "field": "ID"
            },
            "ip": {
                "type": "FIELD"
                "field": "CONTENT",
                "fieldParser": "tni.ip"
            },
            "const": {
                "type": "CONSTANT"
                "value": "42"
            }
        }
    }
    

Example