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()
IClient
getResourceFactory
in interface IClient
public String getResourceURI(IResource resource)
getResourceURI
in interface IClient
public <T extends IResource> List<T> list(String kind)
IClient
public <T extends IResource> List<T> list(String kind, String namespace)
IClient
public <T extends IResource> List<T> list(String kind, String namespace, Map<String,String> labels)
IClient
public Collection<IResource> create(IList list, String namespace)
IClient
public <T extends IResource> T create(T resource)
IClient
public <T extends IResource> T create(T resource, String namespace)
IClient
public <T extends IResource> T create(String kind, String namespace, String name, String subresource, IResource payload)
IClient
public <T extends IResource> T update(T resource)
IClient
public <T extends IResource> void delete(T resource)
IClient
public void initializeCapabilities()
public <T extends ICapability> T getCapability(Class<T> capability)
ICapable
getCapability
in interface ICapable
public boolean supports(Class<? extends ICapability> capability)
ICapable
public <T extends ICapability,R> R accept(CapabilityVisitor<T,R> visitor, R unsupportedCapabililityValue)
ICapable
public List<KubernetesAPIVersion> getKubernetesVersions()
public List<OpenShiftAPIVersion> getOpenShiftVersions()
public String getKubernetesVersion()
public String getOpenShiftAPIVersion()
IClient
getOpenShiftAPIVersion
in interface IClient
public URL getBaseURL()
getBaseURL
in interface IClient
public void setAuthorizationStrategy(IAuthorizationStrategy strategy)
IClient
setAuthorizationStrategy
in interface IClient
public IAuthorizationStrategy getAuthorizationStrategy()
getAuthorizationStrategy
in interface IClient
public IUser getCurrentUser()
getCurrentUser
in interface IClient
public IAuthorizationContext getContext(String baseURL)
IAuthorizationClient
getContext
in interface IAuthorizationClient
public IAuthorizationDetails getAuthorizationDetails(String baseURL)
IAuthorizationClient
getAuthorizationDetails
in interface IAuthorizationClient
public void setSSLCertificateCallback(ISSLCertificateCallback callback)
IAuthorizationClient
setSSLCertificateCallback
in interface IAuthorizationClient
Copyright © 2016 Red Hat, Inc. All rights reserved.