Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

Revision history [back]

click to hide/show revision 1
initial version

Leaves are not directly addressable via InstanceIdentifier. In order to fetch them, you need to read the container in where these reside, in this case a keyed item, hence:

InstanceIdentifier<node> id = InstanceIdentifier.create(DeviceInfo.class).child(Node.class, new NodeKey("1"));
ReadOnlyTransaction tx = db.newReadOnlyTransactio();
Node node = tx.read(id).get();
String desc = node.getDescription();

Leaves are not directly addressable via InstanceIdentifier. In order to fetch them, you need to read the container in where these reside, in this case a keyed item, hence:

InstanceIdentifier<node> InstanceIdentifier<Node> id = InstanceIdentifier.create(DeviceInfo.class).child(Node.class, new NodeKey("1"));
ReadOnlyTransaction tx = db.newReadOnlyTransactio();
Node node = tx.read(id).get();
String desc = node.getDescription();

Leaves are not directly addressable via InstanceIdentifier. In order to fetch them, you need to read the container in where these reside, in this case a keyed item, hence:

InstanceIdentifier<Node> id = InstanceIdentifier.create(DeviceInfo.class).child(Node.class, new NodeKey("1"));
ReadOnlyTransaction tx = db.newReadOnlyTransactio();
Node node = tx.read(id).get();
tx.read(LogicalDatastoreType.OPERATIONAL, id).get();
String desc = node.getDescription();