summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorTrey Morris <trey.morris@rackspace.com>2011-02-24 23:35:21 +0000
committerTarmac <>2011-02-24 23:35:21 +0000
commitc59109e32678535320a39599cce50fec65689082 (patch)
treebe72b6a8b2a34b79d83f794275ca7c4081fb1f34 /nova/api
parent0d6c226afa8085753b85e9b6ab94f239a2549d2d (diff)
parentf4221346418ef103635b104fc152a2507d60a8dc (diff)
downloadnova-c59109e32678535320a39599cce50fec65689082.tar.gz
nova-c59109e32678535320a39599cce50fec65689082.tar.xz
nova-c59109e32678535320a39599cce50fec65689082.zip
adds live network injection/reconfiguration. Some refactoring.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/__init__.py1
-rw-r--r--nova/api/openstack/servers.py14
2 files changed, 15 insertions, 0 deletions
diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py
index d0b18eced..b1b38ed2d 100644
--- a/nova/api/openstack/__init__.py
+++ b/nova/api/openstack/__init__.py
@@ -81,6 +81,7 @@ class APIRouter(wsgi.Router):
server_members['suspend'] = 'POST'
server_members['resume'] = 'POST'
server_members['reset_network'] = 'POST'
+ server_members['inject_network_info'] = 'POST'
mapper.resource("zone", "zones", controller=zones.Controller(),
collection={'detail': 'GET'})
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 841bab6d0..73c7bfe17 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -292,6 +292,20 @@ class Controller(wsgi.Controller):
return faults.Fault(exc.HTTPUnprocessableEntity())
return exc.HTTPAccepted()
+ def inject_network_info(self, req, id):
+ """
+ Inject network info for an instance (admin only).
+
+ """
+ context = req.environ['nova.context']
+ try:
+ self.compute_api.inject_network_info(context, id)
+ except:
+ readable = traceback.format_exc()
+ LOG.exception(_("Compute.api::inject_network_info %s"), readable)
+ return faults.Fault(exc.HTTPUnprocessableEntity())
+ return exc.HTTPAccepted()
+
def pause(self, req, id):
""" Permit Admins to Pause the server. """
ctxt = req.environ['nova.context']