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/20 14:04:21 UTC

[camel] branch master updated (b7088c2 -> 0b818ae)

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 b7088c2  Regen docs
     new ef33faf  Camel-Kubernetes: Adding examples deployments docs
     new 0b818ae  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:
 .../docs/kubernetes-deployments-component.adoc     | 51 ++++++++++++++++++++++
 .../pages/kubernetes-deployments-component.adoc    | 51 ++++++++++++++++++++++
 2 files changed, 102 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 0b818aea947e8eb36ed78d3df9f5281113ec71cb
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 20 16:04:00 2019 +0200

    Regen docs
---
 .../pages/kubernetes-deployments-component.adoc    | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/docs/components/modules/ROOT/pages/kubernetes-deployments-component.adoc b/docs/components/modules/ROOT/pages/kubernetes-deployments-component.adoc
index 3f71c82..6b5d103 100644
--- a/docs/components/modules/ROOT/pages/kubernetes-deployments-component.adoc
+++ b/docs/components/modules/ROOT/pages/kubernetes-deployments-component.adoc
@@ -120,3 +120,54 @@ The component supports 2 options, which are listed below.
 - deleteDeployment
 - scaleDeployment
 
+== Kubernetes Deployments Producer Examples
+
+- listDeployments: this operation list the deployments on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+    toF("kubernetes-deployments:///?kubernetesClient=#kubernetesClient&operation=listDeployments").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Deployment from your cluster
+
+- listDeploymentsByLabels:  this operation list the deployments 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_DEPLOYMENTS_LABELS, labels);
+            }
+        });
+    toF("kubernetes-deployments:///?kubernetesClient=#kubernetesClient&operation=listDeploymentsByLabels").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Deployments from your cluster, using a label selector (with key1 and key2, with value value1 and value2)
+
+== Kubernetes Deployments Consumer Example
+
+[source,java]
+--------------------------------------------------------------------------------
+fromF("kubernetes-deployments://%s?oauthToken=%s&namespace=default&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();
+            Deployment dp = exchange.getIn().getBody(Deployment.class);
+            log.info("Got event with configmap name: " + dp.getMetadata().getName() + " and action " + in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION));
+        }
+    }
+--------------------------------------------------------------------------------
+
+This consumer will return a list of events on the namespace default for the deployment test.
+


[camel] 01/02: Camel-Kubernetes: Adding examples deployments 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 ef33faf5a89d65de9bfb9a81f0b30d1b41ae8594
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Sep 20 16:01:37 2019 +0200

    Camel-Kubernetes: Adding examples deployments docs
---
 .../docs/kubernetes-deployments-component.adoc     | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-deployments-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-deployments-component.adoc
index b5b2787..4980f7e 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-deployments-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-deployments-component.adoc
@@ -119,3 +119,54 @@ The component supports 2 options, which are listed below.
 - deleteDeployment
 - scaleDeployment
 
+== Kubernetes Deployments Producer Examples
+
+- listDeployments: this operation list the deployments on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+    toF("kubernetes-deployments:///?kubernetesClient=#kubernetesClient&operation=listDeployments").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Deployment from your cluster
+
+- listDeploymentsByLabels:  this operation list the deployments 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_DEPLOYMENTS_LABELS, labels);
+            }
+        });
+    toF("kubernetes-deployments:///?kubernetesClient=#kubernetesClient&operation=listDeploymentsByLabels").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of Deployments from your cluster, using a label selector (with key1 and key2, with value value1 and value2)
+
+== Kubernetes Deployments Consumer Example
+
+[source,java]
+--------------------------------------------------------------------------------
+fromF("kubernetes-deployments://%s?oauthToken=%s&namespace=default&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();
+            Deployment dp = exchange.getIn().getBody(Deployment.class);
+            log.info("Got event with configmap name: " + dp.getMetadata().getName() + " and action " + in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION));
+        }
+    }
+--------------------------------------------------------------------------------
+
+This consumer will return a list of events on the namespace default for the deployment test.
+