Chapter 4
Getting Data
RUGGEDCOM NETCONF
Reference Guide
34
Specifying Objects with XPaths
</users>
</admin>
</data>
</rpc-reply>]]>]]>
Section 4.4.2
Specifying Objects with XPaths
When using XPath, use the following syntax in the
select
statement:
select="{element}/.../{element}[{element}='{data}']/{element}"/>
•
{element}
is an element in the data model.
•
...
represents multiple elements in the data model to the target element.
•
{data}
is the identifying data for the object whose information you want to retrieve.
For example, to return the role for a specific user, send an rpc-message similar to the following:
<rpc message-id="3030"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" with-defaults="true">
<get>
<filter type="xpath"
select="admin/users/userid[name='oper']/role"/>
</get>
</rpc>]]>]]>
The device returns the following:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="3030">
<data>
<admin xmlns="http://ruggedcom.com/ns/rmf_admin">
<users>
<userid>
<name>oper</name>
<role>operator</role>
</userid>
</users>
</admin>
</data>
</rpc-reply>]]>]]>
Section 4.5
Getting Default Values
The NETCONF standard does not require NETCONF servers to return the default values from the database. If you
query an object that has a default value, the server may return just the data structure and not the default value.
For example, the NETCONF Trace Log
Enabled
setting is disabled by default. When you query this value, NETCONF
does not return the default setting. When you issue this query:
<rpc message-id="3030"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
<filter type="xpath" select="admin/logging/diagnostics/xpath-trace-log/enabled" />
</get>
Summary of Contents for RUGGEDCOM MX5000RE
Page 8: ...Table of Contents RUGGEDCOM NETCONF Reference Guide viii ...
Page 12: ...Preface RUGGEDCOM NETCONF Reference Guide xii Customer Support ...
Page 26: ...Chapter 1 Introduction RUGGEDCOM NETCONF Reference Guide 14 Sample Session Editing Data ...
Page 40: ...Chapter 3 NETCONF Sessions RUGGEDCOM NETCONF Reference Guide 28 Killing a Session ...
Page 64: ...Chapter 5 Changing Configuration Data RUGGEDCOM NETCONF Reference Guide 52 Committing Changes ...
Page 148: ...Chapter 8 NETCONF XML Elements RUGGEDCOM NETCONF Reference Guide 136 validate ...