NETCONF Operations
NETCONF defines one or more configuration datastores and allows configuration operations on the datastores. A configuration datastore is a complete set of configuration data that is required to get a device from its initial default state into a desired operational state. The configuration datastore does not include state data or executive commands.
| +--get-config
| +--edit-Config
| +--merge
| +--replace
| +--create
| +--delete
| +--remove
| +--default-operations
| +--merge
| +--replace
| +--none
| +--get
These NETCONF operations are described in the following table:
NETCONF Operation |
Description |
Example |
---|---|---|
<get-config> |
Retrieves all or part of a specified configuration from a named data store |
Retrieves the nsf configuration using Cisco-IOS-XR-clns-isis-cfg.
|
<get> |
Retrieves running configuration and device state information |
Retrieves the optics configuration on particular interface.
|
<edit-config> |
Loads all or part of a specified configuration to the specified target configuration |
Edits the nsf configuration using Cisco-IOS-XR-clns-isis-cfg
|
NETCONF Operation to Get Configuration
The <rpc> element in the request and response messages enclose a NETCONF
request sent between the client and the router. The message-id
attribute in the <rpc> element is mandatory. This attribute is a string chosen
by the sender and encodes an integer. The receiver of the <rpc> element does
not decode or interpret this string but simply saves it to be used in the
<rpc-reply> message. The sender must ensure that the
message-id
value is normalized. When the client receives
information from the server, the <rpc-reply> message contains the same
message-id
.
This example shows how a NETCONF <get-config> and <edit-config> request works for the ISIS configuration.
To retrieve the nsf configuration using Cisco-IOS-XR-clns-isis-cfg:
Netconf Request (Client to Router) |
Netconf Response (Router to Client) |
---|---|
|
|
The following displays the command output from the router:
RP/0/RP0:ios#show run router isis
Fri Jul 3 22:22:22.150 IST
router isis 100
is-type level-2-only
net 49.0000.0000.0000.0001.00
nsr
nsf ietf
address-family ipv4 unicast
metric-style wide
mpls traffic-eng level-2-only
mpls traffic-eng router-id Loopback1
To edit the nsf configuration, using Cisco-IOS-XR-clns-isis-cfg:
Netconf Request (Client to Router) |
Netconf Response (Router to Client) |
---|---|
|
|
After a successful edit config operation, the router configuration is changed to:
RP/0/RP0:ios#show run router isis
Fri Jul 3 22:25:33.793 IST
router isis 100
is-type level-2-only
net 49.0000.0000.0000.0001.00
nsr
nsf cisco
address-family ipv4 unicast
metric-style wide
mpls traffic-eng level-2-only
mpls traffic-eng router-id Loopback1