Package com.vmware.general
Class PropertyCollector
- java.lang.Object
-
- com.vmware.connection.ConnectedVimServiceBase
-
- com.vmware.general.PropertyCollector
-
@Sample(name="property-collector", description="This sample illustrates the property collector features added in version 4.1") public class PropertyCollector extends ConnectedVimServiceBasePropertyCollector This sample illustrates the property collector features added in version 4.1 Parameters: url [required] : url of the web service."); username [required] : username for the authentication"); password [required] : password for the authentication"); extension [required] : Extension to be demonstrated [retrieveproperties | updates | filterspec | propertycollector] vmname [optional] : Name of the virtual machine maxobjects [optional] : The maximum number of ObjectContent data objects that should be returned in a single result updatetype [optional] : waitforupdates | checkforupdates| extension nooftasks [optional] : Number of tasks to be created Command Line: Retrieve Properties Extension run.bat com.vmware.general.PropertyCollector --url [webserviceurl] --username [username] --password [password] --extension retrieveproperties --maxobjects [maxobjects] Updates Extension run.bat com.vmware.general.PropertyCollector --url [webserviceurl] --username [username] --password [password] --extension updates --vmname [vm name] --updatetype [waitforupdates | checkforupdates| extension] Filter Spec Extension run.bat com.vmware.general.PropertyCollector --url [webserviceurl] --username [username] --password [password] --extension filterspec --vmname [vm name] --noofTasks [Number of tasks to be created] Property Collector Extension run.bat com.vmware.general.PropertyCollector --url [webserviceurl] --username [username] --password [password] --extension propertycollector
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vmware.connection.ConnectedVimServiceBase
ConnectedVimServiceBase.ConnectionException
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringSVC_INST_NAME-
Fields inherited from class com.vmware.connection.ConnectedVimServiceBase
PROP_ME_NAME
-
-
Constructor Summary
Constructors Constructor Description PropertyCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<com.vmware.vim25.SelectionSpec>buildFullTraversal()java.util.List<com.vmware.vim25.PropertySpec>buildPropertySpecArray(java.lang.String[][] typeinfo)voidcallContinueRetrieveProperties(java.lang.String token)voidcallCreateFilterSpecEx(java.util.List<com.vmware.vim25.ManagedObjectReference> taskArr, java.util.List<java.lang.String> filterProps)voidcallCreatePropertyCollectorEx()voidcallRetrievePropertiesEx(java.lang.String maxObjs)voidcallWaitForUpdatesEx(java.lang.String maxWaitSeconds, java.lang.String maxOjectUpdates)java.util.List<com.vmware.vim25.ManagedObjectReference>createTasks(int taskLength)voiddoOperations()voidgetInputParameters(java.lang.String[] args)com.vmware.vim25.SelectionSpecgetSelectionSpec(java.lang.String name)booleangetTaskResultAfterDone(com.vmware.vim25.ManagedObjectReference task)This method returns a boolean value specifying whether the Task is succeeded or failed.voidhandleChanges(java.util.List<com.vmware.vim25.PropertyChange> changes)voidhandleObjectUpdate(com.vmware.vim25.ObjectUpdate oUpdate)voidhandleUpdate(com.vmware.vim25.UpdateSet update)voidmain()java.util.List<com.vmware.vim25.ObjectContent>retrievePropertiesAllObjects(java.util.List<com.vmware.vim25.PropertyFilterSpec> listpfs)Uses the new RetrievePropertiesEx method to emulate the now deprecated RetrieveProperties method.voidsetExtension(java.lang.String extension)voidsetMaxObjects(java.lang.String maxObjects)voidsetNoofTasks(java.lang.String noofTasks)voidsetUpdateType(java.lang.String updateType)voidsetVmName(java.lang.String vmName)voidvalidate()-
Methods inherited from class com.vmware.connection.ConnectedVimServiceBase
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
-
-
-
-
Field Detail
-
SVC_INST_NAME
public final java.lang.String SVC_INST_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
setExtension
@Option(name="extension", description="Extension to be demonstrated [retrieveproperties | updates | filterspec | propertycollector]") public void setExtension(java.lang.String extension)
-
setVmName
@Option(name="vmname", required=false, description="Name of the virtual machine") public void setVmName(java.lang.String vmName)
-
setMaxObjects
@Option(name="maxobjects", required=false, description="The maximum number of ObjectContent data objects that should be returned in a single result") public void setMaxObjects(java.lang.String maxObjects)
-
setUpdateType
@Option(name="updatetype", required=false, description="waitforupdates | checkforupdates| extension") public void setUpdateType(java.lang.String updateType)
-
setNoofTasks
@Option(name="nooftasks", required=false, description="Number of tasks to be created") public void setNoofTasks(java.lang.String noofTasks)
-
getInputParameters
public void getInputParameters(java.lang.String[] args) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
validate
public void validate()
-
doOperations
public void doOperations() throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg, com.vmware.vim25.InvalidCollectorVersionFaultMsg, com.vmware.vim25.DuplicateNameFaultMsg, com.vmware.vim25.TaskInProgressFaultMsg, com.vmware.vim25.InsufficientResourcesFaultFaultMsg, com.vmware.vim25.VmConfigFaultFaultMsg, com.vmware.vim25.InvalidDatastoreFaultMsg, com.vmware.vim25.FileFaultFaultMsg, com.vmware.vim25.ConcurrentAccessFaultMsg, com.vmware.vim25.InvalidStateFaultMsg, com.vmware.vim25.InvalidNameFaultMsg- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.TaskInProgressFaultMsgcom.vmware.vim25.InsufficientResourcesFaultFaultMsgcom.vmware.vim25.VmConfigFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.ConcurrentAccessFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.InvalidNameFaultMsg
-
callCreatePropertyCollectorEx
public void callCreatePropertyCollectorEx() throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg
-
callCreateFilterSpecEx
public void callCreateFilterSpecEx(java.util.List<com.vmware.vim25.ManagedObjectReference> taskArr, java.util.List<java.lang.String> filterProps) throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg, com.vmware.vim25.InvalidCollectorVersionFaultMsg- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsg
-
createTasks
public java.util.List<com.vmware.vim25.ManagedObjectReference> createTasks(int taskLength) throws com.vmware.vim25.DuplicateNameFaultMsg, com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.TaskInProgressFaultMsg, com.vmware.vim25.VmConfigFaultFaultMsg, com.vmware.vim25.InsufficientResourcesFaultFaultMsg, com.vmware.vim25.InvalidDatastoreFaultMsg, com.vmware.vim25.FileFaultFaultMsg, com.vmware.vim25.ConcurrentAccessFaultMsg, com.vmware.vim25.InvalidStateFaultMsg, com.vmware.vim25.InvalidNameFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg, com.vmware.vim25.InvalidCollectorVersionFaultMsg- Throws:
com.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.TaskInProgressFaultMsgcom.vmware.vim25.VmConfigFaultFaultMsgcom.vmware.vim25.InsufficientResourcesFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.ConcurrentAccessFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.InvalidNameFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsg
-
callWaitForUpdatesEx
public void callWaitForUpdatesEx(java.lang.String maxWaitSeconds, java.lang.String maxOjectUpdates) throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg, com.vmware.vim25.InvalidCollectorVersionFaultMsg- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsg
-
callRetrievePropertiesEx
public void callRetrievePropertiesEx(java.lang.String maxObjs) throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg
-
callContinueRetrieveProperties
public void callContinueRetrieveProperties(java.lang.String token) throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg
-
handleUpdate
public void handleUpdate(com.vmware.vim25.UpdateSet update)
-
handleObjectUpdate
public void handleObjectUpdate(com.vmware.vim25.ObjectUpdate oUpdate)
-
handleChanges
public void handleChanges(java.util.List<com.vmware.vim25.PropertyChange> changes)
-
buildFullTraversal
public java.util.List<com.vmware.vim25.SelectionSpec> buildFullTraversal()
-
getSelectionSpec
public com.vmware.vim25.SelectionSpec getSelectionSpec(java.lang.String name)
-
retrievePropertiesAllObjects
public java.util.List<com.vmware.vim25.ObjectContent> retrievePropertiesAllObjects(java.util.List<com.vmware.vim25.PropertyFilterSpec> listpfs) throws com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsgUses the new RetrievePropertiesEx method to emulate the now deprecated RetrieveProperties method.- Parameters:
listpfs-- Returns:
- list of object content
- Throws:
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg
-
buildPropertySpecArray
public java.util.List<com.vmware.vim25.PropertySpec> buildPropertySpecArray(java.lang.String[][] typeinfo)
-
getTaskResultAfterDone
public boolean getTaskResultAfterDone(com.vmware.vim25.ManagedObjectReference task) throws com.vmware.vim25.InvalidPropertyFaultMsg, com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.InvalidCollectorVersionFaultMsgThis method returns a boolean value specifying whether the Task is succeeded or failed.- Parameters:
task- ManagedObjectReference representing the Task.- Returns:
- boolean value representing the Task result.
- Throws:
com.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg
-
main
@Action public void main() throws com.vmware.vim25.DuplicateNameFaultMsg, com.vmware.vim25.RuntimeFaultFaultMsg, com.vmware.vim25.TaskInProgressFaultMsg, com.vmware.vim25.VmConfigFaultFaultMsg, com.vmware.vim25.InsufficientResourcesFaultFaultMsg, com.vmware.vim25.InvalidDatastoreFaultMsg, com.vmware.vim25.InvalidPropertyFaultMsg, com.vmware.vim25.FileFaultFaultMsg, com.vmware.vim25.ConcurrentAccessFaultMsg, com.vmware.vim25.InvalidStateFaultMsg, com.vmware.vim25.InvalidCollectorVersionFaultMsg, com.vmware.vim25.InvalidNameFaultMsg- Throws:
com.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.TaskInProgressFaultMsgcom.vmware.vim25.VmConfigFaultFaultMsgcom.vmware.vim25.InsufficientResourcesFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.ConcurrentAccessFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.InvalidNameFaultMsg
-
-