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:00 UTC

[camel] 01/03: Camel-Kubernetes: Added samples code for pvc 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 abc12fb4eba40d3cccb3cb819f83a4287505c423
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Sep 23 15:44:27 2019 +0200

    Camel-Kubernetes: Added samples code for pvc component
---
 ...rnetes-persistent-volumes-claims-component.adoc | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc b/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc
index 37be4d6..7629908 100644
--- a/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc
+++ b/components/camel-kubernetes/src/main/docs/kubernetes-persistent-volumes-claims-component.adoc
@@ -110,3 +110,36 @@ The component supports 2 options, which are listed below.
 - createPersistentVolumeClaim
 - deletePersistentVolumeClaim
 
+== Kubernetes Persistent Volume Claims Producer Examples
+
+- listPersistentVolumesClaims: this operation list the pvc on a kubernetes cluster
+
+[source,java]
+--------------------------------------------------------------------------------
+from("direct:list").
+    toF("kubernetes-persistent-volumes-claims:///?kubernetesClient=#kubernetesClient&operation=listPersistentVolumesClaims").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of pvc from your cluster
+
+- listPersistentVolumesClaimsByLabels:  this operation list the pvc 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_CLAIMS_LABELS, labels);
+            }
+        });
+    toF("kubernetes-persistent-volumes-claims:///?kubernetesClient=#kubernetesClient&operation=listPersistentVolumesClaimsByLabels").
+    to("mock:result");
+--------------------------------------------------------------------------------
+
+This operation return a List of pvc from your cluster, using a label selector (with key1 and key2, with value value1 and value2)
+