Search in sources :

Example 6 with StorageProviderRestRep

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

the class StorageProviderUtils method update.

public static StorageProviderRestRep update(URI id, String name, String ipAddress, Integer portNumber, String userName, String password, Boolean useSSL, String interfaceType, String secondaryUsername, String secondaryPassword, String elementManagerURL, String secondaryURL, String secretKey) {
    StorageProviderUpdateParam update = new StorageProviderUpdateParam();
    update.setName(name);
    update.setIpAddress(ipAddress);
    update.setPortNumber(portNumber);
    update.setUserName(userName);
    update.setPassword(StringUtils.defaultIfEmpty(password, null));
    update.setUseSSL(useSSL == null ? false : useSSL);
    update.setInterfaceType(interfaceType);
    update.setSecondaryUsername(StringUtils.defaultIfEmpty(secondaryUsername, null));
    update.setSecondaryPassword(StringUtils.defaultIfEmpty(secondaryPassword, null));
    update.setElementManagerURL(StringUtils.defaultIfEmpty(elementManagerURL, null));
    update.setSecondaryURL(StringUtils.defaultIfEmpty(secondaryURL, null));
    if (StorageProviderTypes.isScaleIOApi(interfaceType)) {
        update.setUserName(secondaryUsername);
        update.setPassword(secondaryPassword);
        update.setSecondaryUsername(null);
        update.setSecondaryPassword(null);
    } else if (StorageProviderTypes.isCeph(interfaceType)) {
        update.setPassword(secretKey);
        if (id != null) {
            update.setInterfaceType(null);
        }
    }
    StorageProviderRestRep provider = getStorageProvider(id);
    if (provider.getSecondaryUsername() != null && !provider.getSecondaryUsername().equals(secondaryUsername)) {
        update.setSecondaryUsername(StringUtils.defaultIfEmpty(secondaryUsername, ""));
    }
    if (provider.getSecondaryURL() != null && !provider.getSecondaryURL().equals(secondaryURL)) {
        update.setSecondaryURL(StringUtils.defaultIfEmpty(secondaryURL, ""));
    }
    if (StringUtils.isEmpty(secondaryURL) && !secondaryUsername.isEmpty() && !StorageProviderTypes.isScaleIOApi(interfaceType)) {
        update.setSecondaryURL(StringUtils.defaultIfEmpty(secondaryURL, ""));
    } else if (StringUtils.isEmpty(secondaryUsername) && secondaryURL != null) {
        update.setSecondaryUsername(StringUtils.defaultIfEmpty(secondaryUsername, ""));
    }
    return getViprClient().storageProviders().update(id, update);
}
Also used : StorageProviderRestRep(com.emc.storageos.model.smis.StorageProviderRestRep) StorageProviderUpdateParam(com.emc.storageos.model.smis.StorageProviderUpdateParam)

Example 7 with StorageProviderRestRep

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

the class ScaleIO method dashboard.

public static void dashboard(String id) {
    StorageProviderRestRep provider = StorageProviderUtils.getStorageProvider(uri(id));
    if (provider == null) {
        flash.error(MessagesUtils.get(StorageProviders.UNKNOWN, id));
        StorageProviders.list();
    }
    response.contentType = "application/x-java-jnlp-file";
    request.format = "jnlp";
    render(provider);
}
Also used : StorageProviderRestRep(com.emc.storageos.model.smis.StorageProviderRestRep)

Example 8 with StorageProviderRestRep

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

the class StorageSystems method itemDetails.

public static void itemDetails(String id) {
    StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
    if (storageSystem == null) {
        error(MessagesUtils.get(UNKNOWN, id));
    }
    StorageProviderRestRep smisProvider = StorageSystemUtils.getStorageProvider(storageSystem);
    Map<String, Set<NamedRelatedResourceRep>> connectivityMap = StorageSystemUtils.getProtectionConnectivityMap(storageSystem);
    render(storageSystem, smisProvider, connectivityMap);
}
Also used : StorageProviderRestRep(com.emc.storageos.model.smis.StorageProviderRestRep) Set(java.util.Set) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep)

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