use of com.emc.storageos.model.block.export.ExportUpdateParam in project coprhd-controller by CoprHD.
the class BlockExportGroups method addClusters.
@FlashException(referrer = { "exportGroup" })
public static void addClusters(String exportId, @As(",") String[] ids) {
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setClusters(new ClustersUpdateParam());
if (ids != null && ids.length > 0) {
for (String clusterId : ids) {
exportUpdateParam.getClusters().getAdd().add(uri(clusterId));
}
}
Task<ExportGroupRestRep> task = getViprClient().blockExports().update(uri(exportId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.clusters.added", task.getOpId()));
exportGroup(exportId);
}
use of com.emc.storageos.model.block.export.ExportUpdateParam 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.storageos.model.block.export.ExportUpdateParam 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.ExportUpdateParam in project coprhd-controller by CoprHD.
the class AddHostToExport method doExecute.
@Override
protected Task<ExportGroupRestRep> doExecute() throws Exception {
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setHosts(new HostsUpdateParam());
exportUpdateParam.getHosts().getAdd().add(hostId);
// Only add the export path parameters to the call if we have to
boolean addExportPathParameters = false;
ExportPathParameters exportPathParameters = new ExportPathParameters();
if (minPaths != null && maxPaths != null && pathsPerInitiator != null) {
exportPathParameters.setMinPaths(minPaths);
exportPathParameters.setMaxPaths(maxPaths);
exportPathParameters.setPathsPerInitiator(pathsPerInitiator);
addExportPathParameters = true;
}
if (portGroup != null) {
exportPathParameters.setPortGroup(portGroup);
addExportPathParameters = true;
}
if (addExportPathParameters) {
exportUpdateParam.setExportPathParameters(exportPathParameters);
}
return getClient().blockExports().update(exportId, exportUpdateParam);
}
use of com.emc.storageos.model.block.export.ExportUpdateParam in project coprhd-controller by CoprHD.
the class ViPRClientApp method addVolumeToExport.
public void addVolumeToExport(URI volumeId, ExportGroupRestRep export) {
ExportUpdateParam input = new ExportUpdateParam();
input.addVolume(volumeId);
client.blockExports().update(export.getId(), input);
}
Aggregations