fix numbers in response

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2026-02-16 18:49:37 +05:30
parent a9c0215f4b
commit 894eef1210
6 changed files with 22 additions and 20 deletions

View File

@ -105,9 +105,9 @@ public class ApiService extends ManagerBase implements RouteHandler {
Version version = new Version();
version.setBuild("8");
version.setFullVersion("4.5.8-0.master.fake.el9");
version.setMajor(4);
version.setMinor(5);
version.setRevision(0);
version.setMajor("4");
version.setMinor("5");
version.setRevision("0");
productInfo.version = version;
api.setProductInfo(productInfo);

View File

@ -76,8 +76,8 @@ public class ClusterVOToClusterConverter {
// --- version (ovirt engine version; keep fixed unless you want to expose something else)
final Version ver = new Version();
ver.setMajor(4);
ver.setMinor(8);
ver.setMajor("4");
ver.setMinor("8");
c.setVersion(ver);
// --- ksm / memory policy (defaults)

View File

@ -54,8 +54,8 @@ public class DataCenterJoinVOToDataCenterConverter {
// ---- Versions (static but valid) ----
final Version v48 = new Version();
v48.setMajor(4);
v48.setMinor(8);
v48.setMajor("4");
v48.setMinor("8");
dc.setVersion(v48);
dc.setSupportedVersions(new SupportedVersions(List.of(v48)));

View File

@ -66,13 +66,14 @@ public class HostJoinVOToHostConverter {
// --- CPU ---
final Cpu cpu = new Cpu();
cpu.setSpeed(Math.toIntExact(vo.getSpeed()));
final Topology topo = new Topology(vo.getCpuSockets(), vo.getCpus(), 1);
cpu.setTopology(topo);
h.setCpu(cpu);
// --- Memory ---
h.setMemory(String.valueOf(vo.getTotalMemory()));
h.setMaxSchedulingMemory(String.valueOf(vo.getTotalMemory()));
h.setMaxSchedulingMemory(String.valueOf(vo.getTotalMemory() - vo.getMemUsedCapacity())); // ToDo: check
// --- OS / versions (optional placeholders) ---
// If you want, you can set conservative defaults to match oVirt shape.
@ -83,6 +84,7 @@ public class HostJoinVOToHostConverter {
h.setReinstallationRequired("false");
h.setUpdateAvailable("false");
// --- links/actions ---
// Start minimal (empty). Add actions only if Veeam tries to follow them.
h.setActions(null);

View File

@ -167,7 +167,7 @@ public final class UserVmJoinVOToVmConverter {
private static String mapStatus(final VirtualMachine.State state) {
// CloudStack-ish states -> oVirt-ish up/down
if (Arrays.asList(VirtualMachine.State.Running, VirtualMachine.State.Starting,
if (Arrays.asList(VirtualMachine.State.Running,
VirtualMachine.State.Migrating, VirtualMachine.State.Restoring).contains(state)) {
return "up";
}

View File

@ -24,9 +24,9 @@ public final class Version {
private String build;
private String fullVersion;
private Integer major;
private Integer minor;
private Integer revision;
private String major;
private String minor;
private String revision;
public Version() {}
@ -46,27 +46,27 @@ public final class Version {
this.fullVersion = fullVersion;
}
public Integer getMajor() {
public String getMajor() {
return major;
}
public void setMajor(Integer major) {
public void setMajor(String major) {
this.major = major;
}
public Integer getMinor() {
public String getMinor() {
return minor;
}
public void setMinor(Integer minor) {
public void setMinor(String minor) {
this.minor = minor;
}
public Integer getRevision() {
public String getRevision() {
return revision;
}
public void setRevision(Integer revision) {
public void setRevision(String revision) {
this.revision = revision;
}
}