use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.
the class BlockExportGroups method removeSnapshot.
@FlashException(referrer = { "exportGroup" })
public static void removeSnapshot(String exportGroupId, String snapshotId) {
ViPRCoreClient client = BourneUtil.getViprClient();
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.removeVolume(uri(snapshotId));
Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.snapshot.removed", task.getOpId()));
exportGroup(exportGroupId);
}
use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.
the class BlockExportGroups method getEligibleInitiators.
/**
* Return list of initiators that can be added to this export group
*
* @param exportGroupId id of the export group
* @return list of initiators
*/
public static List<InitiatorRestRep> getEligibleInitiators(URI exportGroupId) {
if (exportGroupId == null) {
return Lists.newArrayList();
}
ExportGroupRestRep exportGroup = getViprClient().blockExports().get(exportGroupId);
final List<URI> initiatorsInExport = ResourceUtils.ids(exportGroup.getInitiators());
List<URI> allInitiatorIds = getViprClient().initiators().listBulkIds();
final List<URI> validHosts = getValidHostsForInitiatorExport(exportGroup);
return getViprClient().initiators().getByIds(allInitiatorIds, new DefaultResourceFilter<InitiatorRestRep>() {
@Override
public boolean accept(InitiatorRestRep item) {
return !initiatorsInExport.contains(item.getId()) && (validHosts.isEmpty() || (item.getHost() != null && !NullColumnValueGetter.isNullURI(item.getHost().getId()) && validHosts.contains(item.getHost().getId())));
}
});
}
use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.
the class ResourceUtils method getExportMap.
private static Map<ITLRestRep, ExportGroupRestRep> getExportMap(Collection<ITLRestRep> itls) {
Map<URI, ExportGroupRestRep> blockExports = getBlockExports(itls);
Map<ITLRestRep, ExportGroupRestRep> exports = Maps.newLinkedHashMap();
for (ITLRestRep itl : itls) {
URI exportId = id(itl.getExport());
if (exportId != null) {
exports.put(itl, blockExports.get(exportId));
}
}
return exports;
}
use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.
the class BlockExportGroupVolumesDataTable method fetch.
public static List<Volume> fetch(URI exportGroupID) {
if (exportGroupID == null) {
return Collections.emptyList();
}
ViPRCoreClient client = BourneUtil.getViprClient();
ExportGroupRestRep exportGroup = client.blockExports().get(exportGroupID);
List<Volume> volumes = Lists.newArrayList();
for (ExportBlockParam exportBlockParam : exportGroup.getVolumes()) {
if (ResourceType.isType(VOLUME, exportBlockParam.getId())) {
volumes.add(new Volume(client.blockVolumes().get(exportBlockParam.getId()), exportBlockParam));
}
}
return volumes;
}
use of com.emc.storageos.model.block.export.ExportGroupRestRep in project coprhd-controller by CoprHD.
the class BlockExportGroupsDataTable method fetch.
public static List<ExportGroup> fetch(URI projectId) {
if (projectId == null) {
return Collections.EMPTY_LIST;
}
ViPRCoreClient client = getViprClient();
List<ExportGroupRestRep> exportGroups = client.blockExports().findByProject(projectId);
Map<URI, String> virtualArrays = ResourceUtils.mapNames(client.varrays().list());
List<ExportGroup> results = Lists.newArrayList();
for (ExportGroupRestRep exportGroup : exportGroups) {
results.add(new ExportGroup(exportGroup, virtualArrays));
}
return results;
}
Aggregations