Search in sources :

Example 1 with MigrationRestRep

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

the class BlockMapper method map.

public static MigrationRestRep map(Migration from) {
    if (from == null) {
        return null;
    }
    MigrationRestRep to = new MigrationRestRep();
    to.setVolume(toRelatedResource(ResourceTypeEnum.VOLUME, from.getVolume()));
    to.setSource(toRelatedResource(ResourceTypeEnum.VOLUME, from.getSource()));
    to.setTarget(toRelatedResource(ResourceTypeEnum.VOLUME, from.getTarget()));
    to.setStartTime(from.getStartTime());
    to.setStatus(from.getMigrationStatus());
    to.setPercentageDone(from.getPercentDone());
    return to;
}
Also used : MigrationRestRep(com.emc.storageos.model.block.MigrationRestRep)

Example 2 with MigrationRestRep

use of com.emc.storageos.model.block.MigrationRestRep 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 3 with MigrationRestRep

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

the class BlockMigrationMapper method map.

/**
 * Maps the passed migration instance to its corresponding REST response.
 *
 * @param from A reference to a migration instance.
 *
 * @return The response instance.
 */
public static MigrationRestRep map(final Migration from) {
    if (from == null) {
        return null;
    }
    MigrationRestRep to = new MigrationRestRep();
    DbObjectMapper.mapDataObjectFields(from, to);
    to.setVolume(DbObjectMapper.toRelatedResource(ResourceTypeEnum.VOLUME, from.getVolume()));
    to.setSource(DbObjectMapper.toRelatedResource(ResourceTypeEnum.VOLUME, from.getSource()));
    to.setTarget(DbObjectMapper.toRelatedResource(ResourceTypeEnum.VOLUME, from.getTarget()));
    to.setStartTime(from.getStartTime());
    to.setPercentageDone(from.getPercentDone());
    to.setStatus(from.getMigrationStatus());
    return to;
}
Also used : MigrationRestRep(com.emc.storageos.model.block.MigrationRestRep)

Aggregations

MigrationRestRep (com.emc.storageos.model.block.MigrationRestRep)3 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)1