Search in sources :

Example 6 with ViPRCoreClient

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

the class BlockExportGroups method removeCluster.

@FlashException(referrer = { "exportGroup" })
public static void removeCluster(String exportGroupId, String clusterId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
    exportUpdateParam.setClusters(new ClustersUpdateParam());
    exportUpdateParam.getClusters().getRemove().add(uri(clusterId));
    Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
    flash.put("info", MessagesUtils.get("resources.exportgroup.cluster.removed", task.getOpId()));
    exportGroup(exportGroupId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ClustersUpdateParam(com.emc.storageos.model.block.export.ClustersUpdateParam) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) FlashException(controllers.util.FlashException)

Example 7 with ViPRCoreClient

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

the class BlockExportGroups method exportGroup.

public static void exportGroup(String exportGroupId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportGroupRestRep exportGroup = null;
    try {
        exportGroup = client.blockExports().get(uri(exportGroupId));
    } catch (ViPRHttpException e) {
        if (e.getHttpCode() == 404) {
            flash.error(MessagesUtils.get(UNKNOWN, exportGroupId));
            exportGroups(null);
        }
        throw e;
    }
    VirtualArrayRestRep virtualArray = null;
    if (exportGroup != null) {
        virtualArray = client.varrays().get(exportGroup.getVirtualArray());
    } else {
        notFound("Export Group " + exportGroupId);
    }
    renderArgs.put("volumeDataTable", new BlockExportGroupVolumesDataTable());
    renderArgs.put("snapshotDataTable", new BlockExportGroupSnapshotsDataTable());
    SimpleHostDataTable hostsDataTable = new SimpleHostDataTable();
    NetworkEndpointDataTable initiatorsDataTable = NetworkEndpointDataTable.createDataTable("FC");
    initiatorsDataTable.alterColumn("portGroup").hidden().setSearchable(false);
    initiatorsDataTable.alterColumn("storageSystem").hidden().setSearchable(false);
    initiatorsDataTable.alterColumn("discovered").hidden().setSearchable(false);
    HostClusterDataTable clustersDataTable = new HostClusterDataTable();
    render(hostsDataTable, initiatorsDataTable, clustersDataTable, exportGroup, virtualArray);
}
Also used : HostClusterDataTable(models.datatable.HostClusterDataTable) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) NetworkEndpointDataTable(models.datatable.NetworkEndpointDataTable) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) BlockExportGroupSnapshotsDataTable(models.datatable.BlockExportGroupSnapshotsDataTable) BlockExportGroupVolumesDataTable(models.datatable.BlockExportGroupVolumesDataTable) SimpleHostDataTable(models.datatable.SimpleHostDataTable) ViPRHttpException(com.emc.vipr.client.exceptions.ViPRHttpException)

Example 8 with ViPRCoreClient

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

the class BlockExportGroups method removeSnapshot.

@FlashException(referrer = { "exportGroup" })
public static void removeSnapshot(String exportGroupId, String snapshotId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
    exportUpdateParam.removeVolume(uri(snapshotId));
    Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
    flash.put("info", MessagesUtils.get("resources.exportgroup.snapshot.removed", task.getOpId()));
    exportGroup(exportGroupId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) ExportUpdateParam(com.emc.storageos.model.block.export.ExportUpdateParam) FlashException(controllers.util.FlashException)

Example 9 with ViPRCoreClient

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

the class BlockSnapshotSessions method delete.

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

Example 10 with ViPRCoreClient

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

the class BlockSnapshotSessions method snapshotSessionDetails.

public static void snapshotSessionDetails(String snapshotSessionId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    AffectedResources.BlockSnapshotSessionDetails blockSnapshotSession = new AffectedResources.BlockSnapshotSessionDetails(uri(snapshotSessionId));
    if (blockSnapshotSession.blockSnapshotSession == null) {
        flash.error(MessagesUtils.get(UNKNOWN, snapshotSessionId));
        snapshotSessions(null);
    }
    if (blockSnapshotSession.volume != null) {
        AffectedResources.VolumeDetails volume = new AffectedResources.VolumeDetails(blockSnapshotSession.volume.getId());
        renderArgs.put("volume", volume);
    }
    List<Task<BlockSnapshotSessionRestRep>> tasks = null;
    if (blockSnapshotSession.blockSnapshotSession != null) {
        Tasks<BlockSnapshotSessionRestRep> tasksResponse = client.blockSnapshotSessions().getTasks(blockSnapshotSession.blockSnapshotSession.getId());
        tasks = tasksResponse.getTasks();
    }
    render(blockSnapshotSession, tasks);
}
Also used : Task(com.emc.vipr.client.Task) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotSessionRestRep(com.emc.storageos.model.block.BlockSnapshotSessionRestRep)

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