Skip to content

Commit

Permalink
add overloaded methods for Pod operations
Browse files Browse the repository at this point in the history
  • Loading branch information
Ananya2001-an committed Nov 20, 2023
1 parent 592d2a1 commit ab19f45
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions util/src/main/java/io/kubernetes/client/overloading/Pods.java
Original file line number Diff line number Diff line change
@@ -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);
}

}

0 comments on commit ab19f45

Please sign in to comment.