List cluster admins or database users.

    If a database is specified: it will return database users list.
    If a database is not specified: it will return cluster admins list.

    database
        The database to list the users from

    user
        The user to connect as

    password
        The password of the user

    host
        The host to connect to

    port
        The port to connect to

    CLI Example:

    .. code-block:: bash

        salt '*' influxdb08.user_list
        salt '*' influxdb08.user_list <database>
        salt '*' influxdb08.user_list <database> <user> <password> <host> <port>

def user_list(database=None, user=None, password=None, host=None, port=None):
    '''
    List cluster admins or database users.

    If a database is specified: it will return database users list.
    If a database is not specified: it will return cluster admins list.

    database
        The database to list the users from

    user
        The user to connect as

    password
        The password of the user

    host
        The host to connect to

    port
        The port to connect to

    CLI Example:

    .. code-block:: bash

        salt '*' influxdb08.user_list
        salt '*' influxdb08.user_list <database>
        salt '*' influxdb08.user_list <database> <user> <password> <host> <port>
    '''
    client = _client(user=user, password=password, host=host, port=port)

    if not database:
        return client.get_list_cluster_admins()

    client.switch_database(database)
    return client.get_list_users()