Search in sources :

Example 1 with ClustersUpdateParam

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);
}
Also used : ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ClustersUpdateParam(com.emc.storageos.model.block.export.ClustersUpdateParam) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) FlashException(controllers.util.FlashException)

Example 2 with ClustersUpdateParam

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);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ClustersUpdateParam(com.emc.storageos.model.block.export.ClustersUpdateParam) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) FlashException(controllers.util.FlashException)

Example 3 with ClustersUpdateParam

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);
}
Also used : ClustersUpdateParam(com.emc.storageos.model.block.export.ClustersUpdateParam) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) ExportPathParameters(com.emc.storageos.model.block.export.ExportPathParameters)

Aggregations

ClustersUpdateParam (com.emc.storageos.model.block.export.ClustersUpdateParam)3 ExportUpdateParam (com.emc.storageos.model.block.export.ExportUpdateParam)3 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)2 FlashException (controllers.util.FlashException)2 ExportPathParameters (com.emc.storageos.model.block.export.ExportPathParameters)1 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)1