use of org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey in project ovirt-engine by oVirt.
the class OpenStackVolumeAuthenticationKeyMapper method map.
@Mapping(from = LibvirtSecret.class, to = OpenstackVolumeAuthenticationKey.class)
public static OpenstackVolumeAuthenticationKey map(LibvirtSecret entity, OpenstackVolumeAuthenticationKey template) {
OpenstackVolumeAuthenticationKey model = template != null ? template : new OpenstackVolumeAuthenticationKey();
if (entity.getId() != null) {
model.setId(entity.getId().toString());
model.setUuid(entity.getId().toString());
}
if (entity.getDescription() != null) {
model.setDescription(entity.getDescription());
}
if (entity.getCreationDate() != null) {
model.setCreationDate(DateMapper.map(entity.getCreationDate(), null));
}
if (entity.getUsageType() != null) {
model.setUsageType(map(entity.getUsageType(), null));
}
if (entity.getProviderId() != null) {
OpenStackVolumeProvider provider = new OpenStackVolumeProvider();
provider.setId(entity.getProviderId().toString());
model.setOpenstackVolumeProvider(provider);
}
return model;
}
use of org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeAuthenticationKeyResourceTest method getModel.
private OpenstackVolumeAuthenticationKey getModel(int index) {
OpenstackVolumeAuthenticationKey model = new OpenstackVolumeAuthenticationKey();
model.setId(GUIDS[index].toString());
model.setDescription(DESCRIPTIONS[index]);
OpenStackVolumeProvider provider = new OpenStackVolumeProvider();
provider.setId(GUIDS[0].toString());
model.setOpenstackVolumeProvider(provider);
model.setUsageType(OpenstackVolumeAuthenticationKeyUsageType.CEPH);
return model;
}
Aggregations