Search in sources :

Example 11 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class BlockSnapshots method delete.

private static void delete(List<URI> ids) {
    if (ids != null) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        for (URI id : ids) {
            Tasks<BlockSnapshotRestRep> task = client.blockSnapshots().deactivate(id, VolumeDeleteTypeEnum.FULL);
        }
        flash.put("info", MessagesUtils.get("resources.snapshots.deactivate", ids.size()));
    }
    snapshots(null);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) URI(java.net.URI)

Example 12 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class BlockSnapshots method deleteSnapshot.

@FlashException(referrer = { "snapshotDetails" })
public static void deleteSnapshot(String snapshotId) {
    if (StringUtils.isNotBlank(snapshotId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        Tasks<BlockSnapshotRestRep> task = client.blockSnapshots().deactivate(uri(snapshotId), VolumeDeleteTypeEnum.FULL);
        flash.put("info", MessagesUtils.get("resources.snapshot.deactivate", snapshotId));
    }
    snapshotDetails(snapshotId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) FlashException(controllers.util.FlashException)

Example 13 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class Orders method rollbackTask.

@FlashException(referrer = { "receiptContent" })
public static void rollbackTask(String orderId, String taskId) {
    if (StringUtils.isNotBlank(taskId)) {
        ViPRCoreClient client = BourneUtil.getViprClient();
        client.tasks().rollback(uri(taskId));
        flash.put("info", MessagesUtils.get("resources.tasks.rollbackMessage", taskId));
    }
    receipt(orderId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FlashException(controllers.util.FlashException)

Example 14 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class BlockExportGroupVolumesDataTable method fetch.

public static List<Volume> fetch(URI exportGroupID) {
    if (exportGroupID == null) {
        return Collections.emptyList();
    }
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportGroupRestRep exportGroup = client.blockExports().get(exportGroupID);
    List<Volume> volumes = Lists.newArrayList();
    for (ExportBlockParam exportBlockParam : exportGroup.getVolumes()) {
        if (ResourceType.isType(VOLUME, exportBlockParam.getId())) {
            volumes.add(new Volume(client.blockVolumes().get(exportBlockParam.getId()), exportBlockParam));
        }
    }
    return volumes;
}
Also used : ExportBlockParam(com.emc.storageos.model.block.export.ExportBlockParam) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep)

Example 15 with ViPRCoreClient

use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.

the class BlockExportGroupsDataTable method fetch.

public static List<ExportGroup> fetch(URI projectId) {
    if (projectId == null) {
        return Collections.EMPTY_LIST;
    }
    ViPRCoreClient client = getViprClient();
    List<ExportGroupRestRep> exportGroups = client.blockExports().findByProject(projectId);
    Map<URI, String> virtualArrays = ResourceUtils.mapNames(client.varrays().list());
    List<ExportGroup> results = Lists.newArrayList();
    for (ExportGroupRestRep exportGroup : exportGroups) {
        results.add(new ExportGroup(exportGroup, virtualArrays));
    }
    return results;
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) URI(java.net.URI)

Aggregations

ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)225 Asset (com.emc.sa.asset.annotation.Asset)72 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)66 URI (java.net.URI)66 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)49 FlashException (controllers.util.FlashException)48 AssetOption (com.emc.vipr.model.catalog.AssetOption)41 ArrayList (java.util.ArrayList)34 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)29 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)27 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)24 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)20 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)15 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)15 StoragePortGroupRestRepList (com.emc.storageos.model.portgroup.StoragePortGroupRestRepList)13 HashSet (java.util.HashSet)13 Task (com.emc.vipr.client.Task)11 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)10 ViPRHttpException (com.emc.vipr.client.exceptions.ViPRHttpException)10 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)8