Jiří Moskovčák has uploaded a new change for review. Change subject: restapi: added support for ksm control ......................................................................
restapi: added support for ksm control Change-Id: I44b992bd2bb69ff0d7996b029249a787dc266617 Bug-Url: https://bugzilla.redhat.com/1026980 Signed-off-by: Jiri Moskovcak <[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/ClusterMapper.java M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/ClusterMapperTest.java 4 files changed, 15 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/59/23359/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 6c90c58..77bc18e 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 @@ -1270,6 +1270,7 @@ <xs:element name="ha_reservation" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <xs:element name="ballooning_enabled" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <xs:element ref="display" minOccurs="0" maxOccurs="1"/> + <xs:element name="ksm_enabled" type="xs:boolean" minOccurs="0" maxOccurs="1"/> <!-- Also a rel="networks" link --> </xs:sequence> </xs:extension> 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 056a422..930650f 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 @@ -590,7 +590,7 @@ disk.storage_domains.storage_domain--COLLECTION: {storage_domain.id|name: 'xs:string'} description: add a new direct lun disk to the virtual machine, this operation does not require size but needs lun connection details - mandatoryArguments: {disk.id: 'xs:string'} - optionalArguments: + optionalArguments: disk.active: xs:boolean disk.read_only: xs:boolean description: attach a disk to the virtual machine @@ -1261,7 +1261,7 @@ description: add a new storage domain to the system using a direct lun - mandatoryArguments: {storagedomain.host.id|name: 'xs:string', storagedomain.type: 'xs:string', storagedomain.storage.type: 'xs:string', - storagedomain.format: 'xs:boolean',storagedomain.storage.address: 'xs:string', + storagedomain.format: 'xs:boolean',storagedomain.storage.address: 'xs:string', storagedomain.storage.path: 'xs:string'} optionalArguments: {storagedomain.name: 'xs:string', storagedomain.comment: 'xs:string', storagedomain.storage_format: 'xs:string'} description: add a new storage domain to the system using the storage on the given host and path @@ -1561,7 +1561,7 @@ 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.tunnel_migration: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', - cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string'} + cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string', cluster.ksm_enabled: 'xs:boolean'} description: update the specified cluster in the system. The capabilities like virt service, cluster service, tarnsparent huge pages etc can be changed. urlparams: {} headers: @@ -1577,7 +1577,8 @@ optionalArguments: {cluster.description: 'xs:string', cluster.comment: '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.tunnel_migration: 'xs:boolean', cluster.trusted_service: 'xs:boolean', cluster.ha_reservation: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string'} + cluster.tunnel_migration: 'xs:boolean', cluster.trusted_service: 'xs:boolean', cluster.ha_reservation: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string', + cluster.ksm_enabled: 'xs:boolean'} description: add a new cluster to the system urlparams: {} headers: @@ -1906,7 +1907,7 @@ 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.tunnel_migration: 'xs:boolean', cluster.trusted_service: 'xs:boolean', cluster.ha_reservation: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', - cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string'} + cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string', cluster.ksm_enabled: 'xs:boolean',} description: update specified cluster in the data center urlparams: {} headers: @@ -1922,7 +1923,7 @@ 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.tunnel_migration: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string'} + cluster.tunnel_migration: 'xs:boolean', cluster.ballooning_enabled: 'xs:boolean', cluster.cpu.architecture: 'xs:string', cluster.display.proxy: 'xs:string', cluster.ksm_enabled: 'xs:boolean',} description: add a new cluster to the data center urlparams: {} headers: @@ -3924,7 +3925,7 @@ gluster_volume.stripe_count: 'xs:unsignedShort' gluster_volume.options.option--COLLECTION: {option.name: 'xs:string', option.value: 'xs:string'} description: add a new gluster volume to the cluster with bricks - urlparams: + urlparams: force: {context: matrix, type: 'xs:boolean', value: true|false, required: false} headers: Content-Type: {value: application/xml|json, required: true} @@ -4039,7 +4040,7 @@ brick--COLLECTION: {brick.server_id: 'xs:string', brick.brick_dir: 'xs:string'} optionalArguments: {replica_count: 'xs:unsignedShort', stripe_count: 'xs:unsignedShort'} description: add a new brick to the gluster volume attached to the cluster - urlparams: + urlparams: force: {context: matrix, type: 'xs:boolean', value: true|false, required: false} headers: Content-Type: {value: application/xml|json, required: true} 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 756b751..05ee3cb 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 @@ -95,6 +95,9 @@ if (model.isSetBallooningEnabled()) { entity.setEnableBallooning(model.isBallooningEnabled()); } + if (model.isSetKsmEnabled()) { + entity.setEnableKsm(model.isKsmEnabled()); + } if (model.isSetDisplay() && model.getDisplay().isSetProxy()) { entity.setSpiceProxy("".equals(model.getDisplay().getProxy()) ? null : model.getDisplay().getProxy()); } @@ -137,6 +140,7 @@ model.setTrustedService(entity.supportsTrustedService()); model.setHaReservation(entity.supportsHaReservation()); model.setBallooningEnabled(entity.isEnableBallooning()); + model.setKsmEnabled(entity.isEnableKsm()); if (StringUtils.isNotBlank(entity.getSpiceProxy())) { Display display = new Display(); display.setProxy(entity.getSpiceProxy()); 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 3a69c11..4772cc6 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 @@ -53,6 +53,7 @@ assertEquals(model.isTunnelMigration(), transform.isTunnelMigration()); assertEquals(model.isTrustedService(), transform.isTrustedService()); assertEquals(model.isBallooningEnabled(), transform.isBallooningEnabled()); + assertEquals(model.isKsmEnabled(), transform.isKsmEnabled()); assertEquals(model.getDisplay().getProxy(), transform.getDisplay().getProxy()); } -- To view, visit http://gerrit.ovirt.org/23359 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I44b992bd2bb69ff0d7996b029249a787dc266617 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Jiří Moskovčák <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
