Class RawCustomResourceOperationsImpl
- java.lang.Object
-
- io.fabric8.kubernetes.client.dsl.base.OperationSupport
-
- io.fabric8.kubernetes.client.dsl.internal.RawCustomResourceOperationsImpl
-
- All Implemented Interfaces:
AnyNamespaceable<RawCustomResourceOperationsImpl>
,Deletable
,DryRunable<RawCustomResourceOperationsImpl>
,Gettable<Map<String,Object>>
,Listable<Map<String,Object>>
,Nameable<RawCustomResourceOperationsImpl>
,Namespaceable<RawCustomResourceOperationsImpl>
,GracePeriodConfigurable<RawCustomResourceOperationsImpl>
,PropagationPolicyConfigurable<RawCustomResourceOperationsImpl>
public class RawCustomResourceOperationsImpl extends OperationSupport implements Nameable<RawCustomResourceOperationsImpl>, Namespaceable<RawCustomResourceOperationsImpl>, AnyNamespaceable<RawCustomResourceOperationsImpl>, Listable<Map<String,Object>>, Gettable<Map<String,Object>>, GracePeriodConfigurable<RawCustomResourceOperationsImpl>, PropagationPolicyConfigurable<RawCustomResourceOperationsImpl>, DryRunable<RawCustomResourceOperationsImpl>, Deletable
This class simple does basic operations for custom defined resources without demanding the POJOs for custom resources. It is serializing/deserializing objects to plain hash map(String, Object). Right now it supports basic operations like GET, POST, PUT, DELETE.
-
-
Field Summary
-
Fields inherited from class io.fabric8.kubernetes.client.dsl.base.OperationSupport
apiGroupName, apiGroupVersion, client, config, context, dryRun, JSON, JSON_MAPPER, JSON_PATCH, name, namespace, resourceT, STRATEGIC_MERGE_JSON_PATCH, YAML_MAPPER
-
-
Constructor Summary
Constructors Constructor Description RawCustomResourceOperationsImpl(okhttp3.OkHttpClient client, Config config, CustomResourceDefinitionContext customResourceDefinition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
create(InputStream objectAsStream)
Create a custom resource which is non-namespaced object.Map<String,Object>
create(String objectAsString)
Create a custom resource which is a non-namespaced object.Map<String,Object>
create(String namespace, InputStream objectAsStream)
Create a custom resource which is a namespaced object.Map<String,Object>
create(String namespace, String objectAsString)
Create a custom resource which is a namespaced object.Map<String,Object>
create(String namespace, Map<String,Object> object)
Create a custom resource which is a namespaced object.Map<String,Object>
create(Map<String,Object> object)
Create a custom resource which is non-namespaced.Map<String,Object>
createOrReplace(InputStream inputStream)
Create or replace a custom resource which is non-namespaced object.Map<String,Object>
createOrReplace(String objectAsString)
Create or replace a custom resource which is a non-namespaced object.Map<String,Object>
createOrReplace(String namespace, InputStream objectAsStream)
Create or replace a custom resource which is namespaced object.Map<String,Object>
createOrReplace(String namespace, String objectAsString)
Create or replace a custom resource which is namespaced object.Map<String,Object>
createOrReplace(String namespace, Map<String,Object> customResourceObject)
Create or replace a custom resource which is namespaced object.Map<String,Object>
createOrReplace(Map<String,Object> customResourceObject)
Create or replace a custom resource which is a non-namespced object.Boolean
delete()
Deletes resource and all managed resources, returns null or false if not found.boolean
delete(String namespaceOrName)
Delete all Namespaced Scoped Custom Resources in a specified namespace OR Delete a Cluster Scoped Custom Resource with specified nameboolean
delete(String namespaceOrName, boolean cascading)
Delete all Namespaced Scoped Custom Resources in a specified namespace OR Delete a Cluster Scoped Custom Resource with specified nameboolean
delete(String namespaceOrName, io.fabric8.kubernetes.api.model.DeleteOptions deleteOptions)
Delete all Namespaced Scoped Custom Resources in a specified namespace OR Delete a Cluster Scoped Custom Resource with specified nameboolean
delete(String namespace, String name)
Delete a custom resource in a specific namespaceboolean
delete(String namespace, String name, boolean cascading)
Delete a custom resource in a specific namespaceboolean
delete(String namespace, String name, io.fabric8.kubernetes.api.model.DeleteOptions deleteOptions)
Delete a custom resource in a specific namespaceboolean
delete(String namespace, String name, String propagationPolicy)
Delete a custom resource in a specific namespaceRawCustomResourceOperationsImpl
dryRun(boolean isDryRun)
Indicates whether modifications should not be persisted or not.Map<String,Object>
edit(String objectAsString)
Edit a custom resource object.Map<String,Object>
edit(String name, String objectAsString)
Edit a custom resource object which is a non-namespaced object.Map<String,Object>
edit(String namespace, String name, String objectAsString)
Edit a custom resource object which is a namespaced object.Map<String,Object>
edit(String namespace, String name, Map<String,Object> object)
Edit a custom resource object which is a namespaced object.Map<String,Object>
edit(String name, Map<String,Object> object)
Edit a custom resource object which is a non-namespaced object.Map<String,Object>
edit(Map<String,Object> object)
Edit a custom resource object.protected okhttp3.HttpUrl.Builder
fetchWatchUrl(Map<String,String> labels, io.fabric8.kubernetes.api.model.ListOptions options)
Map<String,Object>
get()
Map<String,Object>
get(String name)
Get a custom resource from the cluster which is non-namespaced.Map<String,Object>
get(String namespace, String name)
Get a custom resource from the cluster which is namespaced.RawCustomResourceOperationsImpl
inAnyNamespace()
RawCustomResourceOperationsImpl
inNamespace(String namespace)
Map<String,Object>
list()
List all custom resources in all namespacesMap<String,Object>
list(io.fabric8.kubernetes.api.model.ListOptions listOptions)
List resource from Kubernetes API server.Map<String,Object>
list(Integer limitVal, String continueVal)
List resources from APIServer.Map<String,Object>
list(String namespace)
List all custom resources in a specific namespaceMap<String,Object>
list(String namespace, Map<String,String> labels)
List all custom resources in a specific namespace with some labelsMap<String,Object>
load(InputStream fileInputStream)
Load a custom resource object from an inputstream into a HashMapMap<String,Object>
load(String objectAsJsonString)
Load a custom resource object from a JSON string into a HashMapMap<String,Object>
updateStatus(InputStream objectAsInputStream)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourceMap<String,Object>
updateStatus(String objectAsJsonString)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourceMap<String,Object>
updateStatus(String name, InputStream objectAsStream)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourceMap<String,Object>
updateStatus(String name, String objectAsJsonString)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourceMap<String,Object>
updateStatus(String namespace, String name, InputStream objectAsStream)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourceMap<String,Object>
updateStatus(String namespace, String name, String objectAsJsonString)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourceMap<String,Object>
updateStatus(String namespace, String name, Map<String,Object> objectAsMap)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourceMap<String,Object>
updateStatus(String name, Map<String,Object> objectAsMap)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourceMap<String,Object>
updateStatus(Map<String,Object> objectAsMap)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related to the CustomResourcevoid
watch(Watcher<String> watcher)
Watchers custom resources across all namespaces.void
watch(String namespace, io.fabric8.kubernetes.api.model.ListOptions options, Watcher<String> watcher)
Watch a custom resource in a specific namespace with some resourceVersion.void
watch(String namespace, Watcher<String> watcher)
Watch custom resources in a specific namespace.void
watch(String namespace, String resourceVersion, Watcher<String> watcher)
Watch a custom resource in a specific namespace with some resourceVersion.Watch
watch(String namespace, String name, Map<String,String> labels, io.fabric8.kubernetes.api.model.ListOptions options, Watcher<String> watcher)
Watch custom resources in the parameters specified.Watch
watch(String namespace, String name, Map<String,String> labels, String resourceVersion, Watcher<String> watcher)
Watch custom resources in the parameters specified.Watch
watch(Map<String,String> labels, io.fabric8.kubernetes.api.model.ListOptions options, Watcher<String> watcher)
Watch custom resources in the parameters specified.RawCustomResourceOperationsImpl
withGracePeriod(long gracePeriodSeconds)
The duration in seconds before the object should be deleted.RawCustomResourceOperationsImpl
withName(String name)
RawCustomResourceOperationsImpl
withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
Whether and how garbage collection will be performed.-
Methods inherited from class io.fabric8.kubernetes.client.dsl.base.OperationSupport
assertResponseCode, checkName, checkNamespace, createStatus, createStatus, getAPIGroup, getAPIVersion, getConfig, getName, getNamespace, getNamespacedUrl, getNamespacedUrl, getNamespacedUrl, getObjectValueAsMap, getResourceT, getResourceUrl, getResourceUrl, getResourceURLForWriteOperation, getRootUrl, handleCreate, handleDelete, handleDelete, handleDeploymentRollback, handleGet, handleGet, handleMetric, handlePatch, handlePatch, handleReplace, handleReplace, handleResponse, handleResponse, handleResponse, handleResponse, handleScale, handleStatusUpdate, isResourceNamespaced, requestException, requestFailure, unmarshal, unmarshal, unmarshal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.fabric8.kubernetes.client.dsl.DryRunable
dryRun
-
-
-
-
Constructor Detail
-
RawCustomResourceOperationsImpl
public RawCustomResourceOperationsImpl(okhttp3.OkHttpClient client, Config config, CustomResourceDefinitionContext customResourceDefinition)
-
-
Method Detail
-
withName
public RawCustomResourceOperationsImpl withName(String name)
- Specified by:
withName
in interfaceNameable<RawCustomResourceOperationsImpl>
-
inNamespace
public RawCustomResourceOperationsImpl inNamespace(String namespace)
- Specified by:
inNamespace
in interfaceNamespaceable<RawCustomResourceOperationsImpl>
-
inAnyNamespace
public RawCustomResourceOperationsImpl inAnyNamespace()
- Specified by:
inAnyNamespace
in interfaceAnyNamespaceable<RawCustomResourceOperationsImpl>
-
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 interfaceGracePeriodConfigurable<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 interfacePropagationPolicyConfigurable<RawCustomResourceOperationsImpl>
- Parameters:
propagationPolicy
- propagation policy in form of stringDeletionPropagation
- 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 interfaceDryRunable<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 createdobjectAsStream
- 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 namespaceobjectAsString
- 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 namespacecustomResourceObject
- 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 namespaceobjectAsStream
- 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 resourceobject
- 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 resourceobjectAsString
- 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 namespacename
- name of the custom resourceobject
- 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 namespacename
- name of the custom resourceobjectAsString
- 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 resourceobjectAsMap
- 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 CustomResourceobjectAsJsonString
- 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 CustomResourcename
- name of CustomResourceobjectAsMap
- 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 CustomResourceobjectAsStream
- 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 CustomResourcename
- name of CustomResourceobjectAsStream
- 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 CustomResourcename
- name of CustomResourceobjectAsJsonString
- 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 namespacename
- 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.
-
list
public Map<String,Object> list(io.fabric8.kubernetes.api.model.ListOptions listOptions)
Description copied from interface:Listable
List resource from Kubernetes API server.
-
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 namespacelabels
- 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 nameNote: 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 nameNote: 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 nameNote: 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 namespacename
- 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 namespacename
- required name of custom resourcecascading
- 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 namespacename
- required name of custom resourcepropagationPolicy
- 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 namespacename
- name of custom resourcedeleteOptions
- 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.
-
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 watchwatcher
- 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 watchresourceVersion
- resource version since when to watchwatcher
- 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 watchoptions
-ListOptions
list options for watchingwatcher
- 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 (optionalname
- name of custom resource (optional)labels
- HashMap containing labels (optional)resourceVersion
- resource version to start watch fromwatcher
- 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 (optionalname
- name of custom resource (optional)labels
- HashMap containing labels (optional)options
-ListOptions
list options for watchwatcher
- 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 watchwatcher
- watcher object which reports events- Returns:
- watch object for watching resource
- Throws:
IOException
- in case of network error
-
fetchWatchUrl
protected okhttp3.HttpUrl.Builder fetchWatchUrl(Map<String,String> labels, io.fabric8.kubernetes.api.model.ListOptions options) throws MalformedURLException
- Throws:
MalformedURLException
-
-