{
    "type": "record",
    "name": "AlarmInstance",
    "namespace": "org.jlab.jaws.entity",
    "doc": "Instance of an alarm class",
    "fields": [
        {
            "name": "class",
            "type": {
                "type": "string",
                "avro.java.string": "String"
            },
            "doc": "The alarm class; provides inheritable shared field values, fields are only overridden if null, the producer field is required and cannot be overridden",
            "default": "base"
        },
        {
            "name": "producer",
            "type": [
                {
                    "type": "record",
                    "name": "SimpleProducer",
                    "doc": "Alarm producer which has no specific source",
                    "fields": []
                },
                {
                    "type": "record",
                    "name": "EPICSProducer",
                    "doc": "Alarm producer which sources alarms from EPICS",
                    "fields": [
                        {
                            "name": "pv",
                            "type": {
                                "type": "string",
                                "avro.java.string": "String"
                            },
                            "doc": "The name of the EPICS CA PV, which can be correlated with the key of the epics-channels topic"
                        }
                    ]
                },
                {
                    "type": "record",
                    "name": "CALCProducer",
                    "doc": "Alarm producer which uses CALC-like expressions",
                    "fields": [
                        {
                            "name": "expression",
                            "type": {
                                "type": "string",
                                "avro.java.string": "String"
                            },
                            "doc": "The CALC expression used to generate alarms"
                        }
                    ]
                }
            ],
            "doc": "Indicates how this alarm is produced, useful for producers to monitor when new alarms are added/removed"
        },
        {
            "name": "location",
            "type": {
                "type": "array",
                "items" : "string",
                "default": []
            },
            "doc": "The locations associated with the alarm"
        },
        {
            "name": "maskedby",
            "type": [
                "null",
                {
                    "type": "string",
                    "avro.java.string": "String"
                }
            ],
            "doc": "The name of the parent alarm, which if active, masks this alarm (flood suppression via logical hierarchy)"
        },
        {
            "name": "screenpath",
            "type": [
                "null",
                {
                    "type": "string",
                    "avro.java.string": "String"
                }
            ],
            "doc": "The path the alarm screen display"
        }
    ]
}
