use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class JsonObjectSerializationEntitiesTest method data.
@Parameterized.Parameters
public static Object[] data() {
RandomUtils random = RandomUtils.instance();
VdsStatic vdsStatic = new VdsStatic(random.nextString(10), random.nextString(10), random.nextInt(), random.nextInt(), random.nextString(10), Guid.newGuid(), Guid.newGuid(), random.nextString(10), random.nextBoolean(), random.nextEnum(VDSType.class), Guid.newGuid());
return new Object[] { vdsStatic, randomVdsDynamic(), randomVdsStatistics(), new VdsSpmIdMap(Guid.newGuid(), Guid.newGuid(), random.nextInt()), randomStorageDomainStatic(), new StorageDomainDynamic(random.nextInt(), Guid.newGuid(), random.nextInt()), randomStoragePool(), new StoragePoolIsoMap(Guid.newGuid(), Guid.newGuid(), random.nextEnum(StorageDomainStatus.class)), randomRole(), new IdContainerClass<>(new VdsSpmIdMap(Guid.newGuid(), Guid.newGuid(), random.nextInt())), new IdContainerClass<>(Guid.newGuid()) };
}
use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class BaseNetworkImplementationDetailsUtilsTest method setUpBefore.
@Before
public void setUpBefore() throws Exception {
qosA = createAndMockQos(30, 30, 30);
qosB = createAndMockQos(60, 60, 60);
unlimitedHostNetworkQos = createQos(null, null, null);
VdsStatic vdsStatic = new VdsStatic();
vdsStatic.setId(VDS_ID);
vdsStatic.setClusterId(CLUSTER_ID);
VdsDynamic vdsDynamic = new VdsDynamic();
cluster = new Cluster();
cluster.setCompatibilityVersion(Version.v4_2);
cluster.setId(CLUSTER_ID);
when(vdsStaticDaoMock.get(eq(VDS_ID))).thenReturn(vdsStatic);
when(vdsDynamicDaoMock.get(eq(VDS_ID))).thenReturn(vdsDynamic);
when(clusterDaoMock.get(eq(CLUSTER_ID))).thenReturn(cluster);
EffectiveHostNetworkQos effectiveHostNetworkQos = new EffectiveHostNetworkQos(hostNetworkQosDaoMock);
networkImplementationDetailsUtils = new NetworkImplementationDetailsUtils(effectiveHostNetworkQos, networkAttachmentDaoMock, vdsStaticDaoMock, vdsDynamicDaoMock, clusterDaoMock, calculateBaseNic, this.defaultRouteUtil);
}
use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class GetErrataCountsForHostQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
VdsStatic host = vdsStaticDao.get(getParameters().getId());
if (host == null) {
failWith(EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST);
return;
}
Provider<?> provider = getHostProvider(host);
if (provider == null) {
failWith(EngineMessage.NO_FOREMAN_PROVIDER_FOR_HOST);
return;
}
HostProviderProxy proxy = getHostProviderProxy(provider);
ErrataData errataForHost = proxy.getErrataForHost(host.getHostName(), getParameters().getErrataFilter());
setReturnValue(errataForHost.getErrataCounts());
}
use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class UpdateClusterCommand method updateDefaultNetworkProvider.
private void updateDefaultNetworkProvider() {
if (getCluster().hasDefaultNetworkProviderId(getPrevCluster().getDefaultNetworkProviderId())) {
return;
}
allForCluster.stream().filter(vds -> !Objects.equals(vds.getOpenstackNetworkProviderId(), getCluster().getDefaultNetworkProviderId())).forEach(vds -> {
VdsStatic vdsStatic = vds.getStaticData();
vdsStatic.setOpenstackNetworkProviderId(getCluster().getDefaultNetworkProviderId());
vdsStatic.setReinstallRequired(true);
vdsStaticDao.update(vdsStatic);
});
}
use of org.ovirt.engine.core.common.businessentities.VdsStatic in project ovirt-engine by oVirt.
the class BackendHostsResource method add.
@Override
public Response add(Host host) {
validateParameters(host, "name", "address");
VdsStatic staticHost = getMapper(Host.class, VdsStatic.class).map(host, null);
staticHost.setClusterId(getClusterId(host));
BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations(this, host.getExternalNetworkProviderConfigurations());
AddVdsActionParameters addParams = new AddVdsActionParameters(staticHost, host.getRootPassword());
if (host.isSetOverrideIptables()) {
addParams.setOverrideFirewall(host.isOverrideIptables());
}
addParams.setHostedEngineDeployConfiguration(HostResourceParametersUtil.getHostedEngineDeployConfiguration(this));
addParams = (AddVdsActionParameters) getMapper(Host.class, VdsOperationActionParameters.class).map(host, addParams);
return performCreate(ActionType.AddVds, addParams, new QueryIdResolver<Guid>(QueryType.GetVdsByVdsId, IdQueryParameters.class));
}
Aggregations