use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockExportGroups method removeCluster.
@FlashException(referrer = { "exportGroup" })
public static void removeCluster(String exportGroupId, String clusterId) {
ViPRCoreClient client = BourneUtil.getViprClient();
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setClusters(new ClustersUpdateParam());
exportUpdateParam.getClusters().getRemove().add(uri(clusterId));
Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.cluster.removed", task.getOpId()));
exportGroup(exportGroupId);
}
use of com.emc.vipr.client.ViPRCoreClient 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.vipr.client.ViPRCoreClient 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.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockSnapshotSessions method delete.
private static void delete(List<URI> ids, VolumeDeleteTypeEnum deleteType) {
if (ids != null) {
ViPRCoreClient client = BourneUtil.getViprClient();
for (URI id : ids) {
Tasks<BlockSnapshotSessionRestRep> task = client.blockSnapshotSessions().deactivate(id, deleteType);
}
flash.put("info", MessagesUtils.get("resources.snapshots.deactivate", ids.size()));
}
snapshotSessions(null);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockSnapshotSessions method snapshotSessionDetails.
public static void snapshotSessionDetails(String snapshotSessionId) {
ViPRCoreClient client = BourneUtil.getViprClient();
AffectedResources.BlockSnapshotSessionDetails blockSnapshotSession = new AffectedResources.BlockSnapshotSessionDetails(uri(snapshotSessionId));
if (blockSnapshotSession.blockSnapshotSession == null) {
flash.error(MessagesUtils.get(UNKNOWN, snapshotSessionId));
snapshotSessions(null);
}
if (blockSnapshotSession.volume != null) {
AffectedResources.VolumeDetails volume = new AffectedResources.VolumeDetails(blockSnapshotSession.volume.getId());
renderArgs.put("volume", volume);
}
List<Task<BlockSnapshotSessionRestRep>> tasks = null;
if (blockSnapshotSession.blockSnapshotSession != null) {
Tasks<BlockSnapshotSessionRestRep> tasksResponse = client.blockSnapshotSessions().getTasks(blockSnapshotSession.blockSnapshotSession.getId());
tasks = tasksResponse.getTasks();
}
render(blockSnapshotSession, tasks);
}
Aggregations