docs: def index_get(index, hosts=None, profile=None):
      '''
      Check for the existence of an index and if it exists, return it
  
      index
          Index name
  
      CLI example::
  
          salt myminion elasticsearch.index_get testindex
      '''
      es = _get_instance(hosts, profile)
  
      try:
          return es.indices.get(index=index)
      except elasticsearch.exceptions.NotFoundError:
          return None
      except elasticsearch.TransportError as e:
          raise CommandExecutionError("Cannot retrieve index {0}, server returned code {1} with message {2}".format(index, e.status_code, e.error))