code: def heartbeat(self, context, msg):
          
  
          args = jsonutils.loads(msg)
          when = args.get('when')
          agent = args.get('agent')
          # The configurations in here, only used once when creating entry
          # for an agent in DB for the first time.
          configurations = {'uplink': ''}
          LOG.debug('heartbeat received: %(time)s - %(agent)s', (
                    {'time': when, 'agent': agent}))
  
          if self.obj.neutron_event:
              self.obj.neutron_event.create_rpc_client(agent)
          # Other option is to add the event to the queue for processig it later.
  
          self.obj.update_agent_status(agent, when)
  
          # Update the agents database.
          agent_info = dict(timestamp=utils.utc_time(when), host=agent,
                            config=jsonutils.dumps(configurations))
          self.obj.update_agent_db(agent_info)
docs: Process heartbeat message from agents on compute nodes.