Interface EditReplacePatchable<T>
-
- All Superinterfaces:
Updatable<T>
- All Known Subinterfaces:
CertificateSigningRequestResource<T>,EphemeralContainersResource,ExtensibleResource<T>,NamespaceableResource<T>,NonDeletingOperation<T>,PodResource,Resource<T>,RollableScalableResource<T>,ScalableResource<T>,ServiceAccountResource,ServiceResource<T>,V1beta1CertificateSigningRequestResource<T>,WritableOperation<T>
- All Known Implementing Classes:
ExtensibleResourceAdapter,ResourceAdapter
public interface EditReplacePatchable<T> extends Updatable<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Taccept(Consumer<T> function)Issues a JSON patch against the item based upon the changes made by the function provided as argumentTedit(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.<V> Tedit(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.Tedit(UnaryOperator<T> function)Issues a JSON patch against the item based upon the changes made to the object returned by the function.Tpatch()Update field(s) of a resource using a JSON patch which will be computed using the latest server state as the base.Tpatch(PatchContext patchContext)Update field(s) of a resource using type specified inPatchContext(defaults to strategic merge if not specified).Tpatch(PatchContext patchContext, String patch)Update field(s) of a resource using type specified inPatchContext(defaults to strategic merge if not specified).Tpatch(PatchContext patchContext, T item)Update field(s) of a resource using type specified inPatchContext(defaults to strategic merge if not specified).default Tpatch(String patch)Update field(s) of a resource using strategic merge patch.default Tpatch(T item)Update field(s) of a resource using a JSON patch.
-
-
-
Method Detail
-
edit
T edit(UnaryOperator<T> function)
Issues a JSON patch against the item based upon the changes made to the object returned by the function.It is generally convenient to use a Builder constructed off of the item.
- Parameters:
function- to modify the item- Returns:
- returns deserialized version of api server response
-
edit
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.- Parameters:
visitors- to modify the Builder- Returns:
- returns deserialized version of api server response
-
edit
<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.- Parameters:
visitorType- to create aTypedVisitorvisitor- to modify the Builder- Returns:
- returns deserialized version of api server response
-
accept
T accept(Consumer<T> function)
Issues a JSON patch against the item based upon the changes made by the function provided as argument- Parameters:
function- to modify the item- Returns:
- returns deserialized version of api server response
-
patch
default T patch(T item)
Update field(s) of a resource using a JSON patch. The patch is computed against the context item.It is the same as calling
patch(PatchContext, Object)withPatchType.JSONspecified.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()- Parameters:
item- to be patched with patched values- Returns:
- returns deserialized version of api server response
-
patch
T patch(PatchContext patchContext, T item)
Update field(s) of a resource using type specified inPatchContext(defaults to strategic merge if not specified).PatchType.JSON- will create a JSON patch against the current itemPatchType.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 thePatchContext.getFieldManager()as well to override the default.
ServerSideApplicable.serverSideApply()- Parameters:
item- to be patched with patched valuespatchContext-PatchContextfor patch request- Returns:
- returns deserialized version of api server response
-
patch
default T patch(String patch)
Update field(s) of a resource using strategic merge patch.- Parameters:
patch- The patch to be applied to the resource JSON file.- Returns:
- returns deserialized version of api server response
-
patch
T patch(PatchContext patchContext, String patch)
Update field(s) of a resource using type specified inPatchContext(defaults to strategic merge if not specified).- Parameters:
patchContext-PatchContextfor patch requestpatch- The patch to be applied to the resource JSON file.- Returns:
- updated object
-
patch
T patch()
Update field(s) of a resource using a JSON patch which will be computed using the latest server state as the base.It is the same as calling
patch(PatchContext)withPatchType.JSONspecified.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()- Returns:
- returns deserialized version of api server response
-
patch
T patch(PatchContext patchContext)
Update field(s) of a resource using type specified inPatchContext(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 basePatchType.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 thePatchContext.getFieldManager()as well to override the default.
ServerSideApplicable.serverSideApply()- Parameters:
patchContext-PatchContextfor patch request- Returns:
- returns deserialized version of api server response
-
-