@webob.dec.wsgify
@util.check_accept('application/json')
def get_inventory(req):
 context = req.environ['placement.context']
 uuid = util.wsgi_path_item(req.environ, 'uuid')
 resource_class = util.wsgi_path_item(req.environ, 'resource_class')
 resource_provider = objects.ResourceProvider.get_by_uuid(context, uuid)
 inventory = objects.InventoryList.get_all_by_resource_provider_uuid(context, resource_provider.uuid).find(resource_class)
 if (not inventory):
  raise webob.exc.HTTPNotFound((_('No inventory of class %(class)s for %(rp_uuid)s') % {'class': resource_class, 'rp_uuid': resource_provider.uuid}), json_formatter=util.json_error_formatter)
 return _send_inventory(req.response, resource_provider, inventory)

@ webob . dec . wsgify @ util . check_accept ( 'application/json' ) def get_inventory ( req ) : context = req . environ [ 'placement.context' ] uuid = util . wsgi_path_item ( req . environ , 'uuid' ) resource_class = util . wsgi_path_item ( req . environ , 'resource_class' ) resource_provider = objects . ResourceProvider . get_by_uuid ( context , uuid ) inventory = objects . InventoryList . get_all_by_resource_provider_uuid ( context , resource_provider . uuid ) . find ( resource_class ) if ( not inventory ) : raise webob . exc . HTTPNotFound ( ( _ ( 'No inventory of class %(class)s for %(rp_uuid)s' ) % { 'class' : resource_class , 'rp_uuid' : resource_provider . uuid } ) , json_formatter = util . json_error_formatter ) return _send_inventory ( req . response , resource_provider , inventory )
get one inventory .