'Return an iterable of api_models.Meter instances
:param user: Optional ID for user that owns the resource.
:param project: Optional ID for project that owns the resource.
:param resource: Optional ID of the resource.
:param source: Optional source filter.
:param metaquery: Optional dict with metadata to match on.
:param limit: Maximum number of results to return.
:param unique: If set to true, return only unique meter information.'

def get_meters(self, user=None, project=None, resource=None, source=None, metaquery=None, limit=None, unique=False):

    if (limit == 0):
        return
    s_filter = storage.SampleFilter(user=user, project=project, source=source, metaquery=metaquery, resource=resource)
    session = self._engine_facade.get_session()
    subq = session.query(func.max(models.Sample.id).label('id')).join(models.Resource, (models.Resource.internal_id == models.Sample.resource_id))
    if unique:
        subq = subq.group_by(models.Sample.meter_id)
    else:
        subq = subq.group_by(models.Sample.meter_id, models.Resource.resource_id)
    if resource:
        subq = subq.filter((models.Resource.resource_id == resource))
    subq = subq.subquery()
    query_sample = session.query(models.Sample.meter_id, models.Meter.name, models.Meter.type, models.Meter.unit, models.Resource.resource_id, models.Resource.project_id, models.Resource.source_id, models.Resource.user_id).join(subq, (subq.c.id == models.Sample.id)).join(models.Meter, (models.Meter.id == models.Sample.meter_id)).join(models.Resource, (models.Resource.internal_id == models.Sample.resource_id))
    query_sample = make_query_from_filter(session, query_sample, s_filter, require_meter=False)
    query_sample = (query_sample.limit(limit) if limit else query_sample)
    if unique:
        for row in query_sample.all():
            (yield api_models.Meter(name=row.name, type=row.type, unit=row.unit, resource_id=None, project_id=None, source=None, user_id=None))
    else:
        for row in query_sample.all():
            (yield api_models.Meter(name=row.name, type=row.type, unit=row.unit, resource_id=row.resource_id, project_id=row.project_id, source=row.source_id, user_id=row.user_id))
