.. versionadded:: 2016.3.0

    Makes a best effort to watch for a key or tree change in etcd.
    Returns a dict containing the new key value ( or None if the key was
    deleted ), the modifiedIndex of the key, whether the key changed or
    not, the path to the key that changed and whether it is a directory or not.

    If something catastrophic happens, returns {}

    CLI Example:

    .. code-block:: bash

        salt myminion etcd.watch /path/to/key
        salt myminion etcd.watch /path/to/key timeout=10
        salt myminion etcd.watch /patch/to/key profile=my_etcd_config index=10
        salt myminion etcd.watch /patch/to/key host=127.0.0.1 port=2379

def watch(key, recurse=False, profile=None, timeout=0, index=None, **kwargs):
    '''
    .. versionadded:: 2016.3.0

    Makes a best effort to watch for a key or tree change in etcd.
    Returns a dict containing the new key value ( or None if the key was
    deleted ), the modifiedIndex of the key, whether the key changed or
    not, the path to the key that changed and whether it is a directory or not.

    If something catastrophic happens, returns {}

    CLI Example:

    .. code-block:: bash

        salt myminion etcd.watch /path/to/key
        salt myminion etcd.watch /path/to/key timeout=10
        salt myminion etcd.watch /patch/to/key profile=my_etcd_config index=10
        salt myminion etcd.watch /patch/to/key host=127.0.0.1 port=2379
    '''

    client = __utils__['etcd_util.get_conn'](__opts__, profile, **kwargs)
    return client.watch(key, recurse=recurse, timeout=timeout, index=index)