summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorAlex Meade <alex.meade@rackspace.com>2011-08-18 10:53:01 -0400
committerAlex Meade <alex.meade@rackspace.com>2011-08-18 10:53:01 -0400
commitaf333cc72e753a4a28d0deb20369076df7bf09e3 (patch)
tree1b8ab9526dd60fd96afb16415efe7a92bc472689 /nova/api
parenta4379a342798016a9dc40761561c996093945d87 (diff)
Added accessIPv4 and accessIPv6 to servers view builder
Updated compute api to handle accessIPv4 and 6
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/create_instance_helper.py2
-rw-r--r--nova/api/openstack/views/servers.py4
2 files changed, 6 insertions, 0 deletions
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index 5ba8afe97..332d5d9bb 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -157,6 +157,8 @@ class CreateInstanceHelper(object):
key_name=key_name,
key_data=key_data,
metadata=server_dict.get('metadata', {}),
+ access_ip_v4=server_dict.get('accessIPv4'),
+ access_ip_v6=server_dict.get('accessIPv6'),
injected_files=injected_files,
admin_password=password,
zone_blob=zone_blob,
diff --git a/nova/api/openstack/views/servers.py b/nova/api/openstack/views/servers.py
index edc328129..3b91c037a 100644
--- a/nova/api/openstack/views/servers.py
+++ b/nova/api/openstack/views/servers.py
@@ -182,6 +182,10 @@ class ViewBuilderV11(ViewBuilder):
def _build_extra(self, response, inst):
self._build_links(response, inst)
response['uuid'] = inst['uuid']
+ if inst.get('access_ip_v4'):
+ response['accessIPv4'] = inst['access_ip_v4']
+ if inst.get('access_ip_v6'):
+ response['accessIPv6'] = inst['access_ip_v6']
def _build_links(self, response, inst):
href = self.generate_href(inst["id"])