use of com.emc.storageos.model.block.export.ClustersUpdateParam 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.ClustersUpdateParam 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.ClustersUpdateParam in project coprhd-controller by CoprHD.
the class AddClusterToExport method doExecute.
@Override
protected Task<ExportGroupRestRep> doExecute() throws Exception {
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setClusters(new ClustersUpdateParam());
exportUpdateParam.getClusters().getAdd().add(clusterId);
// 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);
}
Aggregations