Gets all nodes in the cluster.

    @type bulk: bool
    @param bulk: whether to return all information about all instances

    @rtype: list of dict or str
    @return: if bulk is true, info about nodes in the cluster,
            else list of nodes in the cluster

def GetNodes(r, bulk=False):
    """
    Gets all nodes in the cluster.

    @type bulk: bool
    @param bulk: whether to return all information about all instances

    @rtype: list of dict or str
    @return: if bulk is true, info about nodes in the cluster,
            else list of nodes in the cluster
    """

    if bulk:
        return r.request("get", "/2/nodes", query={"bulk": 1})
    else:
        nodes = r.request("get", "/2/nodes")
        return r.applier(itemgetters("id"), nodes)