@webob.dec.wsgify
def delete_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)
 try:
  resource_provider.delete_inventory(resource_class)
 except (exception.ConcurrentUpdateDetected, exception.InventoryInUse) as exc:
  raise webob.exc.HTTPConflict((_('Unable to delete inventory of class %(class)s: %(error)s') % {'class': resource_class, 'error': exc}), json_formatter=util.json_error_formatter)
 except exception.NotFound as exc:
  raise webob.exc.HTTPNotFound((_('No inventory of class %(class)s found for delete: %(error)s') % {'class': resource_class, 'error': exc}), json_formatter=util.json_error_formatter)
 response = req.response
 response.status = 204
 response.content_type = None
 return response

@ webob . dec . wsgify def delete_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 ) try : resource_provider . delete_inventory ( resource_class ) except ( exception . ConcurrentUpdateDetected , exception . InventoryInUse ) as exc : raise webob . exc . HTTPConflict ( ( _ ( 'Unable to delete inventory of class %(class)s: %(error)s' ) % { 'class' : resource_class , 'error' : exc } ) , json_formatter = util . json_error_formatter ) except exception . NotFound as exc : raise webob . exc . HTTPNotFound ( ( _ ( 'No inventory of class %(class)s found for delete: %(error)s' ) % { 'class' : resource_class , 'error' : exc } ) , json_formatter = util . json_error_formatter ) response = req . response response . status = 204 response . content_type = None return response
delete to destroy a single inventory .