01-02-2018 07:58 PM - edited 03-01-2019 04:04 AM
Hi! Is there a REST API to push configuration on to NSO device equivalent to NETCONF edit config?
For example create a interface by using below XMLin request body
<config>
<interface xmlns="urn:ios">
<Loopback>
<name>1175</name>
<ip>
<address>
<primary>
<address>10.172.19.88</address>
<mask>255.255.255.255</mask>
</primary>
</address>
</ip>
</Loopback>
</interface>
</config>
Solved! Go to Solution.
01-02-2018 08:10 PM
May I suggest searching for REST here in the dev hub?
01-02-2018 08:10 PM
May I suggest searching for REST here in the dev hub?
01-07-2018 11:40 PM
Hi!
Thanks much ! The link was helpful but have a basic doubt in flow. can anyone please help?
1)How do we find correct namespace ?
2) how to find complete yang model definition( i.e xml format ) for the device and its corresponding namespace?
Doing GET request wont give all possible tags which can be configured. All i need to achieve is to generalize this xml request body so any configuration can be pushed in one shot.
i used http://localhost:port/api/running/ncs:devices/ncs:device/ios_xr with below PATCH request body
<device xmlns="http://tail-f.com/ns/ncs" xmlns:y="http://tail-f.com/ns/rest" xmlns:ncs="http://tail-f.com/ns/ncs">
<port>23</port>
<state>
<admin-state>unlocked</admin-state>
</state>
<config>
<logging xmlns="http://tail-f.com/ned/cisco-ios-xr">
<host>
<address>9.9.9.9</address>
</host>
</logging>
<interface xmlns="http://tail-f.com/ned/cisco-ios-xr">
<Loopback>
<id>1007</id>
</Loopback>
</interface>
</config>
</device>
01-08-2018 09:15 AM
Easiest is to do this using the CLI:
"show configuration device device foo | display xml"
- or -
"show configuration device device foo | display xml | save foo.xml"
01-08-2018 10:18 PM
This command doesn't work for me. It says show configuration works can only be followed by commit or rollback.
show configuration gives only interface tag and doesn't give possible configuration tags for example <router> ,<snmp-server> etc.
I want the skeleton XML which can be configured irrespective of whether its already configured or not configured at all.
Basically all sub tree tags under <config> tag for a device.
Please comment !
01-09-2018 11:01 AM
You may be in Cisco-style CLI, please try:
show running-config devices device foo config | display xml
or if you're in config mode
show full-configuration devices device foo config | display xml
or by REST
curl -u admin:admin http://localhost:8080/api/running/devices/device/foo/config\?deep
Cheers,
Fredrik
02-13-2018 02:15 AM
Hi !
can anyone please help answering below ?
1) where can i find device specific yang files in NSO managed devices?
a)Is it same as ned yang files(eg: ncs-4.4.2\packages\neds\cisco-ios\src\yang)?
b)Does this mean for all ios device <ncs-4.4.2\packages\neds\cisco-ios\src\yang> is the yang model used ?
note : I am trying to push configuration patch request using pyang -f sample-xml-skeleton output of this file on to device
2)I can see four
tailf-ned-cisco-ios,tailf-ned-cisco-ios-id,tailf-ned-cisco-ios-meta,tailf-ned-cisco-ios-oper,tailf-ned-cisco-ios-stats files in package yang folder.
a)What does each mean ?
b)Which file should i complie using pyang -f sample-xml-skeleton in order to use its output as request body for
http://localhost:8080/api/running/devices/device/ios_192.168.99.194/config\?deep
to change configuration of ios device.
02-14-2018 01:01 AM
Please start a new thread for this question.
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