Skip to content

Commit 95775af

Browse files
committed
add more overloaded methods
1 parent ab19f45 commit 95775af

File tree

3 files changed

+104
-2
lines changed

3 files changed

+104
-2
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+
}

util/src/main/java/io/kubernetes/client/overloading/Pods.java renamed to util/src/main/java/io/kubernetes/client/simplified/Pods.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
package io.kubernetes.client.overloading;
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;
214

315
import io.kubernetes.client.openapi.ApiException;
416
import io.kubernetes.client.openapi.models.V1Pod;
@@ -7,7 +19,7 @@
719
import io.kubernetes.client.openapi.apis.CoreV1Api;
820

921
/*
10-
* This class is used to overload the CoreV1Api class.
22+
* This class is used to overload the CoreV1Api class methods for Pods.
1123
*/
1224

1325
public class Pods{

0 commit comments

Comments
 (0)