6-14
Catalyst 4500 Series Switch, Cisco IOS Software Configuration Guide - Cisco IOS XE 3.9.xE and IOS 15.2(5)Ex
Chapter 6 Programmability
Using NETCONF and RESTCONF Protocols
Using NETCONF and RESTCONF Protocols
NETCONF uses a simple RPC-based (Remote Procedure Call) mechanism to facilitate communication
between a client and a server. The client can be a script or an application running as part of a network
manager. The server is typically a network device (switch or router).
NETCONF uses Secure Shell Version 2(SSHv2) as the transport layer across network devices and
RESTCONF uses HTTP.
To use NETCONF and RESTCONF you must complete all the required tasks as per the
Programmability Components, page 6-4
section.
NETCONF and RESTCONF also support capability discovery and model downloads. Supported models
are discovered using the ietf-netconf-monitoring model. Revision dates for each model are shown in the
capabilities response. Data models are available for optional download from a device using the
get-schema rpc. You can use these YANG models to understand or export the data model.
The following shows sample RPCs you can send and the kind of action that is performed.
•
Examples for NETCONF RPCs, page 6-14
•
Examples for RESTCONF RPCs, page 6-15
Examples for NETCONF RPCs
Get the running-configuration of the switch by sending the following RPC:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config>
<source>
<running/>
</source>
<filter>
<native xmlns="http://cisco.com/ns/yang/ned/ios"/>
</filter>
</get-config>
</rpc>
Change the description of an interface by sending the following RPC
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<native xmlns="http://cisco.com/ns/yang/ned/ios">
<interface>
<TenGigabitEthernet>
<name>4/1</name>
<description>to_distribution</description>
</TenGigabitEthernet>
</interface>
</native>
</config>
</edit-config>
</rpc>
Содержание Catalyst 4500 Series
Страница 2: ......
Страница 4: ......
Страница 2086: ...Index IN 46 Software Configuration Guide Release IOS XE 3 9 0E and IOS 15 2 5 E ...