def put(self, flow_classifier_id):
logging.debug("API CALL: %s PUT" % str(self.__class__.__name__))
try:
request_dict = json.loads(request.data).get("flow_classifier")
flow_classifier = self.api.compute.find_flow_classifier_by_name_or_id(flow_classifier_id)
if "name" in request_dict:
flow_classifier.name = request_dict["name"]
if "description" in request_dict:
flow_classifier.description = request_dict["description"]
resp = {
"flow_classifier": flow_classifier.create_dict(self.api.compute)
}
return Response(json.dumps(resp), status=200, mimetype='application/json')
except Exception as ex:
logging.exception("Neutron SFC: %s Exception." % str(self.__class__.__name__))
return Response(ex.message, status=500, mimetype='application/json')
评论列表
文章目录