OcNOS-RON : NetConf User Guide : Transactions
Transactions
OcNOS supports transaction-oriented configuration management. Transactions are created implicitly by edit-config operations; commit and discard-changes operations close or terminate the transactions. Successive edit-config operations are placed in the same transaction.
Discard Changes
Discard the transaction or candidate configuration changes.
yangcli root@127.1> sget-config /ospfv2 source=candidate
 
Filling list /ospfv2:
RPC Data Reply 63 for session 2:
 
rpc-reply {
data {
ospfv2 {
processes {
process 20 {
ospf-id 20
config {
ospf-id 20
vrf-name default
}
}
}
}
}
}
 
yangcli root@127.1>
 
yangcli root@127.1>
 
edit-config config=@/home/ospf_payload.xml
 
RPC OK Reply 64 for session 2:
 
yangcli root@127.1>
 
yangcli root@127.1> sget-config /ospfv2 source=candidate
 
Filling list /ospfv2:
rpc-reply {
data {
ospfv2 {
processes {
process 20 {
ospf-id 20
config {
ospf-id 20
vrf-name default
}
}
process 25 {
ospf-id 25
config {
ospf-id 25
vrf-name default
}
}
}
}
}
}
 
 
yangcli root@127.1>
 
yangcli root@127.1> discard-changes
 
RPC OK Reply 66 for session 2:
 
yangcli root@127.1>
 
yangcli root@127.1> sget-config /ospfv2 source=candidate
 
Filling list /ospfv2:
RPC Data Reply 67 for session 2:
 
rpc-reply {
data {
ospfv2 {
processes {
process 20 {
ospf-id 20
config {
ospf-id 20
vrf-name default
}
}
}
}
}
}
 
 
yangcli root@127.1>
Commit
Commit the transaction or candidate configuration changes.
edit-config config=@/home/ospf_payload.xml
 
RPC OK Reply 17 for session 2: yangcli ocnos@10.12.45.253> commit RPC OK Reply 18 for session 2:
yangcli ocnos@10.12.45.253> sget-config /ospfv2 source=running
 
Filling list /ospfv2:
RPC Data Reply 19 for session 2:
 
rpc-reply {
data {
ospfv2 {
processes {
process 20 {
ospf-id 20
config {
ospf-id 20
shutdown
vrf-name default
}
}
process 25 {
ospf-id 25
config {
ospf-id 25
vrf-name default
}
}
}
}
}
}
Confirmed-commit
In netconf 1.1, support for confirmed-commit capability is provided.
The confirmed-commit capability indicates that the server will support the <cancel-commit> operation and the <confirmed>, <confirm-timeout>, <persist>, and <persist-id> parameters for the <commit> operation.
commit confirmed
This RPC will initiate the confirmed-commit operation. And the committed configurations will be removed if the commit is not confirmed within the default timeout period of 600 seconds. This timeout is configurable with this option [yangcli root@127.1> commit confirmed confirm-timeout=<id>]
yangcli ocnos@127.1> edit-config config=@/root/a.xml
 
Filling container /edit-config/input/target:
RPC OK Reply 1 for session 2:
 
yangcli ocnos@127.1> commit confirmed
 
RPC OK Reply 2 for session 2:
 
yangcli ocnos@127.1> sget-config source=running /ospfv2
 
Filling container /ospfv2:
RPC Data Reply 3 for session 2:
 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<ospfv2 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-ospf">
<processes>
<process>
<ospf-id>2</ospf-id>
<config>
<ospf-id>2</ospf-id>
<vrf-name>default</vrf-name>
</config>
</process>
</processes>
</ospfv2>
</data>
</rpc-reply>
 
yangcli ocnos@127.1>
cancel-commit
This RPC can be used to cancel the ongoing confirmed commit operation.
yangcli ocnos@127.1> edit-config config=@/root/a.xml
 
Filling container /edit-config/input/target:
RPC OK Reply 1 for session 2:
 
yangcli ocnos@127.1> commit confirmed
 
RPC OK Reply 2 for session 2:
 
yangcli ocnos@127.1> sget-config source=running /ospfv2
 
Filling container /ospfv2:
RPC Data Reply 3 for session 2:
 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<ospfv2 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-ospf">
<processes>
<process>
<ospf-id>2</ospf-id>
<config>
<ospf-id>2</ospf-id>
<vrf-name>default</vrf-name>
</config>
</process>
</processes>
</ospfv2>
</data>
</rpc-reply>
 
yangcli ocnos@127.1> cancel-commit
 
RPC OK Reply 4 for session 2:
 
yangcli ocnos@127.1> sget-config source=running /ospfv2
 
Filling container /ospfv2:
RPC Data Reply 5 for session 2:
 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data/>
</rpc-reply>
 
yangcli ocnos@127.1>
commit confirmed persist= <id>
Persist Is used to attach an identifier to the confirmed commit operation so that only with this identifier one can cancel the ongoing confirmed-commit.
yangcli ocnos@127.1> commit confirmed persist=100
 
RPC OK Reply 12 for session 2:
 
yangcli ocnos@127.1> !sg
 
yangcli ocnos@127.1> sget-config source=running /ospfv2
 
Filling container /ospfv2:
RPC Data Reply 13 for session 2:
 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<ospfv2 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-ospf">
<processes>
<process>
<ospf-id>2</ospf-id>
<config>
<ospf-id>2</ospf-id>
<vrf-name>default</vrf-name>
</config>
</process>
</processes>
</ospfv2>
</data>
</rpc-reply>
 
yangcli ocnos@127.1> cancel-commit
 
RPC Error Reply 14 for session 2:
 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<rpc-error>
<error-type>rpc</error-type>
<error-tag>data-missing</error-tag>
<error-severity>error</error-severity>
<error-app-tag>data-incomplete</error-app-tag>
<error-path>/cancel-commit</error-path>
<error-message
xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en">missing parameter</error-message>
<error-info>
<error-number xmlns="http://netconfcentral.org/ns/yuma-ncx">233</error-number>
</error-info>
</rpc-error>
</rpc-reply>
 
yangcli ocnos@127.1> cancel-commit persist-id=100
 
RPC OK Reply 15 for session 2:
 
yangcli ocnos@127.1> sget-config source=running /ospfv2
 
Filling container /ospfv2:
RPC Data Reply 16 for session 2:
 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data/>
</rpc-reply>
 
yangcli ocnos@127.1>
commit
Commit can be used to confirm the ongoing confirmed-commit operation.
yangcli ocnos@127.1> edit-config config=@/root/a.xml
 
Filling container /edit-config/input/target:
RPC OK Reply 32 for session 2:
 
yangcli ocnos@127.1> commit confirmed
 
RPC OK Reply 33 for session 2:
 
yangcli ocnos@127.1> !sg
 
yangcli ocnos@127.1> sget-config source=running /ospfv2
 
Filling container /ospfv2:
RPC Data Reply 34 for session 2:
 
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<ospfv2 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-ospf">
<processes>
<process>
<ospf-id>2</ospf-id>
<config>
<ospf-id>2</ospf-id>
<vrf-name>default</vrf-name>
</config>
</process>
</processes>
</ospfv2>
</data>
</rpc-reply>
Transaction Limit
The default transaction limit is 5000. The maximum transaction limit is 300000. Set the transaction limit to zero (0) for no limit.
Set transaction limit
<set-transaction-limit xmlns="http://ipinfusion.com/ns/zebmcli">
<transaction-limit>6500</transaction-limit>
</set-transaction-limit>
yangcli ocnos@0> set-transaction-limit 6500
 
RPC OK Reply 1 for session 3:
View transaction limit
yangcli ocnos@0> show-transaction-limit
 
RPC Data Reply 2 for session 3:
 
rpc-reply {
transaction-limit 'Max-Transaction Limit is 6500'
}