@webob.dec.wsgify
@util.check_accept('application/json')
def get_inventories(req):
 context = req.environ['placement.context']
 uuid = util.wsgi_path_item(req.environ, 'uuid')
 try:
  resource_provider = objects.ResourceProvider.get_by_uuid(context, uuid)
 except exception.NotFound as exc:
  raise webob.exc.HTTPNotFound((_('No resource provider with uuid %(uuid)s found : %(error)s') % {'uuid': uuid, 'error': exc}), json_formatter=util.json_error_formatter)
 inventories = objects.InventoryList.get_all_by_resource_provider_uuid(context, resource_provider.uuid)
 return _send_inventories(req.response, resource_provider, inventories)

@ webob . dec . wsgify @ util . check_accept ( 'application/json' ) def get_inventories ( req ) : context = req . environ [ 'placement.context' ] uuid = util . wsgi_path_item ( req . environ , 'uuid' ) try : resource_provider = objects . ResourceProvider . get_by_uuid ( context , uuid ) except exception . NotFound as exc : raise webob . exc . HTTPNotFound ( ( _ ( 'No resource provider with uuid %(uuid)s found : %(error)s' ) % { 'uuid' : uuid , 'error' : exc } ) , json_formatter = util . json_error_formatter ) inventories = objects . InventoryList . get_all_by_resource_provider_uuid ( context , resource_provider . uuid ) return _send_inventories ( req . response , resource_provider , inventories )
get a list of inventories .