|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.zos.jdl.GridObjectInfo
com.novell.zos.jdl.ResourceInfo
public class ResourceInfo
ResourceInfo is a representation of a Resource Grid Object.
This class inherits the base fact operations from GridObjectInfo
and adds the provisioning operations for provisionable resources such as VMs.
See MatrixInfo
for how to script creation of Resource objects.
Example to retrieve an existing ResourceInfo
and
print the value of a fact.
resource = getMatrix().getGridObject("resource","sles_lab1") print resource.getFact("resource.os.name")
Example to retrieve an existing ResourceInfo
and
initiate a provision operation on the Resource.
vm = getMatrix().getGridObject("resource","winxpvm") vm.provision()
Field Summary | |
---|---|
static java.lang.String |
TYPE_BM_INSTANCE
resource.type value for a Bare metal resource |
static java.lang.String |
TYPE_BM_TEMPLATE
resource.type value for a Bare metal Template resource |
static java.lang.String |
TYPE_FIXED_PHYSICAL
resource.type value for a fixed physical resource |
static java.lang.String |
TYPE_VM_INSTANCE
resource.type value for a VM resource |
static java.lang.String |
TYPE_VM_TEMPLATE
resource.type value for a VM Template resource |
Method Summary | |
---|---|
void |
applyConfig()
Apply VM configuration to a provisioned resource. |
void |
build(BuildSpec buildSpec)
Create a new provisionable resource using the supplied BuildSpec . |
void |
cancel()
Cancel the current action on this resource. |
void |
check()
Check and resync the state of this resource. |
void |
checkpoint()
Create a checkpoint for a provisioned resource. |
void |
checkpoint(java.lang.String checkpointName)
Create a checkpoint for a provisioned resource supplying a checkpoint name. |
ResourceInfo |
clone(java.lang.String newName)
Create a copy of this Resource using the supplied name. |
ResourceInfo |
clone(VmSpec vmSpec)
Create a copy of this Resource using the supplied VmSpec . |
ResourceInfo |
createTemplate(java.lang.String newName)
Create a new Template resource from this resource using the supplied name. |
ResourceInfo |
createTemplate(VmSpec vmSpec)
Create a new Template resource from this resource using the supplied VmSpec instance. |
GridObjectInfo |
createVmHost(java.lang.String provisionAdapter)
Create a new Vm Host Grid Object associated with this physical resource. |
void |
destroy()
Destroy this provisionable resource. |
org.python.core.PyList |
getProvisionedInstances()
Return all provisioned instances of this resource. |
GridObjectInfo |
getVmHost(java.lang.String provisionAdapter)
Retrieve an existing Vm Host Grid Object associated with this physical resource. |
void |
installAgent()
Install an Agent on this provisionable resource. |
void |
installAgent(org.python.core.PyDictionary params)
Install an Agent on this provisionable resource. |
void |
makeStandAlone()
Remove dependencies from provisionable instance to a parent template. |
void |
migrate()
Migrate this provisioned resource to another host. |
void |
migrate(MigrateSpec spec)
Migrate this provisioned resource using options specified in the supplied MigrateSpec . |
void |
migrate(java.lang.String newHostName)
Migrate this provisioned resource to the supplied host. |
void |
move(java.lang.String repository,
java.lang.String host)
Move the disk images for this VM to a new repository. |
void |
pause()
Pause this provisioned resource. |
void |
personalize()
Personalize (autoprep) a provisionable resource. |
ResourceInfo |
provision()
Provision this resource for general use. |
ResourceInfo |
provision(ProvisionSpec provisionSpec)
Provision this resource using the supplied ProvisionSpec
instance. |
void |
restart()
Restart this provisioned resource. |
void |
restart(boolean hard)
Restart this provisioned resource. |
void |
restore()
Restore a provisioned resource to a checkpoint. |
void |
restore(java.lang.String checkpointName)
Restore a provisioned resource to a checkpoint. |
void |
resume()
Resume a previously paused provisioned resource. |
void |
saveConfig()
Save the VM configuration of a provisionable resource. |
void |
shutdown()
Initiate a soft shutdown of this provisioned resource. |
void |
shutdown(boolean hard)
Shutdown this provisioned resource. |
void |
shutdownAgent()
Shutdown the agent on this resource if it is online. |
void |
suspend()
Suspend this provisioned resource. |
void |
suspend(boolean hard)
Suspend this provisioned resource. |
Methods inherited from class com.novell.zos.jdl.GridObjectInfo |
---|
deleteFact, factExists, getFact, getFactLastModified, getFactNames, refresh, setArrayFact, setBooleanArrayFact, setDateArrayFact, setDateFact, setFact, setIntegerArrayFact, setRealArrayFact, setStringArrayFact, setTimeArrayFact, setTimeFact |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TYPE_FIXED_PHYSICAL
resource.type
value for a fixed physical resource
public static final java.lang.String TYPE_VM_INSTANCE
resource.type
value for a VM resource
public static final java.lang.String TYPE_VM_TEMPLATE
resource.type
value for a VM Template resource
public static final java.lang.String TYPE_BM_TEMPLATE
resource.type
value for a Bare metal Template resource
public static final java.lang.String TYPE_BM_INSTANCE
resource.type
value for a Bare metal resource
Method Detail |
---|
public void shutdownAgent()
public ResourceInfo provision()
java.lang.Exception
- if this is not a provisionable resource or provisioning
results in errorpublic ResourceInfo provision(ProvisionSpec provisionSpec)
ProvisionSpec
instance. If this resource is a template, a new instance will be created.
provisionSpec
- ProvisionSpec instance to use for provisioning
java.lang.Exception
- if this is not a provisionable resource or provisioning
results in errorpublic org.python.core.PyList getProvisionedInstances()
public void shutdown()
java.lang.Exception
- if this is not a provisioned resource instance or the
shutdown is not possible at presentpublic void move(java.lang.String repository, java.lang.String host)
host
- Host id to affiliate torepository
- to choose from host.
java.lang.Exception
- if error occurs in trying to affiliatepublic void shutdown(boolean hard)
hard
- true to initiate a hard shutdown,
false to initiate a soft shutdown
java.lang.Exception
- if this is not a provisioned resource instance or the
shutdown is not possible at presentpublic void suspend()
java.lang.Exception
- if this is not a provisioned resource or error
occurs in suspendingpublic void suspend(boolean hard)
hard
- true to shutdown hard. false to try a soft shutdown
java.lang.Exception
- if this is not a provisioned resource or error occurs
in suspendingpublic void pause()
java.lang.Exception
- if this is not a provisioned resource or error occurs
in pausingpublic void resume()
java.lang.Exception
- if this is not a provisioned resource or error occurs
in resumingpublic void personalize()
java.lang.Exception
- if this is not a provisionable resource or error occurs
in personalizationpublic void saveConfig()
java.lang.Exception
- if this is not a provisioned resource or error occurs
in saving configurationpublic void applyConfig()
java.lang.Exception
- if this is not a provisioned resource or error occurs
in applying configurationpublic void restart()
java.lang.Exception
- if this is not a provisioned resource or error occurs
in restartingpublic void restart(boolean hard)
hard
- true to shutdown hard. false to try a soft shutdown
java.lang.Exception
- if this is not a provisioned resource or error occurs
in restartingpublic ResourceInfo createTemplate(java.lang.String newName)
newName
- Name of template resource to create
java.lang.Exception
- if this is not a createable resource or creation
results in errorpublic ResourceInfo createTemplate(VmSpec vmSpec)
VmSpec
instance.
vmSpec
- VmSpec instance defining new vm attributes
java.lang.Exception
- if this is not a createable resource or creation results
in errorpublic ResourceInfo clone(java.lang.String newName)
This only applies if this ResourceInfo
is a template.
newName
- Name of new resource to create
java.lang.Exception
- if this is not a cloneable resource or cloning results
in errorpublic ResourceInfo clone(VmSpec vmSpec)
VmSpec
.
This only applies if this ResourceInfo
is a template.
vmSpec
- VmSpec instance defining attributes for new Vm
java.lang.Exception
- if this is not a cloneable resource or cloning results
in errorpublic void migrate()
java.lang.Exception
- if this resource cannot be migratedpublic void migrate(java.lang.String newHostName)
newHostName
- Host to migrate this resource to
java.lang.Exception
- if this resource cannot be migratedpublic void migrate(MigrateSpec spec)
MigrateSpec
.
spec
- Spec instance to use for supplying the migrate options
java.lang.Exception
- if this resource cannot be migratedpublic void check()
public void destroy()
public void cancel()
public void checkpoint()
java.lang.Exception
- if checkpoints are not supported or error occurs in checkpointingpublic void checkpoint(java.lang.String checkpointName)
checkpointName
- Name of new checkpoint if supported. can be null if only one checkpoint supported
java.lang.Exception
- if checkpoints are not supported or errors occur in checkpointingpublic void restore()
java.lang.Exception
- if checkpoints are not supported or error occurs in restoringpublic void restore(java.lang.String checkpointName)
checkpointName
- Name of checkpoint. can be null if only one checkpoint supported
java.lang.Exception
- if checkpoints are not supported or error occurs in restoringpublic void makeStandAlone()
This allows the template to be removed from the system without affecting the instance.
java.lang.Exception
- is error occurs in operationpublic void installAgent()
java.lang.Exception
- if installation is not supported or error occurred in installation.public void installAgent(org.python.core.PyDictionary params)
The new Agent will communicate with this server or the server specified in the
params dictionary. The key value pairs supplied in the dictionary are the
equivalent to the install command line -D
options.
params
- Dictionary of install settings used by agent installer. May be null.
java.lang.Exception
- if installation is not supported or error occurred in installation.public GridObjectInfo createVmHost(java.lang.String provisionAdapter)
The supplied provisioning adapter job name is required for qualifying the name of the new Vm Host. This operation is not supported if this is not a physical resource object.
provisionAdapter
- Name of provisioning adapter job. The supplied job must exist.
java.lang.Exception
- if operation is not supported or error occurs in creationpublic GridObjectInfo getVmHost(java.lang.String provisionAdapter)
The supplied provisioning adapter job name is required for qualifying which Vm Host to retrieve. This operation is not supported if this is not a physical resource object.
provisionAdapter
- Name of provisioning adapter job. The supplied job must exist.
java.lang.Exception
- if operation is not supported or Vm host does not existpublic void build(BuildSpec buildSpec)
BuildSpec
.
This function only applies to newly built Resource
objects.
You must set required facts on this ResourceInfo
for the building process.
Required ResourceInfo
facts include:
build()
executes asynchronously, so to receive notification in your job,
you must implement provisioner_completed_event(),provisioner_cancelled_event(), provisioner_failed_event()
buildSpec
- VmSpec instance defining new vm attributes
java.lang.Exception
- if this ResourceInfo
is not correctly setup for building or an
error occurs in building
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |