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.
The base protocol includes the following NETCONF operations:
| +--get-config
| +--edit-Config
| +--merge
| +--replace
| +--create
| +--delete
| +--remove
| +--default-operations
| +--merge
| +--replace
| +--none
| +--get
| +--lock
| +--unLock
| +--close-session
| +--kill-session
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 |
Retrieve specific interface configuration details from running configuration using filter option
|
<get> |
Retrieves running configuration and device state information |
Retrieve all acl configuration and device state information.
|
<edit-config> |
Loads all or part of a specified configuration to the specified target configuration |
Configure ACL configs using Merge operation
|
<lock> |
Allows the client to lock the entire configuration datastore system of a device |
Lock the running configuration.
|
<Unlock> |
Releases a previously locked configuration. An <unlock> operation will not succeed if either of the following conditions is true:
|
Lock and unlock the running configuration from the same session.
|
<close-session> |
Closes the session. The server releases any locks and resources associated with the session and closes any associated connections. |
Close a NETCONF session.
|
<kill-session> |
Terminates operations currently in process, releases locks and resources associated with the session, and close any associated connections. |
Terminate a session if the ID is other session ID.
|
Note |
The system admin models support |
NETCONF Operation to Get Configuration
This example shows how a NETCONF <get-config> request works for LLDP feature.
The client initiates a message to get the current configuration of LLDP running on the router. The router responds with the current LLDP configuration.
Netconf Request (Client to Router) |
Netconf Response (Router to Client) |
---|---|
|
|
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
.