def get_max_allowed_size(es, percentage_threshold):
    """
    Returns a integer which is calculated as maximal allowed size. We think of <percentage_value_input> as 100% of our total available storage limit.
    """
    i = 0
    data = es.cluster.client.cat.allocation(h="disk.total", bytes="b")
    for node in data.splitlines():
        i = i + int(node)

    max_allowed_size = int( (percentage_threshold * i) / 100.0 )

    return max_allowed_size