Search in sources :

Example 6 with CopiesParam

use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.

the class FailoverBlockVolume method doExecute.

@Override
protected Tasks<VolumeRestRep> doExecute() throws Exception {
    Copy copy = new Copy();
    copy.setType(type);
    copy.setCopyID(failoverTarget);
    if (pointInTime != null) {
        copy.setPointInTime(pointInTime);
    }
    CopiesParam param = new CopiesParam();
    param.getCopies().add(copy);
    return getClient().blockVolumes().failover(volumeId, param);
}
Also used : Copy(com.emc.storageos.model.block.Copy) CopiesParam(com.emc.storageos.model.block.CopiesParam)

Example 7 with CopiesParam

use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.

the class SwapContinuousCopies method doExecute.

@Override
protected Tasks<VolumeRestRep> doExecute() throws Exception {
    Copy copy = new Copy();
    copy.setCopyID(targetVolumeId);
    copy.setType(type);
    CopiesParam param = new CopiesParam();
    param.getCopies().add(copy);
    return getClient().blockVolumes().swapContinuousCopies(targetVolumeId, param);
}
Also used : Copy(com.emc.storageos.model.block.Copy) CopiesParam(com.emc.storageos.model.block.CopiesParam)

Example 8 with CopiesParam

use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.

the class UpdateBlockVolumeAccessMode method doExecute.

@Override
protected Tasks<VolumeRestRep> doExecute() throws Exception {
    Copy copy = new Copy();
    copy.setType(type);
    copy.setCopyID(failoverTarget);
    copy.setAccessMode(accessMode);
    CopiesParam param = new CopiesParam();
    param.getCopies().add(copy);
    return getClient().blockVolumes().updateCopyAccessMode(volumeId, param);
}
Also used : Copy(com.emc.storageos.model.block.Copy) CopiesParam(com.emc.storageos.model.block.CopiesParam)

Example 9 with CopiesParam

use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.

the class BlockVolumes method createCopiesParam.

@Util
private static CopiesParam createCopiesParam(String continuousCopyId) {
    Copy copy = new Copy();
    copy.setType(COPY_NATIVE);
    copy.setCopyID(uri(continuousCopyId));
    List<Copy> copies = Lists.newArrayList();
    copies.add(copy);
    CopiesParam input = new CopiesParam(copies);
    return input;
}
Also used : Copy(com.emc.storageos.model.block.Copy) CopiesParam(com.emc.storageos.model.block.CopiesParam) BourneUtil(util.BourneUtil) Util(play.mvc.Util)

Example 10 with CopiesParam

use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.

the class BlockVolumes method stopContinuousCopy.

@FlashException(referrer = { "volume" })
public static void stopContinuousCopy(String volumeId, String continuousCopyId) {
    if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        CopiesParam input = createCopiesParam(continuousCopyId);
        Tasks<VolumeRestRep> tasks = client.blockVolumes().stopContinuousCopies(uri(volumeId), input);
        flash.put("info", MessagesUtils.get("resources.continuouscopy.stop"));
    }
    volume(volumeId, null);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) CopiesParam(com.emc.storageos.model.block.CopiesParam) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) FlashException(controllers.util.FlashException)

Aggregations

CopiesParam (com.emc.storageos.model.block.CopiesParam)16 Copy (com.emc.storageos.model.block.Copy)12 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)5 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)4 FlashException (controllers.util.FlashException)4 UnManagedVolumeRestRep (com.emc.storageos.model.block.UnManagedVolumeRestRep)1 ServiceErrorException (com.emc.vipr.client.exceptions.ServiceErrorException)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 Util (play.mvc.Util)1 BourneUtil (util.BourneUtil)1