lib/flor/unit/models/trap.rb
def to_hook

      opts = {}

      opts[:consumed] = tconsumed

      opts[:point] = tpoints.split(',') if tpoints
      opts[:tag] = do_split(ttags) if ttags
      opts[:heap] = do_split(theaps) if theaps
      opts[:heat] = do_split(theats) if theats

      opts[:name] = data['names']

      case trange
      when 'execution'
        opts[:exid] = exid
      when 'subdomain'
        opts[:subdomain] = Flor.domain(exid)
      when 'domain'
        opts[:domain] = Flor.domain(exid)
      else #'subnid' # default
        opts[:exid] = exid
        opts[:subnid] = true
      end

      [ "trap#{id}", opts, self, nil ]
    end
def to_hook

      opts = {}

      opts[:consumed] = tconsumed

      opts[:point] = tpoints.split(',') if tpoints
      opts[:tag] = do_split(ttags) if ttags
      opts[:heap] = do_split(theaps) if theaps
      opts[:heat] = do_split(theats) if theats

      opts[:name] = data['names']

      case trange
      when 'execution'
        opts[:exid] = exid
      when 'subdomain'
        opts[:subdomain] = Flor.domain(exid)
      when 'domain'
        opts[:domain] = Flor.domain(exid)
      else #'subnid' # default
        opts[:exid] = exid
        opts[:subnid] = true
      end

      [ "trap#{id}", opts, self, nil ]
    end
create_table :flor_traps do

  primary_key :id, type: :Integer
  String :domain, null: false
  String :exid, null: false
  String :onid, null: false
  String :nid, null: false
  
  TrueClass :tconsumed, null: false, default: false
  String :trange, null: false
  String :tpoints, null: true
  String :ttags, null: true
  String :theats, null: true
  String :theaps, null: true
  
  File :content # JSON msg to trigger
  
  String :status, null: false
  String :ctime, null: false
  String :mtime, null: false

  String :cunit
  String :munit

  String :bnid, null: false

  index :exid
  index [ :exid, :nid ]
end