use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class VolumesDataTable method fetch.
public static List<Volume> fetch(URI projectId) {
if (projectId == null) {
return Collections.EMPTY_LIST;
}
ViPRCoreClient client = getViprClient();
List<VolumeRestRep> volumes = client.blockVolumes().findByProject(projectId);
Map<URI, String> virtualArrays = ResourceUtils.mapNames(client.varrays().list());
Map<URI, String> virtualPools = ResourceUtils.mapNames(client.blockVpools().list());
List<Volume> results = Lists.newArrayList();
for (VolumeRestRep volume : volumes) {
results.add(new Volume(volume, virtualArrays, virtualPools));
}
return results;
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BourneUtil method getViprClient.
public static ViPRCoreClient getViprClient() {
String authToken = Security.getAuthToken();
String key = String.format("ViPRCoreClient.%s", authToken);
ViPRCoreClient client = getRequestArg(key);
if (client == null) {
Logger.debug("Creating new ViPRCoreClient");
client = new ViPRCoreClient(getClientConfig()).withAuthToken(authToken);
setRequestArg(key, client);
} else {
Logger.debug("Returning cached ViPRCoreClient");
}
return client;
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class FileUtils method getFSExportRules.
public static List<ExportRule> getFSExportRules(URI id) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<ExportRule> rules = Lists.newArrayList();
if (URIUtil.isType(id, Snapshot.class)) {
rules = client.fileSnapshots().getExport(id, true, "");
} else if (URIUtil.isType(id, FileShare.class)) {
rules = client.fileSystems().getExport(id, true, "");
}
return rules;
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method volumeMigrations.
public static void volumeMigrations(String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<NamedRelatedResourceRep> migrationsRep = client.blockVolumes().listMigrations(uri(volumeId));
List<MigrationRestRep> migrations = client.blockMigrations().getByRefs(migrationsRep);
render(migrations);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class BlockVolumes method deleteContinuousCopy.
@FlashException(referrer = { "volume" })
public static void deleteContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().deactivateContinuousCopies(uri(volumeId), input, VolumeDeleteTypeEnum.FULL);
flash.put("info", MessagesUtils.get("resources.continuouscopy.deactivate"));
}
volume(volumeId, continuousCopyId);
}
Aggregations