From de4308f12513e16466ba6fb4bf7b842995f35611 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 10 Jan 2023 18:49:39 +0100 Subject: [PATCH 1/4] Elasticsearch Kamelets: Moving from Camel-Elasticsearch-Rest to Camel-Elastichsearch - Index Kamelet Signed-off-by: Andrea Cosentino --- kamelets/elasticsearch-index-sink.kamelet.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/kamelets/elasticsearch-index-sink.kamelet.yaml b/kamelets/elasticsearch-index-sink.kamelet.yaml index f3ccb39f0..58d195cbd 100644 --- a/kamelets/elasticsearch-index-sink.kamelet.yaml +++ b/kamelets/elasticsearch-index-sink.kamelet.yaml @@ -34,6 +34,8 @@ spec: The input data must be formatted in JSON according to the requirements of the index. + If you specify the `certificate` property, you must base64 encode it before you pass it as a parameter. + In the header, you can set the following properties: - `indexId` / `ce-indexid`: The index ID for ElasticSearch. @@ -82,22 +84,27 @@ spec: description: The name of the ElasticSearch index. type: string example: data + certificate: + title: Certificate + description: The Certificate for accessing the Elasticsearch cluster. You must encode this value in base64. + type: string + example: data types: out: - mediaType: application/json + mediaType: text/plain in: mediaType: application/json dependencies: - "camel:core" - "camel:jackson" - "camel:kamelet" - - "camel:elasticsearch-rest" + - "camel:elasticsearch" - "camel:gson" - "camel:bean" template: beans: - name: local-es - type: "#class:org.apache.camel.component.elasticsearch.ElasticsearchComponent" + type: "#class:org.apache.camel.component.es.ElasticsearchComponent" properties: user: "{{?user}}" password: "{{?password}}" @@ -128,6 +135,8 @@ spec: - set-header: name: "indexName" simple: "${header[ce-indexname]}" + - unmarshal: + json: {} - to: uri: "{{local-es}}:{{clusterName}}" parameters: @@ -135,5 +144,4 @@ spec: hostAddresses: "{{hostAddresses}}" enableSSL: "{{enableSSL}}" indexName: "{{?indexName}}" - - marshal: - json: { } + certificatePath: "base64:{{?certificatePath}}" From 99fef6ad6cee3fec9683191a0c030b8ce4e2bc9b Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 10 Jan 2023 18:50:12 +0100 Subject: [PATCH 2/4] Elasticsearch Kamelets: Moving from Camel-Elasticsearch-Rest to Camel-Elastichsearch - Index Kamelet Signed-off-by: Andrea Cosentino --- .../elasticsearch-index-sink.kamelet.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml index f3ccb39f0..58d195cbd 100644 --- a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml @@ -34,6 +34,8 @@ spec: The input data must be formatted in JSON according to the requirements of the index. + If you specify the `certificate` property, you must base64 encode it before you pass it as a parameter. + In the header, you can set the following properties: - `indexId` / `ce-indexid`: The index ID for ElasticSearch. @@ -82,22 +84,27 @@ spec: description: The name of the ElasticSearch index. type: string example: data + certificate: + title: Certificate + description: The Certificate for accessing the Elasticsearch cluster. You must encode this value in base64. + type: string + example: data types: out: - mediaType: application/json + mediaType: text/plain in: mediaType: application/json dependencies: - "camel:core" - "camel:jackson" - "camel:kamelet" - - "camel:elasticsearch-rest" + - "camel:elasticsearch" - "camel:gson" - "camel:bean" template: beans: - name: local-es - type: "#class:org.apache.camel.component.elasticsearch.ElasticsearchComponent" + type: "#class:org.apache.camel.component.es.ElasticsearchComponent" properties: user: "{{?user}}" password: "{{?password}}" @@ -128,6 +135,8 @@ spec: - set-header: name: "indexName" simple: "${header[ce-indexname]}" + - unmarshal: + json: {} - to: uri: "{{local-es}}:{{clusterName}}" parameters: @@ -135,5 +144,4 @@ spec: hostAddresses: "{{hostAddresses}}" enableSSL: "{{enableSSL}}" indexName: "{{?indexName}}" - - marshal: - json: { } + certificatePath: "base64:{{?certificatePath}}" From be9f6e1aa23cff6f7ee9bca9454ac33dd4e280af Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 10 Jan 2023 18:51:44 +0100 Subject: [PATCH 3/4] Elasticsearch Kamelets: Moving from Camel-Elasticsearch-Rest to Camel-Elastichsearch - Index Kamelet Signed-off-by: Andrea Cosentino --- kamelets/elasticsearch-index-sink.kamelet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kamelets/elasticsearch-index-sink.kamelet.yaml b/kamelets/elasticsearch-index-sink.kamelet.yaml index 58d195cbd..964547003 100644 --- a/kamelets/elasticsearch-index-sink.kamelet.yaml +++ b/kamelets/elasticsearch-index-sink.kamelet.yaml @@ -144,4 +144,4 @@ spec: hostAddresses: "{{hostAddresses}}" enableSSL: "{{enableSSL}}" indexName: "{{?indexName}}" - certificatePath: "base64:{{?certificatePath}}" + certificatePath: "base64:{{?certificate}}" From c2d759f73dae89943edd2233a50889336aae1364 Mon Sep 17 00:00:00 2001 From: Andrea Cosentino Date: Tue, 10 Jan 2023 18:52:21 +0100 Subject: [PATCH 4/4] Elasticsearch Kamelets: Moving from Camel-Elasticsearch-Rest to Camel-Elastichsearch - Index Kamelet Signed-off-by: Andrea Cosentino --- .../resources/kamelets/elasticsearch-index-sink.kamelet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml index 58d195cbd..964547003 100644 --- a/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml +++ b/library/camel-kamelets/src/main/resources/kamelets/elasticsearch-index-sink.kamelet.yaml @@ -144,4 +144,4 @@ spec: hostAddresses: "{{hostAddresses}}" enableSSL: "{{enableSSL}}" indexName: "{{?indexName}}" - certificatePath: "base64:{{?certificatePath}}" + certificatePath: "base64:{{?certificate}}"