Package org.jdrupes.vmoperator.common
Class VmDefinitionStub
java.lang.Object
org.jdrupes.vmoperator.common.K8sGenericStub<VmDefinitionModel,VmDefinitionModels>
org.jdrupes.vmoperator.common.K8sDynamicStubBase<VmDefinitionModel,VmDefinitionModels>
org.jdrupes.vmoperator.common.VmDefinitionStub
A stub for namespaced custom objects.
It uses a dynamic model
(see K8sDynamicModel
) for representing the object’s
state and can therefore be used for any kind of object, especially
custom objects.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A factory for creating VmDefinitionModel(s) objects.Nested classes/interfaces inherited from class org.jdrupes.vmoperator.common.K8sGenericStub
K8sGenericStub.GenericSupplier<O extends io.kubernetes.client.common.KubernetesObject,
L extends io.kubernetes.client.common.KubernetesListObject, R extends K8sGenericStub<O, L>> -
Field Summary
Fields inherited from class org.jdrupes.vmoperator.common.K8sGenericStub
client, context, name, namespace
-
Constructor Summary
ConstructorDescriptionVmDefinitionStub
(K8sClient client, io.kubernetes.client.Discovery.APIResource context, String namespace, String name) Instantiates a new stub for VM defintions. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmDefinitionStub
createFromYaml
(K8sClient client, io.kubernetes.client.Discovery.APIResource context, Reader yaml) Creates a stub from yaml.static VmDefinitionStub
get
(K8sClient client, io.kubernetes.client.apimachinery.GroupVersionKind gvk, String namespace, String name) Get a dynamic object stub.static VmDefinitionStub
get
(K8sClient client, io.kubernetes.client.Discovery.APIResource context, String namespace, String name) Get a dynamic object stub.static Collection
<VmDefinitionStub> Get the stubs for the objects in the given namespace.static Collection
<VmDefinitionStub> list
(K8sClient client, io.kubernetes.client.Discovery.APIResource context, String namespace, io.kubernetes.client.util.generic.options.ListOptions options) Get the stubs for the objects in the given namespace that match the criteria from the given options.Methods inherited from class org.jdrupes.vmoperator.common.K8sGenericStub
apiResource, apply, context, create, delete, group, kind, list, model, name, namespace, patch, patch, plural, toString, update, update, updateStatus, updateStatus, updateStatus, version
-
Constructor Details
-
VmDefinitionStub
public VmDefinitionStub(K8sClient client, io.kubernetes.client.Discovery.APIResource context, String namespace, String name) Instantiates a new stub for VM defintions.- Parameters:
client
- the clientcontext
- the contextnamespace
- the namespacename
- the name
-
-
Method Details
-
get
public static VmDefinitionStub get(K8sClient client, io.kubernetes.client.apimachinery.GroupVersionKind gvk, String namespace, String name) throws io.kubernetes.client.openapi.ApiException Get a dynamic object stub.If the version in parameter
gvk
is an empty string, the stub refers to the first object with matching group and kind.- Parameters:
client
- the clientgvk
- the group, version and kindnamespace
- the namespacename
- the name- Returns:
- the stub if the object exists
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception
-
get
public static VmDefinitionStub get(K8sClient client, io.kubernetes.client.Discovery.APIResource context, String namespace, String name) Get a dynamic object stub.- Parameters:
client
- the clientcontext
- the contextnamespace
- the namespacename
- the name- Returns:
- the stub if the object exists
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception
-
createFromYaml
public static VmDefinitionStub createFromYaml(K8sClient client, io.kubernetes.client.Discovery.APIResource context, Reader yaml) throws io.kubernetes.client.openapi.ApiException Creates a stub from yaml.- Parameters:
client
- the clientcontext
- the contextyaml
- the yaml- Returns:
- the k 8 s dynamic stub
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception
-
list
public static Collection<VmDefinitionStub> list(K8sClient client, io.kubernetes.client.Discovery.APIResource context, String namespace, io.kubernetes.client.util.generic.options.ListOptions options) throws io.kubernetes.client.openapi.ApiException Get the stubs for the objects in the given namespace that match the criteria from the given options.- Parameters:
client
- the clientnamespace
- the namespaceoptions
- the options- Returns:
- the collection
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception
-
list
public static Collection<VmDefinitionStub> list(K8sClient client, io.kubernetes.client.Discovery.APIResource context, String namespace) throws io.kubernetes.client.openapi.ApiException Get the stubs for the objects in the given namespace.- Parameters:
client
- the clientnamespace
- the namespace- Returns:
- the collection
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception
-