Package org.jdrupes.vmoperator.common
Class VmDefinition
java.lang.Object
org.jdrupes.vmoperator.common.VmDefinition
Represents a VM definition.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Permissions for accessing and manipulating the VM.static enum
The VM state from the VM definition. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the display password serial.<T> T
Return extra data.Set extra data (locally used, unknown to kubernetes).<T> Optional
<T> Get a value from the spec usingDataPath.get(java.lang.Object, java.lang.Object...)
.<T> Optional
<T> fromStatus
(Object... selectors) Get a value from the status usingDataPath.get(java.lang.Object, java.lang.Object...)
.<T> Optional
<T> Get a value from thespec().get("vm")
usingDataPath.get(java.lang.Object, java.lang.Object...)
.Gets the api version.getKind()
Gets the kind.io.kubernetes.client.openapi.models.V1ObjectMeta
Gets the metadata.getSpec()
Gets the spec.Gets the status.io.kubernetes.client.openapi.models.V1ObjectMeta
metadata()
Gets the metadata.name()
Returns the definition’s name.Returns the definition’s namespace.permissionsFor
(String user, Collection<String> roles) Collect all permissions for the given user with the given roles.void
setApiVersion
(String apiVersion) Sets the api version.void
Sets the kind.void
setMetadata
(io.kubernetes.client.openapi.models.V1ObjectMeta metadata) Sets the metadata.void
Sets the spec.void
Sets the status.spec()
Gets the spec.status()
Gets the status.vmState()
Return the requested VM state
-
Constructor Details
-
VmDefinition
public VmDefinition()
-
-
Method Details
-
getKind
Gets the kind.- Returns:
- the kind
-
setKind
Sets the kind.- Parameters:
kind
- the kind to set
-
getApiVersion
Gets the api version.- Returns:
- the apiVersion
-
setApiVersion
Sets the api version.- Parameters:
apiVersion
- the apiVersion to set
-
getMetadata
Gets the metadata.- Returns:
- the metadata
-
metadata
Gets the metadata.- Returns:
- the metadata
-
setMetadata
Sets the metadata.- Parameters:
metadata
- the metadata to set
-
getSpec
Gets the spec.- Returns:
- the spec
-
spec
Gets the spec.- Returns:
- the spec
-
fromSpec
Get a value from the spec usingDataPath.get(java.lang.Object, java.lang.Object...)
.- Type Parameters:
T
- the generic type- Parameters:
selectors
- the selectors- Returns:
- the value, if found
-
fromVm
Get a value from thespec().get("vm")
usingDataPath.get(java.lang.Object, java.lang.Object...)
.- Type Parameters:
T
- the generic type- Parameters:
selectors
- the selectors- Returns:
- the value, if found
-
setSpec
Sets the spec.- Parameters:
spec
- the spec to set
-
getStatus
Gets the status.- Returns:
- the status
-
status
Gets the status.- Returns:
- the status
-
fromStatus
Get a value from the status usingDataPath.get(java.lang.Object, java.lang.Object...)
.- Type Parameters:
T
- the generic type- Parameters:
selectors
- the selectors- Returns:
- the value, if found
-
setStatus
Sets the status.- Parameters:
status
- the status to set
-
extra
Set extra data (locally used, unknown to kubernetes).- Parameters:
property
- the propertyvalue
- the value- Returns:
- the VM definition
-
extra
Return extra data.- Parameters:
property
- the property- Returns:
- the object
-
name
Returns the definition’s name.- Returns:
- the string
-
namespace
Returns the definition’s namespace.- Returns:
- the string
-
vmState
Return the requested VM state- Returns:
- the string
-
permissionsFor
Collect all permissions for the given user with the given roles.- Parameters:
user
- the userroles
- the roles- Returns:
- the sets the
-
displayPasswordSerial
Get the display password serial.- Returns:
- the optional
-