Refer to this posting for the instructions.
Let’s try a concrete example. If you run the intro/1-2-3-start-query-model example, you should be able to run the NETCONF get-schema query for the dhcpd module as follows:
$ netconf-console --get-schema=dhcpd
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><![CDATA[module dhcpd {
namespace "http://tail-f.com/ns/example/dhcpd";
prefix dhcpd;
import ietf-inet-types {
prefix inet;
}
import tailf-xsd-types {
prefix xs;
}
typedef loglevel {
type enumeration {
enum kern;
enum mail;
enum local7;
}
}
grouping subNet {
list subNet {
key "net mask";
leaf net {
type inet:ipv4-address;
}
leaf mask {
type inet:ipv4-address;
}
container range {
presence "";
leaf dynamicBootP {
type boolean;
default false;
description "Enable BOOTP for this instance.";
}
leaf lowAddr {
type inet:ipv4-address;
mandatory true;
description "Enable BOOTP for this instance.";
}
leaf hiAddr {
type inet:ipv4-address;
description "Enable BOOTP for this instance.";
}
}
leaf routers {
type string;
}
leaf maxLeaseTime {
type xs:duration;
default PT7200S;
}
}
}
container dhcp {
leaf defaultLeaseTime {
type xs:duration;
default PT600S;
}
leaf maxLeaseTime {
type xs:duration;
default PT7200S;
}
leaf logFacility {
type loglevel;
default local7;
}
container SubNets {
uses subNet;
}
container SharedNetworks {
list sharedNetwork {
key name;
max-elements 1024;
leaf name {
type string;
}
container SubNets {
uses subNet ;
}
}
}
}
}
]]></data>
</rpc-reply>
To perform get-schema on the ietf-yang-types module, you will need to modify the Makefile to add an additional loadpath at $(CONFD_DIR)/src/confd/yang as follows:
CONFD_FLAGS = --addloadpath $(CONFD_DIR)/etc/confd --addloadpath $(CONFD_DIR)/src/confd/yang
With the above change in your Makefile, you should see the following line when you do make start:
confd -c confd.conf --addloadpath $CONFD_DIR/etc/confd --addloadpath $CONFD_DIR/src/confd/yang
When you perform the get-schema query on the ietf-yang-types module with the modified Makefile, you should see the following:
$ netconf-console --get-schema=ietf-yang-types
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><![CDATA[module ietf-yang-types {
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types";
prefix "yang";
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/netmod/>
WG List: <mailto:netmod@ietf.org>
WG Chair: David Kessens
<mailto:david.kessens@nsn.com>
WG Chair: Juergen Schoenwaelder
<mailto:j.schoenwaelder@jacobs-university.de>
Editor: Juergen Schoenwaelder
<mailto:j.schoenwaelder@jacobs-university.de>";
description
"This module contains a collection of generally useful derived
YANG data types.
...
typedef dotted-quad {
type string {
pattern
'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+ '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
}
description
"An unsigned 32-bit number expressed in the dotted-quad
notation, i.e., four octets written as decimal numbers
and separated with the '.' (full stop) character.";
}
}
]]></data>
</rpc-reply>