Search in sources :

Example 36 with BlockSnapshotRestRep

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

the class BlockSnapshotSessions method snapshotSessionLinkTarget.

public static void snapshotSessionLinkTarget(String snapshotSessionId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<RelatedResourceRep> targets = client.blockSnapshotSessions().get(uri(snapshotSessionId)).getLinkedTarget();
    List<BlockSnapshotRestRep> snapshots = client.blockSnapshots().getByRefs(targets);
    render(snapshots, snapshotSessionId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep)

Example 37 with BlockSnapshotRestRep

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

the class BlockSnapshots method snapshotDetails.

public static void snapshotDetails(String snapshotId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    AffectedResources.BlockSnapshotDetails blockSnapshot = new AffectedResources.BlockSnapshotDetails(uri(snapshotId));
    if (blockSnapshot.blockSnapshot == null) {
        flash.error(MessagesUtils.get(UNKNOWN, snapshotId));
        snapshots(null);
    }
    AffectedResources.VolumeDetails volume = new AffectedResources.VolumeDetails(blockSnapshot.volume.getId());
    List<Task<BlockSnapshotRestRep>> tasks = null;
    if (blockSnapshot.blockSnapshot != null) {
        Tasks<BlockSnapshotRestRep> tasksResponse = client.blockSnapshots().getTasks(blockSnapshot.blockSnapshot.getId());
        tasks = tasksResponse.getTasks();
    }
    render(blockSnapshot, volume, tasks);
}
Also used : Task(com.emc.vipr.client.Task) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep)

Example 38 with BlockSnapshotRestRep

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

the class BlockVolumes method volumeSnapshots.

public static void volumeSnapshots(String volumeId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<NamedRelatedResourceRep> refs = client.blockSnapshots().listByVolume(uri(volumeId));
    List<BlockSnapshotRestRep> snapshots = client.blockSnapshots().getByRefs(refs);
    render(snapshots);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 39 with BlockSnapshotRestRep

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

the class BlockExportGroupSnapshotsDataTable method fetch.

public static List<ExportBlockSnapshot> fetch(URI exportGroupId) {
    if (exportGroupId == null) {
        return Collections.emptyList();
    }
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportGroupRestRep exportGroup = client.blockExports().get(exportGroupId);
    List<ExportBlockSnapshot> snapshots = Lists.newArrayList();
    for (ExportBlockParam exportBlockParam : exportGroup.getVolumes()) {
        if (ResourceType.isType(BLOCK_SNAPSHOT, exportBlockParam.getId())) {
            BlockSnapshotRestRep snapshot = client.blockSnapshots().get(exportBlockParam.getId());
            VolumeRestRep volume = client.blockVolumes().get(snapshot.getParent().getId());
            snapshots.add(new ExportBlockSnapshot(snapshot, volume.getName()));
        }
    }
    return snapshots;
}
Also used : ExportBlockParam(com.emc.storageos.model.block.export.ExportBlockParam) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep)

Example 40 with BlockSnapshotRestRep

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

the class CreateVplexVolumeFromSnapshotService method execute.

@Override
public void execute() throws Exception {
    for (URI snapshotId : uris(snapshotIds)) {
        Task<BlockSnapshotRestRep> task = execute(new CreateVplexVolumeFromSnapshot(snapshotId));
        URI volume = task.getResourceId();
        addAffectedResource(volume);
    }
}
Also used : BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) CreateVplexVolumeFromSnapshot(com.emc.sa.service.vipr.tasks.CreateVplexVolumeFromSnapshot) URI(java.net.URI)

Aggregations

BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)41 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)20 URI (java.net.URI)17 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)13 ArrayList (java.util.ArrayList)10 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)9 Asset (com.emc.sa.asset.annotation.Asset)8 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)8 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)5 BlockSnapshotSessionRestRep (com.emc.storageos.model.block.BlockSnapshotSessionRestRep)5 AssetOption (com.emc.vipr.model.catalog.AssetOption)5 VolumeGroupCopySetParam (com.emc.storageos.model.application.VolumeGroupCopySetParam)4 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)4 HashSet (java.util.HashSet)4 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)3 ExportBlockParam (com.emc.storageos.model.block.export.ExportBlockParam)3 DeactivateBlockSnapshot (com.emc.sa.service.vipr.block.tasks.DeactivateBlockSnapshot)2 ResourceType (com.emc.sa.util.ResourceType)2 SnapshotList (com.emc.storageos.model.SnapshotList)2 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)2