summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/images.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py
index 5f88ede96..c535e4e26 100644
--- a/nova/api/openstack/images.py
+++ b/nova/api/openstack/images.py
@@ -118,19 +118,25 @@ class Controller(object):
except KeyError:
raise webob.exc.HTTPBadRequest()
+ image_name = get_param("name")
+
if image_type == "snapshot":
- image_name = get_param("name")
- image = self._compute_service.snapshot(context, server_id,
- image_name)
- elif image_type in ("daily", "weekly"):
+ image = self._compute_service.snapshot(
+ context, server_id, image_name)
+ elif image_type == "backup":
+ # NOTE(sirp): Unlike snapshot, backup is not a customer facing
+ # API call; rather, it's used by the internal backup scheduler
if not FLAGS.allow_admin_api:
raise webob.exc.HTTPBadRequest()
+ backup_type = get_param("backup_type")
rotation = int(get_param("rotation"))
- image = self._compute_service.backup(context, server_id,
- image_type, rotation)
+
+ image = self._compute_service.backup(
+ context, server_id, image_name,
+ backup_type, rotation)
else:
- LOG.error(_("Invalid image_type '%s' passed" % image_type))
+ LOG.error(_("Invalid image_type '%s' passed") % image_type)
raise webob.exc.HTTPBadRequest()
return dict(image=self.get_builder(req).build(image, detail=True))