Search in sources :

Example 21 with BlockConsistencyGroupRestRep

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

the class BlockConsistencyGroups method deleteConsistencyGroup.

@FlashException(referrer = { "consistencyGroupDetails" })
public static void deleteConsistencyGroup(String consistencyGroupId) {
    if (StringUtils.isNotBlank(consistencyGroupId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        Task<BlockConsistencyGroupRestRep> task = client.blockConsistencyGroups().deactivate(uri(consistencyGroupId));
        flash.put("info", MessagesUtils.get("resources.consistencygroup.deactivate"));
    }
    consistencyGroupDetails(consistencyGroupId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) FlashException(controllers.util.FlashException)

Example 22 with BlockConsistencyGroupRestRep

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

the class ConsistencyGroups method listJson.

public static void listJson(String projectId) {
    List<BlockConsistencyGroup> items = Lists.newArrayList();
    if (StringUtils.isNotBlank(projectId)) {
        for (BlockConsistencyGroupRestRep cg : BlockConsistencyGroupUtils.getBlockConsistencyGroups(projectId)) {
            items.add(new BlockConsistencyGroup(cg));
        }
    }
    renderJSON(DataTablesSupport.createJSON(items, params));
}
Also used : BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) BlockConsistencyGroup(models.datatable.BlockConsistencyGroupDataTable.BlockConsistencyGroup)

Example 23 with BlockConsistencyGroupRestRep

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

the class ConsistencyGroups method delete.

private static void delete(List<URI> ids) {
    if (!ids.isEmpty()) {
        BlockConsistencyGroupRestRep cg = BlockConsistencyGroupUtils.getBlockConsistencyGroup(ids.get(0));
        if (cg != null) {
            flash.put(ACTIVE_PROJECT_ID, cg.getProject().getId().toString());
        }
    }
    for (URI id : ids) {
        BlockConsistencyGroupUtils.deactivate(id);
    }
    flash.success(MessagesUtils.get("consistencyGroups.deleted"));
    list();
}
Also used : BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) URI(java.net.URI)

Example 24 with BlockConsistencyGroupRestRep

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

the class ConsistencyUtils method removeFullCopy.

static Tasks<BlockConsistencyGroupRestRep> removeFullCopy(URI consistencyGroupId, URI fullCopyId) {
    Tasks<BlockConsistencyGroupRestRep> tasks = execute(new DetachConsistencyGroupFullCopy(consistencyGroupId, fullCopyId));
    BlockStorageUtils.removeBlockResources(Collections.singletonList(fullCopyId), VolumeDeleteTypeEnum.FULL);
    return tasks;
}
Also used : BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) DetachConsistencyGroupFullCopy(com.emc.sa.service.vipr.block.consistency.tasks.DetachConsistencyGroupFullCopy)

Example 25 with BlockConsistencyGroupRestRep

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

the class ConsistencyUtils method createFullCopy.

static Tasks<BlockConsistencyGroupRestRep> createFullCopy(URI consistencyGroupId, String name, Integer count) {
    int countValue = (count != null) ? count : 1;
    Tasks<BlockConsistencyGroupRestRep> copies = execute(new CreateConsistencyGroupFullCopy(consistencyGroupId, name, countValue));
    addAffectedResources(copies);
    return copies;
}
Also used : BlockConsistencyGroupRestRep(com.emc.storageos.model.block.BlockConsistencyGroupRestRep) CreateConsistencyGroupFullCopy(com.emc.sa.service.vipr.block.consistency.tasks.CreateConsistencyGroupFullCopy)

Aggregations

BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)28 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)15 Asset (com.emc.sa.asset.annotation.Asset)12 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)10 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)10 URI (java.net.URI)9 ArrayList (java.util.ArrayList)8 AssetOption (com.emc.vipr.model.catalog.AssetOption)6 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)3 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)3 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)2 BlockObjectRestRep (com.emc.storageos.model.block.BlockObjectRestRep)2 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)2 ProtectionRestRep (com.emc.storageos.model.block.VolumeRestRep.ProtectionRestRep)2 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)2 SRDFSourceFilter (com.emc.vipr.client.core.filters.SRDFSourceFilter)2 FlashException (controllers.util.FlashException)2 HashSet (java.util.HashSet)2 CreateConsistencyGroupFullCopy (com.emc.sa.service.vipr.block.consistency.tasks.CreateConsistencyGroupFullCopy)1 DetachConsistencyGroupFullCopy (com.emc.sa.service.vipr.block.consistency.tasks.DetachConsistencyGroupFullCopy)1