IOS XR and System Admin actions are RPC statements that trigger an operation or execute a command on the router. Theses actions are defined as YANG
models using RPC statements. An action is executed when the router receives the corresponding NETCONF RPC or gRPC request. Once the router executes an action, it replies with a NETCONF RPC or gRPC response.
For example, ping command is a supported action. That means, a YANG model is defined for the ping command using RPC statements. This command can be executed on the router by initiating the corresponding NETCONF RPC or gRPC request.
![](https://www.cisco.com/content/dam/en/us/td/i/templates/note.gif) Note |
NETCONF supports XML format, and gRPC supports JSON format.
|
For the list of supported actions, see the following table:
Actions
|
YANG Models
|
logmsg
|
Cisco-IOS-XR-syslog-act
|
snmp
|
Cisco-IOS-XR-snmp-test-trap-act
|
rollback
|
Cisco-IOS-XR-cfgmgr-rollback-act
|
ping
|
Cisco-IOS-XR-ping-act
Cisco-IOS-XR-ipv4-ping-act
Cisco-IOS-XR-ipv6-ping-act
|
traceroute
|
Cisco-IOS-XR-traceroute-act
Cisco-IOS-XR-ipv4-traceroute-act
Cisco-IOS-XR-ipv6-traceroute-act
|
crypto
|
Cisco-IOS-XR-crypto-act
|
clear ospf
|
Cisco-IOS-XR-ipv4-ospf-act
Cisco-IOS-XR-ipv6-ospfv3-act
|
clear isis
|
Cisco-IOS-XR-isis-act
|
clear bgp
|
Cisco-IOS-XR-ipv4-bgp-act
|
System Process Mgmt : process (restart)
|
Cisco-IOS-XR-sysmgr-act
Cisco-IOS-XR-sysadmin-pm
|
System Process Mgmt : Reload
(System Admin virtual machine (VM) reload, line card (LC) reload)
|
Cisco-IOS-XR-sysadmin-sm
|
System Process Mgmt : Reload
(IOS XR VM node reload from System Admin)
|
Cisco-IOS-XR-sysadmin-sdr-mgr
|
dumpcore
|
Cisco-IOS-XR-spirit-corehelper-cfg
|
Example: PING NETCONF Action
This use case shows the IOS XR NETCONF action request to run the ping command on the router.
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<ping xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ping-act">
<destination>
<destination>1.2.3.4</destination>
</destination>
</ping>
</rpc>
This section shows
the NETCONF action response from the router.
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<ping-response xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ping-act">
<ipv4>
<destination>1.2.3.4</destination>
<repeat-count>5</repeat-count>
<data-size>100</data-size>
<timeout>2</timeout>
<pattern>0xabcd</pattern>
<rotate-pattern>0</rotate-pattern>
<reply-list>
<result>!</result>
<result>!</result>
<result>!</result>
<result>!</result>
<result>!</result>
</reply-list>
<hits>5</hits>
<total>5</total>
<success-rate>100</success-rate>
<rtt-min>1</rtt-min>
<rtt-avg>1</rtt-avg>
<rtt-max>1</rtt-max>
</ipv4>
</ping-response>
</rpc-reply>
Example: XR Process Restart Action
This example shows the process restart action sent to NETCONF agent.
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<sysmgr-process-restart xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-sysmgr-act">
<process-name>processmgr</process-name>
<location>0/RP0/CPU0</location>
</sysmgr-process-restart>
</rpc>
This example shows the action response received from the NETCONF agent.
<?xml version="1.0"?>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<ok/>
</rpc-reply>
Example: Shutdown Dumper Process
This use case shows the System Admin NETCONF action request to shut down dumper process on the router.
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<action xmlns="http://tail-f.com/ns/netconf/actions/1.0">
<data>
<processes xmlns="http://www.cisco.com/ns/yang/Cisco-IOS-XR-sysadmin-pm">
<all-locations>
<location>0/RP0</location>
<name>
<proc-name>dumper</proc-name>
<instance-id>0</instance-id>
<proc-action>
<do-what>shutdown</do-what>
<user-name>root</user-name>
<user-ip>1.2.3.4</user-ip>
</proc-action>
</name>
</all-locations>
</processes>
</data>
</action>
</rpc>
This section shows the NETCONF action response from the router.
<?xml version="1.0"?>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<processes xmlns="http://www.cisco.com/ns/yang/Cisco-IOS-XR-sysadmin-pm">
<all-locations>
<location>0/RP0</location>
<name>
<proc-name>dumper</proc-name>
<instance-id>0</instance-id>
<proc-action>
<proc-action-status>User root (1.2.3.4) requested shutdown for process dumper(0) at 0/RP0
'Sending signal 15 to stop process dumper(IID 0) pid=2439'</proc-action-status>
</proc-action>
</name>
</all-locations>
</processes>
</data>
</rpc-reply>
Example: Copy Action
This example shows the RPC request and response for copy
action:
RPC request:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<copy xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-shellutil-copy-act">
<sourcename>//root:<location>/100MB.txt</sourcename>
<destinationname>/</destinationname>
<sourcefilesystem>ftp:</sourcefilesystem>
<destinationfilesystem>harddisk:</destinationfilesystem>
<destinationlocation>0/RSP1/CPU0</destinationlocation>
</copy>
</rpc>
RPC response:
<?xml version="1.0"?>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<response xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-shellutil-copy-act">Successfully completed copy operation</response>
</rpc-reply>
8.261830565s elapsed
Example: Delete Action
This example shows the RPC request and response for delete
action:
RPC request:
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<delete xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-shellutil-delete-act">
<name>harddisk:/netconf.txt</name>
</delete>
</rpc>
RPC response:
<?xml version="1.0"?>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<response xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-shellutil-delete-act">Successfully completed delete operation</response>
</rpc-reply>
395.099948ms elapsed
Example: Install Action
This example shows the Install action request sent to NETCONF agent.
<install-add xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-spirit-install-act">
<packagepath>/nobackup/hanaik/yang_project/img-xrv9k</packagepath>
<packagename>xrv9k-mpls-2.1.0.0-r64102I.x86_64.rpm</packagename>
</install-add>
This example shows the Install action response received from NETCONF agent.
<?xml version="1.0"?>
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<op-id xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-spirit-install-act">6</op-id>
</rpc-reply>
This example shows how to use install add rpc request with multiple packages enclosed within packagename tag.
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<install-add xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-spirit-install-act">
<packagepath>http://10.105.227.154/install_repo/fretta/651/651_02</packagepath>
<packagename>ncs540-k9sec-1.0.0.0-r632.x86_64.rpm</packagename>
<packagename>ncs540-li-1.0.0.0-r632.x86_64.rpm</packagename>
<packagename>ncs540-mcast-1.0.0.0-r632.x86_64.rpm</packagename>
<packagename>ncs5500-mini-x.iso-6.5.1.02Incs540-mini-x.iso-6.3.2</packagename>
<packagename>ncs540-mpls-1.0.0.0-r632.x86_64.rpm</packagename>
</install-add>
</rpc>
Restrictions for Install Action
-
Install upgrade command is deprecated. Hence, use install update command instead of the install upgrade command.
-
Only one request can be sent at a time.
-
ISSU is not supported.
-
Install Yang using NETCONF action can accept a maximum of 32 input parameters. Input parameters can be any inputs used in
install action commands, such as package names to add, activate, deactivate, or remove, and operation IDs to retrieve any particular log
related to that operation.