From: saurabh Date: Fri, 20 Sep 2013 10:06:09 +0000 (+0530) Subject: Added mapper for update_all on snapshot_metadata X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=baec89a1b09fc68d4028c4ff77431b1da17822ae;p=openstack-build%2Fcinder-build.git 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 --- 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']