use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class AbstractBackendCpuProfileResource method addLinks.
@Override
protected CpuProfile addLinks(CpuProfile model, Class<? extends BaseResource> suggestedParent, String... subCollectionMembersToExclude) {
if (model.isSetQos() && model.getQos().isSetId()) {
QosBase qos = getEntity(QosBase.class, QueryType.GetQosById, new IdQueryParameters(asGuid(model.getQos().getId())), "qos");
model.getQos().setDataCenter(new DataCenter());
model.getQos().getDataCenter().setId(qos.getStoragePoolId().toString());
}
return super.addLinks(model, suggestedParent, subCollectionMembersToExclude);
}
use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class BackendDataCenterNetworksResource method add.
@Override
public Response add(Network network) {
validateParameters(network, getRequiredAddFields());
DataCenter dataCenter = new DataCenter();
dataCenter.setId(dataCenterId.toString());
network.setDataCenter(dataCenter);
org.ovirt.engine.core.common.businessentities.network.Network entity = map(network);
AddNetworkStoragePoolParameters params = getAddParameters(network, entity);
return performCreate(network.isSetExternalProvider() ? ActionType.AddNetworkOnProvider : addAction, params, new DataCenterNetworkIdResolver(network.getName(), params.getStoragePoolId().toString()));
}
use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class BackendAttachedStorageDomainResource method addParents.
@Override
protected StorageDomain addParents(StorageDomain storageDomain) {
// This is for backwards compatibility and will be removed in the future:
storageDomain.setDataCenter(new DataCenter());
storageDomain.getDataCenter().setId(dataCenterId.toString());
// Find all the data centers that this storage domain is attached to and add references to them:
StorageDomainHelper.addAttachedDataCenterReferences(this, storageDomain);
return storageDomain;
}
use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class BackendAttachedStorageDomainsResource method addParents.
@Override
protected StorageDomain addParents(StorageDomain storageDomain) {
// This is for backwards compatibility and will be removed in the future:
storageDomain.setDataCenter(new DataCenter());
storageDomain.getDataCenter().setId(dataCenterId.toString());
// Find all the data centers that this storage domain is attached to and add references to them:
StorageDomainHelper.addAttachedDataCenterReferences(this, storageDomain);
return storageDomain;
}
use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class PermissionMapper method setObjectId.
/**
* Completeness of "{entityType}.id" already validated
*/
private static void setObjectId(Permission model, org.ovirt.engine.core.common.businessentities.Permission entity) {
String id = entity.getObjectId().toString();
switch(entity.getObjectType()) {
case System:
break;
case StoragePool:
model.setDataCenter(new DataCenter());
model.getDataCenter().setId(id);
break;
case Cluster:
model.setCluster(new Cluster());
model.getCluster().setId(id);
break;
case VDS:
model.setHost(new Host());
model.getHost().setId(id);
break;
case Storage:
model.setStorageDomain(new StorageDomain());
model.getStorageDomain().setId(id);
break;
case VM:
model.setVm(new Vm());
model.getVm().setId(id);
break;
case VmPool:
model.setVmPool(new VmPool());
model.getVmPool().setId(id);
break;
case VmTemplate:
model.setTemplate(new Template());
model.getTemplate().setId(id);
break;
case Disk:
model.setDisk(new Disk());
model.getDisk().setId(id);
break;
default:
assert false;
}
}
Aggregations