try:
if stack_name_or_id in self.api.compute.stacks:
self.api.compute.delete_stack(stack_name_or_id)
- return Response('Deleted Stack: ' + stack_name_or_id, 204)
+ return Response("", 204,
+ mimetype='application/json')
for stack in self.api.compute.stacks.values():
if stack.stack_name == stack_name_or_id:
self.api.compute.delete_stack(stack.id)
- return Response('Deleted Stack: ' + stack_name_or_id, 204)
+ return Response("", 204,
+ mimetype='application/json')
except Exception as ex:
LOG.exception("Heat: Delete Stack exception")
self.api.compute.delete_network(network_id)
- return Response('Network ' + str(network_id) + ' deleted.\n', status=204, mimetype='application/json')
+ return Response('', status=204, mimetype='application/json')
except Exception as ex:
LOG.exception("Neutron: Delete network exception.")
return Response(ex.message, status=500, mimetype='application/json')
net.delete_subnet()
- return Response('Subnet ' + str(subnet_id) + ' deleted.\n',
- status=204, mimetype='application/json')
+ return Response('', status=204, mimetype='application/json')
return Response('Could not find subnet.', status=404, mimetype='application/json')
except Exception as ex:
# delete the port
self.api.compute.delete_port(port.id)
- return Response('Port ' + port_id + ' deleted.\n', status=204, mimetype='application/json')
+ return Response('', status=204, mimetype='application/json')
except Exception as ex:
LOG.exception("Neutron: Delete port exception.")
try:
self.api.compute.delete_port_pair(pair_id)
- return Response("Port pair %s deleted.\n" % pair_id, status=204, mimetype='application/json')
+ return Response("", status=204,
+ 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')
try:
self.api.compute.delete_port_pair_group(group_id)
- return Response("Port pair group %s deleted.\n" % group_id, status=204, mimetype='application/json')
+ return Response("", status=204,
+ 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')
try:
self.api.compute.delete_flow_classifier(flow_classifier_id)
- return Response("Port pair group %s deleted.\n" % flow_classifier_id, status=204,
+ return Response("", status=204,
mimetype='application/json')
except Exception as ex:
logging.exception("Neutron SFC: %s Exception." % str(self.__class__.__name__))
self.api.compute.delete_port_chain(chain_id)
try:
- return Response("Port chain %s deleted.\n" % chain_id, status=204, mimetype='application/json')
+ return Response("", status=204,
+ 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')
Does not really remove anything from the machine, just fakes an OK.
"""
LOG.debug("API CALL: %s GET" % str(self.__class__.__name__))
- return Response("{}", status=204, mimetype="application/json")
+ return Response("", status=204, mimetype="application/json")
class NovaListImages(Resource):
Does not really remove anything from the machine, just fakes an OK.
"""
LOG.debug("API CALL: %s GET" % str(self.__class__.__name__))
- return Response("{}", status=204, mimetype="application/json")
+ return Response("", status=204, mimetype="application/json")
class NovaShowServerDetails(Resource):
:type id: ``str``
:param serverid: The UUID of the server
:type serverid: ``str``
- :return: Returns 200 if everything is fine.
+ :return: Returns 204 if everything is fine.
:rtype: :class:`flask.response`
"""
- LOG.debug("API CALL: %s POST" % str(self.__class__.__name__))
+ LOG.debug("API CALL: %s DELETE" % str(self.__class__.__name__))
try:
server = self.api.compute.find_server_by_name_or_id(serverid)
if server is None:
self.api.compute.stop_compute(server)
- response = Response('Server deleted.', status=204, mimetype="application/json")
+ response = Response('', status=204, mimetype="application/json")
response.headers['Access-Control-Allow-Origin'] = '*'
return response