public interface EditReplacePatchable<T> extends Replaceable<T>
| Modifier and Type | Method and Description |
|---|---|
T |
accept(Consumer<T> function)
Issues a JSON patch against the item based upon the changes made by the function provided as argument
|
<V> T |
edit(Class<V> visitorType,
io.fabric8.kubernetes.api.builder.Visitor<V> visitor)
Issues a JSON patch against the item based upon the changes made to the object by the visitor.
|
T |
edit(UnaryOperator<T> function)
Issues a JSON patch against the item based upon the changes made to the object returned by the function.
|
T |
edit(io.fabric8.kubernetes.api.builder.Visitor... visitors)
Issues a JSON patch against the item based upon the changes made to the object by the visitors.
|
T |
editStatus(UnaryOperator<T> function)
Edit the status subresource
|
T |
patch()
Update field(s) of a resource using a JSON patch which will be computed using the latest
server state as the base.
|
T |
patch(PatchContext patchContext)
Update field(s) of a resource using type specified in
PatchContext(defaults to strategic merge if not specified). |
T |
patch(PatchContext patchContext,
String patch)
Update field(s) of a resource using type specified in
PatchContext(defaults to strategic merge if not specified). |
T |
patch(PatchContext patchContext,
T item)
Update field(s) of a resource using type specified in
PatchContext(defaults to strategic merge if not specified). |
default T |
patch(String patch)
Update field(s) of a resource using strategic merge patch.
|
default T |
patch(T item)
Update field(s) of a resource using a JSON patch.
|
T |
patchStatus()
Does a PATCH request to the /status subresource ignoring changes to anything except the status stanza.
|
replace, replaceStatus, update, updateStatusT edit(UnaryOperator<T> function)
It is generally convenient to use a Builder constructed off of the item.
function - to modify the itemT edit(io.fabric8.kubernetes.api.builder.Visitor... visitors)
visitors - to modify the Builder<V> T edit(Class<V> visitorType, io.fabric8.kubernetes.api.builder.Visitor<V> visitor)
visitorType - to create a TypedVisitorvisitor - to modify the BuilderT accept(Consumer<T> function)
function - to modify the itemdefault T patch(T item)
It is the same as calling patch(PatchContext, Object) with PatchType.JSON specified.
WARNING: If no context item is available the latest version of that resource will be used as the base to compute the diff. If you did not intend for the latest version to be your base, this may overwrite concurrent changes (between when you obtained your item and the current state) in an unexpected way.
Consider using edit, which allows for a known base, and a builder instead.
WARNING: For some resource types there is an attempt to make this operation more like
an apply by considering implicit server side state as not being part of the patch. This behavior will be
removed in future versions, you should instead construct the resource to be patched from a resource obtained
from the api server or use patch method that is tolerant to missing state, or
ServerSideApplicable.serverSideApply()
item - to be patched with patched valuesT patch(PatchContext patchContext, T item)
PatchContext(defaults to strategic merge if not specified).
PatchType.JSON - will create a JSON patch against the current item
PatchType.JSON_MERGE - will send the serialization of the item as a JSON MERGE patch.
Set the resourceVersion to null to prevent optimistic locking.
PatchType.STRATEGIC_MERGE - will send the serialization of the item as a STRATEGIC MERGE patch.
Set the resourceVersion to null to prevent optimistic locking.
PatchType.SERVER_SIDE_APPLY - will send the serialization of the item as a SERVER SIDE APPLY patch.
You may explicitly set the PatchContext.getFieldManager() as well to override the default.
ServerSideApplicable.serverSideApply()
item - to be patched with patched valuespatchContext - PatchContext for patch requestdefault T patch(String patch)
patch - The patch to be applied to the resource JSON file.T patch(PatchContext patchContext, String patch)
PatchContext(defaults to strategic merge if not specified).patchContext - PatchContext for patch requestpatch - The patch to be applied to the resource JSON file.T editStatus(UnaryOperator<T> function)
function - to produce a modified statusT patchStatus()
This method has the same patching behavior as patch(PatchContext), with
PatchType.JSON_MERGE but against the status subresource.
Set the resourceVersion to null to prevent optimistic locking.
T patch()
It is the same as calling patch(PatchContext) with PatchType.JSON specified.
WARNING: If you did not intend for the latest version to be your base, this may overwrite concurrent changes (between when you obtained your item and the current state) in an unexpected way.
Consider using edit instead.
WARNING: For some resource types there is an attempt to make this operation more like
an apply by considering implicit server side state as not being part of the patch. This behavior will be
removed in future versions, you should instead construct the resource to be patched from a resource obtained
from the api server or use patch method that is tolerant to missing state, or
ServerSideApplicable.serverSideApply()
T patch(PatchContext patchContext)
PatchContext(defaults to strategic merge if not specified).
For use when you are providing a complete object to be patched: resource(item).patch(PatchContext.of(PatchType.SERVER_SIDE_APPLY))
PatchType.JSON - will create a JSON patch using the latest server state as the base
PatchType.JSON_MERGE - will send the serialization of the item as a JSON MERGE patch.
Set the resourceVersion to null to prevent optimistic locking.
PatchType.STRATEGIC_MERGE - will send the serialization of the item as a STRATEGIC MERGE patch.
Set the resourceVersion to null to prevent optimistic locking.
PatchType.SERVER_SIDE_APPLY - will send the serialization of the item as a SERVER SIDE APPLY patch.
You may explicitly set the PatchContext.getFieldManager() as well to override the default.
ServerSideApplicable.serverSideApply()
patchContext - PatchContext for patch requestCopyright © 2015–2023 Red Hat. All rights reserved.