use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.
the class ApiSystemTestUtil method attachContinuousCopy.
public List<URI> attachContinuousCopy(URI volumeURI, String copyName) {
try {
List<URI> mirrors = new ArrayList<URI>();
Copy copy = new Copy("native", Copy.SyncDirection.SOURCE_TO_TARGET.name(), null, copyName, 1);
CopiesParam input = new CopiesParam();
List<Copy> copies = input.getCopies();
copies.add(copy);
input.setCopies((copies));
;
Tasks<VolumeRestRep> tasks = client.blockVolumes().startContinuousCopies(volumeURI, input);
for (VolumeRestRep volumeRestRep : tasks.get()) {
log.info(String.format("Mirror %s (%s)", volumeRestRep.getName(), volumeRestRep.getNativeId()));
mirrors.add(volumeRestRep.getId());
}
return mirrors;
} catch (ServiceErrorException ex) {
log.info(String.format("Could not attach mirror %s to volume %s", copyName, volumeURI));
throw ex;
}
}
use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.
the class BlockVolumes method deleteContinuousCopy.
@FlashException(referrer = { "volume" })
public static void deleteContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().deactivateContinuousCopies(uri(volumeId), input, VolumeDeleteTypeEnum.FULL);
flash.put("info", MessagesUtils.get("resources.continuouscopy.deactivate"));
}
volume(volumeId, continuousCopyId);
}
use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.
the class BlockVolumes method pauseContinuousCopy.
@FlashException(referrer = { "volume" })
public static void pauseContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().pauseContinuousCopies(uri(volumeId), input);
flash.put("info", MessagesUtils.get("resources.continuouscopy.pause"));
}
volume(volumeId, null);
}
use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.
the class BlockVolumes method resumeContinuousCopy.
@FlashException(referrer = { "volume" })
public static void resumeContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().resumeContinuousCopies(uri(volumeId), input);
flash.put("info", MessagesUtils.get("resources.continuouscopy.resume"));
}
volume(volumeId, null);
}
use of com.emc.storageos.model.block.CopiesParam in project coprhd-controller by CoprHD.
the class DeactivateContinuousCopy method doExecute.
@Override
protected Tasks<VolumeRestRep> doExecute() throws Exception {
Copy copy = new Copy();
copy.setType(type);
copy.setCopyID(continuousCopyId);
CopiesParam param = new CopiesParam();
param.getCopies().add(copy);
return getClient().blockVolumes().deactivateContinuousCopies(volumeId, param, deleteType);
}
Aggregations