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
apiGroupName, apiGroupVersion, client, config, context, dryRun, JSON, JSON_MAPPER, JSON_PATCH, name, namespace, resourceT, STRATEGIC_MERGE_JSON_PATCH, YAML_MAPPER
Constructor and Description |
---|
RawCustomResourceOperationsImpl(okhttp3.OkHttpClient client,
Config config,
CustomResourceDefinitionContext customResourceDefinition) |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
create(InputStream objectAsStream)
Create a custom resource which is non-namespaced object.
|
Map<String,Object> |
create(Map<String,Object> object)
Create a custom resource which is non-namespaced.
|
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,
Map<String,Object> object)
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> |
createOrReplace(InputStream inputStream)
Create or replace a custom resource which is non-namespaced object.
|
Map<String,Object> |
createOrReplace(Map<String,Object> customResourceObject)
Create or replace a custom resource which is a non-namespced 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,
Map<String,Object> customResourceObject)
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.
|
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 name
|
boolean |
delete(String namespaceOrName,
boolean cascading)
Delete all Namespaced Scoped Custom Resources in a specified namespace
OR
Delete a Cluster Scoped Custom Resource with specified name
|
boolean |
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 name
|
boolean |
delete(String namespace,
String name)
Delete a custom resource in a specific namespace
|
boolean |
delete(String namespace,
String name,
boolean cascading)
Delete a custom resource in a specific namespace
|
boolean |
delete(String namespace,
String name,
io.fabric8.kubernetes.api.model.DeleteOptions deleteOptions)
Delete a custom resource in a specific namespace
|
boolean |
delete(String namespace,
String name,
String propagationPolicy)
Delete a custom resource in a specific namespace
|
RawCustomResourceOperationsImpl |
dryRun(boolean isDryRun)
Indicates whether modifications should not be persisted or not.
|
Map<String,Object> |
edit(Map<String,Object> object)
Edit a custom resource object.
|
Map<String,Object> |
edit(String objectAsString)
Edit a custom resource 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(String name,
String objectAsString)
Edit a custom resource object which is a non-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 namespace,
String name,
String objectAsString)
Edit a custom resource object which is a namespaced 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 namespaces
|
Map<String,Object> |
list(Integer limitVal,
String continueVal)
List resources from APIServer.
|
Map<String,Object> |
list(io.fabric8.kubernetes.api.model.ListOptions listOptions)
List resource from Kubernetes API server.
|
Map<String,Object> |
list(String namespace)
List all custom resources in a specific namespace
|
Map<String,Object> |
list(String namespace,
Map<String,String> labels)
List all custom resources in a specific namespace with some labels
|
Map<String,Object> |
load(InputStream fileInputStream)
Load a custom resource object from an inputstream into a HashMap
|
Map<String,Object> |
load(String objectAsJsonString)
Load a custom resource object from a JSON string into a HashMap
|
Map<String,Object> |
updateStatus(InputStream objectAsInputStream)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related
to the CustomResource
|
Map<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 CustomResource
|
Map<String,Object> |
updateStatus(String objectAsJsonString)
Update status related to a CustomResource, this method does a PUT request on /status endpoint related
to the CustomResource
|
Map<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 CustomResource
|
Map<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 CustomResource
|
Map<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 CustomResource
|
Map<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 CustomResource
|
Map<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 CustomResource
|
Map<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 CustomResource
|
Watch |
watch(Map<String,String> labels,
io.fabric8.kubernetes.api.model.ListOptions options,
Watcher<String> watcher)
Watch custom resources in the parameters specified.
|
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.
|
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.
|
void |
watch(String namespace,
String resourceVersion,
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(Watcher<String> watcher)
Watchers custom resources across all namespaces.
|
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.
|
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dryRun
public RawCustomResourceOperationsImpl(okhttp3.OkHttpClient client, Config config, CustomResourceDefinitionContext customResourceDefinition)
public RawCustomResourceOperationsImpl withName(String name)
withName
in interface Nameable<RawCustomResourceOperationsImpl>
public RawCustomResourceOperationsImpl inNamespace(String namespace)
inNamespace
in interface Namespaceable<RawCustomResourceOperationsImpl>
public RawCustomResourceOperationsImpl inAnyNamespace()
inAnyNamespace
in interface AnyNamespaceable<RawCustomResourceOperationsImpl>
public RawCustomResourceOperationsImpl withGracePeriod(long gracePeriodSeconds)
GracePeriodConfigurable
withGracePeriod
in interface GracePeriodConfigurable<RawCustomResourceOperationsImpl>
gracePeriodSeconds
- grace period integer value in secondspublic RawCustomResourceOperationsImpl withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
PropagationPolicyConfigurable
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.
withPropagationPolicy
in interface PropagationPolicyConfigurable<RawCustomResourceOperationsImpl>
propagationPolicy
- propagation policy in form of string DeletionPropagation
public RawCustomResourceOperationsImpl dryRun(boolean isDryRun)
DryRunable
dryRun
in interface DryRunable<RawCustomResourceOperationsImpl>
isDryRun
- whether dry run is enabled or disabledpublic Map<String,Object> load(InputStream fileInputStream) throws IOException
fileInputStream
- file input streamIOException
- exception in case any read operation fails.public Map<String,Object> load(String objectAsJsonString) throws IOException
objectAsJsonString
- object as JSON stringIOException
- exception in case any problem in reading json.public Map<String,Object> create(String objectAsString) throws IOException
objectAsString
- object as JSON stringIOException
- exception in case of any network/read problemspublic Map<String,Object> create(Map<String,Object> object) throws IOException
object
- object a HashMapIOException
- in case of problems while reading HashMappublic Map<String,Object> create(String namespace, String objectAsString) throws IOException
namespace
- namespace in which we want object to be created.objectAsString
- Object as JSON stringIOException
- in case of problems while reading JSON objectpublic Map<String,Object> create(InputStream objectAsStream) throws IOException
objectAsStream
- object as a file input streamIOException
- in case of problems while reading filepublic Map<String,Object> create(String namespace, InputStream objectAsStream) throws IOException
namespace
- namespace in which we want object to be createdobjectAsStream
- object as file input streamIOException
- in case of problems while reading filepublic Map<String,Object> create(String namespace, Map<String,Object> object) throws IOException
namespace
- namespace in which we want object to be created.object
- object as a HashMapIOException
- in case of problems faced while serializing HashMappublic Map<String,Object> createOrReplace(String objectAsString) throws IOException
objectAsString
- object as JSON stringIOException
- in case of network/serializiation failures or failures from Kuberntes APIpublic Map<String,Object> createOrReplace(Map<String,Object> customResourceObject) throws IOException
customResourceObject
- object as HashMapIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> createOrReplace(InputStream inputStream) throws IOException
inputStream
- object as file input streamIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> createOrReplace(String namespace, String objectAsString) throws IOException
namespace
- desired namespaceobjectAsString
- object as JSON StringIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> createOrReplace(String namespace, Map<String,Object> customResourceObject) throws IOException
namespace
- desired namespacecustomResourceObject
- object as HashMapIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> createOrReplace(String namespace, InputStream objectAsStream) throws IOException
namespace
- desired namespaceobjectAsStream
- object as file input streamIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> edit(String name, Map<String,Object> object) throws IOException
name
- name of the custom resourceobject
- new object as a HashMapIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> edit(String name, String objectAsString) throws IOException
name
- name of the custom resourceobjectAsString
- new object as a JSON StringIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> edit(String namespace, String name, Map<String,Object> object) throws IOException
namespace
- desired namespacename
- name of the custom resourceobject
- new object as a HashMapIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> edit(String namespace, String name, String objectAsString) throws IOException
namespace
- desired namespacename
- name of the custom resourceobjectAsString
- new object as a JSON stringIOException
- in case of network/serialization failures or failures from Kubernetes APIpublic Map<String,Object> edit(String objectAsString) throws IOException
objectAsString
- new object as JSON stringIOException
- in case of network/serializatino failures or failures from Kubernetes APIpublic Map<String,Object> edit(Map<String,Object> object) throws IOException
object
- new object as MapIOException
- in case of network/serializatino failures or failures from Kubernetes APIpublic Map<String,Object> updateStatus(String name, Map<String,Object> objectAsMap) throws IOException
name
- name of custom resourceobjectAsMap
- custom resource as a HashMapIOException
- in case any failure to parse Mappublic Map<String,Object> updateStatus(String name, String objectAsJsonString) throws IOException
name
- name of CustomResourceobjectAsJsonString
- CustomResource as a JSON stringIOException
- in case any failure to parse Mappublic Map<String,Object> updateStatus(String namespace, String name, Map<String,Object> objectAsMap) throws IOException
namespace
- namespace of CustomResourcename
- name of CustomResourceobjectAsMap
- CustomResource as a HashMapIOException
- in case any failure to parse Mappublic Map<String,Object> updateStatus(String name, InputStream objectAsStream) throws IOException
name
- name of CustomResourceobjectAsStream
- stream pointing to CustomResourceIOException
- in case any failure to parse Mappublic Map<String,Object> updateStatus(String namespace, String name, InputStream objectAsStream) throws IOException
namespace
- namespace of CustomResourcename
- name of CustomResourceobjectAsStream
- CustomResource object as a streamIOException
- in case any failure to parse Mappublic Map<String,Object> updateStatus(String namespace, String name, String objectAsJsonString) throws IOException
namespace
- namespace of CustomResourcename
- name of CustomResourceobjectAsJsonString
- CustomResource object as a JSON stringIOException
- in case any failure to parse Mappublic Map<String,Object> updateStatus(String objectAsJsonString) throws IOException
objectAsJsonString
- CustomResource object as a JSON stringIOException
- in case any failures to parse provided object or failure from Kubernetes APIpublic Map<String,Object> updateStatus(Map<String,Object> objectAsMap) throws IOException
objectAsMap
- CustomResource object as a HashMapIOException
- in case any failures to parse provided object or failure from Kubernetes APIpublic Map<String,Object> updateStatus(InputStream objectAsInputStream) throws IOException
objectAsInputStream
- CustomResource object as a InputStreamIOException
- in case any failures to parse provided object or failure from Kubernetes APIpublic Map<String,Object> get(String name)
name
- name of custom resourcepublic Map<String,Object> get(String namespace, String name)
namespace
- desired namespacename
- name of custom resourcepublic Map<String,Object> list(Integer limitVal, String continueVal)
Listable
public Map<String,Object> list(io.fabric8.kubernetes.api.model.ListOptions listOptions)
Listable
public Map<String,Object> list(String namespace)
namespace
- desired namespacepublic Map<String,Object> list(String namespace, Map<String,String> labels)
namespace
- desired namespacelabels
- labels as a HashMappublic boolean delete(String namespaceOrName)
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
namespaceOrName
- desired namespace(if CRD is Namespaced) or name(If CRD is Cluster)public boolean delete(String namespaceOrName, boolean cascading) throws IOException
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
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.IOException
- in case of any network/parsing exceptionpublic boolean delete(String namespaceOrName, io.fabric8.kubernetes.api.model.DeleteOptions deleteOptions) throws IOException
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
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-metaIOException
- in case of any network/object parse problemspublic boolean delete(String namespace, String name) throws IOException
namespace
- desired namespacename
- custom resource's nameIOException
- in case of any network/object parse problemspublic boolean delete(String namespace, String name, boolean cascading) throws IOException
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.IOException
- exception related to network/object parsingpublic boolean delete(String namespace, String name, String propagationPolicy) throws IOException
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.IOException
- in case of network/object parse exceptionpublic boolean delete(String namespace, String name, io.fabric8.kubernetes.api.model.DeleteOptions deleteOptions) throws IOException
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-metaIOException
- in case of any network/object parse exceptionpublic Boolean delete()
Deletable
public void watch(String namespace, Watcher<String> watcher) throws IOException
namespace
- namespace to watchwatcher
- watcher object which reports updates with objectIOException
- in case of network errorpublic void watch(String namespace, String resourceVersion, Watcher<String> watcher) throws IOException
namespace
- namespace to watchresourceVersion
- resource version since when to watchwatcher
- watcher object which reports updatesIOException
- in case of network errorpublic void watch(String namespace, io.fabric8.kubernetes.api.model.ListOptions options, Watcher<String> watcher) throws IOException
namespace
- namespace to watchoptions
- ListOptions
list options for watchingwatcher
- watcher object which reports updatesIOException
- in case of network errorpublic void watch(Watcher<String> watcher) throws IOException
watcher
- watcher object which reports eventsIOException
- in case of network errorpublic Watch watch(String namespace, String name, Map<String,String> labels, String resourceVersion, Watcher<String> watcher) throws IOException
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 eventsIOException
- in case of network errorpublic Watch watch(String namespace, String name, Map<String,String> labels, io.fabric8.kubernetes.api.model.ListOptions options, Watcher<String> watcher) throws IOException
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 eventsIOException
- in case of network errorpublic Watch watch(Map<String,String> labels, io.fabric8.kubernetes.api.model.ListOptions options, Watcher<String> watcher) throws IOException
labels
- HashMap containing labels (optional)options
- ListOptions
list options for watchwatcher
- watcher object which reports eventsIOException
- in case of network errorprotected okhttp3.HttpUrl.Builder fetchWatchUrl(Map<String,String> labels, io.fabric8.kubernetes.api.model.ListOptions options) throws MalformedURLException
MalformedURLException
Copyright © 2015–2021 Red Hat. All rights reserved.