Rotates a set of daily indices by updating a "-current" alias to point to
    a (newly-created) index for today. This should probably be called from a
    daily cronjob just after midnight.

def rotate(prefixes, hosts, **kwargs):
    """
    Rotates a set of daily indices by updating a "-current" alias to point to
    a (newly-created) index for today. This should probably be called from a
    daily cronjob just after midnight.
    """

    rotator = Rotator(pyes.ES(hosts), **kwargs)

    for prefix in prefixes:
        rotator.rotate(prefix)