This method retrieves task information from the vCenter Server after a ProtectVms or UnprotectVms request, which both take some time to complete.
Synopsis
ProtectionTask.VmTask[] getTasks()
VmTask[] is an array of monitorable task information keyed by Virtual Machine, containing:
- task – managed object reference to a task on the Site Recovery Manager server.
- vm – managed object reference to a VirtualMachine.
Faults
- RuntimeFault
For information about the faults that Site Recovery Manager throws, see Faults in Site Recovery Manager API.
Example for GetTasks
List < SrmProtectionTaskVmTask > tasks = srmPortType.getTasks(ManagedObjectReference _this); Where ManagedObjectReference _this = _protectionTaskRef; where _protectionTaskRef can be taken from: SrmServiceInstanceContent content = _srmPortType.retrieveContent(_svcRef); ManagedObjectReference _protectionRef = content.getProtection(); List < ManagedObjectReference > groups = srmPortType.listProtectionGroups(_protectionRef); _protectionGroupRef = groups.get(0); ManagedObjectReference _protectionTaskRef = srmPortType.protectVms( _protectionGroupRef, _vms);