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 14:33:02 UTC
[camel] 03/03: Camel-Kubernetes: Added samples code for pv component
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 fce54f7d48ff2a83623ede718ef0fb97ebe9ae8f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Sep 23 15:51:11 2019 +0200
Camel-Kubernetes: Added samples code for pv component
---
.../kubernetes-persistent-volumes-component.adoc | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc
index 75dae3e..18ab5d8 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-component.adoc
@@ -107,3 +107,36 @@ The component supports 2 options, which are listed below.
- listPersistentVolumes
- listPersistentVolumesByLabels
- getPersistentVolume
+
+== Kubernetes Persistent Volumes Producer Examples
+
+- listPersistentVolumes: this operation list the pv on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+ toF("kubernetes-persistent-volumes:///?kubernetesClient=#kubernetesClient&operation=listPersistentVolumes").
+ to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of pv from your cluster
+
+- listPersistentVolumesByLabels: this operation list the pv 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_PERSISTENT_VOLUMES_LABELS, labels);
+ }
+ });
+ toF("kubernetes-persistent-volumes:///?kubernetesClient=#kubernetesClient&operation=listPersistentVolumesByLabels").
+ to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of pv from your cluster, using a label selector (with key1 and key2, with value value1 and value2)