Search in sources :

Example 36 with NamedRelatedResourceRep

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

the class FileVirtualPoolForm method doSave.

protected FileVirtualPoolRestRep doSave() {
    FileVirtualPoolRestRep virtualPool;
    if (isNew()) {
        FileVirtualPoolBuilder builder = apply(new FileVirtualPoolBuilder());
        virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
        this.id = ResourceUtils.stringId(virtualPool);
    } else {
        FileVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getFileVirtualPool(id);
        FileVirtualPoolUpdateBuilder builder = apply(new FileVirtualPoolUpdateBuilder(oldVirtualPool));
        virtualPool = VirtualPoolUtils.update(id, builder.getVirtualPoolUpdate());
        List<NamedRelatedResourceRep> matchingPools = VirtualPoolUtils.refreshMatchingPools(virtualPool);
        Logger.info("Refreshed File Virtual Pool '%s' matching pools: %d", virtualPool.getName(), matchingPools.size());
    }
    virtualPool = saveStoragePools(virtualPool);
    return virtualPool;
}
Also used : FileVirtualPoolRestRep(com.emc.storageos.model.vpool.FileVirtualPoolRestRep) FileVirtualPoolUpdateBuilder(util.builders.FileVirtualPoolUpdateBuilder) FileVirtualPoolBuilder(util.builders.FileVirtualPoolBuilder) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 37 with NamedRelatedResourceRep

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

the class ExecutionWindowUtils method getExecutionWindows.

public static List<ExecutionWindowRestRep> getExecutionWindows() {
    ViPRCatalogClient2 catalog = getCatalogClient();
    List<NamedRelatedResourceRep> reps = catalog.executionWindows().listByUserTenant();
    return catalog.executionWindows().getByRefs(reps);
}
Also used : ViPRCatalogClient2(com.emc.vipr.client.ViPRCatalogClient2) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 38 with NamedRelatedResourceRep

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

the class BlockVolumes method volumeMigrations.

public static void volumeMigrations(String volumeId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<NamedRelatedResourceRep> migrationsRep = client.blockVolumes().listMigrations(uri(volumeId));
    List<MigrationRestRep> migrations = client.blockMigrations().getByRefs(migrationsRep);
    render(migrations);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) MigrationRestRep(com.emc.storageos.model.block.MigrationRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 39 with NamedRelatedResourceRep

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

the class BlockVolumes method volumeSnapshotSessions.

public static void volumeSnapshotSessions(String volumeId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    VolumeRestRep volume = client.blockVolumes().get(uri(volumeId));
    List<BlockSnapshotSessionRestRep> snapshotSessions = Lists.newArrayList();
    if (volume.getConsistencyGroup() != null) {
        URI consistencygroup = volume.getConsistencyGroup().getId();
        List<NamedRelatedResourceRep> cgSessions = client.blockConsistencyGroups().getSnapshotSessions(consistencygroup);
        snapshotSessions = client.blockSnapshotSessions().getByRefs(cgSessions);
    } else {
        List<NamedRelatedResourceRep> refs = client.blockSnapshotSessions().listByVolume(uri(volumeId));
        snapshotSessions = client.blockSnapshotSessions().getByRefs(refs);
    }
    render(snapshotSessions, volumeId);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) BlockSnapshotSessionRestRep(com.emc.storageos.model.block.BlockSnapshotSessionRestRep) VolumeRestRep(com.emc.storageos.model.block.VolumeRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) URI(java.net.URI)

Example 40 with NamedRelatedResourceRep

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

the class FileSystems method fileSystemSnapshots.

public static void fileSystemSnapshots(String fileSystemId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<NamedRelatedResourceRep> refs = client.fileSnapshots().listByFileSystem(uri(fileSystemId));
    List<FileSnapshotRestRep> snapshots = client.fileSnapshots().getByRefs(refs);
    render(snapshots);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileSnapshotRestRep(com.emc.storageos.model.file.FileSnapshotRestRep) 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