Package io.skodjob.testframe.resources
Class LeaseResource
java.lang.Object
io.skodjob.testframe.resources.LeaseResource
- All Implemented Interfaces:
NamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>,ResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
public class LeaseResource
extends Object
implements NamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
Implementation of ResourceType for specific kubernetes resource
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Creates specificLeaseresourcevoidcreateInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Creates specificLeaseresource in Namespace specified by uservoidDeletesLeaseresource from Namespace in current contextvoiddeleteFromNamespace(String namespaceName, String resourceName) DeletesLeaseresource from Namespace specified by userio.fabric8.kubernetes.client.dsl.MixedOperation<?,?, ?> Get specific client for resorucegetKind()Kind of api resourcevoidreplace(String resourceName, Consumer<io.fabric8.kubernetes.api.model.coordination.v1.Lease> editor) voidreplaceInNamespace(String namespaceName, String resourceName, Consumer<io.fabric8.kubernetes.api.model.coordination.v1.Lease> editor) ReplacesLeaseresource in Namespace specified by user, usingConsumerfrom which is the currentLeaseresource updatedvoidupdate(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Updates specificLeaseresourcevoidupdateInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Updates specificLeaseresource in Namespace specified by userbooleanwaitForDeletion(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Waits forLeaseto be deletedbooleanwaitForReadiness(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Waits forLeaseto be ready (created/running)
-
Constructor Details
-
LeaseResource
public LeaseResource()Constructor
-
-
Method Details
-
getKind
Kind of api resource- Specified by:
getKindin interfaceResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Returns:
- kind name
-
getClient
public io.fabric8.kubernetes.client.dsl.MixedOperation<?,?, getClient()?> Get specific client for resoruce- Specified by:
getClientin interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Specified by:
getClientin interfaceResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Returns:
- specific client
-
create
public void create(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Creates specificLeaseresource- Specified by:
createin interfaceResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
resource-Leaseresource
-
update
public void update(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Updates specificLeaseresource- Specified by:
updatein interfaceResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
resource-Leaseresource that will be updated
-
delete
DeletesLeaseresource from Namespace in current context- Specified by:
deletein interfaceResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
resourceName- name of theLeasethat will be deleted
-
replace
public void replace(String resourceName, Consumer<io.fabric8.kubernetes.api.model.coordination.v1.Lease> editor) - Specified by:
replacein interfaceResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
resourceName- name of theLeasethat will be replacededitor-Consumercontaining updates to the resource
-
waitForReadiness
public boolean waitForReadiness(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Waits forLeaseto be ready (created/running)- Specified by:
waitForReadinessin interfaceResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
resource- resource- Returns:
- result of the readiness check
-
waitForDeletion
public boolean waitForDeletion(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Waits forLeaseto be deleted- Specified by:
waitForDeletionin interfaceResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
resource- resource- Returns:
- result of the deletion
-
createInNamespace
public void createInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Creates specificLeaseresource in Namespace specified by user- Specified by:
createInNamespacein interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
namespaceName- Namespace, where the resource should be createdresource-Leaseresource
-
updateInNamespace
public void updateInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.coordination.v1.Lease resource) Updates specificLeaseresource in Namespace specified by user- Specified by:
updateInNamespacein interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
namespaceName- Namespace, where the resource should be updatedresource-Leaseupdated resource
-
deleteFromNamespace
DeletesLeaseresource from Namespace specified by user- Specified by:
deleteFromNamespacein interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
namespaceName- Namespace, where the resource should be deletedresourceName- name of theLeasethat will be deleted
-
replaceInNamespace
public void replaceInNamespace(String namespaceName, String resourceName, Consumer<io.fabric8.kubernetes.api.model.coordination.v1.Lease> editor) ReplacesLeaseresource in Namespace specified by user, usingConsumerfrom which is the currentLeaseresource updated- Specified by:
replaceInNamespacein interfaceNamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>- Parameters:
namespaceName- Namespace, where the resource should be replacedresourceName- name of theLeasethat will be replacededitor-Consumercontaining updates to the resource
-