You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/05/16 14:52:56 UTC

camel git commit: Added camel-openshift docs to Gitbook

Repository: camel
Updated Branches:
  refs/heads/master e253d9c1d -> cc8f51f83


Added camel-openshift docs to Gitbook


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cc8f51f8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cc8f51f8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cc8f51f8

Branch: refs/heads/master
Commit: cc8f51f8399e22dfaf7e59437aa892c8d989e9af
Parents: e253d9c
Author: Andrea Cosentino <an...@gmail.com>
Authored: Mon May 16 16:52:22 2016 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Mon May 16 16:52:22 2016 +0200

----------------------------------------------------------------------
 .../src/main/docs/openshift.adoc                | 171 +++++++++++++++++++
 docs/user-manual/en/SUMMARY.md                  |   1 +
 2 files changed, 172 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cc8f51f8/components/camel-openshift/src/main/docs/openshift.adoc
----------------------------------------------------------------------
diff --git a/components/camel-openshift/src/main/docs/openshift.adoc b/components/camel-openshift/src/main/docs/openshift.adoc
new file mode 100644
index 0000000..4c869b6
--- /dev/null
+++ b/components/camel-openshift/src/main/docs/openshift.adoc
@@ -0,0 +1,171 @@
+[[Openshift-OpenshiftComponent]]
+Openshift Component
+~~~~~~~~~~~~~~~~~~~
+
+*Available as of Camel 2.14*
+
+The *openshift* component is a component for managing your
+https://www.openshift.com/[OpenShift] applications.�
+
+Maven users will need to add the following dependency to their `pom.xml`
+for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+    <groupId>org.apache.camel</groupId>
+    <artifactId>camel-openshift</artifactId>
+    <version>x.x.x</version>
+    <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+[[Openshift-URIformat]]
+URI format
+^^^^^^^^^^
+
+[source,java]
+----------------------------
+openshift:clientId[?options]
+----------------------------
+
+You can append query options to the URI in the following format,
+`?option=value&option=value&...`
+
+[[Openshift-Options]]
+Options
+^^^^^^^
+
+
+// component options: START
+The OpenShift component supports 4 options which are listed below.
+
+
+
+{% raw %}
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| username | String | The username to login to openshift server.
+| password | String | The password for login to openshift server.
+| domain | String | Domain name. If not specified then the default domain is used.
+| server | String | Url to the openshift server. If not specified then the default value from the local openshift configuration file /.openshift/express.conf is used. And if that fails as well then openshift.redhat.com is used.
+|=======================================================================
+{% endraw %}
+// component options: END
+
+
+
+// endpoint options: START
+The OpenShift component supports 27 endpoint options which are listed below:
+
+{% raw %}
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| clientId | common |  | String | *Required* The client id
+| domain | common |  | String | Domain name. If not specified then the default domain is used.
+| password | common |  | String | *Required* The password for login to openshift server.
+| server | common |  | String | Url to the openshift server. If not specified then the default value from the local openshift configuration file /.openshift/express.conf is used. And if that fails as well then openshift.redhat.com is used.
+| username | common |  | String | *Required* The username to login to openshift server.
+| bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| sendEmptyMessageWhenIdle | consumer | false | boolean | If the polling consumer did not poll any files you can enable this option to send an empty message (no body) instead.
+| exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
+| pollStrategy | consumer (advanced) |  | PollingConsumerPollStrategy | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel.
+| application | producer |  | String | The application name to start stop restart or get the state.
+| mode | producer |  | String | Whether to output the message body as a pojo or json. For pojo the message is a List type.
+| operation | producer |  | String | The operation to perform which can be: list start stop restart and state. The list operation returns information about all the applications in json format. The state operation returns the state such as: started stopped etc. The other operations does not return any value.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+| backoffErrorThreshold | scheduler |  | int | The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in.
+| backoffIdleThreshold | scheduler |  | int | The number of subsequent idle polls that should happen before the backoffMultipler should kick-in.
+| backoffMultiplier | scheduler |  | int | To let the scheduled polling consumer backoff if there has been a number of subsequent idles/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening again. When this option is in use then backoffIdleThreshold and/or backoffErrorThreshold must also be configured.
+| delay | scheduler | 500 | long | Milliseconds before the next poll. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| greedy | scheduler | false | boolean | If greedy is enabled then the ScheduledPollConsumer will run immediately again if the previous run polled 1 or more messages.
+| initialDelay | scheduler | 1000 | long | Milliseconds before the first poll starts. You can also specify time values using units such as 60s (60 seconds) 5m30s (5 minutes and 30 seconds) and 1h (1 hour).
+| runLoggingLevel | scheduler | TRACE | LoggingLevel | The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that.
+| scheduledExecutorService | scheduler |  | ScheduledExecutorService | Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool.
+| scheduler | scheduler | none | ScheduledPollConsumerScheduler | To use a cron scheduler from either camel-spring or camel-quartz2 component
+| schedulerProperties | scheduler |  | Map | To configure additional properties when using a custom scheduler or any of the Quartz2 Spring based scheduler.
+| startScheduler | scheduler | true | boolean | Whether the scheduler should be auto started.
+| timeUnit | scheduler | MILLISECONDS | TimeUnit | Time unit for initialDelay and delay options.
+| useFixedDelay | scheduler | true | boolean | Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details.
+|=======================================================================
+{% endraw %}
+// endpoint options: END
+
+
+[[Openshift-Examples]]
+Examples
+^^^^^^^^
+
+[[Openshift-Listingallapplications]]
+Listing all applications
+++++++++++++++++++++++++
+
+[source,java]
+--------------------------------------------------------------------------
+// sending route
+from("direct:apps")
+    .to("openshift:myClient?username=foo&password=secret&operation=list");
+    .to("log:apps");
+--------------------------------------------------------------------------
+
+In this case the information about all the applications is returned as
+pojo. If you want a json response, then set mode=json.
+
+[[Openshift-Stoppinganapplication]]
+Stopping an application
++++++++++++++++++++++++
+
+[source,java]
+---------------------------------------------------------------------------------------------
+// stopping the foobar application
+from("direct:control")
+    .to("openshift:myClient?username=foo&password=secret&operation=stop&application=foobar");
+�
+---------------------------------------------------------------------------------------------
+
+In the example above we stop the application named foobar.
+
+�
+
+Polling for gear state changes
+
+The consumer is used for polling state changes in gears. Such as when a
+new gear is added/removed/ or its lifecycle is changed, eg started, or
+stopped etc.
+
+[source,java]
+---------------------------------------------------------------------------------------------------------------------------------------
+// trigger when state changes on our gears
+from("openshift:myClient?username=foo&password=secret&delay=30s")
+    .log("Event ${header.CamelOpenShiftEventType} on application ${body.name} changed state to ${header.CamelOpenShiftEventNewState}");
+---------------------------------------------------------------------------------------------------------------------------------------
+
+�
+
+When the consumer emits an Exchange then the body contains
+the�`com.openshift.client.IApplication` as the message body. And the
+following headers is included.
+
+[width="100%",cols="10%,10%,80%",options="header",]
+|=======================================================================
+|Header |May be null |Description
+
+|CamelOpenShiftEventType |No |The type of the event which can be one of: added, removed or changed.
+
+|CamelOpenShiftEventOldState |Yes |The old state, when the event type is changed.
+
+|CamelOpenShiftEventNewState |No |The new state, for any of the event types
+|=======================================================================
+
+[[Openshift-SeeAlso]]
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+

http://git-wip-us.apache.org/repos/asf/camel/blob/cc8f51f8/docs/user-manual/en/SUMMARY.md
----------------------------------------------------------------------
diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md
index 4bfc36d..b29fe6b 100644
--- a/docs/user-manual/en/SUMMARY.md
+++ b/docs/user-manual/en/SUMMARY.md
@@ -210,6 +210,7 @@
     * [Netty4 HTTP](netty4-http.adoc)
     * [NATS](nats.adoc)
     * [Olingo2](olingo2.adoc)
+    * [Openshift](openshift.adoc)
     * [Properties](properties.adoc)
     * [Quickfix](quickfix.adoc)
     * [Scp](scp.adoc)