Skip to content

Commit f0b61ce

Browse files
authored
Merge pull request #2901 from Ananya2001-an/add-overloaded-methods
add overloaded methods
2 parents 88ca6d5 + 95775af commit f0b61ce

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
package io.kubernetes.client.simplified;
14+
15+
import io.kubernetes.client.openapi.ApiException;
16+
import io.kubernetes.client.openapi.models.V1Deployment;
17+
import io.kubernetes.client.openapi.models.V1DeploymentList;
18+
import io.kubernetes.client.openapi.models.V1Status;
19+
import io.kubernetes.client.custom.V1Patch;
20+
import io.kubernetes.client.openapi.apis.AppsV1Api;
21+
22+
/*
23+
* This class is used to overload the AppsV1Api class methods for Deployments.
24+
*/
25+
public class Deployments {
26+
private AppsV1Api api;
27+
Deployments(AppsV1Api api){
28+
this.api = api;
29+
}
30+
31+
public V1Deployment createNamespacedDeployment(String namespace, V1Deployment body) throws ApiException {
32+
return api.createNamespacedDeployment(namespace, body, null, null, null, null);
33+
}
34+
35+
public V1Status deleteNamespacedDeployment(String name, String namespace) throws ApiException {
36+
return api.deleteNamespacedDeployment(name, namespace, null, null, null, null, null, null);
37+
}
38+
39+
public V1DeploymentList listNamespacedDeployment(String namespace) throws ApiException {
40+
return api.listNamespacedDeployment(namespace, null, null, null, null, null, null, null, null, null, null, null);
41+
}
42+
43+
public V1DeploymentList listDeploymentForAllNamespaces() throws ApiException {
44+
return api.listDeploymentForAllNamespaces(null, null, null, null, null, null, null, null, null, null, null);
45+
}
46+
47+
public V1Deployment replaceNamespacedDeployment(String name, String namespace, V1Deployment body) throws ApiException {
48+
return api.replaceNamespacedDeployment(name, namespace, body, null, null, null, null);
49+
}
50+
51+
public V1Deployment patchNamespacedDeployment(String name, String namespace, V1Patch body) throws ApiException {
52+
return api.patchNamespacedDeployment(name, namespace, body, null, null, null, null, null);
53+
}
54+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
package io.kubernetes.client.simplified;
14+
15+
import io.kubernetes.client.openapi.ApiException;
16+
import io.kubernetes.client.openapi.models.V1Namespace;
17+
import io.kubernetes.client.openapi.models.V1Status;
18+
import io.kubernetes.client.openapi.apis.CoreV1Api;
19+
20+
/*
21+
* This class is used to overload the CoreV1Api class methods for Namespaces.
22+
*/
23+
public class Namespaces {
24+
private CoreV1Api api;
25+
Namespaces(CoreV1Api api){
26+
this.api = api;
27+
}
28+
29+
public V1Namespace createNamespace(V1Namespace body) throws ApiException {
30+
return api.createNamespace(body, null, null, null, null);
31+
}
32+
33+
public V1Status deleteNamespace(String name) throws ApiException {
34+
return api.deleteNamespace(name, null, null, null, null, null, null);
35+
}
36+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, software
8+
distributed under the License is distributed on an "AS IS" BASIS,
9+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
See the License for the specific language governing permissions and
11+
limitations under the License.
12+
*/
13+
package io.kubernetes.client.simplified;
14+
15+
import io.kubernetes.client.openapi.ApiException;
16+
import io.kubernetes.client.openapi.models.V1Pod;
17+
import io.kubernetes.client.openapi.models.V1PodList;
18+
import io.kubernetes.client.openapi.models.V1PodTemplate;
19+
import io.kubernetes.client.openapi.apis.CoreV1Api;
20+
21+
/*
22+
* This class is used to overload the CoreV1Api class methods for Pods.
23+
*/
24+
25+
public class Pods{
26+
private CoreV1Api api;
27+
Pods(CoreV1Api api){
28+
this.api = api;
29+
}
30+
public V1Pod createNamespacedPod(String namespace, V1Pod body) throws ApiException {
31+
return api.createNamespacedPod(namespace, body, null, null, null, null);
32+
}
33+
34+
public V1Pod deleteNamespacedPod(String name, String namespace) throws ApiException {
35+
return api.deleteNamespacedPod(name, namespace, null, null, null, null, null, null);
36+
}
37+
38+
public V1PodList listNamespacedPod(String namespace) throws ApiException {
39+
return api.listNamespacedPod(namespace, null, null, null, null, null, null, null, null, null, null, null);
40+
}
41+
42+
public V1PodTemplate createNamespacedPodTemplate(String namespace, V1PodTemplate body) throws ApiException {
43+
return api.createNamespacedPodTemplate(namespace, body, null, null, null, null);
44+
}
45+
46+
}

0 commit comments

Comments
 (0)