You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/03/21 14:42:29 UTC

[camel] 02/13: CAMEL-17792: Add doc about the message headers of camel-elasticsearch-rest

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

nfilotto pushed a commit to branch CAMEL-17792/doc-message-headers
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0dcdd8c5d3a4a59e2d785cd5e98cb4e8f77d1647
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Mon Mar 21 11:21:43 2022 +0100

    CAMEL-17792: Add doc about the message headers of camel-elasticsearch-rest
---
 .../camel/component/elasticsearch/elasticsearch-rest.json    | 10 ++++++++++
 .../src/main/docs/elasticsearch-rest-component.adoc          |  4 +++-
 .../component/elasticsearch/ElasticsearchConstants.java      | 12 ++++++++++++
 .../camel/component/elasticsearch/ElasticsearchEndpoint.java |  2 +-
 4 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/components/camel-elasticsearch-rest/src/generated/resources/org/apache/camel/component/elasticsearch/elasticsearch-rest.json b/components/camel-elasticsearch-rest/src/generated/resources/org/apache/camel/component/elasticsearch/elasticsearch-rest.json
index 01fce45..d6b90ec 100644
--- a/components/camel-elasticsearch-rest/src/generated/resources/org/apache/camel/component/elasticsearch/elasticsearch-rest.json
+++ b/components/camel-elasticsearch-rest/src/generated/resources/org/apache/camel/component/elasticsearch/elasticsearch-rest.json
@@ -36,6 +36,16 @@
     "password": { "kind": "property", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Password for authenticate" },
     "user": { "kind": "property", "displayName": "User", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "Basic authenticate user" }
   },
+  "headers": {
+    "operation": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "org.apache.camel.component.elasticsearch.ElasticsearchOperation", "enum": [ "Index", "Update", "Bulk", "BulkIndex", "GetById", "MultiGet", "MultiSearch", "Delete", "DeleteIndex", "Search", "Exists", "Ping" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation to perform" },
+    "indexId": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The id of the indexed document." },
+    "indexName": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The name of the index to act against" },
+    "waitForActiveShards": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The index creation waits for the write consistency number of shards to be available" },
+    "scrollKeepAliveMs": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The starting index of the response." },
+    "useScroll": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Boolean", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Set to true to enable scroll usage" },
+    "size": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The size of the response." },
+    "from": { "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "Integer", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The starting index of the response." }
+  },
   "properties": {
     "clusterName": { "kind": "path", "displayName": "Cluster Name", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.elasticsearch.ElasticsearchConfiguration", "configurationField": "configuration", "description": "Name of the cluster" },
     "connectionTimeout": { "kind": "parameter", "displayName": "Connection Timeout", "group": "producer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 30000, "configurationClass": "org.apache.camel.component.elasticsearch.ElasticsearchConfiguration", "configurationField": "configuration", "description": "The time in ms to wait before connection will timeout." },
diff --git a/components/camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc b/components/camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc
index c455780..305f924 100644
--- a/components/camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc
+++ b/components/camel-elasticsearch-rest/src/main/docs/elasticsearch-rest-component.adoc
@@ -50,7 +50,9 @@ include::partial$component-endpoint-options.adoc[]
 
 // endpoint options: END
 
-
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
 
 == Message Operations
 
diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java
index 10f9908..44d30d8 100644
--- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java
+++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConstants.java
@@ -16,15 +16,27 @@
  */
 package org.apache.camel.component.elasticsearch;
 
+import org.apache.camel.spi.Metadata;
+
 public interface ElasticsearchConstants {
 
+    @Metadata(description = "The operation to perform",
+              javaType = "org.apache.camel.component.elasticsearch.ElasticsearchOperation")
     String PARAM_OPERATION = "operation";
+    @Metadata(description = "The id of the indexed document.", javaType = "String")
     String PARAM_INDEX_ID = "indexId";
+    @Metadata(description = "The name of the index to act against", javaType = "String")
     String PARAM_INDEX_NAME = "indexName";
+    @Metadata(description = "The index creation waits for the write consistency number of shards to be available",
+              javaType = "Integer")
     String PARAM_WAIT_FOR_ACTIVE_SHARDS = "waitForActiveShards";
+    @Metadata(description = "The starting index of the response.", javaType = "Integer")
     String PARAM_SCROLL_KEEP_ALIVE_MS = "scrollKeepAliveMs";
+    @Metadata(description = "Set to true to enable scroll usage", javaType = "Boolean")
     String PARAM_SCROLL = "useScroll";
+    @Metadata(description = "The size of the response.", javaType = "Integer")
     String PARAM_SIZE = "size";
+    @Metadata(description = "The starting index of the response.", javaType = "Integer")
     String PARAM_FROM = "from";
 
     String PROPERTY_SCROLL_ES_QUERY_COUNT = "CamelElasticsearchScrollQueryCount";
diff --git a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
index 87b3c75..a6615ee 100644
--- a/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
+++ b/components/camel-elasticsearch-rest/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
@@ -30,7 +30,7 @@ import org.elasticsearch.client.RestClient;
  */
 @UriEndpoint(firstVersion = "2.21.0", scheme = "elasticsearch-rest", title = "Elasticsearch Rest",
              syntax = "elasticsearch-rest:clusterName", producerOnly = true,
-             category = { Category.SEARCH, Category.MONITORING })
+             category = { Category.SEARCH, Category.MONITORING }, headersClass = ElasticsearchConstants.class)
 public class ElasticsearchEndpoint extends DefaultEndpoint {
 
     @UriParam