Interface Client

    • Method Detail

      • supports

        <R extends io.fabric8.kubernetes.api.model.KubernetesResource> boolean supports​(Class<R> type)
        Checks the Kubernetes server for support for the given KubernetesResource 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.

        Parameters:
        type - to check for support
        Returns:
        boolean value indicating whether this type is supported
      • supports

        boolean supports​(String apiVersion,
                         String kind)
        Checks the Kubernetes server for support for the given 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.

        Parameters:
        apiVersion - the api/version. This should be fully qualified - that is for openshift, please include the api.
        kind - the resource kind
        Returns:
        boolean value indicating whether this type is supported
      • hasApiGroup

        boolean hasApiGroup​(String apiGroup,
                            boolean exact)
        Checks for the api group. exact = false will scan all groups for a suffix match. exact = true will look only for that apiGroup.
        Parameters:
        apiGroup - to check for
        exact - true for an exact match
        Returns:
        true if there is a match
      • adapt

        <C extends Client> C adapt​(Class<C> type)
        Adapt the client to another type. This will not perform any check of whether the new client type is supported. It may even return the same object if it already supports the given client type.
        Parameters:
        type - the instance of Client to adapt.
        Returns:
        The refined instance of the Client.
      • getMasterUrl

        URL getMasterUrl()
      • getApiVersion

        String getApiVersion()
      • getNamespace

        String getNamespace()
      • rootPaths

        io.fabric8.kubernetes.api.model.RootPaths rootPaths()
      • supportsApiPath

        @Deprecated
        boolean supportsApiPath​(String path)
        Deprecated.
        use supports(Class) instead
        Returns true if this cluster supports the given API path or API Group ID
        Parameters:
        path - Path as string
        Returns:
        returns boolean value indicating whether it supports.
      • getAPIVersions

        io.fabric8.kubernetes.api.model.APIVersions getAPIVersions()
        Get the available APIversions. APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.
        Returns:
        the APIVersions object
      • getApiGroups

        io.fabric8.kubernetes.api.model.APIGroupList getApiGroups()
        Returns the api groups. This does not include the core/legacy v1 apiVersion.
        Returns:
        the APIGroupList metadata
      • getApiGroup

        io.fabric8.kubernetes.api.model.APIGroup getApiGroup​(String name)
        Return a single api group
        Parameters:
        name - of the group
        Returns:
        the APIGroup metadata
      • getApiResources

        io.fabric8.kubernetes.api.model.APIResourceList getApiResources​(String groupVersion)
        Return the api resource metadata for the given groupVersion

        Use v1 to indicate the core/legacy resources

        Parameters:
        groupVersion - the groupVersion - group/version
        Returns:
        the APIResourceList for the groupVersion
      • resources

        <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)
        Typed API for managing resources. Any properly annotated POJO can be utilized as a resource.
        Note: this call is generally for use internally within the DSL, not by end users

        Note: your resource POJO (T in this context) must implement Namespaced if it is a namespace-scoped resource.

        Type Parameters:
        T - represents resource type. If it's a namespaced resource, it must implement Namespaced
        L - represents resource list type
        R - represents the Resource operation type
        Parameters:
        resourceType - Class for resource
        Returns:
        returns a MixedOperation object with which you can do basic resource operations. If the class is a known type the dsl operation logic will be used.
      • resources

        default <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)
        Typed API for managing resources. Any properly annotated POJO can be utilized as a resource.

        Note: your resource POJO (T in this context) must implement Namespaced if it is a namespace-scoped resource.

        Type Parameters:
        T - represents resource type. If it's a namespaced resource, it must implement Namespaced
        L - represents resource list type
        Parameters:
        resourceType - Class for resource
        Returns:
        returns a MixedOperation object with which you can do basic resource operations. If the class is a known type the dsl operation logic will be used.
      • newClient

        Client newClient​(RequestConfig requestConfig)
        Creates a new client based upon the current except with a different RequestConfig. It uses the same resources as the current client, thus closing it will close the original client.
        Parameters:
        requestConfig -
        Returns:
        a new client
      • getConfiguration

        Config getConfiguration()
      • raw

        default String raw​(String uri)
        GET the response from the given uri as a String
        Parameters:
        uri - must start with / if relative
        Returns:
        the response, or null if a 404 code
      • raw

        String raw​(String uri,
                   String method,
                   Object payload)
        The response from the given uri as a String
        Parameters:
        uri - must start with / if relative
        method - an http method verb such as GET, DELETE, PUT, POST
        payload - a non-String value will be converted to json
        Returns:
        the response