コード例 #1
0
        public string InitiateFileTransferToGuest(ManagedObjectReference vm, GuestAuthentication auth, string guestFilePath, GuestFileAttributes fileAttributes, long fileSize, bool overwrite)
        {
            string returnval;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim50);
                InitiateFileTransferToGuestRequestType initiateFileTransferToGuestRequestType = new InitiateFileTransferToGuestRequestType();
                initiateFileTransferToGuestRequestType._this          = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                initiateFileTransferToGuestRequestType.vm             = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(vm);
                initiateFileTransferToGuestRequestType.auth           = (VimApi_65.GuestAuthentication)VIConvert.ToWsdlType(auth);
                initiateFileTransferToGuestRequestType.guestFilePath  = guestFilePath;
                initiateFileTransferToGuestRequestType.fileAttributes = (VimApi_65.GuestFileAttributes)VIConvert.ToWsdlType(fileAttributes);
                initiateFileTransferToGuestRequestType.fileSize       = fileSize;
                initiateFileTransferToGuestRequestType.overwrite      = overwrite;
                returnval = this.VimServiceProxy.InitiateFileTransferToGuest(new InitiateFileTransferToGuestRequest(initiateFileTransferToGuestRequestType)).InitiateFileTransferToGuestResponse.returnval;
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(returnval);
        }
コード例 #2
0
 public void ChangeFileAttributesInGuest(ManagedObjectReference vm, GuestAuthentication auth, string guestFilePath, GuestFileAttributes fileAttributes)
 {
     try
     {
         VersionUtils.RequiresVersion(this.Client, VimVersion.Vim50);
         ChangeFileAttributesInGuestRequestType changeFileAttributesInGuestRequestType = new ChangeFileAttributesInGuestRequestType();
         changeFileAttributesInGuestRequestType._this          = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
         changeFileAttributesInGuestRequestType.vm             = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(vm);
         changeFileAttributesInGuestRequestType.auth           = (VimApi_65.GuestAuthentication)VIConvert.ToWsdlType(auth);
         changeFileAttributesInGuestRequestType.guestFilePath  = guestFilePath;
         changeFileAttributesInGuestRequestType.fileAttributes = (VimApi_65.GuestFileAttributes)VIConvert.ToWsdlType(fileAttributes);
         this.VimServiceProxy.ChangeFileAttributesInGuest(new ChangeFileAttributesInGuestRequest(changeFileAttributesInGuestRequestType));
     }
     catch (FaultException ex)
     {
         throw FaultUtility.HandleFault(ex);
     }
 }