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.
Positive Response
Section titled “Positive Response”If the device can satisfy the request, the server sends an
Negative Response
Section titled “Negative Response”An
Example
Section titled “Example”To retrieve the entire
<filter type="subtree"> <top> <vlans xmlns="http://asterfusion.com/ns/yang/asternos-vlan"/> </top></filter>Reply:
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <top> <vlans xmlns="http://asterfusion.com/ns/yang/asternos-vlan"> <vlan> <vlanid>100</vlanid> <mac-limit>10000</mac-limit> <description>this is a test1</description> <unknown-unicast-action>flood</unknown-unicast-action> <unknown-multicast-action>drop</unknown-multicast-action> </vlan> <vlan> <vlanid>200</vlanid> <mac-limit>20000</mac-limit> <description>this is a test2</description> <unknown-unicast-action>flood</unknown-unicast-action> <unknown-multicast-action>drop</unknown-multicast-action> </vlan> <vlan> <vlanid>4000</vlanid> <mac-limit>20000</mac-limit> <description>test</description> <unknown-unicast-action>flood</unknown-unicast-action> <unknown-multicast-action>drop</unknown-multicast-action> </vlan> </vlans> </top></data>Description
Section titled “Description”AsterNOS support
The
This operation allows the new configuration to be expressed in xml format data. If the target configuration datastore does not exist, it will be created.
If a NETCONF peer supports the :url capability (Section 8.8), the
If the
Elements in the
If the “operation” attribute is not specified, the configuration is merged into the configuration datastore.
The “operation” attribute has one of the following values:
merge
The configuration data identified by the element containing this attribute is merged with the configuration at the corresponding level in the configuration datastore identified by the
replace
The configuration data identified by the element containing this attribute replaces any related configuration in the configuration datastore identified by the
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.
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>