From baec89a1b09fc68d4028c4ff77431b1da17822ae Mon Sep 17 00:00:00 2001 From: saurabh Date: Fri, 20 Sep 2013 15:36:09 +0530 Subject: [PATCH] Added mapper for update_all on snapshot_metadata Snapshot metadata controller have action 'update_all' but API for this not exposed for both v1 & v2 Change-Id: I4dcd8878a4ed75bd44494fd175bb66df67e54ebc Closes-Bug: #1228066 --- cinder/api/v1/router.py | 10 ++++++++-- cinder/api/v2/router.py | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cinder/api/v1/router.py b/cinder/api/v1/router.py index bb361412c..bdb0755d7 100644 --- a/cinder/api/v1/router.py +++ b/cinder/api/v1/router.py @@ -74,7 +74,13 @@ class APIRouter(cinder.api.openstack.APIRouter): mapper.resource("snapshot_metadata", "metadata", controller=snapshot_metadata_controller, parent_resource=dict(member_name='snapshot', - collection_name='snapshots')) + collection_name='snapshots')) + + mapper.connect("metadata", + "/{project_id}/snapshots/{snapshot_id}/metadata", + controller=snapshot_metadata_controller, + action='update_all', + conditions={"method": ['PUT']}) self.resources['limits'] = limits.create_resource() mapper.resource("limit", "limits", @@ -86,7 +92,7 @@ class APIRouter(cinder.api.openstack.APIRouter): mapper.resource("volume_metadata", "metadata", controller=volume_metadata_controller, parent_resource=dict(member_name='volume', - collection_name='volumes')) + collection_name='volumes')) mapper.connect("metadata", "/{project_id}/volumes/{volume_id}/metadata", diff --git a/cinder/api/v2/router.py b/cinder/api/v2/router.py index 34eb81933..bbfe4c454 100644 --- a/cinder/api/v2/router.py +++ b/cinder/api/v2/router.py @@ -79,6 +79,13 @@ class APIRouter(cinder.api.openstack.APIRouter): controller=snapshot_metadata_controller, parent_resource=dict(member_name='snapshot', collection_name='snapshots')) + + mapper.connect("metadata", + "/{project_id}/snapshots/{snapshot_id}/metadata", + controller=snapshot_metadata_controller, + action='update_all', + conditions={"method": ['PUT']}) + self.resources['volume_metadata'] = \ volume_metadata.create_resource() volume_metadata_controller = self.resources['volume_metadata'] -- 2.45.2