Martin Betak has uploaded a new change for review.
Change subject: restapi: Expose vm.auto_converge and vm.migrate_compressed
properties
......................................................................
restapi: Expose vm.auto_converge and vm.migrate_compressed properties
<vm>
<auto_converge>true|false</auto_converge>
<migrate_compressed>true|false</migrate_compressed>
</vm>
Change-Id: I9161896d1709c7492201667aa2c5955c5e37efd0
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=867453
Signed-off-by: Martin Betak <[email protected]>
---
M
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
M
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java
M
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
M
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/TemplateMapperTest.java
M
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
6 files changed, 31 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/33/32133/1
diff --git
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
index 5f9c9af..8fed405 100644
---
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
+++
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
@@ -3072,6 +3072,8 @@
<xs:element ref="serial_number" minOccurs="0" maxOccurs="1" />
<xs:element name="start_paused" type="xs:boolean" minOccurs="0"
maxOccurs="1" />
<xs:element ref="cpu_profile" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="auto_converge" type="xs:boolean" minOccurs="0"
maxOccurs="1" />
+ <xs:element name="migrate_compressed" type="xs:boolean"
minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
diff --git
a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
index 821e4da..5911275 100644
---
a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
+++
b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
@@ -105,6 +105,8 @@
vm.numa_tune_mode: xs:string
vm.start_paused: xs:boolean
vm.cpu_profile.id: xs:string
+ vm.auto_converge: xs:boolean
+ vm.migrate_compressed: xs:boolean
description: update the virtual machine in the system for the given
virtual machine id with the values specified in the request
urlparams: {}
headers:
@@ -195,6 +197,8 @@
vm.numa_tune_mode: xs:string
vm.start_paused: xs:boolean
vm.cpu_profile.id: xs:string
+ vm.auto_converge: xs:boolean
+ vm.migrate_compressed: xs:boolean
description: add a virtual machine to the system from scratch
# the following signature is for clone VM from a Snapshot - requires the
Snapshot ID
- mandatoryArguments: {vm.name: 'xs:string', vm.template.id|name:
'xs:string', vm.cluster.id|name: 'xs:string',
@@ -251,6 +255,8 @@
vm.numa_tune_mode: xs:string
vm.start_paused: xs:boolean
vm.cpu_profile.id: xs:string
+ vm.auto_converge: xs:boolean
+ vm.migrate_compressed: xs:boolean
description: add a virtual machine to the system by cloning from a
snapshot
# the following signature is for adding VM from a configuration -
requires the configuration type and the configuration data
- mandatoryArguments: {vm.initialization.configuration.type:
'xs:string', vm.initialization.configuration.data: 'xs:string'}
@@ -310,6 +316,8 @@
vm.numa_tune_mode: xs:string
vm.start_paused: xs:boolean
vm.cpu_profile.id: xs:string
+ vm.auto_converge: xs:boolean
+ vm.migrate_compressed: xs:boolean
description: add a virtual machine to the system from a configuration
- requires the configuration type and the configuration data
urlparams: {}
headers:
@@ -3817,6 +3825,8 @@
template.bios.boot_menu.enabled: xs:boolean
template.start_paused: xs:boolean
template.cpu_profile.id: xs:string
+ template.auto_converge: xs:boolean
+ template.migrate_compressed: xs:boolean
description: update the specified template in the system
urlparams: {}
headers:
@@ -3882,6 +3892,8 @@
template.cluster.name: xs:string
template.start_paused: xs:boolean
template.cpu_profile.id: xs:string
+ template.auto_converge: xs:boolean
+ template.migrate_compressed: xs:boolean
description: add a new template to the system
urlparams: {}
headers:
diff --git
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java
index c8f9053..22e269d 100644
---
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java
+++
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmBaseMapper.java
@@ -157,6 +157,14 @@
if (model.isSetCpuProfile() && model.getCpuProfile().isSetId()) {
entity.setCpuProfileId(GuidUtils.asGuid(model.getCpuProfile().getId()));
}
+
+ if (model.isSetAutoConverge()) {
+ entity.setAutoConverge(model.isAutoConverge());
+ }
+
+ if (model.isSetMigrateCompressed()) {
+ entity.setMigrateCompressed(model.isMigrateCompressed());
+ }
}
protected static void mapVmBaseEntityToModel(VmBase model,
org.ovirt.engine.core.common.businessentities.VmBase entity) {
@@ -233,6 +241,9 @@
cpuProfile.setId(entity.getCpuProfileId().toString());
model.setCpuProfile(cpuProfile);
}
+
+ model.setAutoConverge(entity.isAutoConverge());
+ model.setMigrateCompressed(entity.isMigrateCompressed());
}
@Mapping(from = OriginType.class, to = String.class)
diff --git
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
index f4aa4d3..4c73925 100644
---
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
+++
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
@@ -125,6 +125,8 @@
staticVm.setSpiceCopyPasteEnabled(entity.isSpiceCopyPasteEnabled());
staticVm.setRunAndPause(entity.isRunAndPause());
staticVm.setCpuProfileId(entity.getCpuProfileId());
+ staticVm.setAutoConverge(entity.isAutoConverge());
+ staticVm.setMigrateCompressed(entity.isMigrateCompressed());
return staticVm;
}
diff --git
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/TemplateMapperTest.java
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/TemplateMapperTest.java
index 2ecadbf..57b44ff 100644
---
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/TemplateMapperTest.java
+++
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/TemplateMapperTest.java
@@ -89,5 +89,7 @@
assertEquals(model.getDisplay().isFileTransferEnabled(),
transform.getDisplay().isFileTransferEnabled());
assertEquals(model.getDisplay().isCopyPasteEnabled(),
transform.getDisplay().isCopyPasteEnabled());
assertEquals(model.isStartPaused(), transform.isStartPaused());
+ assertEquals(model.isAutoConverge(), transform.isAutoConverge());
+ assertEquals(model.isMigrateCompressed(),
transform.isMigrateCompressed());
}
}
diff --git
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
index 750cc3d..d7aea4f 100644
---
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
+++
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
@@ -151,6 +151,8 @@
assertEquals(model.getDisplay().isFileTransferEnabled(),
transform.getDisplay().isFileTransferEnabled());
assertEquals(model.getDisplay().isCopyPasteEnabled(),
transform.getDisplay().isCopyPasteEnabled());
assertEquals(model.isStartPaused(), transform.isStartPaused());
+ assertEquals(model.isAutoConverge(), transform.isAutoConverge());
+ assertEquals(model.isMigrateCompressed(),
transform.isMigrateCompressed());
}
@Test
--
To view, visit http://gerrit.ovirt.org/32133
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9161896d1709c7492201667aa2c5955c5e37efd0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches