You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/09/23 08:37:12 UTC

[camel] branch master updated (4a26e41 -> f5e5415)

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

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 4a26e41  Regen docs
     new 065c822  Camel-Kubernetes: Added samples code for nodes component
     new f5e5415  Regen docs

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/docs/kubernetes-nodes-component.adoc  | 52 ++++++++++++++++++++++
 .../ROOT/pages/kubernetes-nodes-component.adoc     | 52 ++++++++++++++++++++++
 2 files changed, 104 insertions(+)


[camel] 02/02: Regen docs

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit f5e5415d4b12a5ff13a49012344e58838ad72e49
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Sep 23 10:36:44 2019 +0200

    Regen docs
---
 .../ROOT/pages/kubernetes-nodes-component.adoc     | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/docs/components/modules/ROOT/pages/kubernetes-nodes-component.adoc b/docs/components/modules/ROOT/pages/kubernetes-nodes-component.adoc
index 509a547..51079c9 100644
--- a/docs/components/modules/ROOT/pages/kubernetes-nodes-component.adoc
+++ b/docs/components/modules/ROOT/pages/kubernetes-nodes-component.adoc
@@ -120,3 +120,55 @@ The component supports 2 options, which are listed below.
 - createNode
 - deleteNode
 
+
+== Kubernetes Nodes Producer Examples
+
+- listNodes: this operation list the nodes on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+    toF("kubernetes-nodes:///?kubernetesClient=#kubernetesClient&operation=listNodes").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Nodes from your cluster
+
+- listNodesByLabels:  this operation list the nodes by labels on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:listByLabels").process(new Processor() {
+
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                Map<String, String> labels = new HashMap<>();
+                labels.put("key1", "value1");
+                labels.put("key2", "value2");
+                exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_NODES_LABELS, labels);
+            }
+        });
+    toF("kubernetes-deployments:///?kubernetesClient=#kubernetesClient&operation=listNodesByLabels").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Nodes from your cluster, using a label selector (with key1 and key2, with value value1 and value2)
+
+== Kubernetes Nodes Consumer Example
+
+[source,java]
+--------------------------------------------------------------------------------
+fromF("kubernetes-nodes://%s?oauthToken=%s&resourceName=test", host, authToken).process(new KubernertesProcessor()).to("mock:result");
+
+    public class KubernertesProcessor implements Processor {
+        @Override
+        public void process(Exchange exchange) throws Exception {
+            Message in = exchange.getIn();
+            Node node = exchange.getIn().getBody(Node.class);
+            log.info("Got event with configmap name: " + node.getMetadata().getName() + " and action " + in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION));
+        }
+    }
+--------------------------------------------------------------------------------
+
+This consumer will return a list of events for the node test.
+


[camel] 01/02: Camel-Kubernetes: Added samples code for nodes component

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 065c822b6819d19b997b52e7262f61e1cd98b886
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Sep 23 10:34:41 2019 +0200

    Camel-Kubernetes: Added samples code for nodes component
---
 .../src/main/docs/kubernetes-nodes-component.adoc  | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc
index 6881b65..6ad9cd4 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-nodes-component.adoc
@@ -119,3 +119,55 @@ The component supports 2 options, which are listed below.
 - createNode
 - deleteNode
 
+
+== Kubernetes Nodes Producer Examples
+
+- listNodes: this operation list the nodes on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+    toF("kubernetes-nodes:///?kubernetesClient=#kubernetesClient&operation=listNodes").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Nodes from your cluster
+
+- listNodesByLabels:  this operation list the nodes by labels on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:listByLabels").process(new Processor() {
+
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                Map<String, String> labels = new HashMap<>();
+                labels.put("key1", "value1");
+                labels.put("key2", "value2");
+                exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_NODES_LABELS, labels);
+            }
+        });
+    toF("kubernetes-deployments:///?kubernetesClient=#kubernetesClient&operation=listNodesByLabels").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Nodes from your cluster, using a label selector (with key1 and key2, with value value1 and value2)
+
+== Kubernetes Nodes Consumer Example
+
+[source,java]
+--------------------------------------------------------------------------------
+fromF("kubernetes-nodes://%s?oauthToken=%s&resourceName=test", host, authToken).process(new KubernertesProcessor()).to("mock:result");
+
+    public class KubernertesProcessor implements Processor {
+        @Override
+        public void process(Exchange exchange) throws Exception {
+            Message in = exchange.getIn();
+            Node node = exchange.getIn().getBody(Node.class);
+            log.info("Got event with configmap name: " + node.getMetadata().getName() + " and action " + in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION));
+        }
+    }
+--------------------------------------------------------------------------------
+
+This consumer will return a list of events for the node test.
+