The Assimilation Project  based on Assimilation version 1.1.7.1474836767
cma.droneinfo.Drone Class Reference
Inheritance diagram for cma.droneinfo.Drone:
Collaboration diagram for cma.droneinfo.Drone:

Public Member Functions

def __init__ (self, designation, port=None, startaddr=None, primary_ip_addr=None, domain=CMAconsts.globaldomain, status='(unknown)', reason='(initialization)', roles=None, key_id='')
 
def gen_current_bp_rules (self)
 
def get_bp_head_rule_for (self, trigger_discovery_type)
 
def get_merged_bp_rules (self, trigger_discovery_type)
 
def bp_category_list (self)
 
def bp_discoverytypes_list (self)
 
def get_owned_ips (self)
 
def get_owned_nics (self)
 
def get_active_nic_count (self)
 
def crypto_identity (self)
 
def destaddr (self, ring=None)
 
def select_ip (self, ring=None)
 
def send_frames (self, framesettype, frames)
 
def send_hbmsg (self, dest, fstype, addrlist)
 
def death_report (self, status, reason, fromaddr, frameset)
 
def start_heartbeat (self, ring, partner1, partner2=None)
 
def stop_heartbeat (self, ring, partner1, partner2=None)
 
def set_crypto_identity (self, keyid=None)
 
def __str__ (self)
 
def find_child_system_from_json (self, jsonobj)
 

Static Public Member Functions

def bp_category_score_attrname (category)
 
def bp_discoverytype_result_attrname (discoverytype)
 
def find (designation, port=None, domain=None)
 
def add (designation, reason, status='up', port=None, domain=CMAconsts.globaldomain, primary_ip_addr=None)
 

Data Fields

 lastjoin
 
 status
 
 reason
 
 key_id
 
 startaddr
 
 primary_ip_addr
 
 time_status_ms
 
 time_status_iso8601
 
 port
 
 monitors_activated
 

Static Public Attributes

 IPownerquery_1 = None
 
 OwnedIPsQuery = None
 
string IPownerquery_1_txt
 
string OwnedIPsQuery_txt
 

Detailed Description

Everything about Drones - endpoints that run our nanoprobes.

There are two Cypher queries that get initialized later:
Drone.IPownerquery_1: Given an IP address, return th SystemNode (probably Drone) 'owning' it.
Drone.OwnedIPsQuery:  Given a Drone object, return all the IPaddrNodes that it 'owns'

Definition at line 45 of file droneinfo.py.

Constructor & Destructor Documentation

def cma.droneinfo.Drone.__init__ (   self,
  designation,
  port = None,
  startaddr = None,
  primary_ip_addr = None,
  domain = CMAconsts.globaldomain,
  status = '(unknown)',
  reason = '(initialization)',
  roles = None,
  key_id = '' 
)
Initialization function for the Drone class.
We mainly initialize a few attributes from parameters as noted above...

The first time around we also initialize a couple of class-wide query
strings for a few queries we know we'll need later.

We also behave as though we're a dict from the perspective of JSON attributes.
These discovery strings are converted into pyConfigContext objects and are
then searchable like dicts themselves - however updating these dicts has
no direct impact on the underlying JSON strings stored in the database.

The reason for treating these as a dict is so we can easily change
the implementation to put JSON strings in separate nodes, or perhaps
eventually in a separate data store.

This is necessary because the performance of putting lots of really large
strings in Neo4j is absolutely horrible. Putting large strings in is dumb
and what Neo4j does with them is even dumber...
The result is at least DUMB^2 -not 2*DUMB ;-)

Definition at line 66 of file droneinfo.py.

References cma.droneinfo.Drone._io, cma.systemnode.SystemNode.addrole(), and cma.graphnodes.ProcessNode.addrole().

Here is the call graph for this function:

Member Function Documentation

def cma.droneinfo.Drone.__str__ (   self)
def cma.droneinfo.Drone.add (   designation,
  reason,
  status = 'up',
  port = None,
  domain = CMAconsts.globaldomain,
  primary_ip_addr = None 
)
static

Definition at line 452 of file droneinfo.py.

Referenced by cma.droneinfo.Drone.find().

Here is the caller graph for this function:

def cma.droneinfo.Drone.bp_category_list (   self)

Definition at line 179 of file droneinfo.py.

def cma.droneinfo.Drone.bp_category_score_attrname (   category)
static

Definition at line 175 of file droneinfo.py.

def cma.droneinfo.Drone.bp_discoverytype_result_attrname (   discoverytype)
static

Definition at line 196 of file droneinfo.py.

def cma.droneinfo.Drone.bp_discoverytypes_list (   self)

Definition at line 187 of file droneinfo.py.

def cma.droneinfo.Drone.crypto_identity (   self)
Return the Crypto Identity that should be associated with this Drone
Note that this current algorithm isn't ideal for a multi-tenant environment.

Definition at line 226 of file droneinfo.py.

References cma.systemnode.SystemNode.designation, cma.tests.store_test.aTestSystem.designation, and obsolete_cma.DroneInfo.designation.

Referenced by cma.droneinfo.Drone.set_crypto_identity().

Here is the caller graph for this function:

def cma.droneinfo.Drone.destaddr (   self,
  ring = None 
)
Return the "primary" IP for this host as a pyNetAddr with port

Definition at line 233 of file droneinfo.py.

References cma.droneinfo.Drone.port, cma.AssimCclasses.pyIpPortFrame.port, cma.droneinfo.Drone.select_ip(), and obsolete_cma.DroneInfo.select_ip().

Referenced by cma.droneinfo.Drone.set_crypto_identity().

Here is the call graph for this function:

Here is the caller graph for this function:

def cma.droneinfo.Drone.find (   designation,
  port = None,
  domain = None 
)
static

Definition at line 395 of file droneinfo.py.

References cma.droneinfo.Drone.add(), and cma.drawwithdot.type.

Here is the call graph for this function:

def cma.droneinfo.Drone.find_child_system_from_json (   self,
  jsonobj 
)
Locate the child drone that goes with this JSON - or maybe it's us

Definition at line 375 of file droneinfo.py.

def cma.droneinfo.Drone.gen_current_bp_rules (   self)
Return a generator producing all the best practice rules
that apply to this Drone.

Definition at line 124 of file droneinfo.py.

def cma.droneinfo.Drone.get_active_nic_count (   self)
Return the number of "active" NICs this Drone has

Definition at line 214 of file droneinfo.py.

References cma.droneinfo.Drone._active_nic_count, and cma.droneinfo.Drone.get_owned_nics().

Here is the call graph for this function:

def cma.droneinfo.Drone.get_bp_head_rule_for (   self,
  trigger_discovery_type 
)
Return the head of the ruleset chain for the particular set of rules
that go with this particular node

Definition at line 130 of file droneinfo.py.

Referenced by cma.droneinfo.Drone.get_merged_bp_rules().

Here is the caller graph for this function:

def cma.droneinfo.Drone.get_merged_bp_rules (   self,
  trigger_discovery_type 
)
Return a merged version of the best practices rules for this
particular discovery type.  This involves creating a hash table
of rules, where the contents are merged together such that we return
a single consolidated view of the rules to our viewer.
We start out with the head of the ruleset chain and then merge in the
ones its based on.

We return a dict-like object reflecting this merger suitable
for evaluating the rules. You just walk the set of rules
and evaluate them.

Definition at line 141 of file droneinfo.py.

References cma.droneinfo.Drone.get_bp_head_rule_for().

Here is the call graph for this function:

def cma.droneinfo.Drone.get_owned_ips (   self)
Return a list of all the IP addresses that this Drone owns

Definition at line 200 of file droneinfo.py.

def cma.droneinfo.Drone.get_owned_nics (   self)
Return an iterator returning all the NICs that this Drone owns

Definition at line 210 of file droneinfo.py.

Referenced by cma.droneinfo.Drone.get_active_nic_count().

Here is the caller graph for this function:

def cma.droneinfo.Drone.select_ip (   self,
  ring = None 
)
Select an appropriate IP address for talking to a partner on this ring
or our primary IP if ring is None

Definition at line 237 of file droneinfo.py.

References cma.droneinfo.Drone.primary_ip_addr.

Referenced by cma.droneinfo.Drone.destaddr(), cma.droneinfo.Drone.send_frames(), cma.droneinfo.Drone.start_heartbeat(), and cma.droneinfo.Drone.stop_heartbeat().

Here is the caller graph for this function:

def cma.droneinfo.Drone.send_frames (   self,
  framesettype,
  frames 
)

Definition at line 249 of file droneinfo.py.

References cma.droneinfo.Drone.port, cma.AssimCclasses.pyIpPortFrame.port, cma.droneinfo.Drone.select_ip(), and obsolete_cma.DroneInfo.select_ip().

Referenced by cma.systemnode.SystemNode.request_discovery().

Here is the call graph for this function:

Here is the caller graph for this function:

def cma.droneinfo.Drone.send_hbmsg (   self,
  dest,
  fstype,
  addrlist 
)
Send a message with an attached pyNetAddr list - each including port numbers'
   This is intended primarily for start or stop heartbeating messages.

Definition at line 266 of file droneinfo.py.

References cma.systemnode.SystemNode.designation, cma.tests.store_test.aTestSystem.designation, and obsolete_cma.DroneInfo.designation.

Referenced by cma.droneinfo.Drone.start_heartbeat(), and cma.droneinfo.Drone.stop_heartbeat().

Here is the caller graph for this function:

def cma.droneinfo.Drone.set_crypto_identity (   self,
  keyid = None 
)

Definition at line 357 of file droneinfo.py.

References cma.droneinfo.Drone.crypto_identity(), cma.droneinfo.Drone.destaddr(), and cma.droneinfo.Drone.key_id.

Here is the call graph for this function:

def cma.droneinfo.Drone.start_heartbeat (   self,
  ring,
  partner1,
  partner2 = None 
)
Start heartbeating to the given partners.
We insert ourselves between partner1 and partner2.
We only use forward links - because we can follow them in both directions in Neo4J.
So, we need to create a forward link from partner1 to us and from us to partner2 (if any)

Definition at line 323 of file droneinfo.py.

References cma.droneinfo.Drone.port, cma.AssimCclasses.pyIpPortFrame.port, cma.droneinfo.Drone.select_ip(), obsolete_cma.DroneInfo.select_ip(), cma.droneinfo.Drone.send_hbmsg(), and obsolete_cma.DroneInfo.send_hbmsg().

Here is the call graph for this function:

def cma.droneinfo.Drone.stop_heartbeat (   self,
  ring,
  partner1,
  partner2 = None 
)
Stop heartbeating to the given partners.'
We don't know which node is our forward link and which our back link,
but we need to remove them either way ;-).

Definition at line 340 of file droneinfo.py.

References cma.droneinfo.Drone.port, cma.AssimCclasses.pyIpPortFrame.port, cma.droneinfo.Drone.select_ip(), obsolete_cma.DroneInfo.select_ip(), cma.droneinfo.Drone.send_hbmsg(), and obsolete_cma.DroneInfo.send_hbmsg().

Here is the call graph for this function:

Field Documentation

cma.droneinfo.Drone.IPownerquery_1 = None
static

Definition at line 52 of file droneinfo.py.

string cma.droneinfo.Drone.IPownerquery_1_txt
static
Initial value:
1 = '''START n=node:IPaddrNode({ipaddr})
2  MATCH (n)<-[:%s]-()<-[:%s]-(drone)
3  return drone LIMIT 1'''

Definition at line 54 of file droneinfo.py.

cma.droneinfo.Drone.key_id

Definition at line 96 of file droneinfo.py.

Referenced by cma.droneinfo.Drone.set_crypto_identity().

cma.droneinfo.Drone.lastjoin

Definition at line 92 of file droneinfo.py.

cma.droneinfo.Drone.monitors_activated

Definition at line 296 of file droneinfo.py.

cma.droneinfo.Drone.OwnedIPsQuery = None
static

Definition at line 53 of file droneinfo.py.

string cma.droneinfo.Drone.OwnedIPsQuery_txt
static
Initial value:
1 = '''START d=node({droneid})
2  MATCH (d)-[:%s]->()-[:%s]->(ip)
3  return ip'''

Definition at line 57 of file droneinfo.py.

cma.droneinfo.Drone.primary_ip_addr

Definition at line 98 of file droneinfo.py.

Referenced by cma.droneinfo.Drone.select_ip().

cma.droneinfo.Drone.reason
cma.droneinfo.Drone.startaddr

Definition at line 97 of file droneinfo.py.

cma.droneinfo.Drone.time_status_iso8601

Definition at line 100 of file droneinfo.py.

cma.droneinfo.Drone.time_status_ms

Definition at line 99 of file droneinfo.py.


The documentation for this class was generated from the following file: