]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Added mapper for update_all on snapshot_metadata
authorsaurabh <saurabh.chordiya@nectechnologies.in>
Fri, 20 Sep 2013 10:06:09 +0000 (15:36 +0530)
committersaurabh <saurabh.chordiya@nectechnologies.in>
Fri, 20 Sep 2013 10:06:09 +0000 (15:36 +0530)
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
cinder/api/v2/router.py

index bb361412cdd6dda8606ff59badde3a18d9f5081a..bdb0755d776f29cbed4669fd63678bfd79490e8c 100644 (file)
@@ -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",
index 34eb81933f6004c76ae60d0f9644409e40dc13c9..bbfe4c454b6949e1d9583a2eeba8162951084280 100644 (file)
@@ -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']