Alona Kaplan has uploaded a new change for review.

Change subject: restapi: Arbitrary vlan device name
......................................................................

restapi: Arbitrary vlan device name

1. base_interface and vlan_id property will be received on GET
VdsNetworkInterface.
2.Changes in "setupnetworks" ACTION-
- If the base_interface is specified, it will be used instead of
determining it from the device name. (The device name will be ignored).
- If not, the base_interface name will be determined from the device name
as before. (This should be done to keep backward compatibility).

See: http://www.ovirt.org/Feature/ArbitraryVlanDeviceName#REST_Api

Change-Id: I2b0a42c3f666e408f336f3475903062e9a80a952
Bug-Url: https://bugzilla.redhat.com/1091863
Bug-Url: https://bugzilla.redhat.com/999975
Signed-off-by: Alona Kaplan <alkap...@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/HostNicMapper.java
3 files changed, 13 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/96/27496/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 811fc9d..1695cf8 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
@@ -3247,6 +3247,7 @@
           <xs:element ref="network" minOccurs="0" maxOccurs="1"/>
           <xs:element ref="mac" minOccurs="0"/>
           <xs:element ref="ip" minOccurs="0"/>
+          <xs:element name="base_interface" type="xs:string" minOccurs="0" 
maxOccurs="1" />
           <xs:element ref="vlan" minOccurs="0"/>
           <xs:element ref="bonding" minOccurs="0" maxOccurs="1"/>
           <xs:element name="boot_protocol" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
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 3d5b635..cb9d12e 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
@@ -2743,7 +2743,7 @@
       signatures:
       - mandatoryArguments: {}
         optionalArguments:
-          action.host_nics.host_nic--COLLECTION: {host_nic.network.id|name: 
'xs:string', host_nic.name: 'xs:string', host_nic.ip.gateway: 'xs:string',
+          action.host_nics.host_nic--COLLECTION: {host_nic.network.id|name: 
'xs:string', host_nic.name: 'xs:string', host_nic.base_interface: 'xs:string', 
host_nic.ip.gateway: 'xs:string',
             host_nic.boot_protocol: 'xs:string', host_nic.mac: 'xs:string', 
host_nic.ip.address: 'xs:string', host_nic.ip.netmask: 'xs:string',
             host_nic.bonding.options.option--COLLECTION: {option.name: 
'xs:string', option.value: 'xs:string', option.type: 'xs:string'},
             bonding.slaves.host_nic--COLLECTION: {host_nic.name|id: 
'xs:string'},
diff --git 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostNicMapper.java
 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostNicMapper.java
index 090fcdf..d105383 100644
--- 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostNicMapper.java
+++ 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/HostNicMapper.java
@@ -11,6 +11,7 @@
 import org.ovirt.engine.api.model.NicStatus;
 import org.ovirt.engine.api.model.Option;
 import org.ovirt.engine.api.model.Options;
+import org.ovirt.engine.api.model.VLAN;
 import org.ovirt.engine.api.restapi.utils.GuidUtils;
 import org.ovirt.engine.core.common.businessentities.network.Bond;
 import org.ovirt.engine.core.common.businessentities.network.InterfaceStatus;
@@ -49,6 +50,9 @@
         }
         if (model.isSetName()) {
             entity.setName(model.getName());
+        }
+        if (model.isSetBaseInterface()) {
+            entity.setBaseInterface(model.getBaseInterface());
         }
         if (model.isSetIp()) {
             if (model.getIp().isSetAddress()) {
@@ -96,6 +100,13 @@
         if (entity.getName() != null) {
             model.setName(entity.getName());
         }
+        if (entity.getBaseInterface() != null) {
+            model.setBaseInterface(entity.getBaseInterface());
+        }
+        if (entity.getVlanId() != null) {
+            model.setVlan(new VLAN());
+            model.getVlan().setId(entity.getVlanId());
+        }
         if (entity.getAddress() != null || entity.getGateway() != null || 
entity.getSubnet() != null) {
             model.setIp(new IP());
             if (entity.getAddress() != null) {


-- 
To view, visit http://gerrit.ovirt.org/27496
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2b0a42c3f666e408f336f3475903062e9a80a952
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <alkap...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to