Karnan t c has uploaded a new change for review. Change subject: restapi: Adds disperse,redundancy info to glustervolumes restapi ......................................................................
restapi: Adds disperse,redundancy info to glustervolumes restapi Disperse count, redundancy count informations of disperse volumes are added to glustervolumes restapi. Change-Id: I722b50e81c5118146d3cd4fb9c522a44aae17362 Bug-Url: https://bugzilla.redhat.com/1213379 Signed-off-by: Karnan TC <kchid...@redhat.com> --- M backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/GlusterVolumeType.java M backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapper.java M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapperTest.java 4 files changed, 29 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/08/40908/1 diff --git a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/GlusterVolumeType.java b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/GlusterVolumeType.java index bda3555..2692b2b 100644 --- a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/GlusterVolumeType.java +++ b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/model/GlusterVolumeType.java @@ -9,7 +9,9 @@ STRIPE, DISTRIBUTED_STRIPE, STRIPED_REPLICATE, - DISTRIBUTED_STRIPED_REPLICATE; + DISTRIBUTED_STRIPED_REPLICATE, + DISPERSE, + DISTRIBUTED_DISPERSE; public String value() { return name().toLowerCase(); 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 648f576..ead1b14 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 @@ -4277,6 +4277,8 @@ <xs:element ref="transport_types" minOccurs="0" maxOccurs="1"/> <xs:element name="replica_count" type="xs:unsignedShort" minOccurs="0" maxOccurs="1"/> <xs:element name="stripe_count" type="xs:unsignedShort" minOccurs="0" maxOccurs="1"/> + <xs:element name="disperse_count" type="xs:unsignedShort" minOccurs="0" maxOccurs="1"/> + <xs:element name="redundancy_count" type="xs:unsignedShort" minOccurs="0" maxOccurs="1"/> <xs:element ref="bricks" minOccurs="0" maxOccurs="1"/> <xs:element ref="options" minOccurs="0" maxOccurs="1"/> <xs:element ref="status" minOccurs="0" maxOccurs="1"/> diff --git a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapper.java b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapper.java index 201dd22..1feedd5 100644 --- a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapper.java +++ b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapper.java @@ -54,6 +54,14 @@ volume.setStripeCount(fromVolume.getStripeCount()); } + if(fromVolume.isSetDisperseCount()) { + volume.setDisperseCount(fromVolume.getDisperseCount()); + } + + if(fromVolume.isSetRedundancyCount()) { + volume.setRedundancyCount(fromVolume.getRedundancyCount()); + } + if (fromVolume.isSetOptions()) { Options options = fromVolume.getOptions(); if (options.isSetOptions()) { @@ -97,6 +105,8 @@ volume.setReplicaCount(fromVolume.getReplicaCount()); volume.setStripeCount(fromVolume.getStripeCount()); + volume.setDisperseCount(fromVolume.getDisperseCount()); + volume.setRedundancyCount(fromVolume.getRedundancyCount()); if(fromVolume.getStatus() != null) { volume.setStatus(StatusUtils.create(map(fromVolume.getStatus(), null))); @@ -141,6 +151,10 @@ return org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.STRIPED_REPLICATE; case DISTRIBUTED_STRIPED_REPLICATE: return org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE; + case DISPERSE: + return org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISPERSE; + case DISTRIBUTED_DISPERSE: + return org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTED_DISPERSE; default: return null; } @@ -164,6 +178,10 @@ return GlusterVolumeType.STRIPED_REPLICATE.value(); case DISTRIBUTED_STRIPED_REPLICATE: return GlusterVolumeType.DISTRIBUTED_STRIPED_REPLICATE.value(); + case DISPERSE: + return GlusterVolumeType.DISPERSE.value(); + case DISTRIBUTED_DISPERSE: + return GlusterVolumeType.DISTRIBUTED_DISPERSE.value(); default: return null; } diff --git a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapperTest.java b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapperTest.java index 99a1081..30f9114 100644 --- a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapperTest.java +++ b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterVolumeMapperTest.java @@ -54,6 +54,12 @@ assertNotNull(transform.getStripeCount()); assertEquals(model.getStripeCount(), transform.getStripeCount()); + assertNotNull(transform.getDisperseCount()); + assertEquals(model.getDisperseCount(), transform.getDisperseCount()); + + assertNotNull(transform.getRedundancyCount()); + assertEquals(model.getRedundancyCount(), transform.getRedundancyCount()); + verifyOptions(model, transform); } -- To view, visit https://gerrit.ovirt.org/40908 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I722b50e81c5118146d3cd4fb9c522a44aae17362 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Karnan t c <kchid...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches