public class BaseOperation<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,D extends io.fabric8.kubernetes.api.model.Doneable<T>,R extends Resource<T,D>> extends OperationSupport implements OperationInfo, MixedOperation<T,L,D,R>, Resource<T,D>
| Modifier and Type | Field and Description |
|---|---|
protected String |
apiVersion |
protected Class<D> |
doneableType |
protected Class<L> |
listType |
protected Class<T> |
type |
apiGroupName, apiGroupVersion, client, config, context, JSON, JSON_MAPPER, JSON_PATCH, name, namespace, resourceT, YAML_MAPPER| Modifier | Constructor and Description |
|---|---|
protected |
BaseOperation(OperationContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
EditReplacePatchDeletable<T,T,D,Boolean> |
cascading(boolean cascading)
deletes dependent resources.
|
T |
create(T... resources) |
T |
create(T resource) |
D |
createNew() |
T |
createOrReplace(T... items) |
D |
createOrReplaceWithNew() |
Boolean |
delete()
Deletes resource and all managed resources, returns null or false if not found.
|
Boolean |
delete(List<T> items) |
Boolean |
delete(T... items) |
D |
edit() |
protected URL |
fetchListUrl(URL url,
io.fabric8.kubernetes.api.model.ListOptions listOptions) |
OperationInfo |
forOperationType(String type) |
Gettable<T> |
fromServer() |
T |
get() |
String |
getApiVersion() |
protected Class<? extends Config> |
getConfigType() |
Class<D> |
getDoneableType() |
String |
getFieldQueryParam() |
protected Map<String,String> |
getFields() |
protected Map<String,String[]> |
getFieldsNot() |
Long |
getGracePeriodSeconds() |
T |
getItem() |
String |
getKind() |
String |
getLabelQueryParam() |
protected Map<String,String> |
getLabels() |
protected Map<String,String[]> |
getLabelsIn() |
protected Map<String,String[]> |
getLabelsNot() |
protected Map<String,String[]> |
getLabelsNotIn() |
Class<L> |
getListType() |
T |
getMandatory() |
String |
getOperationType() |
io.fabric8.kubernetes.api.model.DeletionPropagation |
getPropagationPolicy() |
Boolean |
getReloadingFromServer()
Deprecated.
|
String |
getResourceT() |
String |
getResourceVersion() |
io.fabric8.kubernetes.api.model.RootPaths |
getRootPaths() |
Class<T> |
getType() |
protected T |
handleCreate(T resource) |
protected io.fabric8.kubernetes.api.model.Status |
handleDeploymentRollback(io.fabric8.kubernetes.api.model.extensions.DeploymentRollback deploymentRollback) |
protected T |
handleGet(URL resourceUrl) |
protected T |
handlePatch(T current,
T updated) |
protected T |
handleReplace(T updated) |
protected T |
handleResponse(okhttp3.Request.Builder requestBuilder) |
protected io.fabric8.kubernetes.api.model.autoscaling.v1.Scale |
handleScale(io.fabric8.kubernetes.api.model.autoscaling.v1.Scale scaleParam) |
NonNamespaceOperation<T,L,D,R> |
inAnyNamespace() |
NonNamespaceOperation<T,L,D,R> |
inNamespace(String namespace) |
boolean |
isApiGroup()
Return true if this is an API Group where the versions include a slash in them
|
Boolean |
isCascading() |
Boolean |
isReady() |
Boolean |
isReloadingFromServer() |
boolean |
isResourceNamespaced() |
L |
list() |
L |
list(Integer limitVal,
String continueVal)
List resources from APIServer.
|
L |
list(io.fabric8.kubernetes.api.model.ListOptions listOptions)
List resource from Kubernetes API server.
|
R |
load(File file)
Load from a
File. |
R |
load(InputStream is)
Load from an
InputStream. |
R |
load(String path)
Load from path.
|
R |
load(URL url)
Load from a
URL. |
Replaceable<T,T> |
lockResourceVersion(String resourceVersion) |
BaseOperation<T,L,D,R> |
newInstance(OperationContext context) |
T |
patch(T item) |
T |
replace(T item) |
T |
require() |
void |
setListType(Class<L> listType) |
void |
setNamespace(String namespace) |
void |
setType(Class<T> type) |
protected void |
updateApiVersion(io.fabric8.kubernetes.api.model.HasMetadata hasMetadata)
Updates the resource if it has missing or default apiGroupVersion values and the resource is currently
using API Groups with custom version strings
|
protected void |
updateApiVersion(io.fabric8.kubernetes.api.model.KubernetesResourceList list)
Updates the list items if they have missing or default apiGroupVersion values and the resource is currently
using API Groups with custom version strings
|
protected void |
updateApiVersionResource(Object resource)
Updates the list or single item if it has a missing or incorrect apiGroupVersion
|
T |
updateStatus(T item)
When the status subresource is enabled, the /status subresource for the custom resource is exposed.
|
T |
waitUntilCondition(Predicate<T> condition,
long amount,
TimeUnit timeUnit) |
protected T |
waitUntilExists(long amount,
TimeUnit timeUnit) |
T |
waitUntilReady(long amount,
TimeUnit timeUnit) |
Watch |
watch(String resourceVersion,
Watcher<T> watcher) |
Watch |
watch(Watcher<T> watcher) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withField(String key,
String value) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withFields(Map<String,String> fields) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withGracePeriod(long gracePeriodSeconds) |
BaseOperation<T,L,D,R> |
withItem(T item) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withLabel(String key) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withLabel(String key,
String value) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withLabelIn(String key,
String... values) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withLabelNotIn(String key,
String... values) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withLabels(Map<String,String> labels) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withLabelSelector(io.fabric8.kubernetes.api.model.LabelSelector selector) |
R |
withName(String name) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withoutField(String key,
String value) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withoutFields(Map<String,String> fields)
Deprecated.
|
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withoutLabel(String key) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withoutLabel(String key,
String value) |
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withoutLabels(Map<String,String> labels)
Deprecated.
|
FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> |
withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
Whether and how garbage collection will be performed.
|
Watchable<Watch,Watcher<T>> |
withResourceVersion(String resourceVersion) |
assertResponseCode, checkName, checkNamespace, createStatus, createStatus, getAPIGroup, getAPIVersion, getConfig, getName, getNamespace, getNamespacedUrl, getNamespacedUrl, getNamespacedUrl, getResourceUrl, getResourceUrl, getRootUrl, handleCreate, handleDelete, handleDelete, handleDeploymentRollback, handleGet, handleGet, handleMetric, handlePatch, handleReplace, handleReplace, handleResponse, handleResponse, handleResponse, handleResponse, handleScale, handleStatusUpdate, requestException, requestFailure, unmarshal, unmarshal, unmarshalclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, getNamespaceprotected String apiVersion
protected BaseOperation(OperationContext ctx)
public BaseOperation<T,L,D,R> newInstance(OperationContext context)
protected URL fetchListUrl(URL url, io.fabric8.kubernetes.api.model.ListOptions listOptions) throws MalformedURLException
MalformedURLExceptionpublic T get()
public T require() throws ResourceNotFoundException
require in interface Requirable<T>ResourceNotFoundException - if resource is absentpublic T getMandatory()
public io.fabric8.kubernetes.api.model.RootPaths getRootPaths()
public D edit() throws KubernetesClientException
edit in interface Editable<D extends io.fabric8.kubernetes.api.model.Doneable<T>>KubernetesClientExceptionpublic Replaceable<T,T> lockResourceVersion(String resourceVersion)
lockResourceVersion in interface Lockable<Replaceable<T,T>>public NonNamespaceOperation<T,L,D,R> inNamespace(String namespace)
inNamespace in interface Namespaceable<NonNamespaceOperation<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,D extends io.fabric8.kubernetes.api.model.Doneable<T>,R extends Resource<T,D>>>public NonNamespaceOperation<T,L,D,R> inAnyNamespace()
inAnyNamespace in interface AnyNamespaceable<FilterWatchListMultiDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>public EditReplacePatchDeletable<T,T,D,Boolean> cascading(boolean cascading)
Cascadingpublic R load(InputStream is)
LoadableInputStream.public Gettable<T> fromServer()
fromServer in interface FromServerable<Gettable<T>>public T create(T... resources) throws KubernetesClientException
create in interface Createable<T,T,D extends io.fabric8.kubernetes.api.model.Doneable<T>>KubernetesClientExceptionpublic D createNew() throws KubernetesClientException
createNew in interface Createable<T,T,D extends io.fabric8.kubernetes.api.model.Doneable<T>>KubernetesClientExceptionpublic D createOrReplaceWithNew() throws KubernetesClientException
createOrReplaceWithNew in interface CreateOrReplaceable<T,T,D extends io.fabric8.kubernetes.api.model.Doneable<T>>KubernetesClientExceptionpublic T createOrReplace(T... items)
createOrReplace in interface CreateOrReplaceable<T,T,D extends io.fabric8.kubernetes.api.model.Doneable<T>>public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withLabels(Map<String,String> labels)
withLabels in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withLabelSelector(io.fabric8.kubernetes.api.model.LabelSelector selector)
withLabelSelector in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>@Deprecated public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withoutLabels(Map<String,String> labels) throws KubernetesClientException
withoutLabels in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>KubernetesClientExceptionpublic FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withLabelIn(String key, String... values) throws KubernetesClientException
withLabelIn in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>KubernetesClientExceptionpublic FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withLabelNotIn(String key, String... values) throws KubernetesClientException
withLabelNotIn in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>KubernetesClientExceptionpublic FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withLabel(String key, String value)
withLabel in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withLabel(String key)
withLabel in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withoutLabel(String key, String value)
withoutLabel in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withoutLabel(String key)
withoutLabel in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withFields(Map<String,String> fields)
withFields in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withField(String key, String value)
withField in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>@Deprecated public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withoutFields(Map<String,String> fields) throws KubernetesClientException
withoutFields in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>KubernetesClientExceptionpublic FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withoutField(String key, String value)
withoutField in interface Filterable<FilterWatchListDeletable<T,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList,Boolean,Watch,Watcher<T>>>public String getLabelQueryParam()
public String getFieldQueryParam()
public L list() throws KubernetesClientException
list in interface Listable<L extends io.fabric8.kubernetes.api.model.KubernetesResourceList>KubernetesClientExceptionpublic L list(Integer limitVal, String continueVal)
Listablepublic L list(io.fabric8.kubernetes.api.model.ListOptions listOptions)
Listablepublic Boolean delete()
Deletablepublic Boolean delete(T... items)
delete in interface MultiDeleteable<T,Boolean>public Boolean delete(List<T> items)
delete in interface MultiDeleteable<T,Boolean>public T updateStatus(T item) throws KubernetesClientException
StatusUpdatableupdateStatus in interface StatusUpdatable<T>item - kubernetes objectKubernetesClientExceptionpublic Watchable<Watch,Watcher<T>> withResourceVersion(String resourceVersion)
withResourceVersion in interface Versionable<Watchable<Watch,Watcher<T>>>public Watch watch(Watcher<T> watcher) throws KubernetesClientException
public Watch watch(String resourceVersion, Watcher<T> watcher) throws KubernetesClientException
public boolean isResourceNamespaced()
isResourceNamespaced in class OperationSupportprotected T handleResponse(okhttp3.Request.Builder requestBuilder) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected T handleCreate(T resource) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected T handleReplace(T updated) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected T handlePatch(T current, T updated) throws ExecutionException, InterruptedException, KubernetesClientException, IOException
protected io.fabric8.kubernetes.api.model.autoscaling.v1.Scale handleScale(io.fabric8.kubernetes.api.model.autoscaling.v1.Scale scaleParam)
protected io.fabric8.kubernetes.api.model.Status handleDeploymentRollback(io.fabric8.kubernetes.api.model.extensions.DeploymentRollback deploymentRollback)
protected T handleGet(URL resourceUrl) throws InterruptedException, ExecutionException, IOException
public Boolean isCascading()
public T getItem()
public String getResourceVersion()
@Deprecated public Boolean getReloadingFromServer()
public Boolean isReloadingFromServer()
public Long getGracePeriodSeconds()
public io.fabric8.kubernetes.api.model.DeletionPropagation getPropagationPolicy()
public String getResourceT()
getResourceT in class OperationSupportpublic String getKind()
getKind in interface OperationInfopublic String getOperationType()
getOperationType in interface OperationInfopublic OperationInfo forOperationType(String type)
forOperationType in interface OperationInfopublic FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withGracePeriod(long gracePeriodSeconds)
withGracePeriod in interface GracePeriodConfigurable<Deletable<Boolean>>public FilterWatchListDeletable<T,L,Boolean,Watch,Watcher<T>> withPropagationPolicy(io.fabric8.kubernetes.api.model.DeletionPropagation propagationPolicy)
PropagationPolicyConfigurableThe 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<Deletable<Boolean>>propagationPolicy - propagation policy in form of string DeletionPropagationprotected void updateApiVersionResource(Object resource)
resource - resource objectprotected void updateApiVersion(io.fabric8.kubernetes.api.model.KubernetesResourceList list)
list - Kubernetes resource listprotected void updateApiVersion(io.fabric8.kubernetes.api.model.HasMetadata hasMetadata)
hasMetadata - object whose api version needs to be updatedpublic String getApiVersion()
public boolean isApiGroup()
protected T waitUntilExists(long amount, TimeUnit timeUnit) throws InterruptedException
InterruptedExceptionpublic T waitUntilReady(long amount, TimeUnit timeUnit) throws InterruptedException
waitUntilReady in interface Waitable<T,T>InterruptedExceptionpublic T waitUntilCondition(Predicate<T> condition, long amount, TimeUnit timeUnit) throws InterruptedException
waitUntilCondition in interface Waitable<T,T>InterruptedExceptionpublic void setNamespace(String namespace)
Copyright © 2015–2020 Red Hat. All rights reserved.