summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorTrey Morris <trey.morris@rackspace.com>2011-02-18 16:42:26 -0600
committerTrey Morris <trey.morris@rackspace.com>2011-02-18 16:42:26 -0600
commite369f2842446876505ce528c5bb56a3d41215f8f (patch)
treec9164c821bdcc8fc29b6937fb2a351cab0bbd9a1 /nova/api
parentfa29dc0433384d5aa47f5ac069a8dc650e23ccae (diff)
downloadnova-e369f2842446876505ce528c5bb56a3d41215f8f.tar.gz
nova-e369f2842446876505ce528c5bb56a3d41215f8f.tar.xz
nova-e369f2842446876505ce528c5bb56a3d41215f8f.zip
added admin api call for injecting network info, added api test for inject network info
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 dc3738d4a..cfa2da486 100644
--- a/nova/api/openstack/__init__.py
+++ b/nova/api/openstack/__init__.py
@@ -80,6 +80,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("server", "servers", controller=servers.Controller(),
collection={'detail': 'GET'},
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 33cc3bbde..55fdb765b 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -263,6 +263,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']