use of com.emc.storageos.hds.model.Condition in project coprhd-controller by CoprHD.
the class HDSApiDiscoveryManager method getThinImagePoolList.
public List<Pool> getThinImagePoolList(String systemObjectId) throws Exception {
InputStream responseStream = null;
StorageArray storageArray = null;
try {
URI endpointURI = hdsApiClient.getBaseURI();
Map<String, Object> attributeMap = new HashMap<String, Object>();
StorageArray inputStorageArray = new StorageArray(systemObjectId);
Get getOp = new Get(HDSConstants.STORAGEARRAY);
Condition condition = new Condition("6");
attributeMap.put(HDSConstants.GET, getOp);
attributeMap.put(HDSConstants.STORAGEARRAY, inputStorageArray);
attributeMap.put(HDSConstants.CONDITION, condition);
String getThinImagePoolInputXML = InputXMLGenerationClient.getInputXMLString(HDSConstants.GET_THINIMAGE_POOL_INFO_OP, attributeMap, HDSConstants.HITACHI_INPUT_XML_CONTEXT_FILE, HDSConstants.HITACHI_SMOOKS_CONFIG_FILE);
log.info("Query to get ThinImagePool :{}", getThinImagePoolInputXML);
ClientResponse response = hdsApiClient.post(endpointURI, getThinImagePoolInputXML);
if (HttpStatus.SC_OK == response.getStatus()) {
responseStream = response.getEntityInputStream();
JavaResult result = SmooksUtil.getParsedXMLJavaResult(responseStream, HDSConstants.SMOOKS_CONFIG_FILE);
verifyErrorPayload(result);
storageArray = result.getBean(StorageArray.class);
} else {
log.error("Get system details failed with invalid response code {}", response.getStatus());
throw HDSException.exceptions.invalidResponseFromHDS(String.format("Not able to query system details due to invalid response %1$s from server", response.getStatus()));
}
} finally {
if (null != responseStream) {
try {
responseStream.close();
} catch (IOException e) {
log.warn("IOException occurred while closing the response stream");
}
}
}
return storageArray.getThinPoolList();
}
Aggregations