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
    Constructor
    Description
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    create(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
    Creates specific Lease resource
    void
    createInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
    Creates specific Lease resource in Namespace specified by user
    void
    delete(String resourceName)
    Deletes Lease resource from Namespace in current context
    void
    deleteFromNamespace(String namespaceName, String resourceName)
    Deletes Lease resource from Namespace specified by user
    io.fabric8.kubernetes.client.dsl.MixedOperation<?,?,?>
    Get specific client for resoruce
    Kind of api resource
    void
    replace(String resourceName, Consumer<io.fabric8.kubernetes.api.model.coordination.v1.Lease> editor)
    Replaces Lease resource using Consumer from which is the current Lease resource updated
    void
    replaceInNamespace(String namespaceName, String resourceName, Consumer<io.fabric8.kubernetes.api.model.coordination.v1.Lease> editor)
    Replaces Lease resource in Namespace specified by user, using Consumer from which is the current Lease resource updated
    void
    update(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
    Updates specific Lease resource
    void
    updateInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
    Updates specific Lease resource in Namespace specified by user
    boolean
    waitForDeletion(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
    Waits for Lease to be deleted
    boolean
    waitForReadiness(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
    Waits for Lease to be ready (created/running)

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LeaseResource

      public LeaseResource()
      Constructor
  • Method Details

    • getKind

      public String getKind()
      Kind of api resource
      Specified by:
      getKind in interface ResourceType<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:
      getClient in interface NamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Specified by:
      getClient in interface ResourceType<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 specific Lease resource
      Specified by:
      create in interface ResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Parameters:
      resource - Lease resource
    • update

      public void update(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
      Updates specific Lease resource
      Specified by:
      update in interface ResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Parameters:
      resource - Lease resource that will be updated
    • delete

      public void delete(String resourceName)
      Deletes Lease resource from Namespace in current context
      Specified by:
      delete in interface ResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Parameters:
      resourceName - name of the Lease that will be deleted
    • replace

      public void replace(String resourceName, Consumer<io.fabric8.kubernetes.api.model.coordination.v1.Lease> editor)
      Replaces Lease resource using Consumer from which is the current Lease resource updated
      Specified by:
      replace in interface ResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Parameters:
      resourceName - name of the Lease that will be replaced
      editor - Consumer containing updates to the resource
    • waitForReadiness

      public boolean waitForReadiness(io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
      Waits for Lease to be ready (created/running)
      Specified by:
      waitForReadiness in interface ResourceType<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 for Lease to be deleted
      Specified by:
      waitForDeletion in interface ResourceType<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 specific Lease resource in Namespace specified by user
      Specified by:
      createInNamespace in interface NamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Parameters:
      namespaceName - Namespace, where the resource should be created
      resource - Lease resource
    • updateInNamespace

      public void updateInNamespace(String namespaceName, io.fabric8.kubernetes.api.model.coordination.v1.Lease resource)
      Updates specific Lease resource in Namespace specified by user
      Specified by:
      updateInNamespace in interface NamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Parameters:
      namespaceName - Namespace, where the resource should be updated
      resource - Lease updated resource
    • deleteFromNamespace

      public void deleteFromNamespace(String namespaceName, String resourceName)
      Deletes Lease resource from Namespace specified by user
      Specified by:
      deleteFromNamespace in interface NamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Parameters:
      namespaceName - Namespace, where the resource should be deleted
      resourceName - name of the Lease that will be deleted
    • replaceInNamespace

      public void replaceInNamespace(String namespaceName, String resourceName, Consumer<io.fabric8.kubernetes.api.model.coordination.v1.Lease> editor)
      Replaces Lease resource in Namespace specified by user, using Consumer from which is the current Lease resource updated
      Specified by:
      replaceInNamespace in interface NamespacedResourceType<io.fabric8.kubernetes.api.model.coordination.v1.Lease>
      Parameters:
      namespaceName - Namespace, where the resource should be replaced
      resourceName - name of the Lease that will be replaced
      editor - Consumer containing updates to the resource