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