public String singleton_l2gateway_create_test() {
String url = base + "/l2-gateways";
- String content = " { \"l2_gateway\": { \"name\": \"gateway1\"," +
+ String content = "{ \"l2_gateway\": { \"name\": \"gateway1\"," +
"\"id\": \"3b0ef8f4-82c7-44d4-a4fb-6177f9a21977\"," +
"\"tenant_id\": \"45977fa2dbd7482098dd68d0d8970117\"," +
- "\"devices\": [{\"device_name\": \"device1\"," +
- "\"interfaces\": [{\"name\": \"interface1\", \"segmentation_id\": [100] }] " +
- "}] } }";
+ "\"devices\": [{ \"device_name\": \"device1\"," +
+ "\"id\": \"0a24b09a-88a1-4f2c-94e9-92515972a704\"," +
+ "\"interfaces\": [{\"name\": \"interface1\", \"segmentation_id\": [100] }] }]" +
+ "} }";
ITNeutronE2E.test_create(url, content, "L2 Gateway Singleton Post Failed");
return content;
}
public void l2gateway_modify_test() {
String url = base + "/l2-gateways/3b0ef8f4-82c7-44d4-a4fb-6177f9a21977";
- String content = " { \"l2_gateway\": { \"name\": \"gateway1\"," +
+ String content = "{ \"l2_gateway\": { \"name\": \"gateway1\"," +
"\"id\": \"3b0ef8f4-82c7-44d4-a4fb-6177f9a21977\"," +
"\"tenant_id\": \"45977fa2dbd7482098dd68d0d8970117\"," +
- "\"devices\": [{\"device_name\": \"device1\"," +
- "\"interfaces\": [{\"name\": \"interface1\", \"segmentation_id\": [100, 50] }] " +
- "}] } }";
+ "\"devices\": [{ \"device_name\": \"device1\"," +
+ "\"id\": \"0a24b09a-88a1-4f2c-94e9-92515972a704\"," +
+ "\"interfaces\": [{\"name\": \"interface1\", \"segmentation_id\": [100, 50] }] }]" +
+ "} }";
ITNeutronE2E.test_modify(url, content, "L2 Gateway Singleton Put Failed");
}
prefix neutron-l2gateways;
import ietf-yang-types { prefix "yang"; }
- import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
import neutron-attrs { prefix "attrs"; }
organization "OpenDaylight Neutron Group";
}
grouping l2gateway-connection-attributes {
- leaf l2gateway-id {
- type yang:uuid;
- }
- leaf network-id {
- type yang:uuid;
- }
- leaf segment-id {
- type int32;
- }
- leaf port-id {
- type yang:uuid;
- }
- }
+ leaf l2gateway-id {
+ type yang:uuid;
+ }
+ leaf network-id {
+ type yang:uuid;
+ }
+ leaf segment-id {
+ type int32;
+ }
+ leaf port-id {
+ type yang:uuid;
+ }
+ }
grouping l2gateway-attributes {
- leaf l2gateway-name{
+ leaf l2gateway-name {
type string;
}
list devices {
description "Description of devices.";
- leaf device-name{
+ key "uuid";
+ leaf uuid {
+ type yang:uuid;
+ }
+ leaf device-name {
type string;
}
list interfaces {
- description "Description of interfaces";
- leaf interface-name {
- type string;
- }
- leaf-list segmentation-ids {
- description "Description of segmentations";
- type int32;
- }
+ description "Description of interfaces";
+ key interface-name;
+ leaf interface-name {
+ type string;
+ }
+ leaf-list segmentation-ids {
+ description "Description of segmentations";
+ type int32;
+ }
}
}
}
import javax.xml.bind.annotation.XmlElement;
-public class NeutronL2gatewayDevice implements Serializable {
+public class NeutronL2gatewayDevice extends Neutron_ID implements Serializable {
private static final long serialVersionUID = 1L;
}
@Override
public String toString() {
- return "NeutronL2gatewayDevice [neutronL2gwDeviceInterfaces="
+ return "NeutronL2gatewayDevice ["
+ + "id=" + uuid
+ + ", neutronL2gwDeviceInterfaces="
+ neutronL2gatewayDeviceInterfaces + ", deviceName=" + deviceName
+ "]";
}
if (device.getDeviceName() != null){
neutronL2gatewayDevice.setDeviceName(device.getDeviceName().toString());
}
+ if (device.getUuid() != null) {
+ neutronL2gatewayDevice.setID(device.getUuid().getValue());
+ }
if(device.getInterfaces() != null){
for(final Interfaces deviceInterface:device.getInterfaces()){
final NeutronL2gatewayDeviceInterface neutronL2gatewayDeviceInterface =
interfaces.add(interfacesBuilder.build());
}
deviceBuilder.setDeviceName(neutronL2gatewayDevice.getDeviceName());
+ deviceBuilder.setUuid(toUuid(neutronL2gatewayDevice.getID()));
deviceBuilder.setInterfaces(interfaces);
devices.add(deviceBuilder.build());
}