use of io.kubernetes.client.apis.CoreV1Api in project incubator-heron by apache.
the class KubernetesCompat method killTopology.
boolean killTopology(String kubernetesUri, String topology, String namespace) {
final CoreV1Api client = new CoreV1Api(new ApiClient().setBasePath(kubernetesUri));
// old version deployed topologies as naked pods
try {
final String labelSelector = KubernetesConstants.LABEL_TOPOLOGY + "=" + topology;
final Response response = client.deleteCollectionNamespacedPodCall(namespace, null, null, null, null, labelSelector, null, null, null, null, null, null).execute();
if (!response.isSuccessful()) {
LOG.log(Level.SEVERE, "Error killing topology message: " + response.message());
KubernetesUtils.logResponseBodyIfPresent(LOG, response);
throw new TopologyRuntimeManagementException(KubernetesUtils.errorMessageFromResponse(response));
}
} catch (IOException | ApiException e) {
LOG.log(Level.SEVERE, "Error killing topology " + e.getMessage());
if (e instanceof ApiException) {
LOG.log(Level.SEVERE, "Error details:\n" + ((ApiException) e).getResponseBody());
}
return false;
}
return true;
}
use of io.kubernetes.client.apis.CoreV1Api in project weblogic-kubernetes-operator by oracle.
the class CallBuilder method listPersistentVolume.
/* Persistent Volumes */
/**
* List persistent volumes
* @return List of persistent volumes
* @throws ApiException API Exception
*/
public V1PersistentVolumeList listPersistentVolume() throws ApiException {
String _continue = "";
ApiClient client = helper.take();
try {
return new CoreV1Api(client).listPersistentVolume(pretty, _continue, fieldSelector, includeUninitialized, labelSelector, limit, resourceVersion, timeoutSeconds, watch);
} finally {
helper.recycle(client);
}
}
use of io.kubernetes.client.apis.CoreV1Api in project weblogic-kubernetes-operator by oracle.
the class CallBuilder method listPersistentVolumeClaim.
/* Persistent Volume Claims */
/**
* List persistent volume claims
* @param namespace Namespace
* @return List of persistent volume claims
* @throws ApiException API Exception
*/
public V1PersistentVolumeClaimList listPersistentVolumeClaim(String namespace) throws ApiException {
String _continue = "";
ApiClient client = helper.take();
try {
return new CoreV1Api(client).listNamespacedPersistentVolumeClaim(namespace, pretty, _continue, fieldSelector, includeUninitialized, labelSelector, limit, resourceVersion, timeoutSeconds, watch);
} finally {
helper.recycle(client);
}
}
use of io.kubernetes.client.apis.CoreV1Api in project weblogic-kubernetes-operator by oracle.
the class CallBuilder method listConfigMap.
/* Config Maps */
/**
* List config maps
* @param namespace Namespace
* @return List of config maps
* @throws ApiException API Exception
*/
public V1ConfigMapList listConfigMap(String namespace) throws ApiException {
String _continue = "";
ApiClient client = helper.take();
try {
return new CoreV1Api(client).listNamespacedConfigMap(namespace, pretty, _continue, fieldSelector, includeUninitialized, labelSelector, limit, resourceVersion, timeoutSeconds, watch);
} finally {
helper.recycle(client);
}
}
use of io.kubernetes.client.apis.CoreV1Api in project weblogic-kubernetes-operator by oracle.
the class CallBuilder method listService.
/* Services */
/**
* List services
* @param namespace Namespace
* @return List of services
* @throws ApiException API Exception
*/
public V1ServiceList listService(String namespace) throws ApiException {
String _continue = "";
ApiClient client = helper.take();
try {
return new CoreV1Api(client).listNamespacedService(namespace, pretty, _continue, fieldSelector, includeUninitialized, labelSelector, limit, resourceVersion, timeoutSeconds, watch);
} finally {
helper.recycle(client);
}
}
Aggregations