public class OperationSupport extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
apiGroup |
protected String |
apiVersion |
protected com.squareup.okhttp.OkHttpClient |
client |
protected Config |
config |
static com.squareup.okhttp.MediaType |
JSON |
protected static com.fasterxml.jackson.databind.ObjectMapper |
JSON_MAPPER |
protected String |
name |
protected String |
namespace |
protected String |
resourceT |
protected static com.fasterxml.jackson.databind.ObjectMapper |
YAML_MAPPER |
Constructor and Description |
---|
OperationSupport() |
OperationSupport(com.squareup.okhttp.OkHttpClient client,
Config config,
String apiGroup,
String apiVersion,
String resourceT,
String namespace,
String name) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertResponseCode(com.squareup.okhttp.Request request,
com.squareup.okhttp.Response response,
int expectedStatusCode)
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(com.squareup.okhttp.Response response) |
String |
getAPIGroup() |
String |
getAPIVersion() |
Config |
getConfig() |
String |
getName() |
String |
getNamespace() |
URL |
getNamespacedUrl() |
URL |
getNamespacedUrl(String namespace) |
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) |
protected void |
handleDelete(URL requestUrl,
long gracePeriodSeconds) |
protected <T> T |
handleGet(URL resourceUrl,
Class<T> type) |
protected <T> T |
handleReplace(T updated,
Class<T> type) |
protected <T> T |
handleResponse(com.squareup.okhttp.Request.Builder requestBuilder,
int successStatusCode,
Class<T> type) |
boolean |
isNamespaceRequired() |
protected static <T> T |
unmarshal(InputStream is) |
protected static <T> T |
unmarshal(InputStream is,
Class<T> type) |
public static final com.squareup.okhttp.MediaType JSON
protected static final com.fasterxml.jackson.databind.ObjectMapper JSON_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper YAML_MAPPER
protected final com.squareup.okhttp.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 isNamespaceRequired()
public URL getRootUrl()
public URL getNamespacedUrl(String namespace) throws MalformedURLException
MalformedURLException
public URL getNamespacedUrl() 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) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected void handleDelete(URL requestUrl, long gracePeriodSeconds) 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 handleGet(URL resourceUrl, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected <T> T handleResponse(com.squareup.okhttp.Request.Builder requestBuilder, int successStatusCode, Class<T> type) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected void assertResponseCode(com.squareup.okhttp.Request request, com.squareup.okhttp.Response response, int expectedStatusCode)
request
- The {#link Request} object.response
- The Response
object.expectedStatusCode
- The expected status code.KubernetesClientException
- When the response code is not the expected.public static io.fabric8.kubernetes.api.model.Status createStatus(com.squareup.okhttp.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–2016 Red Hat. All rights reserved.