02-09-2019 07:11 AM
I am trying to use REST API on NSO - to execute exec CLIs like reload or image copy etc.
I am using Cisco Catalyst Switch with IOS-XE OS and using IOS-XE netconf NED on NSO.
I am not able to find appropriate REST API call to execute this from NSO NB interface.
I tried to execute this using NSO CLI - which works fine :
Entering configuration mode terminal
admin@ncs(config)# devices device cat9200-sthana
admin@ncs(config-device-cat9200-sthana)# rpc rpc-license license smart { register { idtoken test-token } }
but on REST API side : what path should i use to execute this RPC ?
http://127.0.0.1:8080/api/running/devices/device/cat9200-sthana/rpc/_operations ?
and how do i form my JSON object for this ?
Solved! Go to Solution.
02-14-2019 01:04 PM - edited 02-14-2019 01:15 PM
And using RESTCONF, here an example of a show command action (alu NED). For a NETCONF RPC is not different. Just search the path to the RPC definition and then draft your "input" parameters.
curl -X POST \
02-09-2019 07:19 AM
I tried this from REST API , but does not work.
02-14-2019 01:39 AM
First of all, I would really recommend that you switch from the old and no longer developing proprietary REST interface to the standard RESTCONF. There are really few reasons to develop code for the non-standard REST interface these days. If you switch, you can also get help, find tools, specifications (RFC 8040) and examples a lot easier.
The path you are using is wrong. Look up the rpc you are looking for in the NED you are using. A trick you can use to find out is to look in the NED's src/ncsc-out/modules/yang and see the complete path there.
02-14-2019 01:04 PM - edited 02-14-2019 01:15 PM
And using RESTCONF, here an example of a show command action (alu NED). For a NETCONF RPC is not different. Just search the path to the RPC definition and then draft your "input" parameters.
curl -X POST \
02-21-2021 06:26 AM
hello that works really we’ll just one question
im using iOS xr and I would like to run the following command: run ls -la /
I have tried using this d '{ "input": { "args":"run ls -la /"} }’
but no luck, I get an error
can you guys help me with this?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide