NETCONF Operations
NETCONF protocol defines a set of operations to modify or obtain information in datastores.
For AsterNOS, operations supported situation are as following:
| Operation | Status | Description |
|---|---|---|
| Supported | Obtains some or all configuration data from the | |
| Supported | Obtains some or all running configuration data and status data from the | |
| Supported | Add/Modify/Delete configuration in | |
| Supported | Replaces the target database with the source database. If no target database has been created, this operation creates a database and then replaces the database. | |
| Supported | Closes a NETCONF session. |
Description
Section titled “Description”AsterNOS support to retrieve all or part of a specified configuration datastore via
Parameters
Section titled “Parameters”- source: Name of the configuration datastore being queried, such as
. - filter: This parameter identifies the portions of the device configuration datastore to retrieve. If this parameter is not present, the entire configuration is returned.
hint{type=“warning”} NOTE: AsterNOS currently DON’T support to replace whole list nodes.
If user specified operation as ‘replace’ in a list node, an rpc-error is returned by server or unexpected action done by server.
create
The configuration data identified by the element containing this attribute is added to the configuration if and only if the configuration data does not already exist in the configuration datastore. If the configuration data exists, an
delete
The configuration data identified by the element containing this attribute is deleted from the configuration if and only if the configuration data currently exists in the configuration datastore. If the configuration data does not exist, an
remove
Not supported currently.
Parameters
Section titled “Parameters”- target: Name of the configuration datastore being edited, such as
or . - config: A hierarchy of configuration data as defined by one of the device’s data models.The contents MUST be placed in an appropriate namespace, to allow the device to detect the appropriate data model, and the contents MUST follow the constraints of that data model, as defined by its capability definition. Capabilities are discussed in Capabilities.
Positive Response
Section titled “Positive Response”If the device was able to satisfy the request, an
Negative Response
Section titled “Negative Response”An
Example
Section titled “Example”The
Set the description to “test netconf” on a vlan “100” in the running configuration:
<config> <top> <vlans xmlns="http://asterfusion.com/ns/yang/asternos-vlan"> <vlan operation="merge"> <vlanid>100</vlanid> <description>test netconf</description> </vlan> </vlans> </top></config>Create a new vlan with vlanid=200:
<config> <top> <vlans xmlns="http://asterfusion.com/ns/yang/asternos-vlan"> <vlan operation="create"> <vlanid>200</vlanid> </vlan> </vlans> </top></config>Delete vlan 100:
<config> <top> <vlans xmlns="http://asterfusion.com/ns/yang/asternos-vlan"> <vlan operation="delete"> <vlanid>100</vlanid> </vlan> </vlans> </top><config>replace vlan 100:
<config> <top> <vlans xmlns="http://asterfusion.com/ns/yang/asternos-vlan"> <vlan operation="replace"> <vlanid>100</vlanid> <description>this is a replaced vlan 100</description> </vlan> </vlans> </top><config>Description
Section titled “Description”AsterNOS support
If the target datastore exists, it is overwritten. Otherwise, a new one is created, if allowed.
NOTE:
User can’t use same datastore as source and target in a
Currently, AsterNOS DON’T support to use
Parameters
Section titled “Parameters”- target: Name of the configuration datastore to use as the destination of the
operation.Support / . - source: Name of the configuration datastore to use as the source of the
operation. Support / / .
Positive Response
Section titled “Positive Response”If the device was able to satisfy the request, an
Negative Response
Section titled “Negative Response”An
Example
Section titled “Example”Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <copy-config> <target> <startup/> </target> <source> <running/> </source> </copy-config></rpc>Reply:
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <ok/></rpc-reply>Description
Section titled “Description”AsterNOS support
Parameters
Section titled “Parameters”filter: This parameter specifies the portion of the system configuration and state data to retrieve.If this parameter is not present, all the device configuration and state information is returned.
The
Positive Response
Section titled “Positive Response”If the device was able to satisfy the request, an
Negative Response
Section titled “Negative Response”An
Example
Section titled “Example”This example shows how to get PTP instance
<filter type="subtree"> <top xmlns="http://www.asterfusion.com/asternos-schema/1.0/config"> <ptp> <instances> <instance> <instance-number>0</instance-number> <current-ds/> </instance> </instances> </ptp> </top></filter>Reply:
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <top xmlns="http://www.asterfusion.com/asternos-schema/1.0/config"> <ptp> <instances> <instance> <instance-number>0</instance-number> <current-ds> <offset-from-master>0</offset-from-master> <mean-path-delay>0</mean-path-delay> <servo-state>unlocked</servo-state> </current-ds> </instance> </instances> </ptp> </top></data>For more subtree info, user may refer to Subtree Filtering.
Description
Section titled “Description”AsterNOS support to use
When NETCONF server receives a
Positive Response
Section titled “Positive Response”If the device was able to satisfy the request, an
Negative Response
Section titled “Negative Response”An
Example
Section titled “Example”Request:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <close-session/></rpc>Reply:
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <ok/></rpc-reply>