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 2021/12/06 09:13:05 UTC

[camel-kamelets] 02/02: Generate doc for wttr.in Source Kamelet

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 39bc34e11100c99d18f818365ab584e8f1796d1a
Author: Tadayoshi Sato <sa...@gmail.com>
AuthorDate: Mon Dec 6 13:10:29 2021 +0900

    Generate doc for wttr.in Source Kamelet
---
 .../ROOT/assets/images/kamelets/wttrin-source.svg  |   1 +
 docs/modules/ROOT/nav.adoc                         |   1 +
 docs/modules/ROOT/pages/wttrin-source.adoc         | 146 +++++++++++++++++++++
 .../bindings/camel-k/wttrin-source-binding.yaml    |  16 +++
 templates/bindings/core/wttrin-source-binding.yaml |   7 +
 5 files changed, 171 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/wttrin-source.svg b/docs/modules/ROOT/assets/images/kamelets/wttrin-source.svg
new file mode 100644
index 0000000..616c828
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/wttrin-source.svg
@@ -0,0 +1 @@
+<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="cloud-sun" class="svg-inline--fa fa-cloud-sun" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M96 208c0-61.86 50.14-111.1 111.1-111.1c52.65 0 96.5 36.45 108.5 85.42C334.7 173.1 354.7 168 375.1 168c4.607 0 9.152 .3809 13.68 .8203l24.13-34.76c5.145-7.414 .8965-17.67-7.984-19.27L317.2 98.78L301.2 10.21C299.6 1.325 289.4-2.919 281.9 2.226L208 53.54L134.1 2.225C126.6-2.92 1 [...]
\ No newline at end of file
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index c94f9f2..f5cac61 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -139,6 +139,7 @@
 * xref:ROOT:value-to-key-action.adoc[image:kamelets/value-to-key-action.svg[] Value to Key Action]
 * xref:ROOT:velocity-template-action.adoc[image:kamelets/velocity-template-action.svg[] Velocity Template Action]
 * xref:ROOT:webhook-source.adoc[image:kamelets/webhook-source.svg[] Webhook Source]
+* xref:ROOT:wttrin-source.adoc[image:kamelets/wttrin-source.svg[] wttr.in Source]
 * xref:ROOT:xj-identity-action.adoc[image:kamelets/xj-identity-action.svg[] XJ Identity Action]
 * xref:ROOT:xj-template-action.adoc[image:kamelets/xj-template-action.svg[] XJ Template Action]
 // THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
diff --git a/docs/modules/ROOT/pages/wttrin-source.adoc b/docs/modules/ROOT/pages/wttrin-source.adoc
new file mode 100644
index 0000000..af490c4
--- /dev/null
+++ b/docs/modules/ROOT/pages/wttrin-source.adoc
@@ -0,0 +1,146 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+
+= image:kamelets/wttrin-source.svg[] wttr.in Source
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Get weather forecasts from the wttr.in weather forecast service
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `wttrin-source` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| language| Language| The language to use for displaying weather forecasts| string| | `"am ar af be bn ca da de el et fr fa hi hu ia id it lt mg nb nl oc pl pt-br ro ru ta tr th uk vi zh-cn zh-tw"`
+| output| Output Type| The type of output| string| `"current"`| `"current, weather, full"`
+| period| Period| The interval between fetches to the wttr.in service in milliseconds| integer| `60000`| 
+| wttrLocation| Location| The location to get weather forecasts| string| | `"\"paris\", \"~Eiffel+tower\", \"Москва\", \"muc\", \"@stackoverflow.com\", \"94107\", \"-78.46,106.79\""`
+|===
+
+NOTE: Fields marked with an asterisk ({empty}*) are mandatory.
+
+
+== Dependencies
+
+At runtime, the `wttrin-source` Kamelet relies upon the presence of the following dependencies:
+
+- camel:http
+- camel:jsonpath
+- camel:jackson 
+
+== Usage
+
+This section describes how you can use the `wttrin-source`.
+
+=== Knative Source
+
+You can use the `wttrin-source` Kamelet as a Knative source by binding it to a Knative object.
+
+.wttrin-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: wttrin-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: wttrin-source
+  sink:
+    ref:
+      kind: Channel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+  
+----
+
+==== *Prerequisite*
+
+You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster.
+
+==== *Procedure for using the cluster CLI*
+
+. Save the `wttrin-source-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the source by using the following command:
++
+[source,shell]
+----
+kubectl apply -f wttrin-source-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the source by using the following command:
+
+[source,shell]
+----
+kamel bind wttrin-source channel:mychannel
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+=== Kafka Source
+
+You can use the `wttrin-source` Kamelet as a Kafka source by binding it to a Kafka topic.
+
+.wttrin-source-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: wttrin-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: wttrin-source
+  sink:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  
+----
+
+==== *Prerequisites*
+
+* You've installed https://strimzi.io/[Strimzi].
+* You've created a topic named `my-topic` in the current namespace.
+* You have xref:{camel-k-version}@camel-k::installation/installation.adoc[Camel K installed] on the cluster.
+
+==== *Procedure for using the cluster CLI*
+
+. Save the `wttrin-source-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the source by using the following command:
++
+[source,shell]
+----
+kubectl apply -f wttrin-source-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the source by using the following command:
+
+[source,shell]
+----
+kamel bind wttrin-source kafka.strimzi.io/v1beta1:KafkaTopic:my-topic
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+== Kamelet source file
+
+https://github.com/apache/camel-kamelets/blob/main/kamelets/wttrin-source.kamelet.yaml
+
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
diff --git a/templates/bindings/camel-k/wttrin-source-binding.yaml b/templates/bindings/camel-k/wttrin-source-binding.yaml
new file mode 100644
index 0000000..7bca533
--- /dev/null
+++ b/templates/bindings/camel-k/wttrin-source-binding.yaml
@@ -0,0 +1,16 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: wttrin-source-binding
+spec:
+  source:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: wttrin-source
+  sink:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  
\ No newline at end of file
diff --git a/templates/bindings/core/wttrin-source-binding.yaml b/templates/bindings/core/wttrin-source-binding.yaml
new file mode 100644
index 0000000..e19d395
--- /dev/null
+++ b/templates/bindings/core/wttrin-source-binding.yaml
@@ -0,0 +1,7 @@
+- route:
+    from:
+      uri: "kamelet:wttrin-source"
+    steps:
+      - to:
+          uri: "log:info"
+    
\ No newline at end of file