Search in sources :

Example 1 with ExportUpdateParam

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);
}
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 ExportUpdateParam

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);
}
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 ExportUpdateParam

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

Example 4 with ExportUpdateParam

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

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

Aggregations

ExportUpdateParam (com.emc.storageos.model.block.export.ExportUpdateParam)13 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)8 FlashException (controllers.util.FlashException)8 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)5 ExportPathParameters (com.emc.storageos.model.block.export.ExportPathParameters)4 HostsUpdateParam (com.emc.storageos.model.block.export.HostsUpdateParam)4 ClustersUpdateParam (com.emc.storageos.model.block.export.ClustersUpdateParam)3 InitiatorsUpdateParam (com.emc.storageos.model.block.export.InitiatorsUpdateParam)2 VolumeParam (com.emc.storageos.model.block.export.VolumeParam)2 VolumeUpdateParam (com.emc.storageos.model.block.export.VolumeUpdateParam)2 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2