示例#1
0
 public CheckResult[] CheckRelocate(ManagedObjectReference vm, VirtualMachineRelocateSpec spec, string[] testType)
 {
     CheckResult[] result;
     try
     {
         VersionUtils.RequiresVersion(this.Client, VimVersion.Vim4);
         ManagedObjectReference taskReference = this.CheckRelocate_Task(vm, spec, testType);
         result = (CheckResult[])this.Client.WaitForTask(taskReference);
     }
     catch (FaultException ex)
     {
         throw FaultUtility.HandleFault(ex);
     }
     return(result);
 }
示例#2
0
        public ManagedObjectReference CheckRelocate_Task(ManagedObjectReference vm, VirtualMachineRelocateSpec spec, string[] testType)
        {
            ManagedObjectReference result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim4);
                CheckRelocateRequestType checkRelocateRequestType = new CheckRelocateRequestType();
                checkRelocateRequestType._this    = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                checkRelocateRequestType.vm       = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(vm);
                checkRelocateRequestType.spec     = (VimApi_65.VirtualMachineRelocateSpec)VIConvert.ToWsdlType(spec);
                checkRelocateRequestType.testType = testType;
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.CheckRelocate_Task(new CheckRelocate_TaskRequest(checkRelocateRequestType)).CheckRelocate_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }