From 52fd1536a897a24ba07b5f4459edb15e581b7adc Mon Sep 17 00:00:00 2001 From: Lin Hua Cheng Date: Wed, 20 Jun 2012 19:37:19 +0000 Subject: Add instance_id in Usage API response. Fixes bug 1003093. Required to fix horizon bug 1003299. Add the instance_id in the server usage response. The value of the id is the UUID of the instance. Change-Id: I77e0f64db456b4c80a03fa922dd18146b94d1187 --- nova/api/openstack/compute/contrib/simple_tenant_usage.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/simple_tenant_usage.py b/nova/api/openstack/compute/contrib/simple_tenant_usage.py index 0179ea75b..7879cf381 100644 --- a/nova/api/openstack/compute/contrib/simple_tenant_usage.py +++ b/nova/api/openstack/compute/contrib/simple_tenant_usage.py @@ -44,9 +44,9 @@ def make_usage(elem): server_usages = xmlutil.SubTemplateElement(elem, 'server_usages') server_usage = xmlutil.SubTemplateElement(server_usages, 'server_usage', selector='server_usages') - for subelem_tag in ('name', 'hours', 'memory_mb', 'local_gb', 'vcpus', - 'tenant_id', 'flavor', 'started_at', 'ended_at', - 'state', 'uptime'): + for subelem_tag in ('instance_id', 'name', 'hours', 'memory_mb', + 'local_gb', 'vcpus', 'tenant_id', 'flavor', + 'started_at', 'ended_at', 'state', 'uptime'): subelem = xmlutil.SubTemplateElement(server_usage, subelem_tag) subelem.text = subelem_tag @@ -133,6 +133,7 @@ class SimpleTenantUsageController(object): flavor = flavors[flavor_type] + info['instance_id'] = instance['uuid'] info['name'] = instance['display_name'] info['memory_mb'] = flavor['memory_mb'] -- cgit