use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method getProviderTenantId.
/**
* Makes call to Bourne to get tenant provider Uri
*
* @return tenant provider Uri
* @throws SOSFailure
* if call to Bourne fails
*/
private String getProviderTenantId() throws SOSFailure {
final String methodName = "getProviderTenantId(): ";
log.trace(methodName + "Entry");
String rootTenantUri = null;
final String ROOT_TENANT_URI = "/tenant";
try {
Tenant tenant = _client.queryObject(ROOT_TENANT_URI, Tenant.class);
rootTenantUri = tenant.getId();
} catch (NoSuchAlgorithmException e) {
log.error(methodName + "NoSuchAlgorithmException occured", e);
throw new SOSFailure(e);
} catch (UniformInterfaceException e) {
log.error(methodName + "UniformInterfaceException occured", e);
throw new SOSFailure(e);
}
log.trace(methodName + "Exit returing tenant uri[" + rootTenantUri + "]");
return rootTenantUri;
}
use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method fetchStoragePortByHref.
private StoragePort fetchStoragePortByHref(String href) throws SOSFailure {
final String methodName = "fetchStoragePortByHref(): ";
log.trace(methodName + "Entry with input: href[" + href + "]");
StoragePort storagePort = null;
try {
storagePort = _client.queryObject(href, StoragePort.class);
if (storagePort == null) {
storagePort = new StoragePort();
}
} catch (NoSuchAlgorithmException e) {
log.error(methodName + "NoSuchAlgorithmException occured", e);
throw new SOSFailure(e);
} catch (UniformInterfaceException e) {
log.error(methodName + "UniformInterfaceException occured", e);
throw new SOSFailure(e);
}
log.trace(methodName + "Exit returning storage port :[" + storagePort + "]");
return storagePort;
}
use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method fetchExportITLS.
private List<Itls> fetchExportITLS(String csvSeparatedInitiatorList) throws SOSFailure {
final String methodName = "fetchExportITLS(): ";
log.trace(methodName + "Entry with input: csvSeparatedInitiatorList[" + csvSeparatedInitiatorList + "]");
final String ITL_LIST_URI = "/block/exports/?initiators=%s";
List<Itls> itlList = new ArrayList<Itls>();
try {
Itls itlObj = _client.queryObject(String.format(ITL_LIST_URI, csvSeparatedInitiatorList), Itls.class);
if (itlObj != null && itlObj.getItls() != null) {
itlList.add(itlObj);
}
} catch (NoSuchAlgorithmException e) {
log.error(methodName + "NoSuchAlgorithmException occured", e);
throw new SOSFailure(e);
} catch (UniformInterfaceException e) {
/*
* if (e.getMessage().contains("400 Bad Request")) {
*
* log.debug(methodName +
* "No export information is available for initiator[" + initiatorId
* + "]"); continue; } else {
*/
log.error(methodName + "UniformInterfaceException occured", e);
throw new SOSFailure(e);
// }
}
// }
log.trace(methodName + "Exit ITL list of size[" + itlList.size() + "]");
return itlList;
}
use of com.emc.storageos.vasa.fault.SOSFailure in project coprhd-controller by CoprHD.
the class SyncManager method fetchStoragePool.
public synchronized StoragePool fetchStoragePool(String storageSystemId, String storagePoolId) throws SOSFailure {
final String methodName = "fetchStoragePool(): ";
final String STORAGE_POOL_DETAIL_URI = "/vdc/storage-systems/%s/storage-pools/%s";
log.trace(methodName + "Entry with storageSystemId[" + storageSystemId + "] storagePoolId[" + storagePoolId + "]");
StoragePool storagePool = null;
try {
storagePool = _client.queryObject(String.format(STORAGE_POOL_DETAIL_URI, storageSystemId, storagePoolId), StoragePool.class);
} catch (NoSuchAlgorithmException e) {
log.error(methodName + "NoSuchAlgorithmException occured", e);
throw new SOSFailure(e);
} catch (UniformInterfaceException e) {
log.error(methodName + "UniformInterfaceException occured", e);
throw new SOSFailure(e);
}
log.trace(methodName + "Exit returning storagePool[ " + storagePool + "]");
return storagePool;
}
Aggregations