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;
}
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);
}
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;
}
Aggregations