Returns the API version derived from endpoint's response.

    CLI Example:

    .. code-block:: bash

        salt '*' keystone.api_version

def api_version(profile=None, **connection_args):
    '''
    Returns the API version derived from endpoint's response.

    CLI Example:

    .. code-block:: bash

        salt '*' keystone.api_version
    '''
    kwargs = _get_kwargs(profile=profile, **connection_args)
    auth_url = kwargs.get('auth_url', kwargs.get('endpoint', None))
    try:
        return salt.utils.http.query(auth_url, decode=True, decode_type='json',
                                     verify_ssl=False)['dict']['version']['id']
    except KeyError:
        return None