Search in sources :

Example 1 with BlockConsistencyGroupVolumeList

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

the class BlockConsistencyGroups method removeVolume.

@FlashException(referrer = { "consistencyGroupDetails" })
public static void removeVolume(String consistencyGroupId, String volumeId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<URI> uris = new ArrayList<URI>();
    uris.add(uri(volumeId));
    BlockConsistencyGroupUpdate blockConsistencyGroupUpdate = new BlockConsistencyGroupUpdate();
    BlockConsistencyGroupVolumeList volumeList = new BlockConsistencyGroupVolumeList();
    volumeList.setVolumes(uris);
    blockConsistencyGroupUpdate.setRemoveVolumesList(volumeList);
    Task<BlockConsistencyGroupRestRep> task = client.blockConsistencyGroups().update(uri(consistencyGroupId), blockConsistencyGroupUpdate);
    flash.put("info", MessagesUtils.get("resources.consistencygroup.volume.removed", task.getOpId()));
    consistencyGroupDetails(consistencyGroupId);
}
Also used : BlockConsistencyGroupVolumeList(com.emc.storageos.model.block.BlockConsistencyGroupUpdate.BlockConsistencyGroupVolumeList) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) ArrayList(java.util.ArrayList) BlockConsistencyGroupUpdate(com.emc.storageos.model.block.BlockConsistencyGroupUpdate) URI(java.net.URI) FlashException(controllers.util.FlashException)

Example 2 with BlockConsistencyGroupVolumeList

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

the class AddVolumesToConsistencyGroup method doExecute.

@Override
protected Task<BlockConsistencyGroupRestRep> doExecute() throws Exception {
    BlockConsistencyGroupUpdate blockConsistencyGroupUpdate = new BlockConsistencyGroupUpdate();
    BlockConsistencyGroupVolumeList volumeList = new BlockConsistencyGroupVolumeList();
    volumeList.setVolumes(volumeIds);
    blockConsistencyGroupUpdate.setAddVolumesList(volumeList);
    return getClient().blockConsistencyGroups().update(consistencyGroupId, blockConsistencyGroupUpdate);
}
Also used : BlockConsistencyGroupVolumeList(com.emc.storageos.model.block.BlockConsistencyGroupUpdate.BlockConsistencyGroupVolumeList) BlockConsistencyGroupUpdate(com.emc.storageos.model.block.BlockConsistencyGroupUpdate)

Aggregations

BlockConsistencyGroupUpdate (com.emc.storageos.model.block.BlockConsistencyGroupUpdate)2 BlockConsistencyGroupVolumeList (com.emc.storageos.model.block.BlockConsistencyGroupUpdate.BlockConsistencyGroupVolumeList)2 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)1 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)1 FlashException (controllers.util.FlashException)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1