08-21-2017 12:19 AM - edited 03-01-2019 03:58 AM
Hi,
Apologies if I'm asking silly question - but there is no mechanism for REST api to send command "default interface xxx", am I right?
Reason I'm asking is currently I'm trying to apply rule policies, and one of the requirement from customer is REST api must not reset interface loopback config (CLI = "default interface Loopback xx").
So it's safe to say since REST can't issue that CLI, it should be fine?
I can apply rule to cover "no interface Loopback xx" scenario - just hoping that I don't have to create another policy rule for restricting "default interface Loopback xx"?
Thanks in advance!
08-21-2017 03:00 AM
If the command is supported by the NED, then you can do this over the REST interface. If the command is missing in the NED, then you can request it: Detailed process regarding NSO and NED support
08-21-2017 08:27 PM
NSO REST can send the command by live-status feature.
admin@ncs# conf Entering configuration mode terminal admin@ncs(config)# devices device csr1kv config default interface Loopback 100 result Interface Loopback100 set to default configuration CSR1000v(config)# admin@ncs(config)#
This is an action, and you can exec it from REST as well.
$ curl -X POST -u admin:admin \ http://localhost:8080/api/operations/devices/device/csr1kv/config/ios:EXEC/default \ -H "Content-Type: application/vnd.yang.data+json" \ -d '{"input": {"args" : "interface Loopback 100"}}' { "tailf-ned-cisco-ios:output": { "result": "\r\nInterface Loopback100 set to default configuration\r\nCSR1000v(config)#" } }
You would need to perform sync-from after the execution, otherwise the config may be out-of-sync.
Regards,
Akira
08-21-2017 08:30 PM
Ah - ok so REST will be able to send CLI command directly on top of using NED.
Ok I think another way for me is to use AAA - rule list to restrict it then.
Thank you Akira-san!
08-22-2017 12:04 PM
You may also wish to review this post:
https://communities.cisco.com/thread/84801
where the discussion was about restricting certain device configs using NSO tfcp:policy rules...
there were several nice examples provided.
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