Retrieve template definition of index or index/type

    name
        Index template name

    CLI example::

        salt myminion elasticsearch.index_template_get testindex_templ

def index_template_get(name, hosts=None, profile=None):
    '''
    Retrieve template definition of index or index/type

    name
        Index template name

    CLI example::

        salt myminion elasticsearch.index_template_get testindex_templ
    '''
    es = _get_instance(hosts, profile)

    try:
        return es.indices.get_template(name=name)
    except elasticsearch.exceptions.NotFoundError:
        return None
    except elasticsearch.TransportError as e:
        raise CommandExecutionError("Cannot retrieve template {0}, server returned code {1} with message {2}".format(name, e.status_code, e.error))