rp- commented on code in PR #13910:
URL: https://github.com/apache/cloudstack/pull/13910#discussion_r4647303496


##########
plugins/storage/volume/linstor/src/main/java/org/apache/cloudstack/storage/datastore/util/LinstorUtil.java:
##########
@@ -101,6 +106,49 @@ public static DevelopersApi getLinstorAPI(String 
linstorUrl, String apiToken, bo
         return new DevelopersApi(client);
     }
 
+    /**
+     * The REST API version of the connected controller, e.g. "1.29.1", or 
null if it could not be queried.
+     */
+    @Nullable
+    public static String getRestApiVersion(DevelopersApi api) {
+        try {
+            return api.controllerVersion().getRestApiVersion();
+        } catch (ApiException apiExc) {
+            LOGGER.warn("Unable to query controller API version: {}", 
apiExc.getBestMessage());
+            return null;
+        }
+    }
+
+    /**
+     * Check if the connected controller supports the live-migration 
attach/detach API:
+     * make-available with auto_manage_dual_primary and unmake-available, 
added with REST API 1.29.0.
+     */
+    public static boolean supportsLiveMigrateApi(DevelopersApi api) {

Review Comment:
   `getRestApiVersion` fails now hard and doesn't fall back to old behaivor



-- 
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