grr/server/grr_response_server/databases/mysql_flows.py
def WriteFlowObject(self, flow_obj, cursor=None):
    """Writes a flow object to the database."""

    query = ("INSERT INTO flows "
             "(client_id, flow_id, long_flow_id, parent_flow_id, flow, "
             "next_request_to_process, timestamp, last_update) VALUES "
             "(%s, %s, %s, %s, %s, %s, %s, %s) "
             "ON DUPLICATE KEY UPDATE "
             "flow=VALUES(flow), "
             "next_request_to_process=VALUES(next_request_to_process),"
             "last_update=VALUES(last_update)")

    if flow_obj.parent_flow_id:
      pfi = mysql_utils.FlowIDToInt(flow_obj.parent_flow_id)
    else:
      pfi = None

    timestamp_str = mysql_utils.RDFDatetimeToMysqlString(flow_obj.create_time)
    now_str = mysql_utils.RDFDatetimeToMysqlString(rdfvalue.RDFDatetime.Now())

    args = [
        mysql_utils.ClientIDToInt(flow_obj.client_id),
        mysql_utils.FlowIDToInt(flow_obj.flow_id), flow_obj.long_flow_id, pfi,
        flow_obj.SerializeToString(), flow_obj.next_request_to_process,
        timestamp_str, now_str
    ]
    try:
      cursor.execute(query, args)
    except MySQLdb.IntegrityError as e:
      raise db.UnknownClientError(flow_obj.client_id, cause=e)
Writes a flow object to the database.
Writes a flow object to the database.
Writes a flow object to the database .
def WriteFlowObject(self, flow_obj, cursor=None):
    query = ("INSERT INTO flows "
             "(client_id, flow_id, long_flow_id, parent_flow_id, flow, "
             "next_request_to_process, timestamp, last_update) VALUES "
             "(%s, %s, %s, %s, %s, %s, %s, %s) "
             "ON DUPLICATE KEY UPDATE "
             "flow=VALUES(flow), "
             "next_request_to_process=VALUES(next_request_to_process),"
             "last_update=VALUES(last_update)")
    if flow_obj.parent_flow_id:
      pfi = mysql_utils.FlowIDToInt(flow_obj.parent_flow_id)
    else:
      pfi = None
    timestamp_str = mysql_utils.RDFDatetimeToMysqlString(flow_obj.create_time)
    now_str = mysql_utils.RDFDatetimeToMysqlString(rdfvalue.RDFDatetime.Now())
    args = [
        mysql_utils.ClientIDToInt(flow_obj.client_id),
        mysql_utils.FlowIDToInt(flow_obj.flow_id), flow_obj.long_flow_id, pfi,
        flow_obj.SerializeToString(), flow_obj.next_request_to_process,
        timestamp_str, now_str
    ]
    try:
      cursor.execute(query, args)
    except MySQLdb.IntegrityError as e:
      raise db.UnknownClientError(flow_obj.client_id, cause=e)
def WriteFlowObject ( self , flow_obj , cursor = None ) : query = ( "INSERT INTO flows " "(client_id, flow_id, long_flow_id, parent_flow_id, flow, " "next_request_to_process, timestamp, last_update) VALUES " "(%s, %s, %s, %s, %s, %s, %s, %s) " "ON DUPLICATE KEY UPDATE " "flow=VALUES(flow), " "next_request_to_process=VALUES(next_request_to_process)," "last_update=VALUES(last_update)" ) if flow_obj . parent_flow_id : pfi = mysql_utils . FlowIDToInt ( flow_obj . parent_flow_id ) else : pfi = None timestamp_str = mysql_utils . RDFDatetimeToMysqlString ( flow_obj . create_time ) now_str = mysql_utils . RDFDatetimeToMysqlString ( rdfvalue . RDFDatetime . Now ( ) ) args = [ mysql_utils . ClientIDToInt ( flow_obj . client_id ) , mysql_utils . FlowIDToInt ( flow_obj . flow_id ) , flow_obj . long_flow_id , pfi , flow_obj . SerializeToString ( ) , flow_obj . next_request_to_process , timestamp_str , now_str ] try : cursor . execute ( query , args ) except MySQLdb . IntegrityError as e : raise db . UnknownClientError ( flow_obj . client_id , cause = e )
Writes a flow object to the database.
Writes a flow object to the database .
"""Writes a flow object to the database."""
self
flow_obj
cursor