use of org.ovirt.engine.api.model.OpenStackVolumeProvider in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeAuthenticationKeysResource method addProvider.
private OpenstackVolumeAuthenticationKey addProvider(OpenstackVolumeAuthenticationKey authenticationKey) {
OpenStackVolumeProvider provider = new OpenStackVolumeProvider();
provider.setId(providerId);
authenticationKey.setOpenstackVolumeProvider(provider);
return authenticationKey;
}
use of org.ovirt.engine.api.model.OpenStackVolumeProvider in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeTypesResource method addParents.
@Override
protected OpenStackVolumeType addParents(OpenStackVolumeType volumeType) {
OpenStackVolumeProvider provider = new OpenStackVolumeProvider();
provider.setId(providerId);
volumeType.setOpenstackVolumeProvider(provider);
return super.addParents(volumeType);
}
use of org.ovirt.engine.api.model.OpenStackVolumeProvider in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeProviderResourceTest method getModel.
private OpenStackVolumeProvider getModel(int index) {
OpenStackVolumeProvider model = new OpenStackVolumeProvider();
model.setName(NAMES[index]);
model.setDescription(DESCRIPTIONS[index]);
return model;
}
use of org.ovirt.engine.api.model.OpenStackVolumeProvider in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeProviderResourceTest method testConflictedUpdate.
@Test
public void testConflictedUpdate() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpGetEntityExpectations(1);
OpenStackVolumeProvider model = getModel(1);
model.setId(GUIDS[1].toString());
try {
resource.update(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyImmutabilityConstraint(wae);
}
}
use of org.ovirt.engine.api.model.OpenStackVolumeProvider 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;
}
Aggregations