Author: buildbot
Date: Sun Mar 10 15:18:23 2013
New Revision: 853865
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/ssh.html
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/ssh.html
==============================================================================
--- websites/production/camel/content/ssh.html (original)
+++ websites/production/camel/content/ssh.html Sun Mar 10 15:18:23 2013
@@ -76,6 +76,7 @@
<tr>
<td valign="top" width="100%">
<div class="wiki-content maincontent"><h2><a shape="rect"
name="SSH-SSH"></a>SSH</h2>
+
<p><b>Available as of Camel 2.10</b></p>
<p>The SSH component enables access to SSH servers such that you can send an
SSH command, and process the response.</p>
@@ -102,12 +103,91 @@ ssh:[username[:password]@]host[:port][?o
<h3><a shape="rect" name="SSH-Options"></a>Options</h3>
<div class="confluenceTableSmall"><div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"> Name </th><th colspan="1" rowspan="1"
class="confluenceTh"> Default Value </th><th colspan="1" rowspan="1"
class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> host </td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Hostname of SSH Server </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> port </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>22</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Port of the SSH Server </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> username </td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Username used for authenticating with SSH Server.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> password
</td><td colspan="1" row
span="1" class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Password used for authenticating with SSH Server. Used if
<tt>keyPairProvider</tt> is null. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> keyPairProvider </td><td colspan="1" rowspan="1"
class="confluenceTd"> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Refers to a
<tt>org.apache.sshd.common.KeyPairProvider</tt> to use for loading keys for
authentication. If this option is used, then <tt>password</tt> is not used.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> keyType
</td><td colspan="1" rowspan="1" class="confluenceTd"> ssh-rsa </td><td
colspan="1" rowspan="1" class="confluenceTd"> Refers to a key type to load from
<tt>keyPairProvider</tt>. The key types can for example be "ssh-rsa" or
"ssh-dss". </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
certFilename </td><td colspan="1" rowspan="1" class="confluenceTd"> </t
d><td colspan="1" rowspan="1" class="confluenceTd"> Refers to a file name to
use as file based <tt>keyPairProvider</tt>. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> timeout </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>30000</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Milliseconds to wait beforing timing out connection to
SSH Server. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
initialDelay </td><td colspan="1" rowspan="1" class="confluenceTd">
<tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
<b>Consumer only:</b> Milliseconds before polling the SSH server starts.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> delay </td><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>500</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <b>Consumer only:</b> Milliseconds before the
next poll of the SSH Server. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"
> useFixedDelay </td><td colspan="1" rowspan="1" class="confluenceTd">
> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
> <b>Consumer only:</b> Controls if fixed delay or fixed rate is used. See
> ScheduledExecutorService in JDK for details. </td></tr><tr><td colspan="1"
> rowspan="1" class="confluenceTd"> pollCommand </td><td colspan="1"
> rowspan="1" class="confluenceTd"> </td><td colspan="1" rowspan="1"
> class="confluenceTd"> <b>Consumer only:</b> Command to send to SSH Server
> during each poll cycle. Used only when acting as Consumer
> </td></tr></tbody></table>
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"> Name </th><th colspan="1" rowspan="1"
class="confluenceTh"> Default Value </th><th colspan="1" rowspan="1"
class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>host</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Hostname of SSH Server </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>port</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>22</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Port of the SSH Server </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>username</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> Username used for authenticating with SSH
Server. </td></tr><tr><td colspan="1" rowspan="1" class="con
fluenceTd"> <tt>password</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Password used for authenticating with SSH Server. Used if
<tt>keyPairProvider</tt> is null. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>keyPairProvider</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Refers to a
<tt>org.apache.sshd.common.KeyPairProvider</tt> to use for loading keys for
authentication. If this option is used, then <tt>password</tt> is not used.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>keyType</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> ssh-rsa
</td><td colspan="1" rowspan="1" class="confluenceTd"> Refers to a key type to
load from <tt>keyPairProvider</tt>. The key types can for example be "ssh-rsa"
or "ssh-dss". </td></tr><tr><td colspan="1" rowspan="1" class="c
onfluenceTd"> <tt>certResource</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Camel 2.11:</b> Path reference to a public key
certificate. Prefix path with <tt>classpath:</tt>, <tt>file:</tt>, or
<tt>http:</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<del><tt>certFilename</tt></del> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>@deprecated:</b> Use <tt>certResource</tt> instead.
Refers to a filename to use within file based <tt>keyPairProvider</tt>.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>timeout</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
<tt>30000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
Milliseconds to wait beforing timing out connection to SSH Server.
</td></tr></tbody></table>
+</div>
+</div>
+
+<h3><a shape="rect" name="SSH-ConsumerOnlyOptions"></a>Consumer Only
Options</h3>
+<div class="confluenceTableSmall"><div class="table-wrap">
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"> Name </th><th colspan="1" rowspan="1"
class="confluenceTh"> Default Value </th><th colspan="1" rowspan="1"
class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>initialDelay</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Milliseconds before polling the SSH server starts.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>delay</tt>
</td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>500</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> Milliseconds before the next poll
of the SSH Server. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>useFixedDelay</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> Controls if fixed delay or fi
xed rate is used. See ScheduledExecutorService in JDK for details.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>pollCommand</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
<tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Command to
send to SSH Server during each poll cycle. You may need to end your command
with a newline, and that must be URL encoded <tt>%0A</tt>.
</td></tr></tbody></table>
</div>
</div>
+<h3><a shape="rect" name="SSH-UsageasaProducerendpoint"></a>Usage as a
Producer endpoint</h3>
+
+<p>When the SSH Component is used as a Producer (<tt>.to("ssh://...")</tt>),
it will send the message body as the command to execute on the remote SSH
server.</p>
+
+<p>Here is an example of this within the XML DSL. Note that the command has an
XML encoded newline (<tt>&#10;</tt>).</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
+<pre class="code-xml">
+<span class="code-tag"><route id=<span
class="code-quote">"camel-example-ssh-producer"</span>></span>
+ <span class="code-tag"><from uri=<span
class="code-quote">"direct:exampleSshProducer"</span>/></span>
+ <span class="code-tag"><setBody></span>
+ <span class="code-tag"><constant></span>features:list&#10;<span
class="code-tag"></constant></span>
+ <span class="code-tag"></setBody></span>
+ <span class="code-tag"><to uri=<span
class="code-quote">"ssh://karaf:karaf@localhost:8101"</span>/></span>
+ <span class="code-tag"><log message=<span
class="code-quote">"${body}"</span>/></span>
+<span class="code-tag"></route></span>
+</pre>
+</div></div>
+
+<h3><a shape="rect" name="SSH-Authentication"></a>Authentication</h3>
+
+<p>The SSH Component can authenticate against the remote SSH server using one
of two mechanisms: Public Key certificate or username/password. Configuring how
the SSH Component does authentication is based on how and which options are
set.</p>
+
+<ol><li>First, it will look to see if the <tt>certResource</tt> option has
been set, and if so, use it to locate the referenced Public Key certificate and
use that for authentication.</li><li>If <tt>certResource</tt> is not set, it
will look to see if a <tt>keyPairProvider</tt> has been set, and if so, it will
use that to for certificate based authentication.</li><li>If neither
<tt>certResource</tt> nor <tt>keyPairProvider</tt> are set, it will use the
<tt>username</tt> and <tt>password</tt> options for authentication.</li></ol>
+
+
+<p>The following route fragment shows an SSH polling consumer using a
certificate from the classpath.</p>
+
+<p>In the XML DSL,</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
+<pre class="code-xml">
+<span class="code-tag"><route></span>
+ <span class="code-tag"><from uri=<span
class="code-quote">"ssh://scott@localhost:8101?certResource=classpath:test_rsa&amp;useFixedDelay=true&amp;delay=5000&amp;pollCommand=features:list%0A"</span>/></span>
+ <span class="code-tag"><log message=<span
class="code-quote">"${body}"</span>/></span>
+<span class="code-tag"></route></span>
+</pre>
+</div></div>
+
+<p>In the Java DSL,</p>
+<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
+<pre class="code-java">
+from(<span class="code-quote">"ssh:<span
class="code-comment">//scott@localhost:8101?certResource=classpath:test_rsa&useFixedDelay=<span
class="code-keyword">true</span>&delay=5000&pollCommand=features:list%0A"</span>)
+</span> .log(<span class="code-quote">"${body}"</span>);
+</pre>
+</div></div>
+
+<p>An example of using Public Key authentication is provided in
<tt>examples/camel-example-ssh-security</tt>.</p>
+
+<h5><a shape="rect" name="SSH-CertificateDependencies"></a>Certificate
Dependencies</h5>
+
+<p>You will need to add some additional runtime dependencies if you use
certificate based authentication. The dependency versions shown are as of Camel
2.11, you may need to use later versions depending what version of Camel you
are using.</p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
+<pre class="code-xml">
+<span class="code-tag"><dependency></span>
+ <span class="code-tag"><groupId></span>org.apache.sshd<span
class="code-tag"></groupId></span>
+ <span class="code-tag"><artifactId></span>sshd-core<span
class="code-tag"></artifactId></span>
+ <span class="code-tag"><version></span>0.8.0<span
class="code-tag"></version></span>
+<span class="code-tag"></dependency></span>
+<span class="code-tag"><dependency></span>
+ <span class="code-tag"><groupId></span>org.bouncycastle<span
class="code-tag"></groupId></span>
+ <span class="code-tag"><artifactId></span>bcpg-jdk15on<span
class="code-tag"></artifactId></span>
+ <span class="code-tag"><version></span>1.47<span
class="code-tag"></version></span>
+<span class="code-tag"></dependency></span>
+<span class="code-tag"><dependency></span>
+ <span class="code-tag"><groupId></span>org.bouncycastle<span
class="code-tag"></groupId></span>
+ <span class="code-tag"><artifactId></span>bcpkix-jdk15on<span
class="code-tag"></artifactId></span>
+ <span class="code-tag"><version></span>1.47<span
class="code-tag"></version></span>
+<span class="code-tag"></dependency></span>
+</pre>
+</div></div>
+
<h3><a shape="rect" name="SSH-Example"></a>Example</h3>
-<p>See the <tt>examples/camel-example-ssh</tt> in the Camel distribution.</p>
+
+<p>See the <tt>examples/camel-example-ssh</tt> and
<tt>examples/camel-example-ssh-security</tt> in the Camel distribution.</p>
<h3><a shape="rect" name="SSH-SeeAlso"></a>See Also</h3>
<ul><li><a shape="rect" href="configuring-camel.html" title="Configuring
Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html"
title="Component">Component</a></li><li><a shape="rect" href="endpoint.html"
title="Endpoint">Endpoint</a></li><li><a shape="rect"
href="getting-started.html" title="Getting Started">Getting
Started</a></li></ul>