'Define query for retrieving Sample data.
:param body: Query rules for the samples to be returned.'

@wsme_pecan.wsexpose([samples.Sample], body=ComplexQuery)
def post(self, body):

    rbac.enforce('query_sample', pecan.request)
    sample_name_mapping = {'resource': 'resource_id', 'meter': 'counter_name', 'type': 'counter_type', 'unit': 'counter_unit', 'volume': 'counter_volume'}
    query = ValidatedComplexQuery(body, storage.models.Sample, sample_name_mapping, metadata_allowed=True)
    query.validate(visibility_field='project_id')
    conn = pecan.request.storage_conn
    return [samples.Sample.from_db_model(s) for s in conn.query_samples(query.filter_expr, query.orderby, query.limit)]
