code: def reboot(name, call=None):
      '''
      Reboot a droplet in DigitalOcean.
  
      .. versionadded:: 2015.8.8
  
      name
          The name of the droplet to restart.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt-cloud -a reboot droplet_name
      '''
      if call != 'action':
          raise SaltCloudSystemExit(
              'The restart action must be called with -a or --action.'
          )
  
      data = show_instance(name, call='action')
      if data.get('status') == 'off':
          return {'success': True,
                  'action': 'stop',
                  'status': 'off',
                  'msg': 'Machine is already off.'}
  
      ret = query(droplet_id=data['id'],
                  command='actions',
                  args={'type': 'reboot'},
                  http_method='post')
  
      return {'success': True,
              'action': ret['action']['type'],
              'state': ret['action']['status']f reboot(name, call=None):
      '''
      Reboot a droplet in DigitalOcean.
  
      .. versionadded:: 2015.8.8
  
      name
          The name of the droplet to restart.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt-cloud -a reboot droplet_name
      '''
      if call != 'action':
          raise SaltCloudSystemExit(
              'The restart action must be called with -a or --action.'
          )
  
      data = show_instance(name, call='action')
      if data.get('status') == 'off':
          return {'success': True,
                  'action': 'stop',
                  'status': 'off',
                  'msg': 'Machine is already off.'}
  
      ret = query(droplet_id=data['id'],
                  command='actions',
                  args={'type': 'reboot'},
                  http_method='post')
  
      return {'success': True,
              'action': ret['action']['type'],
              'state': ret['action']['status']}
docs: Reboot a droplet in DigitalOcean.
  
      .. versionadded:: 2015.8.8
  
      name
          The name of the droplet to restart.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt-cloud -a reboot droplet_name