grr/server/grr_response_server/databases/mysql_clients.py
def ReadClientStartupInfo(self, client_id, cursor=None):
    """Reads the latest client startup record for a single client."""
    query = (
        "SELECT startup_info, timestamp FROM clients, client_startup_history "
        "WHERE clients.last_startup_timestamp=client_startup_history.timestamp "
        "AND clients.client_id=client_startup_history.client_id "
        "AND clients.client_id=%s")
    cursor.execute(query, [mysql_utils.ClientIDToInt(client_id)])
    row = cursor.fetchone()
    if row is None:
      return None

    startup_info, timestamp = row
    res = rdf_client.StartupInfo.FromSerializedString(startup_info)
    res.timestamp = mysql_utils.MysqlToRDFDatetime(timestamp)
    return res
Reads the latest client startup record for a single client.
Reads the latest client startup record for a single client.
Reads the latest client startup record for a single client .
def ReadClientStartupInfo(self, client_id, cursor=None):
    query = (
        "SELECT startup_info, timestamp FROM clients, client_startup_history "
        "WHERE clients.last_startup_timestamp=client_startup_history.timestamp "
        "AND clients.client_id=client_startup_history.client_id "
        "AND clients.client_id=%s")
    cursor.execute(query, [mysql_utils.ClientIDToInt(client_id)])
    row = cursor.fetchone()
    if row is None:
      return None
    startup_info, timestamp = row
    res = rdf_client.StartupInfo.FromSerializedString(startup_info)
    res.timestamp = mysql_utils.MysqlToRDFDatetime(timestamp)
    return res
def ReadClientStartupInfo ( self , client_id , cursor = None ) : query = ( "SELECT startup_info, timestamp FROM clients, client_startup_history " "WHERE clients.last_startup_timestamp=client_startup_history.timestamp " "AND clients.client_id=client_startup_history.client_id " "AND clients.client_id=%s" ) cursor . execute ( query , [ mysql_utils . ClientIDToInt ( client_id ) ] ) row = cursor . fetchone ( ) if row is None : return None startup_info , timestamp = row res = rdf_client . StartupInfo . FromSerializedString ( startup_info ) res . timestamp = mysql_utils . MysqlToRDFDatetime ( timestamp ) return res
Reads the latest client startup record for a single client.
Reads the latest client startup record for a single client .
"""Reads the latest client startup record for a single client."""
self
client_id
cursor