@webob.dec.wsgify
@util.check_accept('application/json')
def list_for_consumer(req):
 context = req.environ['placement.context']
 consumer_id = util.wsgi_path_item(req.environ, 'consumer_uuid')
 allocations = objects.AllocationList.get_all_by_consumer_id(context, consumer_id)
 allocations_json = jsonutils.dumps(_serialize_allocations_for_consumer(allocations))
 req.response.status = 200
 req.response.body = encodeutils.to_utf8(allocations_json)
 req.response.content_type = 'application/json'
 return req.response

@ webob . dec . wsgify @ util . check_accept ( 'application/json' ) def list_for_consumer ( req ) : context = req . environ [ 'placement.context' ] consumer_id = util . wsgi_path_item ( req . environ , 'consumer_uuid' ) allocations = objects . AllocationList . get_all_by_consumer_id ( context , consumer_id ) allocations_json = jsonutils . dumps ( _serialize_allocations_for_consumer ( allocations ) ) req . response . status = 200 req . response . body = encodeutils . to_utf8 ( allocations_json ) req . response . content_type = 'application/json' return req . response
list allocations associated with a consumer .