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 7f1247b76a045c123718ee01324993d790a3cdf0 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Sep 23 09:43:46 2019 +0200 Camel-Kubernetes: Added samples code for job component --- .../src/main/docs/kubernetes-job-component.adoc | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-job-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-job-component.adoc index 5766812..1bdc9aa 100644 --- a/components/camel-kubernetes/src/main/docs/kubernetes-job-component.adoc +++ b/components/camel-kubernetes/src/main/docs/kubernetes-job-component.adoc @@ -118,3 +118,36 @@ The component supports 2 options, which are listed below. - createJob - deleteJob +== Kubernetes Job Producer Examples + +- listJob: this operation list the jobs on a kubernetes cluster + +[source,java] +-------------------------------------------------------------------------------- +from("direct:list"). + toF("kubernetes-job:///?kubernetesClient=#kubernetesClient&operation=listJob"). + to("mock:result"); +-------------------------------------------------------------------------------- + +This operation return a List of Job from your cluster + +- listJobByLabels: this operation list the jobs 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_JOB_LABELS, labels); + } + }); + toF("kubernetes-job:///?kubernetesClient=#kubernetesClient&operation=listJobByLabels"). + to("mock:result"); +-------------------------------------------------------------------------------- + +This operation return a List of Jobs from your cluster, using a label selector (with key1 and key2, with value value1 and value2) +