public class OperationSupport extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
apiGroup |
protected String |
apiVersion |
protected okhttp3.OkHttpClient |
client |
protected Config |
config |
static okhttp3.MediaType |
JSON |
protected static com.fasterxml.jackson.databind.ObjectMapper |
JSON_MAPPER |
static okhttp3.MediaType |
JSON_PATCH |
protected String |
name |
protected String |
namespace |
protected String |
resourceT |
protected static com.fasterxml.jackson.databind.ObjectMapper |
YAML_MAPPER |
Constructor and Description |
---|
OperationSupport() |
OperationSupport(okhttp3.OkHttpClient client,
Config config,
String apiGroup,
String apiVersion,
String resourceT,
String namespace,
String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertResponseCode(okhttp3.Request request,
okhttp3.Response response)
Checks if the response status code is the expected and throws the appropriate KubernetesClientException if not.
|
protected <T> String |
checkName(T item) |
protected <T> String |
checkNamespace(T item) |
static io.fabric8.kubernetes.api.model.Status |
createStatus(int statusCode,
String message) |
static io.fabric8.kubernetes.api.model.Status |
createStatus(okhttp3.Response response) |
String |
getAPIGroup() |
String |
getAPIVersion() |
Config |
getConfig() |
String |
getName() |
String |
getNamespace() |
URL |
getNamespacedUrl() |
URL |
getNamespacedUrl(String namespace) |
<T> URL |
getNamespacedUrl(T item) |
String |
getResourceT() |
URL |
getResourceUrl() |
URL |
getResourceUrl(String namespace,
String name) |
URL |
getRootUrl() |
protected <T,I> T |
handleCreate(I resource,
Class<T> outputType) |
protected <T> void |
handleDelete(T resource,
long gracePeriodSeconds,
boolean cascading) |
protected void |
handleDelete(URL requestUrl,
long gracePeriodSeconds,
boolean cascading) |
protected <T> T |
handleGet(URL resourceUrl,
Class<T> type) |
protected <T> T |
handlePatch(T current,
T updated,
Class<T> type) |
protected <T> T |
handleReplace(T updated,
Class<T> type) |
protected <T> T |
handleResponse(okhttp3.OkHttpClient client,
okhttp3.Request.Builder requestBuilder,
Class<T> type) |
protected <T> T |
handleResponse(okhttp3.Request.Builder requestBuilder,
Class<T> type) |
boolean |
isResourceNamespaced() |
protected static <T> T |
unmarshal(InputStream is) |
protected static <T> T |
unmarshal(InputStream is,
Class<T> type) |
public static final okhttp3.MediaType JSON
public static final okhttp3.MediaType JSON_PATCH
protected static final com.fasterxml.jackson.databind.ObjectMapper JSON_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper YAML_MAPPER
protected final okhttp3.OkHttpClient client
protected final Config config
protected final String resourceT
protected final String namespace
protected final String name
protected final String apiGroup
protected final String apiVersion
public String getAPIGroup()
public String getAPIVersion()
public String getResourceT()
public String getNamespace()
public String getName()
public boolean isResourceNamespaced()
public URL getRootUrl()
public URL getNamespacedUrl(String namespace) throws MalformedURLException
MalformedURLException
public URL getNamespacedUrl() throws MalformedURLException
MalformedURLException
public <T> URL getNamespacedUrl(T item) throws MalformedURLException
MalformedURLException
public URL getResourceUrl(String namespace, String name) throws MalformedURLException
MalformedURLException
public URL getResourceUrl() throws MalformedURLException
MalformedURLException
protected <T> String checkNamespace(T item)
protected <T> String checkName(T item)
protected <T> void handleDelete(T resource, long gracePeriodSeconds, boolean cascading) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected void handleDelete(URL requestUrl, long gracePeriodSeconds, boolean cascading) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T,I> T handleCreate(I resource, Class<T> outputType) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T> T handleReplace(T updated, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T> T handlePatch(T current, T updated, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T> T handleGet(URL resourceUrl, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T> T handleResponse(okhttp3.Request.Builder requestBuilder, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T> T handleResponse(okhttp3.OkHttpClient client, okhttp3.Request.Builder requestBuilder, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected void assertResponseCode(okhttp3.Request request, okhttp3.Response response)
request
- The {#link Request} object.response
- The Response
object.KubernetesClientException
- When the response code is not the expected.public static io.fabric8.kubernetes.api.model.Status createStatus(okhttp3.Response response)
public static io.fabric8.kubernetes.api.model.Status createStatus(int statusCode, String message)
protected static <T> T unmarshal(InputStream is) throws KubernetesClientException
KubernetesClientException
protected static <T> T unmarshal(InputStream is, Class<T> type) throws KubernetesClientException
KubernetesClientException
public Config getConfig()
Copyright © 2015–2017 Red Hat. All rights reserved.