def _get_aggregates_by_provider(ctx, rp):
    """Returns a list of UUIDs of any aggregates for the supplied resource
    provider.
    """
    query = """
            MATCH (rp:RESOURCE_PROVIDER {uuid: '%s'})-[:ASSOCIATED]-> (agg)
            RETURN agg.uuid AS agg_uuid
    """ % rp.uuid
    result = ctx.tx.run(query).data()
    return [rec["agg_uuid"] for rec in result]