Skip to content

Commit

Permalink
Merge pull request #2901 from Ananya2001-an/add-overloaded-methods
Browse files Browse the repository at this point in the history
add overloaded methods
  • Loading branch information
k8s-ci-robot authored Nov 27, 2023
2 parents 88ca6d5 + 95775af commit f0b61ce
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 0 deletions.
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 util/src/main/java/io/kubernetes/client/simplified/Namespaces.java
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 util/src/main/java/io/kubernetes/client/simplified/Pods.java
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);
}

}

0 comments on commit f0b61ce

Please sign in to comment.