Search in sources :

Example 1 with DDSystemInfo

use of com.emc.storageos.datadomain.restapi.model.DDSystemInfo 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)

Aggregations

DataDomainClient (com.emc.storageos.datadomain.restapi.DataDomainClient)1 DataDomainApiException (com.emc.storageos.datadomain.restapi.errorhandling.DataDomainApiException)1 DDMCInfoDetail (com.emc.storageos.datadomain.restapi.model.DDMCInfoDetail)1 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