use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method addNetworks.
/**
* Adds a number of networks to the given virtual array, and redisplays the networks page.
*
* @param virtualArrayId
* the virtual array ID.
* @param ids
* the IDs of the networks to add.
*/
@FlashException
public static void addNetworks(String virtualArrayId, @As(",") String[] ids) {
if ((ids == null) || (ids.length == 0)) {
networks(virtualArrayId);
}
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
updateNetworks(uris(ids), addVirtualArray(virtualArray));
networks(virtualArrayId);
}
use of com.emc.storageos.model.varray.VirtualArrayRestRep 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.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method removeStoragePools.
/**
* Removes a number of storage pools from the given virtual array, and redisplays the storage pools page.
*
* @param virtualArrayId
* the virtual array ID.
* @param ids
* the IDs of the storage pools to remove.
*/
@FlashException
public static void removeStoragePools(String virtualArrayId, @As(",") String[] ids) {
if ((ids != null) && (ids.length > 0)) {
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
updateStoragePools(uris(ids), removeVirtualArray(virtualArray));
}
storagePools(virtualArrayId);
}
use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class BlockExportGroups method exportGroup.
public static void exportGroup(String exportGroupId) {
ViPRCoreClient client = BourneUtil.getViprClient();
ExportGroupRestRep exportGroup = null;
try {
exportGroup = client.blockExports().get(uri(exportGroupId));
} catch (ViPRHttpException e) {
if (e.getHttpCode() == 404) {
flash.error(MessagesUtils.get(UNKNOWN, exportGroupId));
exportGroups(null);
}
throw e;
}
VirtualArrayRestRep virtualArray = null;
if (exportGroup != null) {
virtualArray = client.varrays().get(exportGroup.getVirtualArray());
} else {
notFound("Export Group " + exportGroupId);
}
renderArgs.put("volumeDataTable", new BlockExportGroupVolumesDataTable());
renderArgs.put("snapshotDataTable", new BlockExportGroupSnapshotsDataTable());
SimpleHostDataTable hostsDataTable = new SimpleHostDataTable();
NetworkEndpointDataTable initiatorsDataTable = NetworkEndpointDataTable.createDataTable("FC");
initiatorsDataTable.alterColumn("portGroup").hidden().setSearchable(false);
initiatorsDataTable.alterColumn("storageSystem").hidden().setSearchable(false);
initiatorsDataTable.alterColumn("discovered").hidden().setSearchable(false);
HostClusterDataTable clustersDataTable = new HostClusterDataTable();
render(hostsDataTable, initiatorsDataTable, clustersDataTable, exportGroup, virtualArray);
}
use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.
the class BlockProvider method getExportPathVirtualArray.
@Asset("exportPathVirtualArray")
@AssetDependencies({ "exportPathExport", "exportPathStorageSystem" })
public List<AssetOption> getExportPathVirtualArray(AssetOptionsContext ctx, URI exportId, URI storageSystemId) {
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
ExportGroupRestRep export = client.blockExports().get(exportId);
List<URI> vArrayIds = new ArrayList<URI>();
vArrayIds.add(export.getVirtualArray().getId());
List<StringHashMapEntry> altArrays = export.getAltVirtualArrays() != null ? export.getAltVirtualArrays() : new ArrayList<StringHashMapEntry>();
for (StringHashMapEntry altArray : altArrays) {
if (altArray.getName().equalsIgnoreCase(storageSystemId.toString())) {
vArrayIds.add(URI.create(altArray.getValue()));
}
}
List<VirtualArrayRestRep> vArrays = client.varrays().getByIds(vArrayIds);
for (VirtualArrayRestRep vArray : vArrays) {
options.add(new AssetOption(vArray.getId(), vArray.getName()));
}
return options;
}
Aggregations