def list_containers(
    api,
    url,
    marker=None,
    limit=None,
    end_marker=None,
    prefix=None,
    full_listing=False,
):
    """Get containers in an account

    :param api: a restapi object
    :param url: endpoint
    :param marker: marker query
    :param limit: limit query
    :param end_marker: end_marker query
    :param prefix: prefix query
    :param full_listing: if True, return a full listing, else returns a max
                         of 10000 listings
    :returns: list of containers
    """

    if full_listing:
        data = listing = list_containers(
            api,
            url,
            marker,
            limit,
            end_marker,
            prefix,
        )
        while listing:
            marker = listing[-1]['name']
            listing = list_containers(
                api,
                url,
                marker,
                limit,
                end_marker,
                prefix,
            )
            if listing:
                data.extend(listing)
        return data

    object_url = url
    query = "format=json"
    if marker:
        query += '&marker=%s' % marker
    if limit:
        query += '&limit=%d' % limit
    if end_marker:
        query += '&end_marker=%s' % end_marker
    if prefix:
        query += '&prefix=%s' % prefix
    url = "%s?%s" % (object_url, query)
    response = api.request('GET', url)
    return response.json()