Chapter 4
Getting Data
RUGGEDCOM NETCONF
Reference Guide
38
Using pyang
<version>2012-03-07</version>
<format>yin</format>
</get-schema>
</rpc>]]>]]>
The device returns the text from the specified YIN or YANG file.
Section 4.6.3
Using pyang
pyang
is an open-source utility used to validate and transform YANG and YIN files.
pyang
is particularly useful for
transforming YANG and YIN files into text-based output that clearly illustrated the hierarchy of the elements in the
RUGGEDCOM ROX II data model files.
Download pyang from
[http://code.google.com/p/pyang/].
pyang
is a Python-based
application. If you do not already have Python installed, download it from
This section describes how to us pyang to convert a YANG or YIN file to a text-based tree diagram of a
RUGGEDCOM ROX II schema.
To convert a YANG or YIN file to a text-based tree diagram, do the following:
1. Before beginning, download one or more YANG or YIN files from RUGGEDCOM ROX II. For instructions on
downloading schemas, refer to
Section 4.6.2, “Getting YIN and YANG Files from the Device”
2. At a command line prompt; type this command:
pyang
{inputFile}
-o
{outputFile}
-f tree
•
{inputFile}
The path to and filename of the YANG or YIN file that you want to convert.
•
{outputFile}
The path to and filename of the text-based tree diagram that you want to create.
For example, to convert the
rmf_services.yan
file to a text-based tree diagram, type the following
command. This example assumed that you are issuing the command in the same directory as where the
rmf_services.yang
file is located.
pyang
rmf_services.yang
-o
rmf_services.txt
-f tree
pyang creates the
rmf_services.txt
file.
3. Open the output file in a text editor. This example shows a portion of the
rmf_services.yang
file
rendered as a text-based tree:
module: rmf_services
+--rw services
+--rw time
+--rw ntp
+--rw enabled? boolean
+--rw server [name]
| +--rw name inet:host
| +--rw enabled? empty
| +--rw peer? empty
| +--rw minpoll? ntpPollType
| +--rw maxpoll? ntpPollType
| +--rw iburst? empty
| +--rw ntp-version? ntpVersionType
| +--rw prefer? empty
Содержание RUGGEDCOM MX5000RE
Страница 8: ...Table of Contents RUGGEDCOM NETCONF Reference Guide viii ...
Страница 12: ...Preface RUGGEDCOM NETCONF Reference Guide xii Customer Support ...
Страница 26: ...Chapter 1 Introduction RUGGEDCOM NETCONF Reference Guide 14 Sample Session Editing Data ...
Страница 40: ...Chapter 3 NETCONF Sessions RUGGEDCOM NETCONF Reference Guide 28 Killing a Session ...
Страница 64: ...Chapter 5 Changing Configuration Data RUGGEDCOM NETCONF Reference Guide 52 Committing Changes ...
Страница 148: ...Chapter 8 NETCONF XML Elements RUGGEDCOM NETCONF Reference Guide 136 validate ...