Object obj = client .getJSON() .getGson() .fromJson(json, Class.forName("io.kubernetes.client.models." + args[1])); String output = client.getJSON().getGson().toJson(obj); .getJSON() .getGson() .fromJson( new StringReader(output), Class.forName("io.kubernetes.client.models." + args[1])); String output2 = client.getJSON().getGson().toJson(obj2);
V1Status status = client.getJSON().deserialize(body, returnType); if (status == null) { return -1;
V1Status status = client.getJSON().deserialize(body, returnType); if (status == null) { return -1;
private void submitStatefulSet() throws Exception { final V1StatefulSet statefulSet = createStatefulSet(); log.info("Submitting the following spec to k8 {}", appsClient.getApiClient().getJSON().serialize(statefulSet)); final Response response = appsClient.createNamespacedStatefulSetCall(jobNamespace, statefulSet, null, null, null).execute(); if (!response.isSuccessful()) { if (response.code() == HTTP_CONFLICT) { log.warn("Statefulset already present for function {}/{}/{}", instanceConfig.getFunctionDetails().getTenant(), instanceConfig.getFunctionDetails().getNamespace(), instanceConfig.getFunctionDetails().getName()); } else { log.error("Error creating statefulset for function {}/{}/{}:- {}", instanceConfig.getFunctionDetails().getTenant(), instanceConfig.getFunctionDetails().getNamespace(), instanceConfig.getFunctionDetails().getName(), response.message()); // construct a message based on the k8s api server response throw new IllegalStateException(response.message()); } } else { log.info("Successfully created statefulset for function {}/{}/{}", instanceConfig.getFunctionDetails().getTenant(), instanceConfig.getFunctionDetails().getNamespace(), instanceConfig.getFunctionDetails().getName()); } }
private void submitService() throws Exception { final V1Service service = createService(); log.info("Submitting the following service to k8 {}", coreClient.getApiClient().getJSON().serialize(service)); final Response response = coreClient.createNamespacedServiceCall(jobNamespace, service, null, null, null).execute(); if (!response.isSuccessful()) { if (response.code() == HTTP_CONFLICT) { log.warn("Service already created for function {}/{}/{}", instanceConfig.getFunctionDetails().getTenant(), instanceConfig.getFunctionDetails().getNamespace(), instanceConfig.getFunctionDetails().getName()); } else { log.error("Error creating Service for function {}/{}/{}:- {}", instanceConfig.getFunctionDetails().getTenant(), instanceConfig.getFunctionDetails().getNamespace(), instanceConfig.getFunctionDetails().getName(), response.message()); // construct a message based on the k8s api server response throw new IllegalStateException(response.message()); } } else { log.info("Service Created Successfully for function {}/{}/{}", instanceConfig.getFunctionDetails().getTenant(), instanceConfig.getFunctionDetails().getNamespace(), instanceConfig.getFunctionDetails().getName()); } }
response.message(), response.code(), response.headers().toMultimap(), respBody); return new Watch<>(client.getJSON(), response.body(), watchType, call); } catch (IOException e) { throw new ApiException(e);
response.message(), response.code(), response.headers().toMultimap(), respBody); return new Watch<>(client.getJSON(), response.body(), watchType, call); } catch (IOException e) { throw new ApiException(e);