@webob.dec.wsgify
@microversion.version_handler(1.2)
def delete_resource_class(req):
 name = util.wsgi_path_item(req.environ, 'name')
 context = req.environ['placement.context']
 rc = objects.ResourceClass.get_by_name(context, name)
 try:
  rc.destroy()
 except exception.ResourceClassCannotDeleteStandard as exc:
  raise webob.exc.HTTPBadRequest((_('Cannot delete standard resource class %(rp_name)s: %(error)s') % {'rp_name': name, 'error': exc}), json_formatter=util.json_error_formatter)
 except exception.ResourceClassInUse as exc:
  raise webob.exc.HTTPConflict((_('Unable to delete resource class %(rp_name)s: %(error)s') % {'rp_name': name, 'error': exc}), json_formatter=util.json_error_formatter)
 req.response.status = 204
 req.response.content_type = None
 return req.response

@ webob . dec . wsgify @ microversion . version_handler ( 1.2 ) def delete_resource_class ( req ) : name = util . wsgi_path_item ( req . environ , 'name' ) context = req . environ [ 'placement.context' ] rc = objects . ResourceClass . get_by_name ( context , name ) try : rc . destroy ( ) except exception . ResourceClassCannotDeleteStandard as exc : raise webob . exc . HTTPBadRequest ( ( _ ( 'Cannot delete standard resource class %(rp_name)s: %(error)s' ) % { 'rp_name' : name , 'error' : exc } ) , json_formatter = util . json_error_formatter ) except exception . ResourceClassInUse as exc : raise webob . exc . HTTPConflict ( ( _ ( 'Unable to delete resource class %(rp_name)s: %(error)s' ) % { 'rp_name' : name , 'error' : exc } ) , json_formatter = util . json_error_formatter ) req . response . status = 204 req . response . content_type = None return req . response
delete to destroy a single resource class .