use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class BackendNetworksResourceTest method testAddNetwork.
@Test
public void testAddNetwork() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpCreationExpectations(ActionType.AddNetwork, AddNetworkStoragePoolParameters.class, new String[] { "StoragePoolId" }, new Object[] { DATA_CENTER_ID }, true, true, // GUIDS[0],
null, QueryType.GetAllNetworks, IdQueryParameters.class, new String[] { "Id" }, new Object[] { Guid.Empty }, asList(getEntity(0)));
Network model = getModel(0);
model.setDataCenter(new DataCenter());
model.getDataCenter().setId(DATA_CENTER_ID.toString());
Response response = collection.add(model);
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof Network);
verifyModel((Network) response.getEntity(), 0);
}
use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class BackendNetworksResourceTest method testAddNetworkWithNamedDataCenter.
@Test
public void testAddNetworkWithNamedDataCenter() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(QueryType.GetStoragePoolByDatacenterName, NameQueryParameters.class, new String[] { "Name" }, new Object[] { NAMES[1] }, setUpStoragePool(DATA_CENTER_ID));
setUpCreationExpectations(ActionType.AddNetwork, AddNetworkStoragePoolParameters.class, new String[] { "StoragePoolId" }, new Object[] { DATA_CENTER_ID }, true, true, // GUIDS[0],
null, QueryType.GetAllNetworks, IdQueryParameters.class, new String[] { "Id" }, new Object[] { Guid.Empty }, asList(getEntity(0)));
Network model = getModel(0);
model.setDataCenter(new DataCenter());
model.getDataCenter().setName(NAMES[1]);
Response response = collection.add(model);
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof Network);
verifyModel((Network) response.getEntity(), 0);
}
use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class BackendDataCenterClustersResource method getDataCenter.
@Override
protected StoragePool getDataCenter(org.ovirt.engine.api.model.Cluster cluster) {
DataCenter dataCenter = new DataCenter();
dataCenter.setId(dataCenterId.toString());
cluster.setDataCenter(dataCenter);
StoragePool pool = getStoragePool(cluster.getDataCenter(), this);
return pool;
}
use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class BackendQuotasResource method addParents.
@Override
protected Quota addParents(Quota quota) {
quota.setDataCenter(new DataCenter());
quota.getDataCenter().setId(dataCenterId.toString());
return quota;
}
use of org.ovirt.engine.api.model.DataCenter in project ovirt-engine by oVirt.
the class BackendQossResource method addParents.
@Override
protected Qos addParents(Qos qos) {
qos.setDataCenter(new DataCenter());
qos.getDataCenter().setId(dataCenterId.toString());
return qos;
}
Aggregations