def on_delete(self, req, resp, name):
"""
Handles the deletion of a Cluster.
:param req: Request instance that will be passed through.
:type req: falcon.Request
:param resp: Response instance that will be passed through.
:type resp: falcon.Response
:param name: The name of the Cluster being deleted.
:type name: str
"""
resp.body = '{}'
try:
store_manager = cherrypy.engine.publish('get-store-manager')[0]
store_manager.delete(Cluster.new(name=name))
resp.status = falcon.HTTP_200
self.logger.info(
'Deleted cluster {0} per request.'.format(name))
except:
self.logger.info(
'Deleting for non-existent cluster {0} requested.'.format(
name))
resp.status = falcon.HTTP_404
评论列表
文章目录