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 adafe29e78d5b9da3a9d39f1e0dc26ab724657cd Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Thu Sep 26 10:56:55 2019 +0200 Camel-Kubernetes: Add sample code for openshift builds docs --- .../src/main/docs/openshift-builds-component.adoc | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/components/camel-kubernetes/src/main/docs/openshift-builds-component.adoc b/components/camel-kubernetes/src/main/docs/openshift-builds-component.adoc index 9c51e1d..07b31bf 100644 --- a/components/camel-kubernetes/src/main/docs/openshift-builds-component.adoc +++ b/components/camel-kubernetes/src/main/docs/openshift-builds-component.adoc @@ -82,3 +82,36 @@ with the following path and query parameters: - listBuilds - listBuildsByLabels - getBuild + +== Openshift Builds Producer Examples + +- listBuilds: this operation list the Builds on an Openshift cluster + +[source,java] +-------------------------------------------------------------------------------- +from("direct:list"). + toF("openshift-builds:///?kubernetesClient=#kubernetesClient&operation=listBuilds"). + to("mock:result"); +-------------------------------------------------------------------------------- + +This operation return a List of Builds from your Openshift cluster + +- listBuildsByLabels: this operation list the builds by labels on an Openshift 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_BUILDS_LABELS, labels); + } + }); + toF("openshift-builds:///?kubernetesClient=#kubernetesClient&operation=listBuildsByLabels"). + to("mock:result"); +-------------------------------------------------------------------------------- + +This operation return a List of Builds from your cluster, using a label selector (with key1 and key2, with value value1 and value2)