diff options
| author | William Wolf <throughnothing@gmail.com> | 2011-05-24 15:16:07 -0400 |
|---|---|---|
| committer | William Wolf <throughnothing@gmail.com> | 2011-05-24 15:16:07 -0400 |
| commit | f3d7ec3fd2b2b987ae1118a6ae96874e8bbfdac5 (patch) | |
| tree | 035f893ae68bf29c411940444713106f2e569606 | |
| parent | 884b6d3ed74c5a5f766e405ac2178066314fb6d3 (diff) | |
initial use of limited_by_marker
| -rw-r--r-- | nova/api/openstack/images.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py index 34d4c27fc..b06429943 100644 --- a/nova/api/openstack/images.py +++ b/nova/api/openstack/images.py @@ -153,3 +153,25 @@ class ControllerV11(Controller): def get_default_xmlns(self, req): return common.XML_NS_V11 + + def index(self, req): + """Return an index listing of images available to the request. + + :param req: `wsgi.Request` object + """ + context = req.environ['nova.context'] + images = self._image_service.index(context) + images = common.limited_by_marker(images, req) + builder = self.get_builder(req).build + return dict(images=[builder(image, detail=False) for image in images]) + + def detail(self, req): + """Return a detailed index listing of images available to the request. + + :param req: `wsgi.Request` object. + """ + context = req.environ['nova.context'] + images = self._image_service.detail(context) + images = common.limited_by_marker(images, req) + builder = self.get_builder(req).build + return dict(images=[builder(image, detail=True) for image in images]) |
