Class: TCellAgent::SensorEvents::DiscoveryEvent

Inherits:
TCellSensorEvent show all
Defined in:
lib/tcell_agent/sensor_events/discovery.rb

Constant Summary collapse

DATABASE_TYPE =
"db"

Instance Attribute Summary

Attributes inherited from TCellSensorEvent

#ensure, #flush, #send

Instance Method Summary collapse

Methods inherited from TCellSensorEvent

#bucket_key, #calculateOffset, #post_process

Constructor Details

#initialize(route_id = nil) ⇒ DiscoveryEvent

Returns a new instance of DiscoveryEvent.



7
8
9
10
11
12
# File 'lib/tcell_agent/sensor_events/discovery.rb', line 7

def initialize(route_id=nil)
    super("discovery")
    if route_id
        self["rid"] = route_id
    end
end

Instance Method Details

#for_database(database, schema, table, field) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/tcell_agent/sensor_events/discovery.rb', line 13

def for_database(database, schema, table, field)
    self["type"] = "db"
    self["db"] = database
    self["schema"] = schema
    self["table"] = table
    self["field"] = field
end

#for_database_fields(database, schema, table, fields) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/tcell_agent/sensor_events/discovery.rb', line 20

def for_database_fields(database, schema, table, fields)
    self["type"] = "db"
    self["db"] = database
    self["schema"] = schema
    self["table"] = table
    self["fields"] = fields
    return self
end