From ab19f4581639d7276610fcd32919450273861544 Mon Sep 17 00:00:00 2001 From: Ananya Nayak Date: Mon, 20 Nov 2023 22:27:38 +0530 Subject: [PATCH] add overloaded methods for Pod operations --- .../kubernetes/client/overloading/Pods.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 util/src/main/java/io/kubernetes/client/overloading/Pods.java diff --git a/util/src/main/java/io/kubernetes/client/overloading/Pods.java b/util/src/main/java/io/kubernetes/client/overloading/Pods.java new file mode 100644 index 0000000000..fc1c79cf16 --- /dev/null +++ b/util/src/main/java/io/kubernetes/client/overloading/Pods.java @@ -0,0 +1,34 @@ +package io.kubernetes.client.overloading; + +import io.kubernetes.client.openapi.ApiException; +import io.kubernetes.client.openapi.models.V1Pod; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.openapi.models.V1PodTemplate; +import io.kubernetes.client.openapi.apis.CoreV1Api; + +/* + * This class is used to overload the CoreV1Api class. + */ + +public class Pods{ + private CoreV1Api api; + Pods(CoreV1Api api){ + this.api = api; + } + public V1Pod createNamespacedPod(String namespace, V1Pod body) throws ApiException { + return api.createNamespacedPod(namespace, body, null, null, null, null); + } + + public V1Pod deleteNamespacedPod(String name, String namespace) throws ApiException { + return api.deleteNamespacedPod(name, namespace, null, null, null, null, null, null); + } + + public V1PodList listNamespacedPod(String namespace) throws ApiException { + return api.listNamespacedPod(namespace, null, null, null, null, null, null, null, null, null, null, null); + } + + public V1PodTemplate createNamespacedPodTemplate(String namespace, V1PodTemplate body) throws ApiException { + return api.createNamespacedPodTemplate(namespace, body, null, null, null, null); + } + +}