Github user nuwand commented on a diff in the pull request: https://github.com/apache/stratos/pull/136#discussion_r22091086 --- Diff: components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java --- @@ -725,6 +725,91 @@ static Cartridge getAvailableCartridgeInfo(String cartridgeType, Boolean multiTe return lbCartridges; } + static List<Cartridge> getAvailableCartridgesByProvider(String provider, ConfigurationContext configurationContext) throws RestAPIException { + List<Cartridge> cartridges = new ArrayList<Cartridge>(); + + if (log.isDebugEnabled()) { + log.debug("Getting available cartridges. Privider name : " + provider ); + } + + boolean allowMultipleSubscription = new Boolean( + System.getProperty(CartridgeConstants.FEATURE_MULTI_TENANT_MULTIPLE_SUBSCRIPTION_ENABLED)); + + try { + + + String[] availableCartridges = CloudControllerServiceClient.getServiceClient().getRegisteredCartridges(); + + if (availableCartridges != null) { + for (String cartridgeType : availableCartridges) { + CartridgeInfo cartridgeInfo = null; + try { + cartridgeInfo = CloudControllerServiceClient.getServiceClient().getCartridgeInfo(cartridgeType); + } catch (Exception e) { + if (log.isWarnEnabled()) { + log.warn("Error when calling getCartridgeInfo for " + cartridgeType + ", Error: " + + e.getMessage()); --- End diff -- Add a method comment.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---