-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add overloaded methods for Pod operations
- Loading branch information
1 parent
592d2a1
commit ab19f45
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
util/src/main/java/io/kubernetes/client/overloading/Pods.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
|
||
} |