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 2021/04/26 09:35:13 UTC

[camel-kamelets] 01/05: Added DNS IP Action Kamelet

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

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

commit 701eb46f17e3c37cad1a9e61c3640908f1fe50e1
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Apr 26 09:31:17 2021 +0200

    Added DNS IP Action Kamelet
---
 dns-ip-action.kamelet.yaml | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/dns-ip-action.kamelet.yaml b/dns-ip-action.kamelet.yaml
new file mode 100644
index 0000000..05f9347
--- /dev/null
+++ b/dns-ip-action.kamelet.yaml
@@ -0,0 +1,38 @@
+apiVersion: camel.apache.org/v1alpha1
+kind: Kamelet
+metadata:
+  name: dns-ip-action
+  annotations:
+    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTIyLjg3OSAxMjIuODgxIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMjIuODc5IDEyMi44ODEiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwYXRoIGQ9Ik0xMDkuNDY3LDg5LjUwNWMwLjE4MiwwLDAuMzU5LDAuMDE5LDAuNTMxLDAuMDUzYzEuMT [...]
+    camel.apache.org/provider: "Apache Software Foundation"
+  labels:
+    camel.apache.org/kamelet.type: "action"
+spec:
+  definition:
+    title: "DNS IP Action"
+    description: |-
+      Get an IP from a DNS
+
+      The Kamelet expects the following headers to be set:
+
+      - `domain` / `ce-domain`: as the domain for which we are looking for the IP
+  flow:
+    from:
+      uri: "kamelet:source"
+      steps:
+      - choice:
+          when:
+          - simple: "${header[domain]}"
+            steps:
+            - set-header:
+                name: dns.domain
+                simple: "${header[domain]}"
+          - simple: "${header[ce-domain]}"
+            steps:
+            - set-header:
+                name: dns.domain
+                simple: "${header[ce-domain]}"
+      - to:
+          uri: "dns:ip"
+      - convert-body-to:
+          type: "java.lang.String"