Search in sources :

Example 1 with StorageProviderRestRep

use of com.emc.storageos.model.smis.StorageProviderRestRep in project coprhd-controller by CoprHD.

the class SystemsMapper method map.

public static StorageProviderRestRep map(StorageProvider from) {
    if (from == null) {
        return null;
    }
    StorageProviderRestRep to = new StorageProviderRestRep();
    mapDataObjectFields(from, to);
    to.setIPAddress(from.getIPAddress());
    to.setPortNumber(from.getPortNumber());
    if (from.getStorageSystems() != null) {
        for (String system : from.getStorageSystems()) {
            to.getStorageSystems().add(toRelatedResource(ResourceTypeEnum.STORAGE_SYSTEM, URI.create(system)));
        }
    }
    to.setInterface(from.getInterfaceType());
    to.setDescription(from.getDescription());
    to.setManufacturer(from.getManufacturer());
    to.setVersionString(from.getVersionString());
    to.setProviderID(from.getProviderID());
    to.setConnectionStatus(from.getConnectionStatus());
    to.setUserName(from.getUserName());
    to.setUseSSL(from.getUseSSL());
    to.setScanStatus(from.getScanStatus());
    to.setLastScanStatusMessage(from.getLastScanStatusMessage());
    to.setLastScanTime(from.getLastScanTime());
    to.setNextScanTime(from.getNextScanTime());
    to.setSuccessScanTime(from.getSuccessScanTime());
    to.setCompatibilityStatus(from.getCompatibilityStatus());
    to.setRegistrationStatus(from.getRegistrationStatus());
    to.setSecondaryUsername(from.getSecondaryUsername());
    to.setElementManagerURL(from.getElementManagerURL());
    to.setSecondaryURL(from.getSecondaryURL());
    return to;
}
Also used : StorageProviderRestRep(com.emc.storageos.model.smis.StorageProviderRestRep)

Example 2 with StorageProviderRestRep

use of com.emc.storageos.model.smis.StorageProviderRestRep in project coprhd-controller by CoprHD.

the class StorageProviders method discoveryCheckJson.

public static void discoveryCheckJson(@As(",") String[] ids) {
    List<String> failedDiscovery = new ArrayList<String>();
    for (String id : ids) {
        StorageProviderRestRep storageProvider = StorageProviderUtils.getStorageProvider(uri(id));
        if (storageProvider == null || storageProvider.getRegistrationStatus().equals(UNREGESTERD)) {
            // ignore for now
            continue;
        }
        if (!storageProvider.getScanStatus().equals("COMPLETE")) {
            failedDiscovery.add(storageProvider.getName());
            continue;
        }
        Set<NamedRelatedResourceRep> storageSystems = StorageProviderUtils.getConnectedStorageSystems(uri(id));
        boolean ssFound = false;
        for (NamedRelatedResourceRep storageSystem : storageSystems) {
            StorageSystemRestRep ss = StorageSystemUtils.getStorageSystem(storageSystem.getId());
            if (ss != null) {
                if (!ss.getDiscoveryJobStatus().equals("COMPLETE")) {
                    continue;
                } else {
                    ssFound = true;
                }
            }
        }
        if (!ssFound) {
            failedDiscovery.add(storageProvider.getName());
            continue;
        }
    }
    renderJSON(failedDiscovery);
}
Also used : StorageProviderRestRep(com.emc.storageos.model.smis.StorageProviderRestRep) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) ArrayList(java.util.ArrayList) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 3 with StorageProviderRestRep

use of com.emc.storageos.model.smis.StorageProviderRestRep in project coprhd-controller by CoprHD.

the class StorageProviders method edit.

@FlashException("list")
public static void edit(String id) {
    addReferenceData();
    StorageProviderRestRep provider = StorageProviderUtils.getStorageProvider(uri(id));
    if (provider != null) {
        StorageProviderForm smisProvider = new StorageProviderForm(provider);
        copyRenderArgsToAngular();
        angularRenderArgs().put("smisProvider", smisProvider);
        render(smisProvider);
    } else {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        list();
    }
}
Also used : StorageProviderRestRep(com.emc.storageos.model.smis.StorageProviderRestRep) FlashException(controllers.util.FlashException)

Example 4 with StorageProviderRestRep

use of com.emc.storageos.model.smis.StorageProviderRestRep in project coprhd-controller by CoprHD.

the class StorageProviders method itemDetails.

public static void itemDetails(String id) {
    StorageProviderRestRep storageProvider = StorageProviderUtils.getStorageProvider(uri(id));
    if (storageProvider == null) {
        error(MessagesUtils.get(UNKNOWN, id));
    }
    Set<NamedRelatedResourceRep> storageSystems = StorageProviderUtils.getConnectedStorageSystems(uri(id));
    render(storageProvider, storageSystems);
}
Also used : StorageProviderRestRep(com.emc.storageos.model.smis.StorageProviderRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 5 with StorageProviderRestRep

use of com.emc.storageos.model.smis.StorageProviderRestRep in project coprhd-controller by CoprHD.

the class StorageProviders method getAllFlashStorageSystemsList.

public static void getAllFlashStorageSystemsList(@As(",") String[] ids) {
    List<Map<String, String>> storagesystemslist = new ArrayList<Map<String, String>>();
    for (String id : ids) {
        if (id.contains(PROVIDER_TYPE)) {
            StorageProviderRestRep storageProvider = StorageProviderUtils.getStorageProvider(uri(id));
            if (storageProvider == null) {
                continue;
            }
            Set<NamedRelatedResourceRep> storageSystems = StorageProviderUtils.getConnectedStorageSystems(uri(id));
            for (NamedRelatedResourceRep storageSystem : storageSystems) {
                StorageSystemRestRep ss = StorageSystemUtils.getStorageSystem(storageSystem.getId());
                if (ss != null && !ss.getRegistrationStatus().equals(UNREGESTERD)) {
                    Map<String, String> ssMap = new HashMap<String, String>();
                    // Check if storage system is of type UNITY, VMAX or XtremIO
                    if (StringUtils.equals(XTREMIO, ss.getSystemType())) {
                        ssMap.put("id", ss.getId().toString());
                        ssMap.put("name", ss.getName());
                        storagesystemslist.add(ssMap);
                    }
                    if (StringUtils.equals(VMAX, ss.getSystemType())) {
                        String modelType = ss.getModel();
                        if (modelType != null && modelType.contains(SUFFIX_ALL_FLASH)) {
                            ssMap.put("id", ss.getId().toString());
                            ssMap.put("name", ss.getName());
                            storagesystemslist.add(ssMap);
                        }
                    }
                }
            }
        } else {
            StorageSystemRestRep ss = StorageSystemUtils.getStorageSystem(id);
            if (ss != null && !ss.getRegistrationStatus().equals(UNREGESTERD)) {
                Logger.info(ss.getId() + "-----" + ss.getSystemType());
                Map<String, String> ssMap = new HashMap<String, String>();
                // Check if storage system is of type UNITY, VMAX or XtremIO
                if (StringUtils.equals(XTREMIO, ss.getSystemType())) {
                    ssMap.put("id", ss.getId().toString());
                    ssMap.put("name", ss.getName());
                    storagesystemslist.add(ssMap);
                }
                if (StringUtils.equals(VMAX, ss.getSystemType()) || StringUtils.equals(UNITY, ss.getSystemType())) {
                    String modelType = ss.getModel();
                    if (modelType != null && modelType.contains(SUFFIX_ALL_FLASH)) {
                        ssMap.put("id", ss.getId().toString());
                        ssMap.put("name", ss.getName());
                        storagesystemslist.add(ssMap);
                    }
                }
            }
        }
    }
    renderJSON(storagesystemslist);
}
Also used : StorageProviderRestRep(com.emc.storageos.model.smis.StorageProviderRestRep) HashMap(java.util.HashMap) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) ArrayList(java.util.ArrayList) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) HashMap(java.util.HashMap) Map(java.util.Map) DefaultStorageProviderPortMap(util.DefaultStorageProviderPortMap)

Aggregations

StorageProviderRestRep (com.emc.storageos.model.smis.StorageProviderRestRep)8 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)3 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)3 ArrayList (java.util.ArrayList)2 StorageProviderUpdateParam (com.emc.storageos.model.smis.StorageProviderUpdateParam)1 FlashException (controllers.util.FlashException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 DefaultStorageProviderPortMap (util.DefaultStorageProviderPortMap)1