use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.
the class BlockVirtualPools method checkDisconnectedStoragePools.
public static void checkDisconnectedStoragePools(@As(",") String[] ids) {
List<BlockVirtualPoolRestRep> virtualpools = VirtualPoolUtils.getBlockVirtualPools();
Set<String> connectedstoragepools = new HashSet<String>();
List<String> failedArrays = new ArrayList<String>();
for (BlockVirtualPoolRestRep virtualpool : virtualpools) {
if (virtualpool.getUseMatchedPools()) {
for (RelatedResourceRep pool : virtualpool.getMatchedStoragePools()) {
connectedstoragepools.add(pool.getId().toString());
}
} else {
for (RelatedResourceRep pool : virtualpool.getAssignedStoragePools()) {
connectedstoragepools.add(pool.getId().toString());
}
}
}
for (String id : ids) {
StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
if (storageSystem != null && !storageSystem.getRegistrationStatus().equals("UNREGISTERED")) {
boolean found = false;
List<StoragePoolRestRep> storagepools = StoragePoolUtils.getStoragePools(id);
for (StoragePoolRestRep storagepool : storagepools) {
if (connectedstoragepools.contains(storagepool.getId().toString())) {
found = true;
break;
}
}
if (!found) {
failedArrays.add(storageSystem.getName());
}
}
}
renderJSON(failedArrays);
}
use of com.emc.storageos.model.systems.StorageSystemRestRep 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) || modelType.contains(POWERMAX) || modelType.contains(PMAX))) {
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) || modelType.contains(POWERMAX) || modelType.contains(PMAX))) {
ssMap.put("id", ss.getId().toString());
ssMap.put("name", ss.getName());
storagesystemslist.add(ssMap);
}
}
}
}
}
renderJSON(storagesystemslist);
}
use of com.emc.storageos.model.systems.StorageSystemRestRep 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.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method getConnectedStorage.
public static void getConnectedStorage() {
List<VirtualArrayRestRep> virtualarrays = VirtualArrayUtils.getVirtualArrays();
Set<String> connectedstoragesystems = new HashSet<String>();
for (VirtualArrayRestRep virtualarray : virtualarrays) {
for (StorageSystemRestRep storageSystem : StorageSystemUtils.getStorageSystemsByVirtualArray(virtualarray.getId().toString())) {
connectedstoragesystems.add(storageSystem.getId().toString());
}
}
renderJSON(connectedstoragesystems);
}
use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method getDisconnectedStorage.
public static void getDisconnectedStorage(@As(",") String[] ids) {
Set<String> connectedstoragesystems = new HashSet<String>();
Set<String> disConnectedstoragesystems = new HashSet<String>();
JsonObject dataObject = getCookieAsJson(GUIDE_DATA);
if (dataObject != null) {
JsonArray varrays = dataObject.getAsJsonArray(VARRAYS);
if (varrays != null) {
for (Object virtualarray : varrays) {
JsonObject varrayobject = (JsonObject) virtualarray;
String varrayid = varrayobject.get("id").getAsString();
VirtualArrayRestRep virtualArrayRestRep = VirtualArrayUtils.getVirtualArray(varrayid);
if (virtualArrayRestRep == null || virtualArrayRestRep.getInactive()) {
// ignore for now
continue;
}
for (StorageSystemRestRep storageSystem : StorageSystemUtils.getStorageSystemsByVirtualArray(varrayid)) {
connectedstoragesystems.add(storageSystem.getId().toString());
}
}
}
}
for (String id : ids) {
StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
if (storageSystem == null || storageSystem.getRegistrationStatus().equals("UNREGISTERED")) {
// ignore for now
continue;
}
if (!connectedstoragesystems.contains(id)) {
disConnectedstoragesystems.add(storageSystem.getName());
}
}
renderJSON(disConnectedstoragesystems);
}
Aggregations