1523
Views
0
Helpful
1
Replies
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 10:25 AM - edited 06-19-2020 02:22 PM
I created a template 'mytemplate' using RESTCONF PATCH
I want to deploy that to device 'router1'
<devices xmlns="http://tail-f.com/ns/ncs"> <template> <name>mytemplate</name> <ned-id> <id xmlns:cisco-iosxr-cli-7.23="http://tail-f.com/ns/ned-id/cisco-iosxr-cli-7.23">cisco-iosxr-cli-7.23:cisco-iosxr-cli-7.23</id> <config> <hostname xmlns="http://tail-f.com/ned/cisco-ios-xr">{$hostname}</hostname>
</config>
</ned-id>
</devices>
POST
http://{{NSO_IP}}:{{NSO_HTTP_PORT}}/restconf/data/tailf-ncs:devices/device={{SAMPLE_IOSXR_DEVICE}}/apply-template/ with
<input>
<template-name>mytemplate</template-name>
<variable>
<name>
<hostname>
<value>"blah"</value>
</hostname>
</name>
</variable>
</input>
But I get this error:
<errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
<error>
<error-message>unknown element: hostname in /ncs:devices/ncs:device[ncs:name='router1']/ncs:apply- template/ncs:hostname</error-message>
<error-path>/tailf-ncs:devices/device=router1/apply-template</error-path>
<error-tag>malformed-message</error-tag>
<error-type>application</error-type>
</error>
</errors>
After more troubleshooting, I looked at tailf-ncs-devices.yang file and saw the structure of the template portion and solved it myself
<input> <template-name>mytemplate</template-name> <variable> <name>hostname</name> <value>'blah'</value> </variable> </input>
<output xmlns='http://tail-f.com/ns/ncs'> <apply-template-result> <device>router1</device> <result>ok</result> </apply-template-result> </output>
Solved! Go to Solution.
Labels:
- Labels:
-
DevOps
-
Other NSO Topics
1 Accepted Solution
Accepted Solutions
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 02:22 PM
1 Reply 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 02:22 PM
Solved
