Moti Asayag has uploaded a new change for review. Change subject: revert 925aeee7: Add vnic custom properties ......................................................................
revert 925aeee7: Add vnic custom properties The custom properties per device will be managed on vnic profile level instead for vm nic. Therefore the commit which adds it should be reverted. Change-Id: Ie893f50addf631e72dc52f1c740cf9bb41305dfd Signed-off-by: Moti Asayag <masa...@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/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/FeaturesHelper.java M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NicMapper.java M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/NicMapperTest.java 5 files changed, 4 insertions(+), 29 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/60/17460/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 2a1c526..eea9823 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 @@ -2623,7 +2623,6 @@ <xs:element name="plugged" type="xs:boolean" minOccurs="0"/> <xs:element ref="port_mirroring" minOccurs="0" maxOccurs="1"/> <xs:element ref="reported_devices" minOccurs="0" maxOccurs="1"/> - <xs:element ref="custom_properties" minOccurs="0"/> </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 ed9529a..c778328 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 @@ -517,7 +517,7 @@ parameterType: NIC signatures: - mandatoryArguments: {} - optionalArguments: {nic.network.id|name: 'xs:string', nic.linked: 'xs:boolean', nic.name: 'xs:string', nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}, nic.plugged: 'xs:boolean', nic.custom_properties.custom_property--COLLECTION: {custom_property.name: 'xs:string', custom_property.value: 'xs:string'}} + optionalArguments: {nic.network.id|name: 'xs:string', nic.linked: 'xs:boolean', nic.name: 'xs:string', nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}, nic.plugged: 'xs:boolean'} urlparams: {} headers: Content-Type: {value: application/xml|json, required: true} @@ -546,7 +546,7 @@ parameterType: NIC signatures: - mandatoryArguments: {nic.name: 'xs:string'} - optionalArguments: {nic.network.id|name: 'xs:string', nic.linked: 'xs:boolean', nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}, nic.plugged: 'xs:boolean', nic.custom_properties.custom_property--COLLECTION: {custom_property.name: 'xs:string', custom_property.value: 'xs:string'}} + optionalArguments: {nic.network.id|name: 'xs:string', nic.linked: 'xs:boolean', nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}, nic.plugged: 'xs:boolean'} urlparams: {} headers: Content-Type: {value: application/xml|json, required: true} @@ -2605,7 +2605,7 @@ parameterType: NIC signatures: - mandatoryArguments: {nic.name: 'xs:string'} - optionalArguments: {nic.network.id|name: 'xs:string', nic.linked: 'xs:boolean', nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}, nic.custom_properties.custom_property--COLLECTION: {custom_property.name: 'xs:string', custom_property.value: 'xs:string'}} + optionalArguments: {nic.network.id|name: 'xs:string', nic.linked: 'xs:boolean', nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}} urlparams: {} headers: Content-Type: {value: application/xml|json, required: true} @@ -2633,7 +2633,7 @@ parameterType: NIC signatures: - mandatoryArguments: {} - optionalArguments: {nic.network.id|name: 'xs:string', nic.linked: 'xs:boolean', nic.name: 'xs:string', nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}, nic.custom_properties.custom_property--COLLECTION: {custom_property.name: 'xs:string', custom_property.value: 'xs:string'}} + optionalArguments: {nic.network.id|name: 'xs:string', nic.linked: 'xs:boolean', nic.name: 'xs:string', nic.mac.address: 'xs:string', nic.interface: 'xs:string', nic.port_mirroring.networks.network--COLLECTION: {network.id: 'xs:string'}} urlparams: {} headers: Content-Type: {value: application/xml|json, required: true} diff --git a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/FeaturesHelper.java b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/FeaturesHelper.java index bb80690..becc8ce 100644 --- a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/FeaturesHelper.java +++ b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/FeaturesHelper.java @@ -52,7 +52,6 @@ } if (VersionUtils.greaterOrEqual(version, BackendCapabilitiesResource.VERSION_3_3)) { addFeatureVmApplications(features); - addFeatureVnicCustomProperties(features); addFeatureVirtioScsi(features); addFeatureComment(features); addFeatureRefreshHostCapabilities(features); @@ -258,13 +257,6 @@ feature.setName("Gluster Support"); feature.setDescription("Support for Gluster Volumes and Bricks"); feature.setGlusterVolumes(new GlusterVolumes()); - features.getFeature().add(feature); - } - - private void addFeatureVnicCustomProperties(Features features) { - Feature feature = new Feature(); - feature.setName("VM NIC Custom Properties"); - feature.setDescription("Ability to add custom properties to vm nic."); features.getFeature().add(feature); } diff --git a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NicMapper.java b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NicMapper.java index 47d68f4..326e2d1 100644 --- a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NicMapper.java +++ b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NicMapper.java @@ -1,15 +1,12 @@ package org.ovirt.engine.api.restapi.types; -import org.ovirt.engine.api.model.CustomProperties; import org.ovirt.engine.api.model.MAC; import org.ovirt.engine.api.model.NIC; import org.ovirt.engine.api.model.Network; import org.ovirt.engine.api.model.NicInterface; import org.ovirt.engine.api.model.VM; -import org.ovirt.engine.api.restapi.utils.CustomPropertiesParser; import org.ovirt.engine.api.restapi.utils.GuidUtils; import org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface; -import org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils; public class NicMapper { @Mapping(from = NIC.class, to = VmNetworkInterface.class) @@ -54,10 +51,6 @@ entity.setPortMirroring(false); } } - if (model.isSetCustomProperties()) { - entity.setCustomProperties(DevicePropertiesUtils.getInstance().convertProperties( - CustomPropertiesParser.parse(model.getCustomProperties().getCustomProperty()))); - } return entity; } @@ -88,13 +81,6 @@ model.setInterface(map(entity.getType())); model.setActive(entity.isPlugged()); model.setPlugged(entity.isPlugged()); - - if (entity.getCustomProperties() != null && !entity.getCustomProperties().isEmpty()) { - CustomProperties hooks = new CustomProperties(); - hooks.getCustomProperty().addAll(CustomPropertiesParser.parse( - DevicePropertiesUtils.getInstance().convertProperties(entity.getCustomProperties()), false)); - model.setCustomProperties(hooks); - } return model; } diff --git a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/NicMapperTest.java b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/NicMapperTest.java index 2c6bad7..121d9d9 100644 --- a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/NicMapperTest.java +++ b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/NicMapperTest.java @@ -6,7 +6,6 @@ import org.ovirt.engine.api.model.Networks; import org.ovirt.engine.api.model.NicInterface; import org.ovirt.engine.api.model.PortMirroring; -import org.ovirt.engine.api.restapi.utils.CustomPropertiesParser; import org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface; import org.ovirt.engine.core.compat.Guid; @@ -36,7 +35,6 @@ assertEquals(model.getInterface(), transform.getInterface()); assertEquals(model.isLinked(), transform.isLinked()); assertEquals(model.isPlugged(), transform.isPlugged()); - assertEquals(CustomPropertiesParser.parse(model.getCustomProperties().getCustomProperty()), CustomPropertiesParser.parse(transform.getCustomProperties().getCustomProperty())); } @Test -- To view, visit http://gerrit.ovirt.org/17460 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie893f50addf631e72dc52f1c740cf9bb41305dfd Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Moti Asayag <masa...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches