Chapter 1
Introduction
RUGGEDCOM NETCONF
Reference Guide
8
Sample Session: Performing an Action
2. Respond to the device with the client's
<hello>
statement. The client's
<hello>
statement can describe the
client's capabilities, or it can respond with just the base NETCONF capability. This example shows the minimal
<hello>
response:
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
</capabilities>
</hello>]]>]]>
3. Issue an
<rpc>
request with the action to perform:
<rpc message-id="1005" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<action xmlns="http://tail-f.com/ns/netconf/actions/1.0">
<data>
<admin xmlns="http://ruggedcom.com/ns/rmf_admin">
<set-system-clock>
<time>2012-03-26 18:00:00</time>
</set-system-clock>
</admin>
</data>
</action>
</rpc>]]>]]>
• All commands must be enclosed within
<rpc>
tags. The
message-id
attribute is not required but is
recommended. The
message-id
attribute is returned in the device response, allowing you to match
responses with requests.
• The
<action>
element indicates that this request is to perform an action on the device. The
<action>
element must refer to the action namespace in the
xmlns
attribute.
• The
<admin>
element is the root of the RUGGEDCOM admin namespace. Within the
<admin>
element,
additional elements
navigate
down to the desired command. In this example, we are navigating to
admin/
set-system-clock
in the RUGGEDCOM NETCONF data model.
• The
]]>]]>
string indicates the end of the NETCONF message. Each NETCONF message must end with
]]>]]>
The device responds with the results of the command:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1005">
<data>
<admin xmlns='http://ruggedcom.com/ns/rmf_admin'>
<set-system-clock>
<system-clock>Mon Mar 26 18:00:01 2012</system-clock>
</set-system-clock>
</admin>
</data>
</rpc-reply>]]>]]>
• The
<rpc-reply>
element contains the response. Notice the
message-id
attribute returned with the
<rpc-reply>
element; it corresponds to the <message-id> sent in the
<rpc>
request.
4. After receiving the response, close the session:
<rpc message-id="1006" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<close-session/>
</rpc>]]>]]>
The device responds with the following and closes the session:
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1006">
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 ...