Package dev.strela.v1
Class KubernetesCrudRepository<R extends io.fabric8.kubernetes.client.CustomResource>
java.lang.Object
dev.strela.v1.KubernetesCrudRepository<R>
- Type Parameters:
R- the type of the custom resource
- Direct Known Subclasses:
MinecraftDeployments,MinecraftServers,MinecraftServerSets,MinecraftStatefulSets
public abstract class KubernetesCrudRepository<R extends io.fabric8.kubernetes.client.CustomResource>
extends Object
A repository for Kubernetes custom resources
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA builder for a resource informer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final io.fabric8.kubernetes.client.KubernetesClient -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedKubernetesCrudRepository(Class<R> customResourceClass, io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, String defaultNamespace) Creates a new KubernetesCrudRepository -
Method Summary
Modifier and TypeMethodDescriptionCreates a new resourceCreates a new resourceCreates an informer builder for a resource in the default namespacecreateInformer(String namespace) Creates an informer builder for a resourceDeletes a resourceDeletes a resourceGets a resourceGets a resourcelist()Lists all resourcesLists all resourcesUpdates a resourceUpdates a resourceUpdates a resourceUpdates a resource
-
Field Details
-
customResourceClass
-
kubernetesClient
protected final io.fabric8.kubernetes.client.KubernetesClient kubernetesClient -
defaultNamespace
-
-
Constructor Details
-
KubernetesCrudRepository
protected KubernetesCrudRepository(Class<R> customResourceClass, io.fabric8.kubernetes.client.KubernetesClient kubernetesClient, String defaultNamespace) Creates a new KubernetesCrudRepository- Parameters:
customResourceClass- the class of the custom resourcekubernetesClient- the Kubernetes clientdefaultNamespace- the default namespace
-
-
Method Details
-
create
Creates a new resource- Parameters:
resource- the resource to create- Returns:
- a future that will be completed when the resource is created. The future will contain the created resource
-
create
Creates a new resource- Parameters:
namespace- the namespace to create the resource inresource- the resource to create- Returns:
- a future that will be completed when the resource is created. The future will contain the created resource
-
update
Updates a resource- Parameters:
resource- the resource to update- Returns:
- a future that will be completed when the resource is updated. The future will contain the updated resource
-
update
Updates a resource- Parameters:
namespace- the namespace to update the resource inresource- the resource to update- Returns:
- a future that will be completed when the resource is updated. The future will contain the updated resource
-
update
Updates a resource- Parameters:
name- the name of the resource to updateupdater- a function that will be called with the resource to update- Returns:
- a future that will be completed when the resource is updated. The future will contain the updated resource
-
update
Updates a resource- Parameters:
namespace- the namespace to update the resource inname- the name of the resource to updateupdater- a function that will be called with the resource to update- Returns:
- a future that will be completed when the resource is updated. The future will contain the updated resource
-
get
Gets a resource- Parameters:
name- the name of the resource to get- Returns:
- a future that will be completed when the resource is retrieved. The future will contain the resource
-
get
Gets a resource- Parameters:
namespace- the namespace to get the resource fromname- the name of the resource to get- Returns:
- a future that will be completed when the resource is retrieved. The future will contain the resource
-
list
Lists all resources- Returns:
- a future that will be completed when the resources are listed. The future will contain a list of resources
-
list
Lists all resources- Parameters:
namespace- the namespace to list the resources from- Returns:
- a future that will be completed when the resources are listed. The future will contain a list of resources
-
delete
Deletes a resource- Parameters:
name- the name of the resource to delete- Returns:
- a future that will be completed when the resource is deleted
-
delete
Deletes a resource- Parameters:
namespace- the namespace to delete the resource fromname- the name of the resource to delete- Returns:
- a future that will be completed when the resource is deleted
-
createInformer
Creates an informer builder for a resource in the default namespace- Returns:
- a builder for the informer
-
createInformer
Creates an informer builder for a resource- Parameters:
namespace- the namespace to inform the resource in- Returns:
- a builder for the informer
-