public interface Client extends Closeable
Modifier and Type | Method and Description |
---|---|
<C extends Client> |
adapt(Class<C> 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() |
Config |
getConfiguration() |
HttpClient |
getHttpClient() |
URL |
getMasterUrl() |
String |
getNamespace() |
boolean |
hasApiGroup(String apiGroup,
boolean exact)
Checks for the api group.
|
<C extends Client> |
isAdaptable(Class<C> type)
Deprecated.
if the client can test for support, then use adapt(type).isSupported() instead.
|
Client |
newClient(RequestConfig requestConfig)
Creates a new client based upon the current except with a different
RequestConfig . |
default String |
raw(String uri)
GET the response from the given uri as a String
|
String |
raw(String uri,
String method,
Object payload)
The response from the given uri as a String
|
default <T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> |
resources(Class<T> resourceType,
Class<L> listClass)
Typed API for managing resources.
|
<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() |
<R extends io.fabric8.kubernetes.api.model.KubernetesResource> |
supports(Class<R> type)
Checks the Kubernetes server for support for the given KubernetesResource type.
|
boolean |
supports(String apiVersion,
String kind)
Checks the Kubernetes server for support for the given type.
|
boolean |
supportsApiPath(String path)
Deprecated.
use
supports(Class) instead |
@Deprecated <C extends Client> Boolean isAdaptable(Class<C> type)
C
- The target client type.type
- The target client class.ExtensionAdapter
is found.<R extends io.fabric8.kubernetes.api.model.KubernetesResource> boolean supports(Class<R> type)
The 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.
type
- to check for supportboolean supports(String apiVersion, String kind)
The 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.
apiVersion
- the api/version. This should be fully qualified - that is for openshift, please include the api.kind
- the resource kindboolean hasApiGroup(String apiGroup, boolean exact)
apiGroup
- to check forexact
- true for an exact match<C extends Client> C adapt(Class<C> type)
URL getMasterUrl()
String getApiVersion()
String getNamespace()
io.fabric8.kubernetes.api.model.RootPaths rootPaths()
@Deprecated boolean supportsApiPath(String path)
supports(Class)
insteadpath
- Path as stringvoid close()
close
in interface AutoCloseable
close
in interface Closeable
io.fabric8.kubernetes.api.model.APIGroupList getApiGroups()
APIGroupList
metadataio.fabric8.kubernetes.api.model.APIGroup getApiGroup(String name)
name
- of the groupAPIGroup
metadataio.fabric8.kubernetes.api.model.APIResourceList getApiResources(String groupVersion)
Use v1 to indicate the core/legacy resources
groupVersion
- the groupVersion - group/versionAPIResourceList
for the groupVersion<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)
Note: your resource POJO (T in this context) must implement
Namespaced
if it is a namespace-scoped resource.
T
- represents resource type. If it's a namespaced resource, it must implement
Namespaced
L
- represents resource list typeR
- represents the Resource operation typeresourceType
- Class for resourcedefault <T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> MixedOperation<T,L,Resource<T>> resources(Class<T> resourceType, Class<L> listClass)
Note: your resource POJO (T in this context) must implement
Namespaced
if it is a namespace-scoped resource.
T
- represents resource type. If it's a namespaced resource, it must implement
Namespaced
L
- represents resource list typeresourceType
- Class for resourceClient newClient(RequestConfig requestConfig)
RequestConfig
. It uses the same resources as the current client, thus
closing it will close the original client.requestConfig
- HttpClient getHttpClient()
Config getConfiguration()
default String raw(String uri)
uri
- must start with / if relativeCopyright © 2015–2023 Red Hat. All rights reserved.