-
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.
Merge pull request #2901 from Ananya2001-an/add-overloaded-methods
add overloaded methods
- Loading branch information
Showing
3 changed files
with
136 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
util/src/main/java/io/kubernetes/client/simplified/Deployments.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,54 @@ | ||
/* | ||
Copyright 2023 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package io.kubernetes.client.simplified; | ||
|
||
import io.kubernetes.client.openapi.ApiException; | ||
import io.kubernetes.client.openapi.models.V1Deployment; | ||
import io.kubernetes.client.openapi.models.V1DeploymentList; | ||
import io.kubernetes.client.openapi.models.V1Status; | ||
import io.kubernetes.client.custom.V1Patch; | ||
import io.kubernetes.client.openapi.apis.AppsV1Api; | ||
|
||
/* | ||
* This class is used to overload the AppsV1Api class methods for Deployments. | ||
*/ | ||
public class Deployments { | ||
private AppsV1Api api; | ||
Deployments(AppsV1Api api){ | ||
this.api = api; | ||
} | ||
|
||
public V1Deployment createNamespacedDeployment(String namespace, V1Deployment body) throws ApiException { | ||
return api.createNamespacedDeployment(namespace, body, null, null, null, null); | ||
} | ||
|
||
public V1Status deleteNamespacedDeployment(String name, String namespace) throws ApiException { | ||
return api.deleteNamespacedDeployment(name, namespace, null, null, null, null, null, null); | ||
} | ||
|
||
public V1DeploymentList listNamespacedDeployment(String namespace) throws ApiException { | ||
return api.listNamespacedDeployment(namespace, null, null, null, null, null, null, null, null, null, null, null); | ||
} | ||
|
||
public V1DeploymentList listDeploymentForAllNamespaces() throws ApiException { | ||
return api.listDeploymentForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null); | ||
} | ||
|
||
public V1Deployment replaceNamespacedDeployment(String name, String namespace, V1Deployment body) throws ApiException { | ||
return api.replaceNamespacedDeployment(name, namespace, body, null, null, null, null); | ||
} | ||
|
||
public V1Deployment patchNamespacedDeployment(String name, String namespace, V1Patch body) throws ApiException { | ||
return api.patchNamespacedDeployment(name, namespace, body, null, null, null, null, null); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
util/src/main/java/io/kubernetes/client/simplified/Namespaces.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,36 @@ | ||
/* | ||
Copyright 2023 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package io.kubernetes.client.simplified; | ||
|
||
import io.kubernetes.client.openapi.ApiException; | ||
import io.kubernetes.client.openapi.models.V1Namespace; | ||
import io.kubernetes.client.openapi.models.V1Status; | ||
import io.kubernetes.client.openapi.apis.CoreV1Api; | ||
|
||
/* | ||
* This class is used to overload the CoreV1Api class methods for Namespaces. | ||
*/ | ||
public class Namespaces { | ||
private CoreV1Api api; | ||
Namespaces(CoreV1Api api){ | ||
this.api = api; | ||
} | ||
|
||
public V1Namespace createNamespace(V1Namespace body) throws ApiException { | ||
return api.createNamespace(body, null, null, null, null); | ||
} | ||
|
||
public V1Status deleteNamespace(String name) throws ApiException { | ||
return api.deleteNamespace(name, null, null, null, null, null, null); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
util/src/main/java/io/kubernetes/client/simplified/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,46 @@ | ||
/* | ||
Copyright 2023 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package io.kubernetes.client.simplified; | ||
|
||
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 methods for Pods. | ||
*/ | ||
|
||
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); | ||
} | ||
|
||
} |