public abstract class ClientAdapter<C extends ClientAdapter<C>> extends Object implements Client
| Constructor and Description |
|---|
ClientAdapter() |
| Modifier and Type | Method and Description |
|---|---|
<A extends Client> |
adapt(Class<A> type)
Adapt the client to another type.
|
void |
close() |
io.fabric8.kubernetes.api.model.APIGroup |
getApiGroup(String name)
Return a single api group
|
io.fabric8.kubernetes.api.model.APIGroupList |
getApiGroups()
Returns the api groups.
|
io.fabric8.kubernetes.api.model.APIResourceList |
getApiResources(String groupVersion)
Return the api resource metadata for the given groupVersion
|
String |
getApiVersion() |
Client |
getClient() |
Config |
getConfiguration() |
HttpClient |
getHttpClient() |
URL |
getMasterUrl() |
String |
getNamespace() |
boolean |
hasApiGroup(String apiGroup,
boolean exact)
Checks for the api group.
|
C |
inAnyNamespace() |
void |
init(Client client) |
C |
inNamespace(String namespace) |
<A extends Client> |
isAdaptable(Class<A> type)
Checks if the client can be adapted to an other client type and if that target client is supported.
|
Client |
newClient(RequestConfig requestConfig)
Creates a new client based upon the current except with a different
RequestConfig. |
abstract C |
newInstance() |
<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,R extends Resource<T>> |
resources(Class<T> resourceType,
Class<L> listClass,
Class<R> resourceClass)
Typed API for managing resources.
|
io.fabric8.kubernetes.api.model.RootPaths |
rootPaths() |
<T extends io.fabric8.kubernetes.api.model.KubernetesResource> |
supports(Class<T> type)
Checks the Kubernetes server for support for the given KubernetesResource type.
|
boolean |
supportsApiPath(String path)
Returns true if this cluster supports the given API path or API Group ID
|
public Client getClient()
public void init(Client client)
public HttpClient getHttpClient()
getHttpClient in interface Clientpublic Config getConfiguration()
getConfiguration in interface Clientpublic <A extends Client> Boolean isAdaptable(Class<A> type)
ClientisAdaptable in interface ClientA - The target client type.type - The target client class.ExtensionAdapter is found.public <T extends io.fabric8.kubernetes.api.model.KubernetesResource> boolean supports(Class<T> type)
ClientThe response is not cached, a new check will be performed for each method invocation. In case custom resource definition is installed in between invocations, this method might return different values.
public boolean hasApiGroup(String apiGroup, boolean exact)
ClienthasApiGroup in interface ClientapiGroup - to check forexact - true for an exact matchpublic <A extends Client> A adapt(Class<A> type)
Clientpublic URL getMasterUrl()
getMasterUrl in interface Clientpublic String getApiVersion()
getApiVersion in interface Clientpublic String getNamespace()
getNamespace in interface Clientpublic io.fabric8.kubernetes.api.model.RootPaths rootPaths()
public boolean supportsApiPath(String path)
ClientsupportsApiPath in interface Clientpath - Path as stringpublic void close()
public io.fabric8.kubernetes.api.model.APIGroupList getApiGroups()
ClientgetApiGroups in interface ClientAPIGroupList metadatapublic io.fabric8.kubernetes.api.model.APIGroup getApiGroup(String name)
ClientgetApiGroup in interface Clientname - of the groupAPIGroup metadatapublic io.fabric8.kubernetes.api.model.APIResourceList getApiResources(String groupVersion)
ClientUse v1 to indicate the core/legacy resources
getApiResources in interface ClientgroupVersion - the groupVersion - group/versionAPIResourceList for the groupVersionpublic <T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,R extends Resource<T>> MixedOperation<T,L,R> resources(Class<T> resourceType, Class<L> listClass, Class<R> resourceClass)
Client
Note: your resource POJO (T in this context) must implement
Namespaced if it is a namespace-scoped resource.
resources in interface ClientT - represents resource type. If it's a namespaced resource, it must implement
NamespacedL - represents resource list typeR - represents the Resource operation typeresourceType - Class for resourcepublic C inAnyNamespace()
public Client newClient(RequestConfig requestConfig)
ClientRequestConfig. This client will use independent resources,
and should be closed appropriatelypublic abstract C newInstance()
Copyright © 2015–2022 Red Hat. All rights reserved.