owsferraro commented on code in PR #12880:
URL: https://github.com/apache/cloudstack/pull/12880#discussion_r2987184629


##########
plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/client/ScaleIOGatewayClientImpl.java:
##########
@@ -621,15 +624,27 @@ public boolean revertSnapshot(final String 
sourceSnapshotVolumeId, final String
             throw new CloudRuntimeException("Unable to revert, source snapshot 
volume and destination volume doesn't belong to same volume tree");
         }
 
+        String requestBody = 
buildOverwriteVolumeContentRequest(sourceSnapshotVolumeId);
+
         Boolean overwriteVolumeContentStatus = post(
                 "/instances/Volume::" + destVolumeId + 
"/action/overwriteVolumeContent",
-                
String.format("{\"srcVolumeId\":\"%s\",\"allowOnExtManagedVol\":\"TRUE\"}", 
sourceSnapshotVolumeId), Boolean.class);
+                requestBody,Boolean.class);
         if (overwriteVolumeContentStatus != null) {
             return overwriteVolumeContentStatus;
         }
         return false;
     }
 
+    private String buildOverwriteVolumeContentRequest(final String 
srcVolumeId) {
+        if (isVersionAtLeast(4, 0)) {
+            logger.debug("Using PowerFlex 4.0+ overwriteVolumeContent request 
body");
+            return String.format("{\"srcVolumeId\":\"%s\"}", srcVolumeId);
+        }
+        else {
+            logger.debug("Using pre-4.0 overwriteVolumeContent request body");
+            return 
String.format("{\"srcVolumeId\":\"%s\",\"allowOnExtManagedVol\":\"TRUE\"}", 
srcVolumeId);                }

Review Comment:
   based on public Dell Rest API documentation, the parameter was removed 
starting on version 4.0, the previous version 3.6 contains the parameter. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to