From 16ebf9c65cf6c6efa5a65962c569bc09906bb81d Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Mon, 3 May 2021 07:43:58 +0200 Subject: [PATCH 1/2] Added Insert Header action --- insert-header-action.kamelet.yaml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 insert-header-action.kamelet.yaml diff --git a/insert-header-action.kamelet.yaml b/insert-header-action.kamelet.yaml new file mode 100644 index 000000000..51b77b16f --- /dev/null +++ b/insert-header-action.kamelet.yaml @@ -0,0 +1,33 @@ +apiVersion: camel.apache.org/v1alpha1 +kind: Kamelet +metadata: + name: insert-header-action + labels: + camel.apache.org/kamelet.type: "action" + annotations: + camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgdmlld0JveD0iMCAtMjU2IDE3OTIgMTc5MiIKICAgaWQ9InN2ZzMwMjUiCiAgIHZlcnNpb249IjEuMSIKICAgaW5rc2NhcGU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UgMCw1MTggMCw1MzEgdiAyMjIgcSAwLDEyIDgsMjMgOCwxMSAxOSwxMyBsIDE4NiwyOCBxIDE0LDQ2IDM5LDkyIC00MCw1NyAtMTA3LDEzOCAtMTAsMTIgLTEwLDI0IDAsMTAgOSwyMyAyNiwzNiA5OC41LDEwNy41IDcyLjUsNzEuNSA5NC41LDcxLjUgMTMsMCAyNiwtMTAgbCAxMzgsLTEwNyBxIDQ0LDIzIDkxLDM4IDE2LDEzNiAyOSwxODYgNywyOCAzNiwyOCBoIDIyMiBxIDE0LDAgMjQuNSwtOC41IFEgOTE0LDEzOTEgOTE1LDEzNzggbCAyOCwtMTg0IHEgNDksLTE2IDkwLC0zNyBsIDE0MiwxMDcgcSA5LDkgMjQsOSAxMywwIDI1LC0xMCAxMjksLTExOSAxNjUsLTE3MCA3LC04IDcsLTIyIDAsLTEyIC04LC0yMyAtMTUsLTIxIC01MSwtNjYuNSAtMzYsLTQ1LjUgLTU0LC03MC41IDI2LC01MCA0MSwtOTggbCAxODMsLTI4IHEgMTMsLTIgMjEsLTEyLjUgOCwtMTAuNSA4LC0yMy41IHoiCiAgICAgICBpZD0icGF0aDMwMjkiCiAgICAgICBpbmtzY2FwZTpjb25uZWN0b3ItY3VydmF0dXJlPSIwIgogICAgICAgc3R5bGU9ImZpbGw6Y3VycmVudENvbG9yIiAvPgogIDwvZz4KPC9zdmc+Cg==" + camel.apache.org/provider: "Apache Software Foundation" +spec: + definition: + title: "Insert Header" + description: "Adds an header with a constant value to the message in transit" + required: + - name + - value + properties: + name: + title: Name + description: The name of the header to be added + type: string + value: + title: Value + description: The value of the header + type: string + type: object + flow: + from: + uri: kamelet:source + steps: + - set-header: + name: "{{name}}" + constant: "{{value}}" From 51ffd6de17a024545d5d1e14dacc7d7e02fd3111 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Mon, 3 May 2021 07:45:38 +0200 Subject: [PATCH 2/2] Added insert header action and regen --- .../images/kamelets/insert-field-action.svg | 59 ++++++++++++++++ .../images/kamelets/insert-header-action.svg | 59 ++++++++++++++++ docs/modules/ROOT/nav.adoc | 3 +- .../ROOT/pages/insert-field-action.adoc | 69 +++++++++++++++++++ .../ROOT/pages/insert-header-action.adoc | 69 +++++++++++++++++++ 5 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 docs/modules/ROOT/assets/images/kamelets/insert-field-action.svg create mode 100644 docs/modules/ROOT/assets/images/kamelets/insert-header-action.svg create mode 100644 docs/modules/ROOT/pages/insert-field-action.adoc create mode 100644 docs/modules/ROOT/pages/insert-header-action.adoc diff --git a/docs/modules/ROOT/assets/images/kamelets/insert-field-action.svg b/docs/modules/ROOT/assets/images/kamelets/insert-field-action.svg new file mode 100644 index 000000000..fa06352da --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/insert-field-action.svg @@ -0,0 +1,59 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/docs/modules/ROOT/assets/images/kamelets/insert-header-action.svg b/docs/modules/ROOT/assets/images/kamelets/insert-header-action.svg new file mode 100644 index 000000000..fa06352da --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/insert-header-action.svg @@ -0,0 +1,59 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 796b4bcdd..f8d6052ab 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -42,7 +42,8 @@ * xref:ROOT:http-sink.adoc[image:kamelets/http-sink.svg[] HTTP Sink] * xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source] * xref:ROOT:infinispan-source.adoc[image:kamelets/infinispan-source.svg[] Infinispan Source] -* xref:ROOT:insert-field.adoc[image:kamelets/insert-field.svg[] Insert Field] +* xref:ROOT:insert-field-action.adoc[image:kamelets/insert-field-action.svg[] Insert Field] +* xref:ROOT:insert-header-action.adoc[image:kamelets/insert-header-action.svg[] Insert Header] * xref:ROOT:jira-source.adoc[image:kamelets/jira-source.svg[] Jira Source] * xref:ROOT:kafka-source.adoc[image:kamelets/kafka-source.svg[] Kafka Source] * xref:ROOT:mail-imap-source.adoc[image:kamelets/mail-imap-source.svg[] Mail IMAP Source] diff --git a/docs/modules/ROOT/pages/insert-field-action.adoc b/docs/modules/ROOT/pages/insert-field-action.adoc new file mode 100644 index 000000000..14502bd1c --- /dev/null +++ b/docs/modules/ROOT/pages/insert-field-action.adoc @@ -0,0 +1,69 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT += image:kamelets/insert-field-action.svg[] Insert Field + +*Provided by: "Apache Software Foundation"* + +Adds a custom field with a constant value to the message in transit + +== Configuration Options + +The following table summarizes the configuration options available for the `insert-field-action` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *field {empty}* *| Field| The name of the field to be added| string| | +| *value {empty}* *| Value| The value of the field| string| | +|=== + +NOTE: Fields marked with ({empty}*) are mandatory. + +== Usage + +This section summarizes how the `insert-field-action` can be used in various contexts. + +=== Knative Action + +The `insert-field-action` Kamelet can be used as intermediate step in a binding. + +.insert-field-action-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: insert-field-action-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: timer-source + properties: + message: "Hello" + steps: + - ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: insert-field-action + properties: + field: "The Field" + value: "The Value" + sink: + ref: + kind: InMemoryChannel + apiVersion: messaging.knative.dev/v1 + name: mychannel + +---- + +Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to. + +Save the `insert-field-action-binding.yaml` file into your hard drive, then configure it according to your needs. + +You can run the action using the following command: + +[source,shell] +---- +kubectl apply -f insert-field-action-binding.yaml +---- +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT diff --git a/docs/modules/ROOT/pages/insert-header-action.adoc b/docs/modules/ROOT/pages/insert-header-action.adoc new file mode 100644 index 000000000..b3fba9e35 --- /dev/null +++ b/docs/modules/ROOT/pages/insert-header-action.adoc @@ -0,0 +1,69 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT += image:kamelets/insert-header-action.svg[] Insert Header + +*Provided by: "Apache Software Foundation"* + +Adds an header with a constant value to the message in transit + +== Configuration Options + +The following table summarizes the configuration options available for the `insert-header-action` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *name {empty}* *| Name| The name of the header to be added| string| | +| *value {empty}* *| Value| The value of the header| string| | +|=== + +NOTE: Fields marked with ({empty}*) are mandatory. + +== Usage + +This section summarizes how the `insert-header-action` can be used in various contexts. + +=== Knative Action + +The `insert-header-action` Kamelet can be used as intermediate step in a binding. + +.insert-header-action-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: insert-header-action-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: timer-source + properties: + message: "Hello" + steps: + - ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: insert-header-action + properties: + name: "The Name" + value: "The Value" + sink: + ref: + kind: InMemoryChannel + apiVersion: messaging.knative.dev/v1 + name: mychannel + +---- + +Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to. + +Save the `insert-header-action-binding.yaml` file into your hard drive, then configure it according to your needs. + +You can run the action using the following command: + +[source,shell] +---- +kubectl apply -f insert-header-action-binding.yaml +---- +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT