<?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 Enabling tunneling and adding a tunnel with a script in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Enabling-tunneling-and-adding-a-tunnel-with-a-script/m-p/512124#M9046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm planning to write a script which would&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Enable tunneling for a thing which is based on remoteThingWithTunnels&lt;/P&gt;&lt;P&gt;2. Create a new tunnel with these parameters:&lt;/P&gt;&lt;P&gt;name: ssh&lt;/P&gt;&lt;P&gt;host: 127.0.0.1&lt;/P&gt;&lt;P&gt;port: 22&lt;/P&gt;&lt;P&gt;App URI: undefined&lt;/P&gt;&lt;P&gt;# Connections: 1&lt;/P&gt;&lt;P&gt;Protocol: tcp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to use AddTunnel-method as following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var params = {&lt;/P&gt;&lt;P&gt;&amp;nbsp; numConnects: "1" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; port: "22" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; proto: "tcp" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; name: "ssh" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; host: "127.0.0.1" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; description: "ssh tunnel" /* STRING */&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;me.AddTunnel(params);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it gives me this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #b94a48; font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; background-color: #f2dede;"&gt;Wrapped java.lang.Exception: No service handler defined for service AddTunnel on thing [TestThing] Cause: No service handler defined for service AddTunnel on thing [&lt;/SPAN&gt;&lt;SPAN style="color: #b94a48; font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; background-color: #f2dede;"&gt;TestThing&lt;/SPAN&gt;&lt;SPAN style="color: #b94a48; font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; background-color: #f2dede;"&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jun 2016 14:46:39 GMT</pubDate>
    <dc:creator>hpulkkinen</dc:creator>
    <dc:date>2016-06-09T14:46:39Z</dc:date>
    <item>
      <title>Enabling tunneling and adding a tunnel with a script</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Enabling-tunneling-and-adding-a-tunnel-with-a-script/m-p/512124#M9046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm planning to write a script which would&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Enable tunneling for a thing which is based on remoteThingWithTunnels&lt;/P&gt;&lt;P&gt;2. Create a new tunnel with these parameters:&lt;/P&gt;&lt;P&gt;name: ssh&lt;/P&gt;&lt;P&gt;host: 127.0.0.1&lt;/P&gt;&lt;P&gt;port: 22&lt;/P&gt;&lt;P&gt;App URI: undefined&lt;/P&gt;&lt;P&gt;# Connections: 1&lt;/P&gt;&lt;P&gt;Protocol: tcp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to use AddTunnel-method as following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var params = {&lt;/P&gt;&lt;P&gt;&amp;nbsp; numConnects: "1" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; port: "22" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; proto: "tcp" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; name: "ssh" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; host: "127.0.0.1" /* STRING */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; description: "ssh tunnel" /* STRING */&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;me.AddTunnel(params);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it gives me this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #b94a48; font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; background-color: #f2dede;"&gt;Wrapped java.lang.Exception: No service handler defined for service AddTunnel on thing [TestThing] Cause: No service handler defined for service AddTunnel on thing [&lt;/SPAN&gt;&lt;SPAN style="color: #b94a48; font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; background-color: #f2dede;"&gt;TestThing&lt;/SPAN&gt;&lt;SPAN style="color: #b94a48; font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; background-color: #f2dede;"&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 14:46:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Enabling-tunneling-and-adding-a-tunnel-with-a-script/m-p/512124#M9046</guid>
      <dc:creator>hpulkkinen</dc:creator>
      <dc:date>2016-06-09T14:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling tunneling and adding a tunnel with a script</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Enabling-tunneling-and-adding-a-tunnel-with-a-script/m-p/512125#M9047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Heikki, this is a known bug and it is active in our Jira database. As a workaround for the moment, you would have to use GetConfigurationTable, with the tableName as Tunnels, and add new rows to the resulting InfoTable. Once you've added all rows, you would need to call SetMultiRowConfigurationTable to reflect changes. Please do note that this will overwrite all current settings; and that's why we use Get in the beginning to get/ keep our current settings intact.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 18:40:59 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Enabling-tunneling-and-adding-a-tunnel-with-a-script/m-p/512125#M9047</guid>
      <dc:creator>Aanjan</dc:creator>
      <dc:date>2016-06-09T18:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling tunneling and adding a tunnel with a script</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Enabling-tunneling-and-adding-a-tunnel-with-a-script/m-p/512126#M9048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very good! I have now this script to automatically create a correct configuration for a ssh tunnel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var confTable = me.GetConfigurationTable({tableName: "Tunnels"});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var tunnel = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name: "ssh",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; host: "127.0.0.1",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; port: "22",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; description: "ssh tunnel",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; numConnects: 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; appUri: "",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proto: "tcp"&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;confTable.AddRow(tunnel);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var setTableParams = {&lt;/P&gt;&lt;P&gt;&amp;nbsp; configurationTable: confTable /* INFOTABLE */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; persistent: true /* BOOLEAN */,&lt;/P&gt;&lt;P&gt;&amp;nbsp; tableName: "Tunnels" /* STRING */&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;me.SetMultiRowConfigurationTable(setTableParams);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;result = confTable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also realized that I can configure the tunnel setting to the whole thing template at once. So in the end I didn't need to use this script myself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 12:33:47 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Enabling-tunneling-and-adding-a-tunnel-with-a-script/m-p/512126#M9048</guid>
      <dc:creator>hpulkkinen</dc:creator>
      <dc:date>2016-06-15T12:33:47Z</dc:date>
    </item>
  </channel>
</rss>

