ONOS-6080
Dynamic Config Svc : Demo1 end to end integration and dry runs
Change-Id: Ied90252fe786fc6331b710c3ae977f9b9016232c
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfActiveComponent.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfActiveComponent.java
index 287f871..ac7735e 100644
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfActiveComponent.java
+++ b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/impl/NetconfActiveComponent.java
@@ -34,6 +34,7 @@
import org.onosproject.netconf.client.NetconfTranslator.OperationType;
import org.onosproject.yang.model.DataNode;
import org.onosproject.yang.model.LeafNode;
+import org.onosproject.yang.model.ListKey;
import org.onosproject.yang.model.ResourceId;
import org.onosproject.yang.runtime.DefaultResourceData;
import org.slf4j.Logger;
@@ -51,7 +52,7 @@
private static final Logger log = LoggerFactory.getLogger(NetconfActiveComponent.class);
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected DynamicConfigService cfgService;
- public static final String DEVNMSPACE = "namespace1";
+ public static final String DEVNMSPACE = "ne-l3vpn-api";
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected NetconfTranslator netconfTranslator;
@@ -64,6 +65,8 @@
private ResourceId resId = new ResourceId.Builder()
.addBranchPointSchema("device", DEVNMSPACE)
+ .addBranchPointSchema("device", DEVNMSPACE)
+ .addKeyLeaf("deviceid", DEVNMSPACE, "netconf:172.16.5.11:22")
.build();
@Activate
@@ -171,6 +174,7 @@
* @param node the node associated with the event
* @return the deviceId of the effected device
*/
+ @Beta
public DeviceId getDeviceId(DataNode node) {
String[] temp;
String ip, port;
@@ -181,6 +185,14 @@
}
ip = temp[1];
port = temp[2];
+ } else if (node.type() == DataNode.Type.MULTI_INSTANCE_NODE) {
+ ListKey key = (ListKey) node.key();
+ temp = key.keyLeafs().get(0).leafValAsString().split("\\:");
+ if (temp.length != 3) {
+ throw new RuntimeException(new NetconfException("Invalid device id form, cannot apply"));
+ }
+ ip = temp[1];
+ port = temp[2];
} else {
throw new RuntimeException(new NetconfException("Invalid device id type, cannot apply"));
}