Omer Frenkel has uploaded a new change for review. Change subject: restapi: Add support for tunnel migration ......................................................................
restapi: Add support for tunnel migration add tunnel migration field to cluster and vm Change-Id: I2822082c546ca2f19ad882834bb06add9e6ab3a3 Signed-off-by: Omer Frenkel <ofren...@redhat.com> --- 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/ClusterMapper.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/ClusterMapperTest.java M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java 6 files changed, 24 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/79/11379/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 dd5877b..5d1b32e 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 @@ -1072,6 +1072,7 @@ <xs:element name="virt_service" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <xs:element name="gluster_service" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <xs:element name="threads_as_cores" type="xs:boolean" minOccurs="0" maxOccurs="1"/> + <xs:element name="tunnel_migration" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <!-- Also a rel="networks" link --> </xs:sequence> </xs:extension> @@ -1905,6 +1906,7 @@ <xs:element name="timezone" type="xs:string" minOccurs="0" maxOccurs="1"/> <xs:element ref="domain" minOccurs="0" maxOccurs="1"/> <xs:element ref="usb" minOccurs="0" maxOccurs="1"/> + <xs:element name="tunnel_migration" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <!-- also rel="cdroms/disks/nics" links, see Devices below --> </xs:sequence> </xs:extension> @@ -2107,6 +2109,7 @@ <xs:element name="guest_info" type="GuestInfo" minOccurs="0" maxOccurs="1"/> <xs:element ref="quota" minOccurs="0" maxOccurs="1"/> <xs:element ref="usb" minOccurs="0" maxOccurs="1"/> + <xs:element name="tunnel_migration" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <xs:element ref="vmpool" minOccurs="0" maxOccurs="1"> <xs:annotation> 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 262e573..ef5e682 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 @@ -70,6 +70,7 @@ vm.placement_policy.host.id|name: xs:string vm.origin: xs:string vm.os.kernel: xs:string + vm.tunnel_migration: xs:boolean vm.payloads.payload--COLLECTION: {payload.type: 'xs:string', payload.file.name: 'xs:string', payload.file.content: 'xs:string'} vm.cpu.cpu_tune.vcpu_pin--COLLECTION: {vcpu_pin.vcpu: 'xs:int', vcpu_pin.cpu_set: 'xs:string'} urlparams: {} @@ -111,6 +112,7 @@ vm.origin: xs:string vm.os.kernel: xs:string vm.disks.clone: xs:boolean + vm.tunnel_migration: xs:boolean vm.payloads.payload--COLLECTION: {payload.type: 'xs:string', payload.file.name: 'xs:string', payload.file.content: 'xs:string'} vm.cpu.cpu_tune.vcpu_pin--COLLECTION: {vcpu_pin.vcpu: 'xs:int', vcpu_pin.cpu_set: 'xs:string'} urlparams: {} @@ -927,7 +929,7 @@ optionalArguments: {cluster.name: 'xs:string', cluster.description: 'xs:string', cluster.cpu.id: 'xs:string', cluster.version.major: 'xs:int', cluster.version.minor: 'xs:int', cluster.memory_policy.overcommit.percent: 'xs:double', cluster.memory_policy.transparent_hugepages.enabled: 'xs:boolean', cluster.scheduling_policy.policy: 'xs:string', cluster.scheduling_policy.thresholds.low: 'xs:int', cluster.scheduling_policy.thresholds.high: 'xs:int', cluster.scheduling_policy.thresholds.duration: 'xs:int', - cluster.error_handling.on_error: 'xs:string', cluster.virt_service: 'xs:boolean', cluster.gluster_service: 'xs:boolean', cluster.threads_as_cores: 'xs:boolean'} + cluster.error_handling.on_error: 'xs:string', cluster.virt_service: 'xs:boolean', cluster.gluster_service: 'xs:boolean', cluster.threads_as_cores: 'xs:boolean', cluster.tunnel_migration: 'xs:boolean'} urlparams: {} headers: Content-Type: {value: application/xml|json, required: true} @@ -940,7 +942,8 @@ - mandatoryArguments: {cluster.data_center.id|name: 'xs:string', cluster.name: 'xs:string', cluster.version.major: 'xs:int', cluster.version.minor: 'xs:int', cluster.cpu.id: 'xs:string'} optionalArguments: {cluster.description: 'xs:string', cluster.memory_policy.overcommit.percent: 'xs:double', cluster.memory_policy.transparent_hugepages.enabled: 'xs:boolean', cluster.scheduling_policy.policy: 'xs:string', cluster.scheduling_policy.thresholds.low: 'xs:int', cluster.scheduling_policy.thresholds.high: 'xs:int', - cluster.scheduling_policy.thresholds.duration: 'xs:int', cluster.error_handling.on_error: 'xs:string', cluster.virt_service: 'xs:boolean', cluster.gluster_service: 'xs:boolean', cluster.threads_as_cores: 'xs:boolean'} + cluster.scheduling_policy.thresholds.duration: 'xs:int', cluster.error_handling.on_error: 'xs:string', cluster.virt_service: 'xs:boolean', cluster.gluster_service: 'xs:boolean', cluster.threads_as_cores: 'xs:boolean', + cluster.tunnel_migration: 'xs:boolean'} urlparams: {} headers: Content-Type: {value: application/xml|json, required: true} @@ -2104,6 +2107,7 @@ template.os.initRd: xs:string template.usb.enabled: xs:boolean template.usb.type: xs:string + template.tunnel_migration: xs:boolean urlparams: {} headers: Content-Type: {value: application/xml|json, required: true} @@ -2140,6 +2144,7 @@ template.os.initRd: xs:string template.usb.enabled: xs:boolean template.usb.type: xs:string + template.tunnel_migration: xs:boolean template.vm.disks.disk--COLLECTION: {disk.id: 'xs:string', storage_domains.storage_domain--COLLECTION: {storage_domain.id: 'xs:string'}} template.cpu.cpu_tune.vcpu_pin--COLLECTION: {vcpu_pin.vcpu: 'xs:int', vcpu_pin.cpu_set: 'xs:string'} urlparams: {} diff --git a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java index 5388ce8..9ad8f11 100644 --- a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java +++ b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java @@ -1,5 +1,7 @@ package org.ovirt.engine.api.restapi.types; +import static org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual; + import org.ovirt.engine.api.model.CPU; import org.ovirt.engine.api.model.Cluster; import org.ovirt.engine.api.model.DataCenter; @@ -12,14 +14,11 @@ import org.ovirt.engine.api.model.SchedulingPolicyType; import org.ovirt.engine.api.model.TransparentHugePages; import org.ovirt.engine.api.model.Version; - import org.ovirt.engine.core.common.businessentities.MigrateOnErrorOptions; -import org.ovirt.engine.core.common.businessentities.storage_pool; import org.ovirt.engine.core.common.businessentities.VDSGroup; import org.ovirt.engine.core.common.businessentities.VdsSelectionAlgorithm; +import org.ovirt.engine.core.common.businessentities.storage_pool; import org.ovirt.engine.core.compat.Guid; - -import static org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual; public class ClusterMapper { @@ -67,6 +66,9 @@ if (model.isSetThreadsAsCores()) { entity.setCountThreadsAsCores(model.isThreadsAsCores()); } + if (model.isSetTunnelMigration()) { + entity.setTunnelMigration(model.isTunnelMigration()); + } return entity; } @@ -97,6 +99,7 @@ model.setVirtService(entity.supportsVirtService()); model.setGlusterService(entity.supportsGlusterService()); model.setThreadsAsCores(entity.getCountThreadsAsCores()); + model.setTunnelMigration(entity.isTunnelMigration()); return model; } 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 dc8e5bb..e2a477f 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 @@ -98,6 +98,7 @@ staticVm.setAllowConsoleReconnect(entity.isAllowConsoleReconnect()); staticVm.setPriority(entity.getPriority()); staticVm.setUsbPolicy(entity.getUsbPolicy()); + staticVm.setTunnelMigration(entity.getTunnelMigration()); return staticVm; } @@ -226,6 +227,9 @@ } if (vm.isSetQuota() && vm.getQuota().isSetId()) { staticVm.setQuotaId(new Guid(vm.getQuota().getId())); + } + if (vm.isSetTunnelMigration()) { + staticVm.setTunnelMigration(vm.isTunnelMigration()); } return staticVm; } @@ -415,6 +419,7 @@ quota.setId(entity.getQuotaId().toString()); model.setQuota(quota); } + model.setTunnelMigration(entity.getTunnelMigration()); return model; } diff --git a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/ClusterMapperTest.java b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/ClusterMapperTest.java index 42c0ab4..5b5cf70 100644 --- a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/ClusterMapperTest.java +++ b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/ClusterMapperTest.java @@ -48,6 +48,7 @@ .isEnabled()); assertEquals(model.isVirtService(), transform.isVirtService()); assertEquals(model.isGlusterService(), transform.isGlusterService()); + assertEquals(model.isTunnelMigration(), transform.isTunnelMigration()); } private Mapper<Cluster, VDSGroup> getMapper() { 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 a71e3fd..bc9536b 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 @@ -111,6 +111,7 @@ assertEquals(model.getTimezone(), transform.getTimezone()); assertEquals(model.getDisplay().isSmartcardEnabled(), transform.getDisplay().isSmartcardEnabled()); assertEquals(model.isDeleteProtected(), transform.isDeleteProtected()); + assertEquals(model.isTunnelMigration(), transform.isTunnelMigration()); } @Test -- To view, visit http://gerrit.ovirt.org/11379 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2822082c546ca2f19ad882834bb06add9e6ab3a3 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Omer Frenkel <ofren...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches