From commits-return-77693-archive-asf-public=cust-asf.ponee.io@camel.apache.org Mon Sep 23 08:24:47 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C35C6180651 for ; Mon, 23 Sep 2019 10:24:46 +0200 (CEST) Received: (qmail 24967 invoked by uid 500); 23 Sep 2019 08:24:46 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 24952 invoked by uid 99); 23 Sep 2019 08:24:46 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Sep 2019 08:24:46 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 7F72181E23; Mon, 23 Sep 2019 08:24:45 +0000 (UTC) Date: Mon, 23 Sep 2019 08:24:46 +0000 To: "commits@camel.apache.org" Subject: [camel] 02/02: Regen docs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: acosentino@apache.org In-Reply-To: <156922708421.24021.1067495054571144968@gitbox.apache.org> References: <156922708421.24021.1067495054571144968@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: camel X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 4a26e41ea6976ad8476e02beaaada252656a6a0b X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20190923082445.7F72181E23@gitbox.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 4a26e41ea6976ad8476e02beaaada252656a6a0b Author: Andrea Cosentino AuthorDate: Mon Sep 23 10:24:04 2019 +0200 Regen docs --- .../pages/kubernetes-namespaces-component.adoc | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/docs/components/modules/ROOT/pages/kubernetes-namespaces-component.adoc b/docs/components/modules/ROOT/pages/kubernetes-namespaces-component.adoc index e31a4a6..8f11531 100644 --- a/docs/components/modules/ROOT/pages/kubernetes-namespaces-component.adoc +++ b/docs/components/modules/ROOT/pages/kubernetes-namespaces-component.adoc @@ -120,3 +120,55 @@ The component supports 2 options, which are listed below. - createNamespace - deleteNamespace +== Kubernetes Namespaces Producer Examples + +- listNamespaces: this operation list the namespaces on a kubernetes cluster + +[source,java] +-------------------------------------------------------------------------------- +from("direct:list"). + toF("kubernetes-deployments:///?kubernetesClient=#kubernetesClient&operation=listNamespaces"). + to("mock:result"); +-------------------------------------------------------------------------------- + +This operation return a List of namespaces from your cluster + +- listNamespacesByLabels: this operation list the namespaces by labels on a kubernetes cluster + +[source,java] +-------------------------------------------------------------------------------- +from("direct:listByLabels").process(new Processor() { + + @Override + public void process(Exchange exchange) throws Exception { + Map labels = new HashMap<>(); + labels.put("key1", "value1"); + labels.put("key2", "value2"); + exchange.getIn().setHeader(KubernetesConstants.KUBERNETES_NAMESPACES_LABELS, labels); + } + }); + toF("kubernetes-deployments:///?kubernetesClient=#kubernetesClient&operation=listNamespacesByLabels"). + to("mock:result"); +-------------------------------------------------------------------------------- + +This operation return a List of Namespaces from your cluster, using a label selector (with key1 and key2, with value value1 and value2) + +== Kubernetes Namespaces Consumer Example + +[source,java] +-------------------------------------------------------------------------------- +fromF("kubernetes-namespaces://%s?oauthToken=%s&namespace=default", 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(); + Namespace ns = exchange.getIn().getBody(Namespace.class); + log.info("Got event with configmap name: " + ns.getMetadata().getName() + " and action " + in.getHeader(KubernetesConstants.KUBERNETES_EVENT_ACTION)); + } + } +-------------------------------------------------------------------------------- + +This consumer will return a list of events on the namespace default. + +