Search in sources :

Example 21 with NamedRelatedResourceRep

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

the class BlockApplications method applicationSnapSessionJson.

public static void applicationSnapSessionJson(String id) {
    List<ApplicationSnapSessionSets> snapDetails = Lists.newArrayList();
    Set<String> sessionSet = AppSupportUtil.getVolumeGroupSnapsetSessionSets(id);
    for (String snap : sessionSet) {
        List<NamedRelatedResourceRep> snapshots = AppSupportUtil.getVolumeGroupSnapshotSessionsByCopySet(id, snap);
        snapDetails.add(new ApplicationSnapSessionSets(snap, snapshots));
    }
    renderJSON(DataTablesSupport.createJSON(snapDetails, params));
}
Also used : ApplicationSnapSessionSets(models.datatable.ApplicationSnapSessionSetDataTable.ApplicationSnapSessionSets) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 22 with NamedRelatedResourceRep

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

the class BlockApplications method getAssociatedVolumesJSON.

public static void getAssociatedVolumesJSON(String copyLabel) {
    List<VolumeApplication> volumeDetails = Lists.newArrayList();
    String[] copySets = copyLabel.split("~~~");
    List<NamedRelatedResourceRep> volumeDetailClone = AppSupportUtil.getVolumeGroupFullCopiesForSet(copySets[0], copySets[1]);
    Map<URI, String> virtualArrays = ResourceUtils.mapNames(BourneUtil.getViprClient().varrays().list());
    Map<URI, String> virtualPools = ResourceUtils.mapNames(BourneUtil.getViprClient().blockVpools().list());
    for (NamedRelatedResourceRep volume : volumeDetailClone) {
        VolumeRestRep blockVolume = BourneUtil.getViprClient().blockVolumes().get(volume.getId());
        volumeDetails.add(new VolumeApplication(blockVolume, virtualArrays, virtualPools));
    }
    renderJSON(DataTablesSupport.createJSON(volumeDetails, params));
}
Also used : NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) VolumeApplication(controllers.resources.BlockApplications.VolumeApplicationDataTable.VolumeApplication) URI(java.net.URI)

Example 23 with NamedRelatedResourceRep

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

the class BlockApplications method getAssociatedSnapSessionJSON.

public static void getAssociatedSnapSessionJSON(String sessionLabel) {
    String[] sessionSet = sessionLabel.split("~~~");
    List<ApplicationSnapshotSession> sessionDetails = Lists.newArrayList();
    List<NamedRelatedResourceRep> sessionSetDetails = AppSupportUtil.getVolumeGroupSnapshotSessionsByCopySet(sessionSet[0], sessionSet[1]);
    for (NamedRelatedResourceRep snapSession : sessionSetDetails) {
        BlockSnapshotSessionRestRep snapshotSession = BourneUtil.getViprClient().blockSnapshotSessions().get(snapSession.getId());
        sessionDetails.add(new ApplicationSnapshotSession(snapshotSession));
    }
    renderJSON(DataTablesSupport.createJSON(sessionDetails, params));
}
Also used : BlockSnapshotSessionRestRep(com.emc.storageos.model.block.BlockSnapshotSessionRestRep) ApplicationSnapshotSession(models.datatable.ApplicationSnapSessionDataTable.ApplicationSnapshotSession) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 24 with NamedRelatedResourceRep

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

the class BlockApplications method applicationVolumeJson.

public static void applicationVolumeJson(String id) {
    List<VolumeApplication> volumeDetails = Lists.newArrayList();
    List<NamedRelatedResourceRep> volumes = AppSupportUtil.getVolumesByApplication(id);
    Map<URI, String> virtualArrays = ResourceUtils.mapNames(BourneUtil.getViprClient().varrays().list());
    Map<URI, String> virtualPools = ResourceUtils.mapNames(BourneUtil.getViprClient().blockVpools().list());
    for (NamedRelatedResourceRep volume : volumes) {
        VolumeRestRep blockVolume = BourneUtil.getViprClient().blockVolumes().get((volume.getId()));
        volumeDetails.add(new VolumeApplication(blockVolume, virtualArrays, virtualPools));
    }
    renderJSON(DataTablesSupport.createJSON(volumeDetails, params));
}
Also used : NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) VolumeApplication(controllers.resources.BlockApplications.VolumeApplicationDataTable.VolumeApplication) URI(java.net.URI)

Example 25 with NamedRelatedResourceRep

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

the class BlockApplications method getAssociatedSnapshotsJSON.

public static void getAssociatedSnapshotsJSON(String snapLabel) {
    String[] snapSets = snapLabel.split("~~~");
    List<ApplicationSnapshots> snapShotDetails = Lists.newArrayList();
    List<NamedRelatedResourceRep> snapsetDetails = AppSupportUtil.getVolumeGroupSnapshotsForSet(snapSets[0], snapSets[1]);
    for (NamedRelatedResourceRep snapShot : snapsetDetails) {
        BlockSnapshotRestRep blockSnapshot = BourneUtil.getViprClient().blockSnapshots().get(snapShot.getId());
        snapShotDetails.add(new ApplicationSnapshots(blockSnapshot));
    }
    renderJSON(DataTablesSupport.createJSON(snapShotDetails, params));
}
Also used : ApplicationSnapshots(models.datatable.ApplicationSnapshotDataTable.ApplicationSnapshots) BlockSnapshotRestRep(com.emc.storageos.model.block.BlockSnapshotRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Aggregations

NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)111 URI (java.net.URI)47 ArrayList (java.util.ArrayList)28 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)22 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)18 Asset (com.emc.sa.asset.annotation.Asset)11 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)11 AssetOption (com.emc.vipr.model.catalog.AssetOption)9 HashMap (java.util.HashMap)8 GET (javax.ws.rs.GET)8 Produces (javax.ws.rs.Produces)8 NamedVolumesList (com.emc.storageos.model.block.NamedVolumesList)7 Path (javax.ws.rs.Path)7 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)6 NamedURI (com.emc.storageos.db.client.model.NamedURI)5 SnapshotList (com.emc.storageos.model.SnapshotList)5 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)5 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)5 HashSet (java.util.HashSet)5 List (java.util.List)5