use of com.emc.storageos.datadomain.restapi.model.DDMCInfoDetail in project coprhd-controller by CoprHD.
the class DataDomainCommunicationInterface method scan.
@Override
public void scan(AccessProfile accessProfile) throws DataDomainApiException {
DataDomainClient ddClient = getDataDomainClient(accessProfile);
StorageProvider provider = _dbClient.queryObject(StorageProvider.class, accessProfile.getSystemId());
DDMCInfoDetail ddmcInfo = new DDMCInfoDetail();
try {
ddmcInfo = ddClient.getManagementSystemInfo();
} catch (DataDomainApiException dex) {
provider.setConnectionStatus(ConnectionStatus.NOTCONNECTED.toString());
String op = "DDMC info retrieval";
String sys = provider.getLabel() + "(" + provider.getIPAddress() + ")";
throw DataDomainApiException.exceptions.opFailedProviderUnreachable(op, sys);
}
if (!validDdmcVersion(accessProfile, provider, ddmcInfo)) {
String version = null;
String minimumSupportedVersion = null;
Map<String, String> props = accessProfile.getProps();
if (props != null) {
version = props.get(CURRENT_VERSION);
minimumSupportedVersion = props.get(MINIMUM_VERSION);
}
throw DataDomainApiException.exceptions.scanFailedIncompatibleDdmc(version, minimumSupportedVersion);
}
Map<String, StorageSystemViewObject> cache = accessProfile.getCache();
DDSystemList systemList = ddClient.getManagedSystemList();
for (DDSystemInfo system : systemList.getSystemInfo()) {
DDSystem ddSystem = ddClient.getDDSystem(system.getId());
StorageSystemViewObject view = new StorageSystemViewObject();
view.addprovider(accessProfile.getSystemId().toString());
view.setDeviceType(accessProfile.getSystemType());
view.setProperty(StorageSystemViewObject.SERIAL_NUMBER, ddSystem.serialNo);
view.setProperty(StorageSystemViewObject.MODEL, ddSystem.model);
view.setProperty(StorageSystemViewObject.STORAGE_NAME, ddSystem.name);
view.setProperty(StorageSystemViewObject.VERSION, ddSystem.version);
cache.put(system.getId(), view);
}
}
use of com.emc.storageos.datadomain.restapi.model.DDMCInfoDetail in project coprhd-controller by CoprHD.
the class DataDomainFileStorageDevice method doConnect.
@Override
public void doConnect(StorageSystem storage) {
try {
_log.info("doConnect {} - start", storage.getId());
DataDomainClient ddClient = getDataDomainClient(storage);
if (ddClient == null) {
_log.error("doConnect failed, provider unreachable");
String sys = storage.getLabel() + "(" + storage.getIpAddress() + ")";
throw DataDomainApiException.exceptions.connectStorageFailed(sys);
}
DDMCInfoDetail ddInfo = ddClient.getManagementSystemInfo();
String msg = String.format("doConnect %1$s - complete", ddInfo);
_log.info(msg);
} catch (DataDomainApiException e) {
_log.error("doConnect failed.", e);
throw DeviceControllerException.exceptions.connectStorageFailed(e);
}
}
Aggregations