03-14-2023 03:27 AM
Hej
I am trying to import and merge bunch of devices from an xml file but I get the below error
The problem seems to be "spacing" related but as far as I can see all the spacing seems fine
oscj@oscar:~$ ncs_load -lm downloads/oscar.xml
ncs_load: 645: maapi_load_config(sock, tid, flags, abspath(argv[0])) failed: external error (19): Error on line 1: unknown namespace: in device
This is first 3 devices in the XML file. I have taken the xml template from a working device in the NSO instance.
<device>
<name>Oscar-Cust-3</name>
<address>10.250.10.103</address>
<port>830</port>
<authgroup>Oscar</authgroup>
<device-type>
<netconf>
<ned-id xmlns:juniper-junos-nc-3.0="http://tail-f.com/ns/ned-id/juniper-junos-nc-3.0">juniper-junos-nc-3.0:juniper-junos-nc-3.0</ned-id>
</netconf>
</device-type>
<state>
<admin-state>unlocked</admin-state>
</state>
</device>
<device>
<name>Oscar-Cust-4</name>
<address>10.250.10.104</address>
<port>830</port>
<authgroup>Oscar</authgroup>
<device-type>
<netconf>
<ned-id xmlns:juniper-junos-nc-3.0="http://tail-f.com/ns/ned-id/juniper-junos-nc-3.0">juniper-junos-nc-3.0:juniper-junos-nc-3.0</ned-id>
</netconf>
</device-type>
<state>
<admin-state>unlocked</admin-state>
</state>
</device>
<device>
<name>Oscar-PE-1</name>
<address>10.250.10.111</address>
<port>830</port>
<authgroup>Oscar</authgroup>
<device-type>
<netconf>
<ned-id xmlns:juniper-junos-nc-3.0="http://tail-f.com/ns/ned-id/juniper-junos-nc-3.0">juniper-junos-nc-3.0:juniper-junos-nc-3.0</ned-id>
</netconf>
</device-type>
<state>
<admin-state>unlocked</admin-state>
</state>
</device>
03-14-2023 05:39 AM
Hi
Try to wrap your xml in config tags like this:
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>Oscar-Cust-3</name>
<address>10.250.10.103</address>
<port>830</port>
<authgroup>Oscar</authgroup>
<device-type>
<netconf>
<ned-id xmlns:juniper-junos-nc-3.0="http://tail-f.com/ns/ned-id/juniper-junos-nc-3.0">juniper-junos-nc-3.0:juniper-junos-nc-3.0</ned-id>
</netconf>
</device-type>
<state>
<admin-state>unlocked</admin-state>
</state>
</device>
<device>
<name>Oscar-Cust-4</name>
<address>10.250.10.104</address>
<port>830</port>
<authgroup>Oscar</authgroup>
<device-type>
<netconf>
<ned-id xmlns:juniper-junos-nc-3.0="http://tail-f.com/ns/ned-id/juniper-junos-nc-3.0">juniper-junos-nc-3.0:juniper-junos-nc-3.0</ned-id>
</netconf>
</device-type>
<state>
<admin-state>unlocked</admin-state>
</state>
</device>
<device>
<name>Oscar-PE-1</name>
<address>10.250.10.111</address>
<port>830</port>
<authgroup>Oscar</authgroup>
<device-type>
<netconf>
<ned-id xmlns:juniper-junos-nc-3.0="http://tail-f.com/ns/ned-id/juniper-junos-nc-3.0">juniper-junos-nc-3.0:juniper-junos-nc-3.0</ned-id>
</netconf>
</device-type>
<state>
<admin-state>unlocked</admin-state>
</state>
</device>
</devices>
</config>
HTH
Marcel
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