/** * Get the storage pools in the protection domain * * @param pdId The protection domain ID * @return The List of storage pools * @throws JSONException */ public List<ScaleIOStoragePool> getProtectionDomainStoragePools(String pdId) throws Exception { ClientResponse response = get(URI.create(ScaleIOConstants.getProtectionDomainStoragePoolURI(pdId))); List<ScaleIOStoragePool> pools = getResponseObjects(ScaleIOStoragePool.class, response); for (ScaleIOStoragePool pool : pools) { ScaleIOStoragePool poolResult = getStoragePoolStats(pool.getId()); pool.setCapacityAvailableForVolumeAllocationInKb( poolResult.getCapacityAvailableForVolumeAllocationInKb()); pool.setMaxCapacityInKb(poolResult.getMaxCapacityInKb()); } return pools; }
/** * Get the detail information for a pool * * @param poolId The storage pool native Id * @return The storage pool information * @throws Exception */ public ScaleIOStoragePool queryStoragePool(String poolId) throws Exception { ClientResponse response = get(URI.create(ScaleIOConstants.getStoragePoolStatsURI(poolId))); ScaleIOStoragePool pool = getResponseObject(ScaleIOStoragePool.class, response); ScaleIOStoragePool poolStats = getStoragePoolStats(poolId); pool.setCapacityAvailableForVolumeAllocationInKb( poolStats.getCapacityAvailableForVolumeAllocationInKb()); pool.setMaxCapacityInKb(poolStats.getMaxCapacityInKb()); return pool; }
/** * Get the Storage Pool detail data * * @param poolId The storage pool ID * @return The details of the storage pool * @throws Exception */ public ScaleIOStoragePool getStoragePoolStats(String poolId) throws Exception { ClientResponse response = get(URI.create(ScaleIOConstants.getStoragePoolStatsURI(poolId))); ScaleIOStoragePool pool = getResponseObject(ScaleIOStoragePool.class, response); pool.setId(poolId); return pool; }