diff options
| author | Josh Kearney <josh@jk0.org> | 2011-06-24 15:03:01 -0500 |
|---|---|---|
| committer | Josh Kearney <josh@jk0.org> | 2011-06-24 15:03:01 -0500 |
| commit | 594d5c7a98f2b4e6ea2d866f10c67cbdaa88ce0c (patch) | |
| tree | 75db0f8b25fe08ea6a037cdd8c4f03b8d0abb01a /nova/api | |
| parent | 1d3960e3b76e3f75c68f919278a2a227e1f96e48 (diff) | |
Refactored backup rotate.
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/images.py | 20 |
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)) |
