Class RawCustomResourceOperationsImpl

    • Constructor Detail

    • Method Detail

      • withGracePeriod

        public RawCustomResourceOperationsImpl withGracePeriod​(long gracePeriodSeconds)
        Description copied from interface: GracePeriodConfigurable
        The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
        Specified by:
        withGracePeriod in interface GracePeriodConfigurable<RawCustomResourceOperationsImpl>
        Parameters:
        gracePeriodSeconds - grace period integer value in seconds
        Returns:
        the object for which grace period is configured
      • withPropagationPolicy

        public RawCustomResourceOperationsImpl withPropagationPolicy​(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
        Description copied from interface: PropagationPolicyConfigurable
        Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both.

        The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.

        Acceptable values are:
        'Orphan' - orphan the dependents;
        'Background' - allow the garbage collector to delete the dependents in the background;
        'Foreground' - a cascading policy that deletes all dependents in the foreground.

        Specified by:
        withPropagationPolicy in interface PropagationPolicyConfigurable<RawCustomResourceOperationsImpl>
        Parameters:
        propagationPolicy - propagation policy in form of string DeletionPropagation
        Returns:
        resource
      • dryRun

        public RawCustomResourceOperationsImpl dryRun​(boolean isDryRun)
        Description copied from interface: DryRunable
        Indicates whether modifications should not be persisted or not. If enabled, All dry run stages will be processed. the request is still processed as typical request: the fields are defaulted, the object is validated, it goes through the validation admission chain, and through the mutating admission chain, and then the final object is returned to the user as it normally would, without being persisted.
        Specified by:
        dryRun in interface DryRunable<RawCustomResourceOperationsImpl>
        Parameters:
        isDryRun - whether dry run is enabled or disabled
        Returns:
        write operations which are applicable for dry run
      • load

        public Map<String,​Object> load​(InputStream fileInputStream)
                                      throws IOException
        Load a custom resource object from an inputstream into a HashMap
        Parameters:
        fileInputStream - file input stream
        Returns:
        custom resource as HashMap
        Throws:
        IOException - exception in case any read operation fails.
      • load

        public Map<String,​Object> load​(String objectAsJsonString)
                                      throws IOException
        Load a custom resource object from a JSON string into a HashMap
        Parameters:
        objectAsJsonString - object as JSON string
        Returns:
        custom resource as HashMap
        Throws:
        IOException - exception in case any problem in reading json.
      • create

        public Map<String,​Object> create​(String objectAsString)
                                        throws IOException
        Create a custom resource which is a non-namespaced object.
        Parameters:
        objectAsString - object as JSON string
        Returns:
        Object as HashMap
        Throws:
        IOException - exception in case of any network/read problems
      • create

        public Map<String,​Object> create​(Map<String,​Object> object)
                                        throws IOException
        Create a custom resource which is non-namespaced.
        Parameters:
        object - object a HashMap
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of problems while reading HashMap
      • create

        public Map<String,​Object> create​(String namespace,
                                               String objectAsString)
                                        throws IOException
        Create a custom resource which is a namespaced object.
        Parameters:
        namespace - namespace in which we want object to be created.
        objectAsString - Object as JSON string
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of problems while reading JSON object
      • create

        public Map<String,​Object> create​(InputStream objectAsStream)
                                        throws IOException
        Create a custom resource which is non-namespaced object.
        Parameters:
        objectAsStream - object as a file input stream
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of problems while reading file
      • create

        public Map<String,​Object> create​(String namespace,
                                               InputStream objectAsStream)
                                        throws IOException
        Create a custom resource which is a namespaced object.
        Parameters:
        namespace - namespace in which we want object to be created
        objectAsStream - object as file input stream
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of problems while reading file
      • create

        public Map<String,​Object> create​(String namespace,
                                               Map<String,​Object> object)
                                        throws IOException
        Create a custom resource which is a namespaced object.
        Parameters:
        namespace - namespace in which we want object to be created.
        object - object as a HashMap
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of problems faced while serializing HashMap
      • createOrReplace

        public Map<String,​Object> createOrReplace​(String objectAsString)
                                                 throws IOException
        Create or replace a custom resource which is a non-namespaced object.
        Parameters:
        objectAsString - object as JSON string
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serializiation failures or failures from Kuberntes API
      • createOrReplace

        public Map<String,​Object> createOrReplace​(Map<String,​Object> customResourceObject)
                                                 throws IOException
        Create or replace a custom resource which is a non-namespced object.
        Parameters:
        customResourceObject - object as HashMap
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • createOrReplace

        public Map<String,​Object> createOrReplace​(InputStream inputStream)
                                                 throws IOException
        Create or replace a custom resource which is non-namespaced object.
        Parameters:
        inputStream - object as file input stream
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • createOrReplace

        public Map<String,​Object> createOrReplace​(String namespace,
                                                        String objectAsString)
                                                 throws IOException
        Create or replace a custom resource which is namespaced object.
        Parameters:
        namespace - desired namespace
        objectAsString - object as JSON String
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • createOrReplace

        public Map<String,​Object> createOrReplace​(String namespace,
                                                        Map<String,​Object> customResourceObject)
                                                 throws IOException
        Create or replace a custom resource which is namespaced object.
        Parameters:
        namespace - desired namespace
        customResourceObject - object as HashMap
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • createOrReplace

        public Map<String,​Object> createOrReplace​(String namespace,
                                                        InputStream objectAsStream)
                                                 throws IOException
        Create or replace a custom resource which is namespaced object.
        Parameters:
        namespace - desired namespace
        objectAsStream - object as file input stream
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • edit

        public Map<String,​Object> edit​(String name,
                                             Map<String,​Object> object)
                                      throws IOException
        Edit a custom resource object which is a non-namespaced object.
        Parameters:
        name - name of the custom resource
        object - new object as a HashMap
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • edit

        public Map<String,​Object> edit​(String name,
                                             String objectAsString)
                                      throws IOException
        Edit a custom resource object which is a non-namespaced object.
        Parameters:
        name - name of the custom resource
        objectAsString - new object as a JSON String
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • edit

        public Map<String,​Object> edit​(String namespace,
                                             String name,
                                             Map<String,​Object> object)
                                      throws IOException
        Edit a custom resource object which is a namespaced object.
        Parameters:
        namespace - desired namespace
        name - name of the custom resource
        object - new object as a HashMap
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • edit

        public Map<String,​Object> edit​(String namespace,
                                             String name,
                                             String objectAsString)
                                      throws IOException
        Edit a custom resource object which is a namespaced object.
        Parameters:
        namespace - desired namespace
        name - name of the custom resource
        objectAsString - new object as a JSON string
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serialization failures or failures from Kubernetes API
      • edit

        public Map<String,​Object> edit​(String objectAsString)
                                      throws IOException
        Edit a custom resource object.
        Parameters:
        objectAsString - new object as JSON string
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serializatino failures or failures from Kubernetes API
      • edit

        public Map<String,​Object> edit​(Map<String,​Object> object)
                                      throws IOException
        Edit a custom resource object.
        Parameters:
        object - new object as Map
        Returns:
        Object as HashMap
        Throws:
        IOException - in case of network/serializatino failures or failures from Kubernetes API
      • updateStatus

        public Map<String,​Object> updateStatus​(String name,
                                                     Map<String,​Object> objectAsMap)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        name - name of custom resource
        objectAsMap - custom resource as a HashMap
        Returns:
        updated CustomResource as HashMap
        Throws:
        IOException - in case any failure to parse Map
      • updateStatus

        public Map<String,​Object> updateStatus​(String name,
                                                     String objectAsJsonString)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        name - name of CustomResource
        objectAsJsonString - CustomResource as a JSON string
        Returns:
        updated CustomResource as a HashMap
        Throws:
        IOException - in case any failure to parse Map
      • updateStatus

        public Map<String,​Object> updateStatus​(String namespace,
                                                     String name,
                                                     Map<String,​Object> objectAsMap)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        namespace - namespace of CustomResource
        name - name of CustomResource
        objectAsMap - CustomResource as a HashMap
        Returns:
        updated CustomResource as a HashMap
        Throws:
        IOException - in case any failure to parse Map
      • updateStatus

        public Map<String,​Object> updateStatus​(String name,
                                                     InputStream objectAsStream)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        name - name of CustomResource
        objectAsStream - stream pointing to CustomResource
        Returns:
        updated CustomResource as a HashMap
        Throws:
        IOException - in case any failure to parse Map
      • updateStatus

        public Map<String,​Object> updateStatus​(String namespace,
                                                     String name,
                                                     InputStream objectAsStream)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        namespace - namespace of CustomResource
        name - name of CustomResource
        objectAsStream - CustomResource object as a stream
        Returns:
        updated CustomResource as a HashMap
        Throws:
        IOException - in case any failure to parse Map
      • updateStatus

        public Map<String,​Object> updateStatus​(String namespace,
                                                     String name,
                                                     String objectAsJsonString)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        namespace - namespace of CustomResource
        name - name of CustomResource
        objectAsJsonString - CustomResource object as a JSON string
        Returns:
        updated CustomResource as a HashMap
        Throws:
        IOException - in case any failure to parse Map
      • updateStatus

        public Map<String,​Object> updateStatus​(String objectAsJsonString)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        objectAsJsonString - CustomResource object as a JSON string
        Returns:
        updated CustomResource as HashMap
        Throws:
        IOException - in case any failures to parse provided object or failure from Kubernetes API
      • updateStatus

        public Map<String,​Object> updateStatus​(Map<String,​Object> objectAsMap)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        objectAsMap - CustomResource object as a HashMap
        Returns:
        updated CustomResource as HashMap
        Throws:
        IOException - in case any failures to parse provided object or failure from Kubernetes API
      • updateStatus

        public Map<String,​Object> updateStatus​(InputStream objectAsInputStream)
                                              throws IOException
        Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResource
        Parameters:
        objectAsInputStream - CustomResource object as a InputStream
        Returns:
        updated CustomResource as HashMap
        Throws:
        IOException - in case any failures to parse provided object or failure from Kubernetes API
      • get

        public Map<String,​Object> get​(String name)
        Get a custom resource from the cluster which is non-namespaced.
        Parameters:
        name - name of custom resource
        Returns:
        Object as HashMap
      • get

        public Map<String,​Object> get​(String namespace,
                                            String name)
        Get a custom resource from the cluster which is namespaced.
        Parameters:
        namespace - desired namespace
        name - name of custom resource
        Returns:
        Object as HashMap
      • list

        public Map<String,​Object> list​(Integer limitVal,
                                             String continueVal)
        Description copied from interface: Listable
        List resources from APIServer.
        Specified by:
        list in interface Listable<Map<String,​Object>>
        Parameters:
        limitVal - number of resources to list
        continueVal - an offset to pick listing from
        Returns:
        resource list
      • list

        public Map<String,​Object> list​(io.fabric8.kubernetes.api.model.ListOptions listOptions)
        Description copied from interface: Listable
        List resource from Kubernetes API server.
        Specified by:
        list in interface Listable<Map<String,​Object>>
        Parameters:
        listOptions - ListOptions is the query options to a standard REST list call.
        Returns:
        list of resource type
      • list

        public Map<String,​Object> list​(String namespace)
        List all custom resources in a specific namespace
        Parameters:
        namespace - desired namespace
        Returns:
        list of custom resources as HashMap
      • list

        public Map<String,​Object> list​(String namespace,
                                             Map<String,​String> labels)
        List all custom resources in a specific namespace with some labels
        Parameters:
        namespace - desired namespace
        labels - labels as a HashMap
        Returns:
        list of custom resources as HashMap
      • delete

        public boolean delete​(String namespaceOrName)
        Delete all Namespaced Scoped Custom Resources in a specified namespace OR Delete a Cluster Scoped Custom Resource with specified name

        Note: This method behaves differently based on the scope of CRD: If specified CRD is of Namespaced scope, this method would delete all Custom Resources in namespace which is specified as parameter. If specified CRD is of Cluster scope, this method would delete a Custom Resource matching the name which is specified as parameter

        Parameters:
        namespaceOrName - desired namespace(if CRD is Namespaced) or name(If CRD is Cluster)
        Returns:
        deleted objects as HashMap
      • delete

        public boolean delete​(String namespaceOrName,
                              boolean cascading)
                       throws IOException
        Delete all Namespaced Scoped Custom Resources in a specified namespace OR Delete a Cluster Scoped Custom Resource with specified name

        Note: This method behaves differently based on the scope of CRD: If specified CRD is of Namespaced scope, this method would delete all Custom Resources in namespace which is specified as parameter. If specified CRD is of Cluster scope, this method would delete a Custom Resource matching the name which is specified as parameter

        Parameters:
        namespaceOrName - desired namespace(If CRD is Namespaced) or name(If CRD is Cluster)
        cascading - whether dependent object need to be orphaned or not. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list.
        Returns:
        a boolean value whether item was deleted or item didn't exist in server
        Throws:
        IOException - in case of any network/parsing exception
      • delete

        public boolean delete​(String namespaceOrName,
                              io.fabric8.kubernetes.api.model.DeleteOptions deleteOptions)
                       throws IOException
        Delete all Namespaced Scoped Custom Resources in a specified namespace OR Delete a Cluster Scoped Custom Resource with specified name

        Note: This method behaves differently based on the scope of CRD: If specified CRD is of Namespaced scope, this method would delete all Custom Resources in namespace which is specified as parameter. If specified CRD is of Cluster scope, this method would delete a Custom Resource matching the name which is specified as parameter

        Parameters:
        namespaceOrName - desired namespace(If CRD is Namespaced) or name(If CRD is Cluster)
        deleteOptions - object provided by Kubernetes API for more fine grained control over deletion. For more information please see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#deleteoptions-v1-meta
        Returns:
        a boolean value whether item was deleted or item didn't exist in server
        Throws:
        IOException - in case of any network/object parse problems
      • delete

        public boolean delete​(String namespace,
                              String name)
                       throws IOException
        Delete a custom resource in a specific namespace
        Parameters:
        namespace - desired namespace
        name - custom resource's name
        Returns:
        a boolean value whether item was deleted or item didn't exist in server
        Throws:
        IOException - in case of any network/object parse problems
      • delete

        public boolean delete​(String namespace,
                              String name,
                              boolean cascading)
                       throws IOException
        Delete a custom resource in a specific namespace
        Parameters:
        namespace - required namespace
        name - required name of custom resource
        cascading - whether dependent object need to be orphaned or not. If true/false, the "orphan" finalizer will be added to/removed from the object's finalizers list.
        Returns:
        a boolean value whether item was deleted or item didn't exist in server
        Throws:
        IOException - exception related to network/object parsing
      • delete

        public boolean delete​(String namespace,
                              String name,
                              String propagationPolicy)
                       throws IOException
        Delete a custom resource in a specific namespace
        Parameters:
        namespace - required namespace
        name - required name of custom resource
        propagationPolicy - Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
        Returns:
        a boolean value whether item was deleted or item didn't exist in server
        Throws:
        IOException - in case of network/object parse exception
      • delete

        public boolean delete​(String namespace,
                              String name,
                              io.fabric8.kubernetes.api.model.DeleteOptions deleteOptions)
                       throws IOException
        Delete a custom resource in a specific namespace
        Parameters:
        namespace - required namespace
        name - name of custom resource
        deleteOptions - object provided by Kubernetes API for more fine grained control over deletion. For more information please see https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#deleteoptions-v1-meta
        Returns:
        a boolean value whether item was deleted or item didn't exist in server
        Throws:
        IOException - in case of any network/object parse exception
      • delete

        public Boolean delete()
        Description copied from interface: Deletable
        Deletes resource and all managed resources, returns null or false if not found.
        Specified by:
        delete in interface Deletable
        Returns:
        value indicating object was deleted or not
      • watch

        public void watch​(String namespace,
                          Watcher<String> watcher)
                   throws IOException
        Watch custom resources in a specific namespace. Here Watcher is provided for string type only. User has to deserialize object itself.
        Parameters:
        namespace - namespace to watch
        watcher - watcher object which reports updates with object
        Throws:
        IOException - in case of network error
      • watch

        public void watch​(String namespace,
                          String resourceVersion,
                          Watcher<String> watcher)
                   throws IOException
        Watch a custom resource in a specific namespace with some resourceVersion. Here watcher is provided from string type only. User has to deserialize object itself.
        Parameters:
        namespace - namespace to watch
        resourceVersion - resource version since when to watch
        watcher - watcher object which reports updates
        Throws:
        IOException - in case of network error
      • watch

        public void watch​(String namespace,
                          io.fabric8.kubernetes.api.model.ListOptions options,
                          Watcher<String> watcher)
                   throws IOException
        Watch a custom resource in a specific namespace with some resourceVersion. Here watcher is provided from string type only. User has to deserialize object itself.
        Parameters:
        namespace - namespace to watch
        options - ListOptions list options for watching
        watcher - watcher object which reports updates
        Throws:
        IOException - in case of network error
      • watch

        public void watch​(Watcher<String> watcher)
                   throws IOException
        Watchers custom resources across all namespaces. Here watcher is provided for string type only. User has to deserialize object itself.
        Parameters:
        watcher - watcher object which reports events
        Throws:
        IOException - in case of network error
      • watch

        public Watch watch​(String namespace,
                           String name,
                           Map<String,​String> labels,
                           String resourceVersion,
                           Watcher<String> watcher)
                    throws IOException
        Watch custom resources in the parameters specified. Most of the parameters except watcher are optional, they would be skipped if passed null. Here watcher is provided for string type only. User has to deserialize the object itself.
        Parameters:
        namespace - namespace to watch (optional
        name - name of custom resource (optional)
        labels - HashMap containing labels (optional)
        resourceVersion - resource version to start watch from
        watcher - watcher object which reports events
        Returns:
        watch object for watching resource
        Throws:
        IOException - in case of network error
      • watch

        public Watch watch​(String namespace,
                           String name,
                           Map<String,​String> labels,
                           io.fabric8.kubernetes.api.model.ListOptions options,
                           Watcher<String> watcher)
                    throws IOException
        Watch custom resources in the parameters specified. Most of the parameters except watcher are optional, they would be skipped if passed null. Here watcher is provided for string type only. User has to deserialize the object itself.
        Parameters:
        namespace - namespace to watch (optional
        name - name of custom resource (optional)
        labels - HashMap containing labels (optional)
        options - ListOptions list options for watch
        watcher - watcher object which reports events
        Returns:
        watch object for watching resource
        Throws:
        IOException - in case of network error
      • watch

        public Watch watch​(Map<String,​String> labels,
                           io.fabric8.kubernetes.api.model.ListOptions options,
                           Watcher<String> watcher)
                    throws IOException
        Watch custom resources in the parameters specified. Most of the parameters except watcher are optional, they would be skipped if passed null. Here watcher is provided for string type only. User has to deserialize the object itself.
        Parameters:
        labels - HashMap containing labels (optional)
        options - ListOptions list options for watch
        watcher - watcher object which reports events
        Returns:
        watch object for watching resource
        Throws:
        IOException - in case of network error