public class DefaultClient extends Object implements IClient, IHttpStatusCodes
| Modifier and Type | Field and Description |
|---|---|
static String |
SYSTEM_PROP_K8E_API_VERSION |
static String |
SYSTEM_PROP_OPENSHIFT_API_VERSION |
STATUS_BAD_REQUEST, STATUS_FORBIDDEN, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_OK, STATUS_UNAUTHORIZED| Constructor and Description |
|---|
DefaultClient(URL baseUrl,
ISSLCertificateCallback sslCertCallback) |
| Modifier and Type | Method and Description |
|---|---|
<T extends ICapability,R> |
accept(CapabilityVisitor<T,R> visitor,
R unsupportedCapabililityValue)
Uses the given visitor to access the desired capability if it
is supported
|
Collection<IResource> |
create(IList list,
String namespace)
Creates a list of resources in the given namespace
|
<T extends IResource> |
create(String kind,
String namespace,
String name,
String subresource,
IResource payload)
Creates the given resource in the given namespace using the subresource
|
<T extends IResource> |
create(T resource)
Creates the given resource in the namespace defined on the
resource or the default namspace if undefined
|
<T extends IResource> |
create(T resource,
String namespace)
Creates the given resource in the given namespace
|
<T extends IResource> |
delete(T resource)
Deletes the given resource.
|
boolean |
equals(Object obj) |
<T extends IResource> |
get(String kind,
String name,
String namespace) |
IAuthorizationDetails |
getAuthorizationDetails(String baseURL)
Retrieve the authorization details for a server
|
IAuthorizationStrategy |
getAuthorizationStrategy() |
URL |
getBaseURL() |
<T extends ICapability> |
getCapability(Class<T> capability)
Gets the capability of the desired type
|
IAuthorizationContext |
getContext(String baseURL)
Retrieve a token for OpenShift.
|
IUser |
getCurrentUser() |
String |
getKubernetesVersion() |
List<KubernetesAPIVersion> |
getKubernetesVersions() |
String |
getOpenShiftAPIVersion()
Returns the OpenShift API version for this client
|
List<OpenShiftAPIVersion> |
getOpenShiftVersions() |
IResourceFactory |
getResourceFactory()
Returns the resource factory used to create resources based on the
response from the server
|
String |
getResourceURI(IResource resource) |
int |
hashCode() |
void |
initializeCapabilities() |
<T extends IResource> |
list(String kind)
Lists all possible resources of the given kind in the default namespace
|
<T extends IResource> |
list(String kind,
String namespace)
Lists the given given resource kind scoping it to a specific namespace
|
<T extends IResource> |
list(String kind,
String namespace,
Map<String,String> labels)
Lists the given given resource kind scoping it to a specific namespace
|
void |
setAuthorizationStrategy(IAuthorizationStrategy strategy)
Sets the authorization strategy for the client when
making requests to the server
|
void |
setSSLCertificateCallback(ISSLCertificateCallback callback)
Set the callback handler to use for certificate trust issues.
|
boolean |
supports(Class<? extends ICapability> capability)
Determines if the client supports the desired capability
|
<T extends IResource> |
update(T resource)
Updates the given resource
|
public static final String SYSTEM_PROP_K8E_API_VERSION
public static final String SYSTEM_PROP_OPENSHIFT_API_VERSION
public DefaultClient(URL baseUrl, ISSLCertificateCallback sslCertCallback)
public IResourceFactory getResourceFactory()
IClientgetResourceFactory in interface IClientpublic String getResourceURI(IResource resource)
getResourceURI in interface IClientpublic <T extends IResource> List<T> list(String kind)
IClientpublic <T extends IResource> List<T> list(String kind, String namespace)
IClientpublic <T extends IResource> List<T> list(String kind, String namespace, Map<String,String> labels)
IClientpublic Collection<IResource> create(IList list, String namespace)
IClientpublic <T extends IResource> T create(T resource)
IClientpublic <T extends IResource> T create(T resource, String namespace)
IClientpublic <T extends IResource> T create(String kind, String namespace, String name, String subresource, IResource payload)
IClientpublic <T extends IResource> T update(T resource)
IClientpublic <T extends IResource> void delete(T resource)
IClientpublic void initializeCapabilities()
public <T extends ICapability> T getCapability(Class<T> capability)
ICapablegetCapability in interface ICapablepublic boolean supports(Class<? extends ICapability> capability)
ICapablepublic <T extends ICapability,R> R accept(CapabilityVisitor<T,R> visitor, R unsupportedCapabililityValue)
ICapablepublic List<KubernetesAPIVersion> getKubernetesVersions()
public List<OpenShiftAPIVersion> getOpenShiftVersions()
public String getKubernetesVersion()
public String getOpenShiftAPIVersion()
IClientgetOpenShiftAPIVersion in interface IClientpublic URL getBaseURL()
getBaseURL in interface IClientpublic void setAuthorizationStrategy(IAuthorizationStrategy strategy)
IClientsetAuthorizationStrategy in interface IClientpublic IAuthorizationStrategy getAuthorizationStrategy()
getAuthorizationStrategy in interface IClientpublic IUser getCurrentUser()
getCurrentUser in interface IClientpublic IAuthorizationContext getContext(String baseURL)
IAuthorizationClientgetContext in interface IAuthorizationClientpublic IAuthorizationDetails getAuthorizationDetails(String baseURL)
IAuthorizationClientgetAuthorizationDetails in interface IAuthorizationClientpublic void setSSLCertificateCallback(ISSLCertificateCallback callback)
IAuthorizationClientsetSSLCertificateCallback in interface IAuthorizationClientCopyright © 2016 Red Hat, Inc. All rights reserved.