abh1sar commented on code in PR #8875:
URL: https://github.com/apache/cloudstack/pull/8875#discussion_r1608479716
##########
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java:
##########
@@ -1147,6 +1155,41 @@ public ListResponse<UserVmResponse>
searchForUserVMs(ListVMsCmd cmd) {
return response;
}
+ @Override
+ public ListResponse<VirtualMachineResponse>
findAffectedVmsForStorageScopeChange(FindAffectedVmsForStorageScopeChangeCmd
cmd) {
+ Long poolId = cmd.getStorageId();
+ StoragePoolVO pool = storagePoolDao.findById(poolId);
+ if (pool == null) {
+ throw new IllegalArgumentException("Unable to find storage pool
with ID: " + poolId);
+ }
+ if (!pool.getStatus().equals(StoragePoolStatus.Disabled)) {
+ throw new InvalidParameterValueException("Scope change of Storage
pool is only allowed in Disabled state");
+ }
Review Comment:
Since scope change is only allowed when storage pool is disabled, the idea
behind doing this was to not let admin use this api too unless the storage pool
is disabled.
Do you think operator would want to use this api to get the list of vms even
when storage pool state is up?
--
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]