@Sample(name="property-collector",
description="This sample illustrates the property collector features added in version 4.1")
public class PropertyCollector
extends ConnectedVimServiceBase
PropertyCollector
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
ConnectedVimServiceBase.ConnectionException| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
SVC_INST_NAME |
PROP_ME_NAME| Constructor and Description |
|---|
PropertyCollector() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<com.vmware.vim25.SelectionSpec> |
buildFullTraversal() |
java.util.List<com.vmware.vim25.PropertySpec> |
buildPropertySpecArray(java.lang.String[][] typeinfo) |
void |
callContinueRetrieveProperties(java.lang.String token) |
void |
callCreateFilterSpecEx(java.util.List<com.vmware.vim25.ManagedObjectReference> taskArr,
java.util.List<java.lang.String> filterProps) |
void |
callCreatePropertyCollectorEx() |
void |
callRetrievePropertiesEx(java.lang.String maxObjs) |
void |
callWaitForUpdatesEx(java.lang.String maxWaitSeconds,
java.lang.String maxOjectUpdates) |
java.util.List<com.vmware.vim25.ManagedObjectReference> |
createTasks(int taskLength) |
void |
doOperations() |
void |
getInputParameters(java.lang.String[] args) |
com.vmware.vim25.SelectionSpec |
getSelectionSpec(java.lang.String name) |
boolean |
getTaskResultAfterDone(com.vmware.vim25.ManagedObjectReference task)
This method returns a boolean value specifying whether the Task is
succeeded or failed.
|
void |
handleChanges(java.util.List<com.vmware.vim25.PropertyChange> changes) |
void |
handleObjectUpdate(com.vmware.vim25.ObjectUpdate oUpdate) |
void |
handleUpdate(com.vmware.vim25.UpdateSet update) |
void |
main() |
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.
|
void |
setExtension(java.lang.String extension) |
void |
setMaxObjects(java.lang.String maxObjects) |
void |
setNoofTasks(java.lang.String noofTasks) |
void |
setUpdateType(java.lang.String updateType) |
void |
setVmName(java.lang.String vmName) |
void |
validate() |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnectionpublic final java.lang.String SVC_INST_NAME
@Option(name="extension",
description="Extension to be demonstrated [retrieveproperties | updates | filterspec | propertycollector]")
public void setExtension(java.lang.String extension)
@Option(name="vmname",
required=false,
description="Name of the virtual machine")
public void setVmName(java.lang.String vmName)
@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)
@Option(name="updatetype",
required=false,
description="waitforupdates | checkforupdates| extension")
public void setUpdateType(java.lang.String updateType)
@Option(name="nooftasks",
required=false,
description="Number of tasks to be created")
public void setNoofTasks(java.lang.String noofTasks)
public void getInputParameters(java.lang.String[] args)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic void validate()
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
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.InvalidNameFaultMsgpublic void callCreatePropertyCollectorEx()
throws com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgpublic 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
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgpublic 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
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.InvalidCollectorVersionFaultMsgpublic void callWaitForUpdatesEx(java.lang.String maxWaitSeconds,
java.lang.String maxOjectUpdates)
throws com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgpublic void callRetrievePropertiesEx(java.lang.String maxObjs)
throws com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgpublic void callContinueRetrieveProperties(java.lang.String token)
throws com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg
com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgpublic void handleUpdate(com.vmware.vim25.UpdateSet update)
public void handleObjectUpdate(com.vmware.vim25.ObjectUpdate oUpdate)
public void handleChanges(java.util.List<com.vmware.vim25.PropertyChange> changes)
public java.util.List<com.vmware.vim25.SelectionSpec> buildFullTraversal()
public com.vmware.vim25.SelectionSpec getSelectionSpec(java.lang.String name)
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.InvalidPropertyFaultMsg
listpfs - com.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgpublic java.util.List<com.vmware.vim25.PropertySpec> buildPropertySpecArray(java.lang.String[][] typeinfo)
public boolean getTaskResultAfterDone(com.vmware.vim25.ManagedObjectReference task)
throws com.vmware.vim25.InvalidPropertyFaultMsg,
com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg
task - ManagedObjectReference representing the Task.com.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsg@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
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