use of com.emc.storageos.model.ports.StoragePortRestRep in project coprhd-controller by CoprHD.
the class Networks method getConnectedStorage.
public static void getConnectedStorage() {
List<NetworkRestRep> networks = NetworkUtils.getNetworks();
Set<String> connectedstoragesystems = new HashSet<String>();
for (NetworkRestRep network : networks) {
for (StoragePortRestRep port : StoragePortUtils.getStoragePortsByNetwork(network.getId())) {
connectedstoragesystems.add(port.getStorageDevice().getId().toString());
}
}
renderJSON(connectedstoragesystems);
}
use of com.emc.storageos.model.ports.StoragePortRestRep in project coprhd-controller by CoprHD.
the class StorageSystems method metricDetails.
public static void metricDetails(String id) {
StoragePortRestRep port = StoragePortUtils.getStoragePort(id);
render(port);
}
use of com.emc.storageos.model.ports.StoragePortRestRep in project coprhd-controller by CoprHD.
the class StorageSystems method editPort.
public static void editPort(String id, String portId) {
StoragePortRestRep storagePort = StoragePortUtils.getStoragePort(portId);
if (storagePort == null) {
flash.error(MessagesUtils.get(UNKNOWN_PORT, portId));
ports(id);
}
URI storageSystemId = id(storagePort.getStorageDevice());
StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(storageSystemId);
if (storageSystem == null) {
flash.error(MessagesUtils.get(UNKNOWN, storageSystemId));
list();
}
if (RegistrationStatus.isUnregistered(storageSystem.getRegistrationStatus())) {
flash.put("warning", MessagesUtils.get(NOT_REGISTERED, storageSystem.getName()));
}
StorageArrayPortForm storageArrayPort = new StorageArrayPortForm();
storageArrayPort.readFrom(storagePort);
render(storageArrayPort, storagePort, storageSystem);
}
use of com.emc.storageos.model.ports.StoragePortRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method addStorageSystems.
/**
* Adds all ports of the given storage systems to the virtual array.
*
* @param virtualArrayId
* the virtual array ID.
* @param ids
* the storage system IDs.
*/
@FlashException(referrer = { "edit", "list" })
public static void addStorageSystems(String virtualArrayId, @As(",") String[] ids) {
List<URI> storagePorts = Lists.newArrayList();
for (URI storageSystemId : uris(ids)) {
List<StoragePortRestRep> ports = StoragePortUtils.getStoragePortsByStorageSystem(storageSystemId);
storagePorts.addAll(ResourceUtils.ids(ports));
}
if (!storagePorts.isEmpty()) {
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
updateStoragePorts(storagePorts, addVirtualArray(virtualArray));
}
edit(virtualArrayId);
}
use of com.emc.storageos.model.ports.StoragePortRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method addStorageSysVarray.
/**
* Adds all ports of the given storage systems to the virtual array.
*
* @param virtualArrayId
* the virtual array ID.
* @param ids
* the storage system IDs.
*/
private static void addStorageSysVarray(String virtualArrayId, List<String> ids) {
List<URI> storagePorts = Lists.newArrayList();
for (URI storageSystemId : uris(ids)) {
List<StoragePortRestRep> ports = StoragePortUtils.getStoragePortsByStorageSystem(storageSystemId);
storagePorts.addAll(ResourceUtils.ids(ports));
}
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
if (!storagePorts.isEmpty()) {
updateStoragePorts(storagePorts, addVirtualArray(virtualArray));
}
updateVarrayCookie(virtualArray.getId().toString(), virtualArray.getName());
list();
}
Aggregations