System.out.println(exception);
return;
}
CartridgeWrapper cartridgeWrapper = gson.fromJson(resultString, CartridgeWrapper.class);
Cartridge cartridge = cartridgeWrapper.getCartridge();
if (cartridge == null) {
System.out.println("Cartridge is null");
return;
}
// Get LB IP s
Map<String, Set<String>> lbIpMap = getLbIpList(cartridge, httpClient);
final Set<String> lbPrivateIpSet = lbIpMap.get("private");
final Set<String> lbFloatingIpSet = lbIpMap.get("floating");
Cartridge[] cartridges = new Cartridge[1];
cartridges[0] = cartridge;
System.out.println("\nSubscribed Cartridges Info\n");
System.out.println("\tType : " + cartridge.getCartridgeType());
System.out.println("\tName : " + cartridge.getDisplayName());
System.out.println("\tVersion : " + cartridge.getVersion());
String tenancy = cartridge.isMultiTenant() ? "Multi-Tenant" : "Single-Tenant";
System.out.println("\tTenancy Model : " + tenancy);
System.out.println("\tAlias : " + cartridge.getCartridgeAlias());
System.out.println("\tStatus : " + cartridge.getStatus());
String instanceCount = cartridge.isMultiTenant() ? "N/A" : String.valueOf(cartridge.getActiveInstances());
System.out.println("\tRunning Instances : " + instanceCount);
System.out.println("\tAccess URL(s) : " + getAccessURLs(cartridge));
if (cartridge.getRepoURL() != null) {
System.out.println("\tRepo URL : " + cartridge.getRepoURL());
}
System.out.println("\tLB Private IP : " + lbPrivateIpSet.toString());
if (lbFloatingIpSet != null) {
System.out.println("\tLB Floating IP : " + lbFloatingIpSet.toString());
}
if (cartridge.getProvider().equals("data")) {
System.out.println("\tDB-username : " +cartridge.getDbUserName());
System.out.println("\tDB-password : " +cartridge.getPassword());
System.out.println("\tDB-Host IP (private) : " +cartridge.getIp());
if (cartridge.getPublicIp() != null) {
System.out.println("\tDB-Host IP (floating) : "
+ cartridge.getPublicIp());
}
}
System.out.println();
} catch (Exception e) {
handleException("Exception in listing subscribe cartridges", e);