-
Notifications
You must be signed in to change notification settings - Fork 26
/
elasticsearch-index-sink.kamelet.yaml
131 lines (125 loc) · 10.6 KB
/
elasticsearch-index-sink.kamelet.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
apiVersion: camel.apache.org/v1
kind: Kamelet
metadata:
name: elasticsearch-index-sink
labels:
camel.apache.org/kamelet.type: "sink"
annotations:
camel.apache.org/kamelet.support.level: "Stable"
camel.apache.org/catalog.version: "2.3.0"
camel.apache.org/kamelet.group: "ElasticSearch"
camel.apache.org/kamelet.namespace: "Search"
camel.apache.org/provider: "Red Hat"
camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1NTAgMjUwIiB2aWV3Qm94PSI3Nyw4Myw0MTAsOTAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiA8cGF0aCBkPSJtMTc4IDEwMi41aDMxM3Y0MWgtMzEzeiIgZmlsbD0ibm9uZSIvPgogPGcgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyI+CiAgPHBhdGggZD0ibTE5My4zIDEzOS40Yy00IDAtNy4yLTEuMi05LjUtMy41cy0zLjQtNS42LTMuNC05LjdjMC00LjIgMS4xLTcuNiAzLjItMTBzNS0zLjYgOC43LTMuNmMzLjQgMCA2LjEgMSA4LjEgMy4xczMgNC45IDMgOC42djNoLTE3LjNjLjE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MTMuOSA2LjYgMjIgNi42IDEzLjkgMCAyNi4xLTcuMSAzMy4zLTE3LjgtMy43LTMuOC04LjktNi4yLTE0LjYtNi4yeiIgZmlsbD0iIzAwYmZiMyIvPgogPHBhdGggZD0ibTExNi43IDE0OC42YzEtMS42IDEuOS0zLjMgMi43LTUuMWgtMjkuM2MzLjEgNy4xIDguMiAxMy4yIDE0LjcgMTcuNCAxLjYtMS4xIDMuMS0yLjIgNC42LTMuNS43LS42IDEuNC0xLjMgMi4xLTIgMS45LTIgMy43LTQuMyA1LjItNi44eiIgZmlsbD0iIzAxOWI4ZiIvPgogPHBhdGggZD0ibTExMS40IDk5LjZjLS43LS43LTEuNC0xLjMtMi4xLTItMS40LTEuMy0zLTIuNC00LjYtMy41LTYuNCA0LjItMTEuNSAxMC4zLTE0LjcgMTcuNGgyOS4zYy0uOC0xLjgtMS43LTMuNS0yLjctNS4xLTEuNC0yLjUtMy4yLTQuOC01LjItNi44eiIgZmlsbD0iI2Y5YjExMCIvPgogPHBhdGggZD0ibTEyNi43IDg3LjVjLTguMSAwLTE1LjcgMi40LTIyIDYuNiAxLjYgMS4xIDMuMSAyLjIgNC42IDMuNS43LjYgMS40IDEuMyAyLjEgMiAyIDIuMSAzLjggNC4zIDUuMyA2LjggMSAxLjYgMS45IDMuMyAyLjcgNS4xaDI2YzUuNyAwIDEwLjktMi40IDE0LjYtNi4yLTcuMi0xMC43LTE5LjQtMTcuOC0zMy4zLTE3Ljh6IiBmaWxsPSIjZmVkMTBhIi8+Cjwvc3ZnPg=="
spec:
definition:
title: "ElasticSearch Index Sink"
description: |-
Stores JSON-formatted data into ElasticSearch.
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.
- `indexName` / `ce-indexname`: The index name for ElasticSearch.
If you do not set a property in the header, the Kamelet uses the exchange ID for the index setting.
required:
- clusterName
- hostAddresses
type: object
properties:
user:
title: Username
description: The username to connect to ElasticSearch.
type: string
x-descriptors:
- urn:camel:group:credentials
password:
title: Password
description: The password to connect to ElasticSearch.
type: string
format: password
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:password
- urn:camel:group:credentials
enableSSL:
title: Enable SSL
description: Specifies to connect by using SSL.
type: boolean
default: true
x-descriptors:
- 'urn:alm:descriptor:com.tectonic.ui:checkbox'
hostAddresses:
title: Host Addresses
description: A comma-separated list of remote transport addresses in `ip:port format`.
type: string
example: quickstart-es-http:9200
clusterName:
title: ElasticSearch Cluster Name
description: The name of the ElasticSearch cluster.
type: string
example: quickstart
indexName:
title: Index in ElasticSearch
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
types:
out:
mediaType: text/plain
in:
mediaType: application/json
dependencies:
- "camel:core"
- "camel:jackson"
- "camel:kamelet"
- "camel:elasticsearch"
- "camel:gson"
- "camel:bean"
template:
beans:
- name: local-es
type: "#class:org.apache.camel.component.es.ElasticsearchComponent"
properties:
user: "{{?user}}"
password: "{{?password}}"
from:
uri: kamelet:source
steps:
- choice:
when:
- simple: "${header[indexId]}"
steps:
- set-header:
name: "indexId"
simple: "${header[indexId]}"
- simple: "${header[ce-indexid]}"
steps:
- set-header:
name: "indexId"
simple: "${header[ce-indexid]}"
- choice:
when:
- simple: "${header[indexName]}"
steps:
- set-header:
name: "indexName"
simple: "${header[indexName]}"
- simple: "${header[ce-indexname]}"
steps:
- set-header:
name: "indexName"
simple: "${header[ce-indexname]}"
- unmarshal:
json: {}
- to:
uri: "{{local-es}}:{{clusterName}}"
parameters:
operation: "INDEX"
hostAddresses: "{{hostAddresses}}"
enableSSL: "{{enableSSL}}"
indexName: "{{?indexName}}"
certificatePath: "base64:{{?certificate}}"