sureshanaparti commented on code in PR #10560: URL: https://github.com/apache/cloudstack/pull/10560#discussion_r2053602617
########## server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java: ########## @@ -717,4 +761,43 @@ public List<UserVmJoinVO> listByAccountServiceOfferingTemplateAndNotInState(long sc.setParameters("displayVm", 1); return customSearch(sc, null); } + + /** + * This method fetches instances where + * 1. lease has expired + * 2. leaseExpiryActions are valid, either STOP or DESTROY + * 3. instance State is eligible for expiry action + * @return list of instances, expiry action can be executed on + */ + @Override + public List<UserVmJoinVO> listEligibleInstancesWithExpiredLease() { + SearchCriteria<UserVmJoinVO> sc = leaseExpiredInstanceSearch.create(); + sc.setParameters("leaseExpired", new Date()); + sc.setParameters("leaseExpiryActions", "STOP", "DESTROY"); Review Comment: use enum VmLeaseManager.ExpiryAction for these actions -- 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: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org