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/17 17:28:43 UTC

[camel-kamelets] 04/11: Added Google Cloud Functions Sink Kamelet - Docs

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

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

commit a9973f87b3355737ef982b70cdc5b9938836d2cd
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Dec 17 18:21:06 2021 +0100

    Added Google Cloud Functions Sink Kamelet - Docs
---
 .../images/kamelets/google-functions-sink.svg      |   1 +
 docs/modules/ROOT/pages/google-functions-sink.adoc | 156 +++++++++++++++++++++
 2 files changed, 157 insertions(+)

diff --git a/docs/modules/ROOT/assets/images/kamelets/google-functions-sink.svg b/docs/modules/ROOT/assets/images/kamelets/google-functions-sink.svg
new file mode 100644
index 0000000..449dd6e
--- /dev/null
+++ b/docs/modules/ROOT/assets/images/kamelets/google-functions-sink.svg
@@ -0,0 +1 @@
+<svg height="2500" viewBox="-1.63323543 7.03260933 131.26574682 114.43939067" width="2500" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="64" x2="64" y1="7.034" y2="120.789"><stop offset="0" stop-color="#4387fd"/><stop offset="1" stop-color="#4683ea"/></linearGradient><path d="m27.79 115.217-26.25-45.468a11.499 11.499 0 0 1 0-11.499l26.25-45.467a11.5 11.5 0 0 1 9.96-5.75h52.5a11.5 11.5 0 0 1 9.959 5. [...]
\ No newline at end of file
diff --git a/docs/modules/ROOT/pages/google-functions-sink.adoc b/docs/modules/ROOT/pages/google-functions-sink.adoc
new file mode 100644
index 0000000..09e7637
--- /dev/null
+++ b/docs/modules/ROOT/pages/google-functions-sink.adoc
@@ -0,0 +1,156 @@
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT
+
+= image:kamelets/google-functions-sink.svg[] Google Functions Sink
+
+*Provided by: "Apache Software Foundation"*
+
+*Support Level for this Kamelet is: "Preview"*
+
+Send messages to Google Functions.
+
+The serviceAccountKey property needs to be a path to a service account key file.
+
+== Configuration Options
+
+The following table summarizes the configuration options available for the `google-functions-sink` Kamelet:
+[width="100%",cols="2,^2,3,^2,^2,^3",options="header"]
+|===
+| Property| Name| Description| Type| Default| Example
+| *functionName {empty}* *| Function Name| The Function Name| string| | 
+| *projectId {empty}* *| Project Id| The Google Cloud Functions Project Id| string| | 
+| *serviceAccountKey {empty}* *| Service Account Key| The Service account key that can be used as credentials for the Google Cloud Functions platform| string| | 
+| region| Region| The Region where the Google Cloud Functions has been deployed| string| | 
+|===
+
+NOTE: Fields marked with an asterisk ({empty}*) are mandatory.
+
+
+== Dependencies
+
+At runtime, the `google-functions-sink` Kamelet relies upon the presence of the following dependencies:
+
+- camel:kamelet
+- camel:google-functions
+- camel:jackson 
+
+== Usage
+
+This section describes how you can use the `google-functions-sink`.
+
+=== Knative Sink
+
+You can use the `google-functions-sink` Kamelet as a Knative sink by binding it to a Knative object.
+
+.google-functions-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: google-functions-sink-binding
+spec:
+  source:
+    ref:
+      kind: Channel
+      apiVersion: messaging.knative.dev/v1
+      name: mychannel
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: google-functions-sink
+    properties:
+      functionName: "The Function Name"
+      projectId: "The Project Id"
+      serviceAccountKey: "The Service Account Key"
+  
+----
+
+==== *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 `google-functions-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the sink by using the following command:
++
+[source,shell]
+----
+kubectl apply -f google-functions-sink-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the sink by using the following command:
+
+[source,shell]
+----
+kamel bind channel:mychannel google-functions-sink -p "sink.functionName=The Function Name" -p "sink.projectId=The Project Id" -p "sink.serviceAccountKey=The Service Account Key"
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+=== Kafka Sink
+
+You can use the `google-functions-sink` Kamelet as a Kafka sink by binding it to a Kafka topic.
+
+.google-functions-sink-binding.yaml
+[source,yaml]
+----
+apiVersion: camel.apache.org/v1alpha1
+kind: KameletBinding
+metadata:
+  name: google-functions-sink-binding
+spec:
+  source:
+    ref:
+      kind: KafkaTopic
+      apiVersion: kafka.strimzi.io/v1beta1
+      name: my-topic
+  sink:
+    ref:
+      kind: Kamelet
+      apiVersion: camel.apache.org/v1alpha1
+      name: google-functions-sink
+    properties:
+      functionName: "The Function Name"
+      projectId: "The Project Id"
+      serviceAccountKey: "The Service Account Key"
+  
+----
+
+==== *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 `google-functions-sink-binding.yaml` file to your local drive, and then edit it as needed for your configuration.
+
+. Run the sink by using the following command:
++
+[source,shell]
+----
+kubectl apply -f google-functions-sink-binding.yaml
+----
+
+==== *Procedure for using the Kamel CLI*
+
+Configure and run the sink by using the following command:
+
+[source,shell]
+----
+kamel bind kafka.strimzi.io/v1beta1:KafkaTopic:my-topic google-functions-sink -p "sink.functionName=The Function Name" -p "sink.projectId=The Project Id" -p "sink.serviceAccountKey=The Service Account Key"
+----
+
+This command creates the KameletBinding in the current namespace on the cluster.
+
+== Kamelet source file
+
+https://github.com/apache/camel-kamelets/blob/main/kamelets/google-functions-sink.kamelet.yaml
+
+// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT