.. versionadded:: 2017.7.0

    Return Elasticsearch information.

    CLI example::

        salt myminion elasticsearch.info
        salt myminion elasticsearch.info profile=elasticsearch-extra

def info(hosts=None, profile=None):
    '''
    .. versionadded:: 2017.7.0

    Return Elasticsearch information.

    CLI example::

        salt myminion elasticsearch.info
        salt myminion elasticsearch.info profile=elasticsearch-extra
    '''
    es = _get_instance(hosts, profile)

    try:
        return es.info()
    except elasticsearch.TransportError as e:
        raise CommandExecutionError("Cannot retrieve server information, server returned code {0} with message {1}".format(e.status_code, e.error))