def on_get(self, req, resp, name):
"""
Handles GET requests for Cluster hosts.
: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 requested.
:type name: str
"""
try:
store_manager = cherrypy.engine.publish('get-store-manager')[0]
cluster = store_manager.get(Cluster.new(name=name))
except:
resp.status = falcon.HTTP_404
return
resp.body = json.dumps(cluster.hostset)
resp.status = falcon.HTTP_200
评论列表
文章目录