<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to apply a device template to a device when a character contains a special character like '!'? in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/4041432#M4911</link>
    <description>&lt;P&gt;I meet the same question but the another char "?", the question mask.&lt;/P&gt;
&lt;P&gt;the device is F5 and I want to create a monitor, there is a parameter called "&lt;STRONG&gt;send&lt;/STRONG&gt;", and its value is an url. In the following example, I simple the value "get ?"&lt;/P&gt;
&lt;P&gt;Of cause, I use the&amp;nbsp;&lt;SPAN&gt;escape character but the nso give the following error info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;ERROR&amp;gt; 05-Mar-2020::23:06:14.602 NedComGenericBase Ned-Worker-Thread-0: - BigIP Error in prepare
com.tailf.ned.NedException: AddToTransaction:
Device Response:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
-&amp;gt;
Command:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
        at com.tailf.packages.ned.bigip.BigIpNedGeneric.addToTransaction(BigIpNedGeneric.java:4816)
        at com.tailf.packages.ned.bigip.BigIpNedGeneric.addToTransaction(BigIpNedGeneric.java:4728)
        at com.tailf.packages.ned.bigip.BigIpNedGeneric.edit(BigIpNedGeneric.java:3537)
        at com.tailf.packages.ned.bigip.BigIpNedGeneric.prepare(BigIpNedGeneric.java:3100)
        at com.tailf.ned.NedWorker.dorun(NedWorker.java:1589)
        at com.tailf.ned.NedWorker.run(NedWorker.java:294)
&amp;lt;ERROR&amp;gt; 05-Mar-2020::23:06:14.603 NedComGenericBase Ned-Worker-Thread-0: - BigIP AddToTransaction:
Device Response:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
-&amp;gt;
Command:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
&amp;lt;WARN&amp;gt; 05-Mar-2020::23:06:14.603 NedWorker Ned-Worker-Thread-0: - reporting error with illegal errorcode : 'AddToTransaction:
Device Response:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
-&amp;gt;
Command:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } ', fallback to NED_EXTERNAL_ERROR&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Mar 2020 04:18:42 GMT</pubDate>
    <dc:creator>shiqian</dc:creator>
    <dc:date>2020-03-06T04:18:42Z</dc:date>
    <item>
      <title>How to apply a device template to a device when a character contains a special character like '!'?</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/3850073#M3747</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a device template which I am using to configure my device's password. Here the is the results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;admin@ncs(config)# devices device nexus apply-template template-name test variable { name pass value 'cisco' } &lt;BR /&gt;apply-template-result {&lt;BR /&gt;device nexus&lt;BR /&gt;result ok&lt;BR /&gt;}&lt;BR /&gt;admin@ncs(config)# commit dry-run outformat native &lt;BR /&gt;native {&lt;BR /&gt;device {&lt;BR /&gt;name nexus&lt;BR /&gt;data username admin password 0 cisco role network-admin&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;admin@ncs(config)# commit&lt;BR /&gt;Commit complete.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I confirm it works by ssh'ing to the real device with the new password.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now when adding a special character, here is the result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;admin@ncs(config)# devices device nexus apply-template template-name test variable { name pass value 'cisco!123' }&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------^&lt;BR /&gt;syntax error: expecting '}'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know what is being sent is XPath logic per:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;admin@ncs(config)# devices device nexus apply-template template-name test variable { name pass value ?&lt;BR /&gt;Possible completions:&lt;BR /&gt;&amp;lt;node set&amp;gt; - an XPath expression resulting in a node set&lt;BR /&gt;&amp;lt;number&amp;gt; - some integer or float number. This is an XPath number.&lt;BR /&gt;&amp;lt;quoted&amp;gt; - some text enclosed in single quotes. This is an XPath string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone here know what value I need to insert between the single quotes that include a special character to make it work? Or is it not supported?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 19:24:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/3850073#M3747</guid>
      <dc:creator>joepak</dc:creator>
      <dc:date>2019-05-03T19:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a device template to a device when a character contains a special character like '!'?</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/3850143#M3748</link>
      <description>&lt;P&gt;'!' is a comment marker in the C-style CLI, so, of course you should escape that character in the C-style CLI in general, and especially in templates. So, use 'cisco\!23' as the value in the command.&lt;/P&gt;
&lt;P&gt;If you try the same in the J-style CLI, it will work even without the escaping. But you can see the same problem in the J-style CLI, with the '#' character, since '#' denotes a comment in the J-style CLI. So, in J-style CLI, to configure a value with '#' character, you should escape it, like 'cisco\#123'&lt;/P&gt;
&lt;P&gt;/Ram&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2019 21:52:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/3850143#M3748</guid>
      <dc:creator>ramkraja</dc:creator>
      <dc:date>2019-05-03T21:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a device template to a device when a character contains a special character like '!'?</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/3850147#M3749</link>
      <description>Thank you so much! I made the mistake of assuming it had something to do with how XPath is configured, but of course it was as simple as utilizing a backslash within the text value.&lt;BR /&gt;&lt;BR /&gt;Much appreciated.</description>
      <pubDate>Fri, 03 May 2019 21:59:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/3850147#M3749</guid>
      <dc:creator>joepak</dc:creator>
      <dc:date>2019-05-03T21:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a device template to a device when a character contains a special character like '!'?</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/4041432#M4911</link>
      <description>&lt;P&gt;I meet the same question but the another char "?", the question mask.&lt;/P&gt;
&lt;P&gt;the device is F5 and I want to create a monitor, there is a parameter called "&lt;STRONG&gt;send&lt;/STRONG&gt;", and its value is an url. In the following example, I simple the value "get ?"&lt;/P&gt;
&lt;P&gt;Of cause, I use the&amp;nbsp;&lt;SPAN&gt;escape character but the nso give the following error info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;lt;ERROR&amp;gt; 05-Mar-2020::23:06:14.602 NedComGenericBase Ned-Worker-Thread-0: - BigIP Error in prepare
com.tailf.ned.NedException: AddToTransaction:
Device Response:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
-&amp;gt;
Command:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
        at com.tailf.packages.ned.bigip.BigIpNedGeneric.addToTransaction(BigIpNedGeneric.java:4816)
        at com.tailf.packages.ned.bigip.BigIpNedGeneric.addToTransaction(BigIpNedGeneric.java:4728)
        at com.tailf.packages.ned.bigip.BigIpNedGeneric.edit(BigIpNedGeneric.java:3537)
        at com.tailf.packages.ned.bigip.BigIpNedGeneric.prepare(BigIpNedGeneric.java:3100)
        at com.tailf.ned.NedWorker.dorun(NedWorker.java:1589)
        at com.tailf.ned.NedWorker.run(NedWorker.java:294)
&amp;lt;ERROR&amp;gt; 05-Mar-2020::23:06:14.603 NedComGenericBase Ned-Worker-Thread-0: - BigIP AddToTransaction:
Device Response:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
-&amp;gt;
Command:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
&amp;lt;WARN&amp;gt; 05-Mar-2020::23:06:14.603 NedWorker Ned-Worker-Thread-0: - reporting error with illegal errorcode : 'AddToTransaction:
Device Response:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } 
-&amp;gt;
Command:
create /ltm monitor http "sj-test" {  adaptive "disabled" defaults-from "http" destination "*:*" interval "5" ip-dscp "0" recv "none" recv-disable "none" send "get \?" time-until-up "0" timeout "16" } ', fallback to NED_EXTERNAL_ERROR&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 04:18:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/4041432#M4911</guid>
      <dc:creator>shiqian</dc:creator>
      <dc:date>2020-03-06T04:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply a device template to a device when a character contains a special character like '!'?</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/4041635#M4912</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I define the "send" element in my Yang , use the:&lt;/P&gt;
&lt;PRE&gt;module monitor {&lt;BR /&gt;...&lt;BR /&gt;import ietf-inet-types {&lt;BR /&gt;  prefix inet;&lt;BR /&gt;}&lt;BR /&gt;...&lt;BR /&gt;leaf send {&lt;BR /&gt;  type inet:uri;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;it seems can accept the vaule "Get \?" , but it still cannot accept the value "GET /HELLO/WORLD/cisco\?success\r\n"&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 11:24:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-apply-a-device-template-to-a-device-when-a-character/m-p/4041635#M4912</guid>
      <dc:creator>shiqian</dc:creator>
      <dc:date>2020-03-06T11:24:33Z</dc:date>
    </item>
  </channel>
</rss>

