public abstract class RollableScalableResourceOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,R extends Resource<T>> extends HasMetadataOperation<T,L,R> implements RollableScalableResource<T>, TimeoutImageEditReplacePatchable<T>
Modifier and Type | Field and Description |
---|---|
protected RollingOperationContext |
rollingOperationContext |
DEFAULT_GRACE_PERIOD_IN_SECONDS, DEFAULT_PROPAGATION_POLICY
apiVersion, listType
type
apiGroupName, apiGroupVersion, config, context, dryRun, httpClient, JSON, JSON_MAPPER, JSON_MERGE_PATCH, JSON_PATCH, name, namespace, resourceT, STRATEGIC_MERGE_JSON_PATCH, YAML_MAPPER
DEFAULT_BACKOFF_MULTIPLIER, DEFAULT_INITIAL_BACKOFF_MILLIS
POLL_INTERVAL_MS
Modifier | Constructor and Description |
---|---|
protected |
RollableScalableResourceOperation(RollingOperationContext context,
OperationContext superContext,
Class<T> type,
Class<L> listType) |
Modifier and Type | Method and Description |
---|---|
T |
edit(UnaryOperator<T> function)
Issues a JSON patch against the item based upon the changes made to the object returned by the function.
|
protected abstract int |
getCurrentReplicas(T current) |
protected abstract int |
getDesiredReplicas(T item) |
String |
getLog()
Get logs of a resource
|
protected abstract long |
getObservedGeneration(T current) |
protected abstract RollingUpdater<T,L> |
getRollingUpdater(long rollingTimeout,
TimeUnit rollingTimeUnit) |
Loggable<LogWatch> |
inContainer(String id)
Get logs of a specific container
|
abstract RollableScalableResourceOperation<T,L,R> |
newInstance(RollingOperationContext context) |
T |
patch(PatchContext patchContext,
T item)
Update field(s) of a resource using type specified in
PatchContext (defaults to strategic merge if not specified). |
T |
replace(T t)
Replace the server's state with the given item.
|
TimeoutImageEditReplacePatchable<T> |
rolling() |
io.fabric8.kubernetes.api.model.autoscaling.v1.Scale |
scale() |
T |
scale(int count)
Scale the resource to given count
|
T |
scale(int count,
boolean wait)
Scale the resource to given count
|
io.fabric8.kubernetes.api.model.autoscaling.v1.Scale |
scale(io.fabric8.kubernetes.api.model.autoscaling.v1.Scale scaleParam) |
LogWatch |
watchLog()
Watch logs of a resource
|
Loggable<LogWatch> |
withLogWaitTimeout(Integer logWaitTimeout)
While waiting for Pod logs, how long shall we wait until a Pod
becomes ready and starts producing logs
|
protected abstract T |
withReplicas(int count) |
ImageEditReplacePatchable<T> |
withTimeout(long timeout,
TimeUnit unit) |
ImageEditReplacePatchable<T> |
withTimeoutInMillis(long timeoutInMillis) |
accept, createVisitableBuilder, edit, editStatus, modifyItemForReplaceOrPatch, newInstance, patch, patch, patchStatus, replace, replaceStatus, requireFromServer, requireFromServer, validateOperation
appendListOptionParams, cascading, createOrReplace, delete, delete, delete, dryRun, edit, fetchListUrl, forOperationType, fromServer, get, getConfigType, getFieldQueryParam, getGracePeriodSeconds, getGroup, getItem, getKind, getLabelQueryParam, getListType, getMandatory, getOperationType, getPlural, getPropagationPolicy, getReadiness, getResourceVersion, getVersion, handleCreate, handleDeploymentRollback, handleGet, handlePatch, handlePatch, handleResponse, handleScale, handleUpdate, inAnyNamespace, inform, informOnCondition, inNamespace, isCascading, isReady, isReloadingFromServer, isResourceNamespaced, list, list, list, load, load, load, load, lockResourceVersion, require, runnableInformer, sendPatchedObject, setListType, setNamespace, setType, updateApiVersion, updateApiVersion, updateStatus, waitUntilCondition, waitUntilReady, watch, watch, watch, withField, withFields, withGracePeriod, withIndexers, withInvolvedObject, withItem, withLabel, withLabelIn, withLabelNotIn, withLabels, withLabelSelector, withLabelSelector, withName, withNewFilter, withoutField, withoutFields, withoutLabel, withoutLabels, withPropagationPolicy, withResourceVersion, withWaitRetryBackoff
create, create, getType
assertResponseCode, checkName, checkNamespace, createStatus, createStatus, getAPIGroupName, getAPIGroupVersion, getConfig, getName, getNamespace, getNamespacedUrl, getNamespacedUrl, getNamespacedUrl, getObjectValueAsMap, getResourceT, getResourceUrl, getResourceUrl, getResourceUrl, getResourceURLForPatchOperation, getResourceURLForWriteOperation, getRootUrl, handleCreate, handleDelete, handleDelete, handleDeploymentRollback, handleGet, handleGet, handleMetric, handlePatch, handlePatch, handlePatch, handleRawGet, handleResponse, handleResponse, handleResponse, handleResponse, handleScale, handleUpdate, handleUpdate, requestException, requestException, requestFailure, requestFailure, restCall, retryWithExponentialBackoff, unmarshal, unmarshal, unmarshal
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createOrReplace
fromServer
updateStatus
editStatus
replaceStatus
patchStatus
withGracePeriod
withPropagationPolicy
lockResourceVersion
waitUntilCondition, waitUntilReady, withWaitRetryBackoff
withResourceVersion
dryRun, dryRun
require
inform, inform, inform, informOnCondition, runnableInformer, withIndexers
create, create
getLog, getLogReader, watchLog
pause, restart, resume, undo, updateImage, updateImage
getFullResourceName, getName, getNamespace
withLabel, withoutLabel
getNamespace
protected final RollingOperationContext rollingOperationContext
protected RollableScalableResourceOperation(RollingOperationContext context, OperationContext superContext, Class<T> type, Class<L> listType)
protected abstract T withReplicas(int count)
protected abstract RollingUpdater<T,L> getRollingUpdater(long rollingTimeout, TimeUnit rollingTimeUnit)
protected abstract int getCurrentReplicas(T current)
protected abstract int getDesiredReplicas(T item)
protected abstract long getObservedGeneration(T current)
public T scale(int count)
Scaleable
public T scale(int count, boolean wait)
Scaleable
public io.fabric8.kubernetes.api.model.autoscaling.v1.Scale scale()
public io.fabric8.kubernetes.api.model.autoscaling.v1.Scale scale(io.fabric8.kubernetes.api.model.autoscaling.v1.Scale scaleParam)
public T edit(UnaryOperator<T> function)
Editable
It is generally convenient to use a Builder constructed off of the item.
edit
in interface Editable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
edit
in class HasMetadataOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,R extends Resource<T>>
function
- to modify the itempublic T replace(T t)
Replaceable
If Lockable.lockResourceVersion(String)
has been used to lock the resourceVersion,
this operation is effectively a single update attempt against that version.
If Lockable.lockResourceVersion(String)
has not been called, this operation
will be retried a number of times in the event of a conflict. If a resourceVersion has been set
on the item, the first update attempt will be made against that version. Subsequent attempts will fetch
the latest resourceVersion from the server.
replace
in interface Replaceable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
replace
in class HasMetadataOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,R extends Resource<T>>
t
- with the replacement statepublic T patch(PatchContext patchContext, T item)
Patchable
PatchContext
(defaults to strategic merge if not specified).
PatchType.JSON
- will create a JSON patch against the current item.
WARNING: This may overwrite concurrent changes (between when you obtained your item and the current state) in an unexpected way.
Consider using edit instead. The resourceVersion and other fields of the item may be modified by this call.
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.
patch
in interface Patchable<T extends io.fabric8.kubernetes.api.model.HasMetadata>
patch
in class HasMetadataOperation<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>,R extends Resource<T>>
patchContext
- PatchContext
for patch requestitem
- to be patched with patched valuespublic abstract RollableScalableResourceOperation<T,L,R> newInstance(RollingOperationContext context)
public Loggable<LogWatch> withLogWaitTimeout(Integer logWaitTimeout)
Loggable
withLogWaitTimeout
in interface Loggable<LogWatch>
logWaitTimeout
- timeout in millisecondsLoggable
for fetching logspublic Loggable<LogWatch> inContainer(String id)
Containerable
inContainer
in interface Containerable<String,Loggable<LogWatch>>
id
- container for which we want logspublic TimeoutImageEditReplacePatchable<T> rolling()
rolling
in interface Rollable<TimeoutImageEditReplacePatchable<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
public ImageEditReplacePatchable<T> withTimeoutInMillis(long timeoutInMillis)
withTimeoutInMillis
in interface Timeoutable<ImageEditReplacePatchable<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
public ImageEditReplacePatchable<T> withTimeout(long timeout, TimeUnit unit)
withTimeout
in interface Timeoutable<ImageEditReplacePatchable<T extends io.fabric8.kubernetes.api.model.HasMetadata>>
Copyright © 2015–2020 Red Hat. All rights reserved.