use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockSnapshots method delete.
private static void delete(List<URI> ids) {
if (ids != null) {
ViPRCoreClient client = BourneUtil.getViprClient();
for (URI id : ids) {
Tasks<BlockSnapshotRestRep> task = client.blockSnapshots().deactivate(id, VolumeDeleteTypeEnum.FULL);
}
flash.put("info", MessagesUtils.get("resources.snapshots.deactivate", ids.size()));
}
snapshots(null);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockSnapshots method deleteSnapshot.
@FlashException(referrer = { "snapshotDetails" })
public static void deleteSnapshot(String snapshotId) {
if (StringUtils.isNotBlank(snapshotId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
Tasks<BlockSnapshotRestRep> task = client.blockSnapshots().deactivate(uri(snapshotId), VolumeDeleteTypeEnum.FULL);
flash.put("info", MessagesUtils.get("resources.snapshot.deactivate", snapshotId));
}
snapshotDetails(snapshotId);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class Orders method rollbackTask.
@FlashException(referrer = { "receiptContent" })
public static void rollbackTask(String orderId, String taskId) {
if (StringUtils.isNotBlank(taskId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
client.tasks().rollback(uri(taskId));
flash.put("info", MessagesUtils.get("resources.tasks.rollbackMessage", taskId));
}
receipt(orderId);
}
use of com.emc.vipr.client.ViPRCoreClient 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.vipr.client.ViPRCoreClient 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