use of io.fabric8.kubernetes.api.model.PersistentVolumeList in project camel by apache.
the class KubernetesPersistentVolumesProducer method doListPersistentVolumesByLabels.
protected void doListPersistentVolumesByLabels(Exchange exchange, String operation) throws Exception {
PersistentVolumeList pvList = null;
Map<String, String> labels = exchange.getIn().getHeader(KubernetesConstants.KUBERNETES_PERSISTENT_VOLUMES_LABELS, Map.class);
NonNamespaceOperation<PersistentVolume, PersistentVolumeList, DoneablePersistentVolume, Resource<PersistentVolume, DoneablePersistentVolume>> pvs;
pvs = getEndpoint().getKubernetesClient().persistentVolumes();
for (Map.Entry<String, String> entry : labels.entrySet()) {
pvs.withLabel(entry.getKey(), entry.getValue());
}
pvList = pvs.list();
MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
exchange.getOut().setBody(pvList.getItems());
}
use of io.fabric8.kubernetes.api.model.PersistentVolumeList in project camel by apache.
the class KubernetesPersistentVolumesProducer method doList.
protected void doList(Exchange exchange, String operation) throws Exception {
PersistentVolumeList persistentVolumeList = getEndpoint().getKubernetesClient().persistentVolumes().list();
MessageHelper.copyHeaders(exchange.getIn(), exchange.getOut(), true);
exchange.getOut().setBody(persistentVolumeList.getItems());
}
Aggregations