diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2011-02-18 16:42:26 -0600 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2011-02-18 16:42:26 -0600 |
| commit | e369f2842446876505ce528c5bb56a3d41215f8f (patch) | |
| tree | c9164c821bdcc8fc29b6937fb2a351cab0bbd9a1 /nova/api | |
| parent | fa29dc0433384d5aa47f5ac069a8dc650e23ccae (diff) | |
| download | nova-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__.py | 1 | ||||
| -rw-r--r-- | nova/api/openstack/servers.py | 14 |
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'] |
