self.compute = compute
self.api.add_resource(NeutronListAPIVersions, "/")
- self.api.add_resource(Shutdown, "/shutdown")
self.api.add_resource(NeutronShowAPIv2Details, "/v2.0")
self.api.add_resource(NeutronListNetworks, "/v2.0/networks.json", "/v2.0/networks",
resource_class_kwargs={'api': self})
"/v2.0/sfc/port_chains/<chain_id>",
resource_class_kwargs={'api': self})
- def _start_flask(self):
- LOG.info("Starting %s endpoint @ http://%s:%d" % (__name__, self.ip, self.port))
- if self.app is not None:
- self.app.before_request(self.dump_playbook)
- self.app.run(self.ip, self.port, debug=True, use_reloader=False)
-
-
-class Shutdown(Resource):
- def get(self):
- LOG.debug(("%s is beeing shut down") % (__name__))
- func = request.environ.get('werkzeug.server.shutdown')
- if func is None:
- raise RuntimeError('Not running with the Werkzeug Server')
- func()
-
class NeutronListAPIVersions(Resource):
def get(self):
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.")