Search in sources :

Example 1 with DDMCInfoDetail

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);
    }
}
Also used : DataDomainApiException(com.emc.storageos.datadomain.restapi.errorhandling.DataDomainApiException) DDSystemInfo(com.emc.storageos.datadomain.restapi.model.DDSystemInfo) DDMCInfoDetail(com.emc.storageos.datadomain.restapi.model.DDMCInfoDetail) DDSystemList(com.emc.storageos.datadomain.restapi.model.DDSystemList) StorageSystemViewObject(com.emc.storageos.plugins.StorageSystemViewObject) DDSystem(com.emc.storageos.datadomain.restapi.model.DDSystem) StorageProvider(com.emc.storageos.db.client.model.StorageProvider) DataDomainClient(com.emc.storageos.datadomain.restapi.DataDomainClient)

Example 2 with DDMCInfoDetail

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);
    }
}
Also used : DataDomainApiException(com.emc.storageos.datadomain.restapi.errorhandling.DataDomainApiException) DDMCInfoDetail(com.emc.storageos.datadomain.restapi.model.DDMCInfoDetail) DataDomainClient(com.emc.storageos.datadomain.restapi.DataDomainClient)

Aggregations

DataDomainClient (com.emc.storageos.datadomain.restapi.DataDomainClient)2 DataDomainApiException (com.emc.storageos.datadomain.restapi.errorhandling.DataDomainApiException)2 DDMCInfoDetail (com.emc.storageos.datadomain.restapi.model.DDMCInfoDetail)2 DDSystem (com.emc.storageos.datadomain.restapi.model.DDSystem)1 DDSystemInfo (com.emc.storageos.datadomain.restapi.model.DDSystemInfo)1 DDSystemList (com.emc.storageos.datadomain.restapi.model.DDSystemList)1 StorageProvider (com.emc.storageos.db.client.model.StorageProvider)1 StorageSystemViewObject (com.emc.storageos.plugins.StorageSystemViewObject)1