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);
}
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);
}
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);
}
Aggregations