'Report state from agent to server.
Returns - agent\'s status: AGENT_NEW, AGENT_REVIVED, AGENT_ALIVE'

@db_api.retry_if_session_inactive()
def report_state(self, context, **kwargs):

    time = kwargs['time']
    time = timeutils.parse_strtime(time)
    agent_state = kwargs['agent_state']['agent_state']
    self._check_clock_sync_on_agent_start(agent_state, time)
    if (self.START_TIME > time):
        time_agent = datetime.datetime.isoformat(time)
        time_server = datetime.datetime.isoformat(self.START_TIME)
        log_dict = {'agent_time': time_agent, 'server_time': time_server}
        LOG.debug("Stale    message    received    with    timestamp:    %(agent_time)s.    Skipping    processing    because    it's    older    than    the    server    start    timestamp:    %(server_time)s", log_dict)
        return
    if (not self.plugin):
        self.plugin = directory.get_plugin()
    (agent_status, agent_state) = self.plugin.create_or_update_agent(context, agent_state)
    self._update_local_agent_resource_versions(context, agent_state)
    return agent_status
