10-28-2019 03:40 PM
Hi NSO Community,
I am obtaining an error-message "unknown namespace" when trying to implement the below which are referenced from - https://documenter.getpostman.com/view/23187/RWgqWK3D?version=latest#nso-sample-policies
I've also checked the following:
admin@ncs> show packages package cisco-nx-cli-3.0
packages package cisco-nx-cli-3.0
package-version 3.0.0.3
description "NED package for the Cisco NX"
ncs-min-version [ 3.0.1 ]
directory ./state/packages-in-use/1/cisco-nx-cli-3.0
component cisco-nx
ned cli ned-id cisco-nx-cli-3.0
ned cli java-class-name com.tailf.packages.ned.nexus.NexusNedCli
ned device vendor Cisco
NAME VALUE
---------------------
show-tag interface
build-info date "2019-04-13 20:36:20"
build-info file cisco-nx-cli-3.0-source-3.0.0.3.tar.gz
build-info arch .linux.x86_64
build-info java "compiled Java class data, version 50.0"
build-info package name cisco-nx-cli-3.0
build-info package version 3.0.0.3
build-info package ref 3.0.0.3
build-info package sha1 This_Is_An_Example_NED
build-info ncs version 5.1.0.1_HEAD
build-info ncs sha1 This_NED_should_not_be_used
oper-status up
[ok][2019-10-29 09:13:15]
-----------------------------------------------------------------------------------------
[charllia@centos-1 nso-play]$ ncs-netsim status
DEVICE ios1
vsn: 7.1
SMP support: no
Using epoll: no
available modules: backplane,netconf,cdb,cli,snmp,webui
running modules: backplane,netconf,cdb,cli
status: started
namespaces: http://tail-f.com/ns/aaa/1.1 prefix:aaa exported to: none
http://tail-f.com/ns/common/query prefix:tfcq exported to: all
http://tail-f.com/ns/kicker prefix:kicker exported to: all
http://tail-f.com/ns/netconf/extensions prefix:tfnce exported to: netconf
http://tail-f.com/ns/netconf/forward/1.0 prefix:fwd exported to: netconf
http://tail-f.com/ns/netconf/inactive/1.0 prefix:in exported to: netconf
http://tail-f.com/ns/netconf/query prefix:tfncq exported to: netconf
http://tail-f.com/ns/netconf/rollback prefix:netconf-rollback exported to: netconf
http://tail-f.com/ns/netconf/transactions/1.0 prefix:tr exported to: netconf
http://tail-f.com/ns/netconf/with-transaction-id prefix:wtxid exported to: netconf
http://tail-f.com/ns/progress prefix:progress exported to: all
http://tail-f.com/ns/rollback prefix:rollback exported to: rest,netconf,maapi
http://tail-f.com/ns/tailf-rest-error prefix:tfrerr exported to: none
http://tail-f.com/ns/tailf-rest-query prefix:tfrestq exported to: none
http://tail-f.com/ns/webui prefix:webui exported to: all
http://tail-f.com/yang/acm prefix:tacm exported to: all
http://tail-f.com/yang/common prefix:tailf exported to: all
http://tail-f.com/yang/common-monitoring prefix:tfcg exported to: all
http://tail-f.com/yang/confd-monitoring prefix:tfcm exported to: all
http://tail-f.com/yang/netconf-monitoring prefix:tncm exported to: all
http://tail-f.com/yang/xsd-types prefix:xs exported to: all
urn:ietf:params:xml:ns:netconf:base:1.0 prefix:nc exported to: netconf
urn:ietf:params:xml:ns:netconf:partial-lock:1.0 prefix:pl exported to: netconf
urn:ietf:params:xml:ns:netmod:notification prefix:nm exported to: netconf
urn:ietf:params:xml:ns:yang:iana-crypt-hash prefix:ianach exported to: all
urn:ietf:params:xml:ns:yang:ietf-inet-types prefix:inet exported to: all
urn:ietf:params:xml:ns:yang:ietf-netconf-acm prefix:nacm exported to: none
urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring prefix:ncm exported to: all
urn:ietf:params:xml:ns:yang:ietf-netconf-notifications prefix:ncn exported to: all
urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults prefix:ncwd exported to: netconf
urn:ietf:params:xml:ns:yang:ietf-restconf prefix:rc exported to: rest
urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring prefix:rcmon exported to: all
urn:ietf:params:xml:ns:yang:ietf-yang-library prefix:yanglib exported to: netconf,rest
urn:ietf:params:xml:ns:yang:ietf-yang-patch prefix:ypatch exported to: rest
urn:ietf:params:xml:ns:yang:ietf-yang-types prefix:yang exported to: all
urn:ios prefix:ios exported to: all
YANG data models:
module: iana-crypt-hash revision: 2014-08-06
namespace: urn:ietf:params:xml:ns:yang:iana-crypt-hash
prefix: ianach
exported to: all
module: ietf-inet-types revision: 2013-07-15
namespace: urn:ietf:params:xml:ns:yang:ietf-inet-types
prefix: inet
exported to: all
module: ietf-netconf revision: 2011-06-01
namespace: urn:ietf:params:xml:ns:netconf:base:1.0
prefix: nc
exported to: netconf
module: ietf-netconf-acm revision: 2018-02-14
namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-acm
prefix: nacm
exported to: none
module: ietf-netconf-monitoring revision: 2010-10-04
namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
prefix: ncm
exported to: all
module: ietf-netconf-notifications revision: 2012-02-06
namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-notifications
prefix: ncn
exported to: all
module: ietf-netconf-partial-lock revision: 2009-10-19
namespace: urn:ietf:params:xml:ns:netconf:partial-lock:1.0
prefix: pl
exported to: netconf
module: ietf-netconf-with-defaults revision: 2011-06-01
namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults
prefix: ncwd
exported to: netconf
module: ietf-restconf revision: 2017-01-26
namespace: urn:ietf:params:xml:ns:yang:ietf-restconf
prefix: rc
exported to: rest
module: ietf-restconf-monitoring revision: 2017-01-26
namespace: urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring
prefix: rcmon
exported to: all
module: ietf-yang-library revision: 2016-06-21
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-library
prefix: yanglib
exported to: netconf,rest
module: ietf-yang-patch revision: 2017-02-22
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-patch
prefix: ypatch
exported to: rest
module: ietf-yang-types revision: 2013-07-15
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-types
prefix: yang
exported to: all
module: netconf_netmod
namespace: urn:ietf:params:xml:ns:netmod:notification
prefix: nm
exported to: netconf
module: tailf-aaa revision: 2018-09-12
namespace: http://tail-f.com/ns/aaa/1.1
prefix: aaa
exported to: none
module: tailf-acm revision: 2013-03-07
namespace: http://tail-f.com/yang/acm
prefix: tacm
exported to: all
module: tailf-common revision: 2019-04-09
namespace: http://tail-f.com/yang/common
prefix: tailf
exported to: all
module: tailf-common-monitoring revision: 2019-04-09
namespace: http://tail-f.com/yang/common-monitoring
prefix: tfcg
exported to: all
module: tailf-common-query revision: 2017-12-15
namespace: http://tail-f.com/ns/common/query
prefix: tfcq
exported to: all
module: tailf-confd-monitoring revision: 2019-04-09
namespace: http://tail-f.com/yang/confd-monitoring
prefix: tfcm
exported to: all
module: tailf-kicker revision: 2017-09-28
namespace: http://tail-f.com/ns/kicker
prefix: kicker
exported to: all
module: tailf-ned-cisco-ios revision: 2015-03-16
namespace: urn:ios
prefix: ios
exported to: all
module: tailf-netconf-extensions revision: 2019-04-09
namespace: http://tail-f.com/ns/netconf/extensions
prefix: tfnce
exported to: netconf
module: tailf-netconf-forward
namespace: http://tail-f.com/ns/netconf/forward/1.0
prefix: fwd
exported to: netconf
module: tailf-netconf-inactive
namespace: http://tail-f.com/ns/netconf/inactive/1.0
prefix: in
exported to: netconf
module: tailf-netconf-monitoring revision: 2019-03-28
namespace: http://tail-f.com/yang/netconf-monitoring
prefix: tncm
exported to: all
module: tailf-netconf-query revision: 2017-01-06
namespace: http://tail-f.com/ns/netconf/query
prefix: tfncq
exported to: netconf
module: tailf-netconf-rollback revision: 2018-01-12
namespace: http://tail-f.com/ns/netconf/rollback
prefix: netconf-rollback
exported to: netconf
module: tailf-netconf-transactions
namespace: http://tail-f.com/ns/netconf/transactions/1.0
prefix: tr
exported to: netconf
module: tailf-netconf-with-transaction-id revision: 2018-11-23
namespace: http://tail-f.com/ns/netconf/with-transaction-id
prefix: wtxid
exported to: netconf
module: tailf-progress revision: 2018-06-14
namespace: http://tail-f.com/ns/progress
prefix: progress
exported to: all
module: tailf-rest-error
namespace: http://tail-f.com/ns/tailf-rest-error
prefix: tfrerr
exported to: none
module: tailf-rest-query revision: 2017-01-06
namespace: http://tail-f.com/ns/tailf-rest-query
prefix: tfrestq
exported to: none
module: tailf-rollback revision: 2018-01-12
namespace: http://tail-f.com/ns/rollback
prefix: rollback
exported to: rest,netconf,maapi
module: tailf-webui revision: 2013-03-07
namespace: http://tail-f.com/ns/webui
prefix: webui
exported to: all
module: tailf-xsd-types revision: 2017-11-20
namespace: http://tail-f.com/yang/xsd-types
prefix: xs
exported to: all
user sessions:
system sessions:
sessionId=1 2019-10-29 08:33:28 system@0.0.0.0 system/system
no locks set
no transactions
sessionId=10 2019-10-29 08:33:29 system@0.0.0.0 system/system
no locks set
no transactions
sessionId=11 2019-10-29 08:33:29 system@0.0.0.0 system/system
no locks set
no transactions
sessionId=12 2019-10-29 08:33:29 system@0.0.0.0 system/system
no locks set
transactions:
tid=8 db=running mode=read
callpoints:
validation points:
actionpoints:
typepoints:
notification stream replay support:
SNMP inform delivery callbacks:
SNMP notification subscriptions:
authentication callback:
not enabled
authorization callbacks:
not enabled
error formatting callbacks:
partial running locks:
partial candidate locks:
partial startup locks:
cdb:
current transaction id: 1572-298409-356219
running:
ram size: 16.0 kB
read locks: 0
write lock: unset
startup:
filename: ./cdb/A.cdb
disk size: 1.9 kB
ram size: 16.0 kB
read locks: 0
write lock: unset
operational:
filename: ./cdb/O.cdb
disk size: 4 bytes
ram size: 136 bytes
subscription lock: unset
no pending subscription notifications
no registered cdb clients
tts alloc:
44191 40:42:54 64:291:97 72:30:0 120:17:0 176:54:486
fxs store:
memory: 5.3415 MB
size: 71369
reuse: 5.59
DEVICE nx1
vsn: 7.1
SMP support: no
Using epoll: no
available modules: backplane,netconf,cdb,cli,snmp,webui
running modules: backplane,cdb,cli
status: started
namespaces: http://tail-f.com/ned/cisco-nx prefix:nx exported to: all
http://tail-f.com/ns/aaa/1.1 prefix:aaa exported to: none
http://tail-f.com/ns/common/query prefix:tfcq exported to: all
http://tail-f.com/ns/kicker prefix:kicker exported to: all
http://tail-f.com/ns/netconf/extensions prefix:tfnce exported to: netconf
http://tail-f.com/ns/netconf/forward/1.0 prefix:fwd exported to: netconf
http://tail-f.com/ns/netconf/inactive/1.0 prefix:in exported to: netconf
http://tail-f.com/ns/netconf/query prefix:tfncq exported to: netconf
http://tail-f.com/ns/netconf/rollback prefix:netconf-rollback exported to: netconf
http://tail-f.com/ns/netconf/transactions/1.0 prefix:tr exported to: netconf
http://tail-f.com/ns/netconf/with-transaction-id prefix:wtxid exported to: netconf
http://tail-f.com/ns/progress prefix:progress exported to: all
http://tail-f.com/ns/rollback prefix:rollback exported to: rest,netconf,maapi
http://tail-f.com/ns/tailf-rest-error prefix:tfrerr exported to: none
http://tail-f.com/ns/tailf-rest-query prefix:tfrestq exported to: none
http://tail-f.com/ns/webui prefix:webui exported to: all
http://tail-f.com/yang/acm prefix:tacm exported to: all
http://tail-f.com/yang/common prefix:tailf exported to: all
http://tail-f.com/yang/common-monitoring prefix:tfcg exported to: all
http://tail-f.com/yang/confd-monitoring prefix:tfcm exported to: all
http://tail-f.com/yang/netconf-monitoring prefix:tncm exported to: all
http://tail-f.com/yang/xsd-types prefix:xs exported to: all
urn:ietf:params:xml:ns:netconf:base:1.0 prefix:nc exported to: netconf
urn:ietf:params:xml:ns:netconf:partial-lock:1.0 prefix:pl exported to: netconf
urn:ietf:params:xml:ns:netmod:notification prefix:nm exported to: netconf
urn:ietf:params:xml:ns:yang:iana-crypt-hash prefix:ianach exported to: all
urn:ietf:params:xml:ns:yang:ietf-inet-types prefix:inet exported to: all
urn:ietf:params:xml:ns:yang:ietf-netconf-acm prefix:nacm exported to: none
urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring prefix:ncm exported to: all
urn:ietf:params:xml:ns:yang:ietf-netconf-notifications prefix:ncn exported to: all
urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults prefix:ncwd exported to: netconf
urn:ietf:params:xml:ns:yang:ietf-restconf prefix:rc exported to: rest
urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring prefix:rcmon exported to: all
urn:ietf:params:xml:ns:yang:ietf-yang-library prefix:yanglib exported to: netconf,rest
urn:ietf:params:xml:ns:yang:ietf-yang-patch prefix:ypatch exported to: rest
urn:ietf:params:xml:ns:yang:ietf-yang-types prefix:yang exported to: all
YANG data models:
module: iana-crypt-hash revision: 2014-08-06
namespace: urn:ietf:params:xml:ns:yang:iana-crypt-hash
prefix: ianach
exported to: all
module: ietf-inet-types revision: 2013-07-15
namespace: urn:ietf:params:xml:ns:yang:ietf-inet-types
prefix: inet
exported to: all
module: ietf-netconf revision: 2011-06-01
namespace: urn:ietf:params:xml:ns:netconf:base:1.0
prefix: nc
exported to: netconf
module: ietf-netconf-acm revision: 2018-02-14
namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-acm
prefix: nacm
exported to: none
module: ietf-netconf-monitoring revision: 2010-10-04
namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
prefix: ncm
exported to: all
module: ietf-netconf-notifications revision: 2012-02-06
namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-notifications
prefix: ncn
exported to: all
module: ietf-netconf-partial-lock revision: 2009-10-19
namespace: urn:ietf:params:xml:ns:netconf:partial-lock:1.0
prefix: pl
exported to: netconf
module: ietf-netconf-with-defaults revision: 2011-06-01
namespace: urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults
prefix: ncwd
exported to: netconf
module: ietf-restconf revision: 2017-01-26
namespace: urn:ietf:params:xml:ns:yang:ietf-restconf
prefix: rc
exported to: rest
module: ietf-restconf-monitoring revision: 2017-01-26
namespace: urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring
prefix: rcmon
exported to: all
module: ietf-yang-library revision: 2016-06-21
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-library
prefix: yanglib
exported to: netconf,rest
module: ietf-yang-patch revision: 2017-02-22
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-patch
prefix: ypatch
exported to: rest
module: ietf-yang-types revision: 2013-07-15
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-types
prefix: yang
exported to: all
module: netconf_netmod
namespace: urn:ietf:params:xml:ns:netmod:notification
prefix: nm
exported to: netconf
module: tailf-aaa revision: 2018-09-12
namespace: http://tail-f.com/ns/aaa/1.1
prefix: aaa
exported to: none
module: tailf-acm revision: 2013-03-07
namespace: http://tail-f.com/yang/acm
prefix: tacm
exported to: all
module: tailf-common revision: 2019-04-09
namespace: http://tail-f.com/yang/common
prefix: tailf
exported to: all
module: tailf-common-monitoring revision: 2019-04-09
namespace: http://tail-f.com/yang/common-monitoring
prefix: tfcg
exported to: all
module: tailf-common-query revision: 2017-12-15
namespace: http://tail-f.com/ns/common/query
prefix: tfcq
exported to: all
module: tailf-confd-monitoring revision: 2019-04-09
namespace: http://tail-f.com/yang/confd-monitoring
prefix: tfcm
exported to: all
module: tailf-kicker revision: 2017-09-28
namespace: http://tail-f.com/ns/kicker
prefix: kicker
exported to: all
module: tailf-ned-cisco-nx revision: 2013-09-24
namespace: http://tail-f.com/ned/cisco-nx
prefix: nx
exported to: all
module: tailf-netconf-extensions revision: 2019-04-09
namespace: http://tail-f.com/ns/netconf/extensions
prefix: tfnce
exported to: netconf
module: tailf-netconf-forward
namespace: http://tail-f.com/ns/netconf/forward/1.0
prefix: fwd
exported to: netconf
module: tailf-netconf-inactive
namespace: http://tail-f.com/ns/netconf/inactive/1.0
prefix: in
exported to: netconf
module: tailf-netconf-monitoring revision: 2019-03-28
namespace: http://tail-f.com/yang/netconf-monitoring
prefix: tncm
exported to: all
module: tailf-netconf-query revision: 2017-01-06
namespace: http://tail-f.com/ns/netconf/query
prefix: tfncq
exported to: netconf
module: tailf-netconf-rollback revision: 2018-01-12
namespace: http://tail-f.com/ns/netconf/rollback
prefix: netconf-rollback
exported to: netconf
module: tailf-netconf-transactions
namespace: http://tail-f.com/ns/netconf/transactions/1.0
prefix: tr
exported to: netconf
module: tailf-netconf-with-transaction-id revision: 2018-11-23
namespace: http://tail-f.com/ns/netconf/with-transaction-id
prefix: wtxid
exported to: netconf
module: tailf-progress revision: 2018-06-14
namespace: http://tail-f.com/ns/progress
prefix: progress
exported to: all
module: tailf-rest-error
namespace: http://tail-f.com/ns/tailf-rest-error
prefix: tfrerr
exported to: none
module: tailf-rest-query revision: 2017-01-06
namespace: http://tail-f.com/ns/tailf-rest-query
prefix: tfrestq
exported to: none
module: tailf-rollback revision: 2018-01-12
namespace: http://tail-f.com/ns/rollback
prefix: rollback
exported to: rest,netconf,maapi
module: tailf-webui revision: 2013-03-07
namespace: http://tail-f.com/ns/webui
prefix: webui
exported to: all
module: tailf-xsd-types revision: 2017-11-20
namespace: http://tail-f.com/yang/xsd-types
prefix: xs
exported to: all
user sessions:
system sessions:
sessionId=1 2019-10-29 08:33:30 system@0.0.0.0 system/system
no locks set
no transactions
sessionId=10 2019-10-29 08:33:30 system@0.0.0.0 system/system
no locks set
no transactions
sessionId=11 2019-10-29 08:33:30 system@0.0.0.0 system/system
no locks set
no transactions
sessionId=12 2019-10-29 08:33:30 system@0.0.0.0 system/system
no locks set
transactions:
tid=8 db=running mode=read
callpoints:
validation points:
actionpoints:
typepoints:
notification stream replay support:
SNMP inform delivery callbacks:
SNMP notification subscriptions:
authentication callback:
not enabled
authorization callbacks:
not enabled
error formatting callbacks:
partial running locks:
partial candidate locks:
partial startup locks:
cdb:
current transaction id: 1572-298410-494676
running:
ram size: 14.6 kB
read locks: 0
write lock: unset
startup:
filename: ./cdb/A.cdb
disk size: 1.8 kB
ram size: 14.6 kB
read locks: 0
write lock: unset
operational:
filename: ./cdb/O.cdb
disk size: 4 bytes
ram size: 136 bytes
subscription lock: unset
no pending subscription notifications
no registered cdb clients
tts alloc:
29894 40:48:0 64:185:12 72:27:0 120:10:0 176:40:31
fxs store:
memory: 1.3048 MB
size: 5265
reuse: 1.80
[charllia@centos-1 nso-play]$
----------------------------------------------------------------------------------
To me it seems that the namespace is there and correct. Am I missing something here?
Any tips, thoughts or advice would be greatly appreciated!
Cheer
Solved! Go to Solution.
10-29-2019 08:02 AM
Hello.
No mention of NSO version here so assumption is 5.x
To configure the device template in 5.x the ned-id needs to be specified:
admin@ncs% set devices template Standard_DNS_Servers ned-id
Possible completions:
snmp netconf lsa-netconf cisco-nx-cli-5.11 cisco-iosxr-cli-7.13 cisco-ios-cli-6.30
admin@ncs% set devices template Standard_DNS_Servers ned-id cisco-nx-cli-5.11 config nx:ip
Possible completions:
nx:ip nx:ipv6
admin@ncs% set devices template Standard_DNS_Servers ned-id cisco-nx-cli-5.11 config nx:ip name-server servers 8.8.8.8
[ok][2019-10-29 10:21:00]
[edit]
admin@ncs% set devices template Standard_DNS_Servers ned-id cisco-ios-cli-6.30 config ios:ip name-server name-server-list 8.8.8.8
Showing the resulting configuration in xml format (or json) is what needs to be applied in the REST call payload:
admin@ncs% show devices template Standard_DNS_Servers | display xml
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<template>
<name>Standard_DNS_Servers</name>
<ned-id>
<id xmlns:cisco-nx-cli-5.11="http://tail-f.com/ns/ned-id/cisco-nx-cli-5.11">cisco-nx-cli-5.11:cisco-nx-cli-5.11</id>
<config>
<ip xmlns="http://tail-f.com/ned/cisco-nx">
<name-server>
<servers>8.8.8.8</servers>
</name-server>
</ip>
</config>
</ned-id>
<ned-id>
<id xmlns:cisco-ios-cli-6.30="http://tail-f.com/ns/ned-id/cisco-ios-cli-6.30">cisco-ios-cli-6.30:cisco-ios-cli-6.30</id>
<config>
<ip xmlns="urn:ios">
<name-server>
<name-server-list>
<address>8.8.8.8</address>
</name-server-list>
</name-server>
</ip>
</config>
</ned-id>
</template>
</devices>
</config>
admin@ncs% show devices template Standard_DNS_Servers | display xml | save nameserver_template.xml
and remove the <config> container:
$ cat nameserver_template.xml
<devices xmlns="http://tail-f.com/ns/ncs">
<template>
<name>Standard_DNS_Servers</name>
<ned-id>
<id xmlns:cisco-nx-cli-5.11="http://tail-f.com/ns/ned-id/cisco-nx-cli-5.11">cisco-nx-cli-5.11:cisco-nx-cli-5.11</id>
<config>
<ip xmlns="http://tail-f.com/ned/cisco-nx">
<name-server>
<servers>8.8.8.8</servers>
</name-server>
</ip>
</config>
</ned-id>
<ned-id>
<id xmlns:cisco-ios-cli-6.30="http://tail-f.com/ns/ned-id/cisco-ios-cli-6.30">cisco-ios-cli-6.30:cisco-ios-cli-6.30</id>
<config>
<ip xmlns="urn:ios">
<name-server>
<name-server-list>
<address>8.8.8.8</address>
</name-server-list>
</name-server>
</ip>
</config>
</ned-id>
</template>
</devices>
10-29-2019 08:02 AM
Hello.
No mention of NSO version here so assumption is 5.x
To configure the device template in 5.x the ned-id needs to be specified:
admin@ncs% set devices template Standard_DNS_Servers ned-id
Possible completions:
snmp netconf lsa-netconf cisco-nx-cli-5.11 cisco-iosxr-cli-7.13 cisco-ios-cli-6.30
admin@ncs% set devices template Standard_DNS_Servers ned-id cisco-nx-cli-5.11 config nx:ip
Possible completions:
nx:ip nx:ipv6
admin@ncs% set devices template Standard_DNS_Servers ned-id cisco-nx-cli-5.11 config nx:ip name-server servers 8.8.8.8
[ok][2019-10-29 10:21:00]
[edit]
admin@ncs% set devices template Standard_DNS_Servers ned-id cisco-ios-cli-6.30 config ios:ip name-server name-server-list 8.8.8.8
Showing the resulting configuration in xml format (or json) is what needs to be applied in the REST call payload:
admin@ncs% show devices template Standard_DNS_Servers | display xml
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<template>
<name>Standard_DNS_Servers</name>
<ned-id>
<id xmlns:cisco-nx-cli-5.11="http://tail-f.com/ns/ned-id/cisco-nx-cli-5.11">cisco-nx-cli-5.11:cisco-nx-cli-5.11</id>
<config>
<ip xmlns="http://tail-f.com/ned/cisco-nx">
<name-server>
<servers>8.8.8.8</servers>
</name-server>
</ip>
</config>
</ned-id>
<ned-id>
<id xmlns:cisco-ios-cli-6.30="http://tail-f.com/ns/ned-id/cisco-ios-cli-6.30">cisco-ios-cli-6.30:cisco-ios-cli-6.30</id>
<config>
<ip xmlns="urn:ios">
<name-server>
<name-server-list>
<address>8.8.8.8</address>
</name-server-list>
</name-server>
</ip>
</config>
</ned-id>
</template>
</devices>
</config>
admin@ncs% show devices template Standard_DNS_Servers | display xml | save nameserver_template.xml
and remove the <config> container:
$ cat nameserver_template.xml
<devices xmlns="http://tail-f.com/ns/ncs">
<template>
<name>Standard_DNS_Servers</name>
<ned-id>
<id xmlns:cisco-nx-cli-5.11="http://tail-f.com/ns/ned-id/cisco-nx-cli-5.11">cisco-nx-cli-5.11:cisco-nx-cli-5.11</id>
<config>
<ip xmlns="http://tail-f.com/ned/cisco-nx">
<name-server>
<servers>8.8.8.8</servers>
</name-server>
</ip>
</config>
</ned-id>
<ned-id>
<id xmlns:cisco-ios-cli-6.30="http://tail-f.com/ns/ned-id/cisco-ios-cli-6.30">cisco-ios-cli-6.30:cisco-ios-cli-6.30</id>
<config>
<ip xmlns="urn:ios">
<name-server>
<name-server-list>
<address>8.8.8.8</address>
</name-server-list>
</name-server>
</ip>
</config>
</ned-id>
</template>
</devices>
10-29-2019 02:06 PM
Thank you for the quick and prompt response.
Yes it's NSO 5.x and it resolved my issue.
Really appreciate it. Cheers
Regards,
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