Skip to content

Commit

Permalink
Revert "Include list of attached volumes with instance info"
Browse files Browse the repository at this point in the history
This reverts commit dd66f23.

This changed the core servers API without doing it as an API extension,
so it's not an acceptable change as written.

Change-Id: I3787060583de1371e366647d38d69f37746317d5
  • Loading branch information
russellb committed May 16, 2013
1 parent 1e9937e commit 56f5172
Show file tree
Hide file tree
Showing 69 changed files with 52 additions and 329 deletions.
3 changes: 1 addition & 2 deletions doc/api_samples/OS-DCF/list-servers-detail-get.json
Expand Up @@ -51,8 +51,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-02T02:11:56Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
]
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-DCF/server-action-rebuild-resp.json
Expand Up @@ -51,7 +51,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-02T02:11:56Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-DCF/server-get-resp.json
Expand Up @@ -50,7 +50,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-02T02:11:55Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-DCF/server-update-put-resp.json
Expand Up @@ -50,7 +50,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-02T02:11:58Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-AZ/server-get-resp.json
Expand Up @@ -50,7 +50,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-01-30T13:38:49Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-AZ/servers-detail-resp.json
Expand Up @@ -51,8 +51,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-01-30T13:26:52Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
]
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-IPS-MAC/server-get-resp.json
Expand Up @@ -50,7 +50,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-07T18:46:29Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-IPS-MAC/servers-detail-resp.json
Expand Up @@ -51,8 +51,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-07T18:40:59Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
]
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-IPS/server-get-resp.json
Expand Up @@ -50,7 +50,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-07T18:46:29Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-IPS/servers-detail-resp.json
Expand Up @@ -51,8 +51,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-07T18:40:59Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
]
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-SRV-ATTR/server-get-resp.json
Expand Up @@ -52,7 +52,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-11-15T19:27:04Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-SRV-ATTR/servers-detail-resp.json
Expand Up @@ -53,8 +53,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-11-15T19:27:05Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
]
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-STS/server-get-resp.json
Expand Up @@ -52,7 +52,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-07T19:35:10Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/OS-EXT-STS/servers-detail-resp.json
Expand Up @@ -53,8 +53,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-05T07:34:10Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
]
}
Expand Up @@ -51,7 +51,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-09-25T13:36:09Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
6 changes: 1 addition & 5 deletions doc/api_samples/all_extensions/server-get-resp.json
Expand Up @@ -66,10 +66,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-07T18:58:57Z",
"user_id": "fake",
"volumes_attached": [
{"id": "volume_id1"},
{"id": "volume_id2"}
]
"user_id": "fake"
}
}
2 changes: 0 additions & 2 deletions doc/api_samples/all_extensions/server-get-resp.xml
Expand Up @@ -15,8 +15,6 @@
OS-EXT-IPS-MAC:mac_addr="00:0c:29:e1:42:90"/>
</network>
</addresses>
<volume_attached id="volume_id1"/>
<volume_attached id="volume_id2"/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/6be39927-53b2-4aee-8593-1c72b3673168" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/6be39927-53b2-4aee-8593-1c72b3673168" rel="bookmark"/>
<security_groups>
Expand Down
6 changes: 1 addition & 5 deletions doc/api_samples/all_extensions/servers-details-resp.json
Expand Up @@ -67,11 +67,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-07T18:58:57Z",
"user_id": "fake",
"volumes_attached": [
{"id": "volume_id1"},
{"id": "volume_id2"}
]
"user_id": "fake"
}
]
}
2 changes: 0 additions & 2 deletions doc/api_samples/all_extensions/servers-details-resp.xml
Expand Up @@ -15,8 +15,6 @@
<ip OS-EXT-IPS:type="fixed" version="4" addr="192.168.0.3" OS-EXT-IPS-MAC:mac_addr="00:0c:29:e1:42:90"/>
</network>
</addresses>
<volume_attached id="volume_id1"/>
<volume_attached id="volume_id2"/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/b45edf9d-30f6-41e8-a00b-ef8962376586" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/b45edf9d-30f6-41e8-a00b-ef8962376586" rel="bookmark"/>
<security_groups>
Expand Down
Expand Up @@ -50,7 +50,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-04T13:17:51Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
Expand Up @@ -51,8 +51,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-02-04T13:21:44Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
]
}
Expand Up @@ -49,10 +49,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-19T20:32:42Z",
"user_id": "fake",
"volumes_attached": [
{"id": "volume_id1"},
{"id": "volume_id2"}
]
"user_id": "fake"
}
}
2 changes: 0 additions & 2 deletions doc/api_samples/os-hide-server-addresses/server-get-resp.xml
Expand Up @@ -14,8 +14,6 @@
<ip version="4" addr="192.168.0.3"/>
</network>
</addresses>
<volume_attached id="volume_id1"/>
<volume_attached id="volume_id2"/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/b8b02dd4-b2bb-441d-b52a-ee5c89c832d2" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/b8b02dd4-b2bb-441d-b52a-ee5c89c832d2" rel="bookmark"/>
</server>
Expand Up @@ -50,11 +50,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-12-19T20:32:39Z",
"user_id": "fake",
"volumes_attached": [
{"id": "volume_id1"},
{"id": "volume_id2"}
]
"user_id": "fake"
}
]
}
Expand Up @@ -15,8 +15,6 @@
<ip version="4" addr="192.168.0.3"/>
</network>
</addresses>
<volume_attached id="volume_id1"/>
<volume_attached id="volume_id2"/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/55db7849-8ec4-46dd-8897-492d82282f29" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/55db7849-8ec4-46dd-8897-492d82282f29" rel="bookmark"/>
</server>
Expand Down
3 changes: 1 addition & 2 deletions doc/api_samples/os-rescue/server-get-resp-rescue.json
Expand Up @@ -48,7 +48,6 @@
"status": "RESCUE",
"tenant_id": "openstack",
"updated": "2012-09-19T09:22:27Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/os-rescue/server-get-resp-unrescue.json
Expand Up @@ -49,7 +49,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-09-19T09:22:28Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
3 changes: 1 addition & 2 deletions doc/api_samples/server-action-rebuild-resp.json
Expand Up @@ -50,7 +50,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-09-12T17:20:37Z",
"user_id": "fake",
"volumes_attached": []
"user_id": "fake"
}
}
6 changes: 1 addition & 5 deletions doc/api_samples/server-get-resp.json
Expand Up @@ -49,10 +49,6 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-08-20T21:11:09Z",
"user_id": "fake",
"volumes_attached": [
{"id": "volume_id1"},
{"id": "volume_id2"}
]
"user_id": "fake"
}
}
2 changes: 0 additions & 2 deletions doc/api_samples/server-get-resp.xml
Expand Up @@ -14,8 +14,6 @@
<ip version="4" addr="192.168.0.3"/>
</network>
</addresses>
<volume_attached id="volume_id1"/>
<volume_attached id="volume_id2"/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/3f9f7d18-aaf3-4703-b368-ea9b4d609c95" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/3f9f7d18-aaf3-4703-b368-ea9b4d609c95" rel="bookmark"/>
</server>
6 changes: 1 addition & 5 deletions doc/api_samples/servers-details-resp.json
Expand Up @@ -50,11 +50,7 @@
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2012-09-07T16:56:37Z",
"user_id": "fake",
"volumes_attached": [
{"id": "volume_id1"},
{"id": "volume_id2"}
]
"user_id": "fake"
}
]
}
2 changes: 0 additions & 2 deletions doc/api_samples/servers-details-resp.xml
Expand Up @@ -15,8 +15,6 @@
<ip version="4" addr="192.168.0.3"/>
</network>
</addresses>
<volume_attached id="volume_id1"/>
<volume_attached id="volume_id2"/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/7c3c0f79-343e-4b99-93bc-2ade47641e64" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/7c3c0f79-343e-4b99-93bc-2ade47641e64" rel="bookmark"/>
</server>
Expand Down
14 changes: 0 additions & 14 deletions nova/api/openstack/compute/servers.py
Expand Up @@ -98,11 +98,6 @@ def make_server(elem, detailed=False):
# Attach addresses node
elem.append(ips.AddressesTemplate())

# Attach volumes_attached node
volumes = xmlutil.SubTemplateElement(elem, 'volume_attached',
selector='volumes_attached')
volumes.set('id')

xmlutil.make_links(elem, 'links')


Expand Down Expand Up @@ -500,13 +495,6 @@ def _add_instance_faults(self, ctxt, instances):

return instances

def _add_instance_volumes(self, context, instances):
for instance in instances:
bdms = self.compute_api.get_instance_bdms(context, instance)
volumes = [bdm['volume_id'] for bdm in bdms if bdm['volume_id']]
if volumes:
instance['volumes_attached'] = volumes

def _get_servers(self, req, is_detail):
"""Returns a list of servers, based on any search options specified."""

Expand Down Expand Up @@ -574,7 +562,6 @@ def _get_servers(self, req, is_detail):

if is_detail:
self._add_instance_faults(context, instance_list)
self._add_instance_volumes(context, instance_list)
response = self._view_builder.detail(req, instance_list)
else:
response = self._view_builder.index(req, instance_list)
Expand Down Expand Up @@ -751,7 +738,6 @@ def show(self, req, id):
instance = self.compute_api.get(context, id)
req.cache_db_instance(instance)
self._add_instance_faults(context, [instance])
self._add_instance_volumes(context, [instance])
return self._view_builder.show(req, instance)
except exception.NotFound:
msg = _("Instance could not be found")
Expand Down
2 changes: 0 additions & 2 deletions nova/api/openstack/compute/views/servers.py
Expand Up @@ -108,8 +108,6 @@ def show(self, request, instance):
"links": self._get_links(request,
instance["uuid"],
self._collection_name),
"volumes_attached": [{'id': vol_id} for vol_id in
instance.get("volumes_attached", [])],
},
}
_inst_fault = self._get_fault(request, instance)
Expand Down

0 comments on commit 56f5172

Please sign in to comment.