use of com.emc.storageos.model.NamedRelatedResourceRep 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.NamedRelatedResourceRep 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.NamedRelatedResourceRep 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);
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class MobilityGroupSupportUtil method getMobilityGroups.
public static List<NamedRelatedResourceRep> getMobilityGroups() {
List<VolumeGroupRestRep> volumeGroups = BourneUtil.getViprClient().application().getApplications(new ResourceFilter<VolumeGroupRestRep>() {
@Override
public boolean acceptId(URI id) {
return true;
}
@Override
public boolean accept(VolumeGroupRestRep item) {
return !item.getRoles().isEmpty() && item.getRoles().contains(VolumeGroup.VolumeGroupRole.MOBILITY.name());
}
});
List<NamedRelatedResourceRep> reps = Lists.newArrayList();
for (VolumeGroupRestRep vg : volumeGroups) {
reps.add(com.emc.vipr.client.core.util.ResourceUtils.createNamedRef(vg));
}
return reps;
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class StorageSystemUtils method mapProtectionSystemConnectivity.
private static Map<String, Set<NamedRelatedResourceRep>> mapProtectionSystemConnectivity(List<StorageSystemConnectivityRestRep> connectivityList) {
Map<String, Set<NamedRelatedResourceRep>> results = Maps.newTreeMap();
for (StorageSystemConnectivityRestRep connectivity : connectivityList) {
for (String connectionType : connectivity.getConnectionTypes()) {
if (connectivity.getProtectionSystem() == null) {
continue;
}
Set<NamedRelatedResourceRep> values = results.get(connectionType);
if (values == null) {
values = Sets.newTreeSet(new RelatedResourceComparator());
results.put(connectionType, values);
}
values.add(connectivity.getProtectionSystem());
}
}
return results;
}
Aggregations