1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848
|
.. _int: https://docs.python.org/2/library/stdtypes.html
.. _str: https://docs.python.org/2/library/stdtypes.html
.. _long: https://docs.python.org/2/library/stdtypes.html
.. _bool: https://docs.python.org/2/library/stdtypes.html
.. _vim.Task: ../../../vim/Task.rst
.. _HostSystem: ../../../vim/HostSystem.rst
.. _VirtualMachine: ../../../vim/VirtualMachine.rst
.. _HostConfigInfo: ../../../vim/host/ConfigInfo.rst
.. _vSphere API 5.0: ../../../vim/version.rst#vimversionversion7
.. _vim.VirtualMachine: ../../../vim/VirtualMachine.rst
.. _vim.fault.NotAFile: ../../../vim/fault/NotAFile.rst
.. _vim.fault.FileFault: ../../../vim/fault/FileFault.rst
.. _vim.fault.InvalidState: ../../../vim/fault/InvalidState.rst
.. _vim.fault.NotADirectory: ../../../vim/fault/NotADirectory.rst
.. _FileTransferInformation: ../../../vim/vm/guest/FileManager/FileTransferInformation.rst
.. _vim.fault.TaskInProgress: ../../../vim/fault/TaskInProgress.rst
.. _VirtualMachineRuntimeInfo: ../../../vim/vm/RuntimeInfo.rst
.. _vim.fault.InvalidGuestLogin: ../../../vim/fault/InvalidGuestLogin.rst
.. _vmodl.fault.InvalidArgument: ../../../vmodl/fault/InvalidArgument.rst
.. _vim.fault.FileAlreadyExists: ../../../vim/fault/FileAlreadyExists.rst
.. _vim.fault.InvalidPowerState: ../../../vim/fault/InvalidPowerState.rst
.. _vim.fault.GuestOperationsFault: ../../../vim/fault/GuestOperationsFault.rst
.. _vim.fault.GuestPermissionDenied: ../../../vim/fault/GuestPermissionDenied.rst
.. _vim.vm.guest.GuestAuthentication: ../../../vim/vm/guest/GuestAuthentication.rst
.. _vim.fault.GuestComponentsOutOfDate: ../../../vim/fault/GuestComponentsOutOfDate.rst
.. _vim.fault.OperationDisabledByGuest: ../../../vim/fault/OperationDisabledByGuest.rst
.. _vim.fault.GuestOperationsUnavailable: ../../../vim/fault/GuestOperationsUnavailable.rst
.. _vim.vm.guest.FileManager.ListFileInfo: ../../../vim/vm/guest/FileManager/ListFileInfo.rst
.. _vim.fault.OperationNotSupportedByGuest: ../../../vim/fault/OperationNotSupportedByGuest.rst
.. _vim.vm.guest.FileManager.FileAttributes: ../../../vim/vm/guest/FileManager/FileAttributes.rst
.. _vim.vm.guest.FileManager.FileTransferInformation: ../../../vim/vm/guest/FileManager/FileTransferInformation.rst
vim.vm.guest.FileManager
========================
FileManager is the managed object that provides APIs to manipulate the guest operating system files.
:since: `vSphere API 5.0`_
Attributes
----------
Methods
-------
MakeDirectoryInGuest(vm, auth, directoryPath, createParentDirectories):
Creates a directory in the guest OS
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
directoryPath (`str`_):
The complete path to the directory to be created.
createParentDirectories (`bool`_):
Whether any parent directories are to be created.
Returns:
None
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the directory cannot be created because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.FileAlreadyExists`_:
if the specified object already exists.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
DeleteFileInGuest(vm, auth, filePath):
Deletes a file in the guest OS
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
filePath (`str`_):
The complete path to the file or symbolic link to be deleted.
Returns:
None
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.NotAFile`_:
if the specified object is not a file.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
DeleteDirectoryInGuest(vm, auth, directoryPath, recursive):
Deletes a directory in the guest OS.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
directoryPath (`str`_):
The complete path to the directory to be deleted.
recursive (`bool`_):
If true, all subdirectories are also deleted. If false, the directory must be empty for the operation to succeed.
Returns:
None
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.NotADirectory`_:
if the specified object is not a directory.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
MoveDirectoryInGuest(vm, auth, srcDirectoryPath, dstDirectoryPath):
Moves or renames a directory in the guest.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
srcDirectoryPath (`str`_):
The complete path to the directory to be moved.
dstDirectoryPath (`str`_):
The complete path to the where the directory is moved or its new name. It cannot be a path to an existing directory or an existing file.
Returns:
None
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
MoveFileInGuest(vm, auth, srcFilePath, dstFilePath, overwrite):
Renames a file in the guest.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
srcFilePath (`str`_):
The complete path to the original file or symbolic link to be moved.
dstFilePath (`str`_):
The complete path to the where the file is renamed. It cannot be a path to an existing diectory.
overwrite (`bool`_):
If set, the destination file is clobbered.
Returns:
None
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
CreateTemporaryFileInGuest(vm, auth, prefix, suffix, directoryPath):
Creates a temporary file.Creates a new unique temporary file for the user to use as needed. The user is responsible for removing it when it is no longer needed.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
prefix (`str`_):
The prefix to be given to the new temporary file.
suffix (`str`_):
The suffix to be given to the new temporary file.
directoryPath (`str`_, optional):
The complete path to the directory in which to create the file. If unset, or an empty string, a guest-specific location will be used.
Returns:
`str`_:
The absolute path of the temporary file that is created.
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
CreateTemporaryDirectoryInGuest(vm, auth, prefix, suffix, directoryPath):
Creates a temporary directory.Creates a new unique temporary directory for the user to use as needed. The user is responsible for removing it when it is no longer needed.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
prefix (`str`_):
The prefix to be given to the new temporary directory.
suffix (`str`_):
The suffix to be given to the new temporary directory.
directoryPath (`str`_, optional):
The complete path to the directory in which to create the new directory. If unset or an empty string, a guest-specific location will be used.
Returns:
`str`_:
The absolute path of the temporary directory that is created.
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
ListFilesInGuest(vm, auth, filePath, index, maxResults, matchPattern):
Returns information about files or directories in the guest.The results could be extermely large, so to minimize the size of the return value for cases where a UI only needs to show the first N results, the answer is batched. Files are returned in OS-specific (inode) order. If the directory is modified between queries, missing or duplicate results can occur.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
filePath (`str`_):
The complete path to the directory or file to query.
index (`int`_, optional):
Which result to start the list with. The default is 0.
maxResults (`int`_, optional):
The maximum number of results to return. The default is 50.
matchPattern (`str`_, optional):
A filter for the return values. Match patterns are specified using perl-compatible regular expressions. If matchPattern is unset, then the pattern '.*' is used.
Returns:
`vim.vm.guest.FileManager.ListFileInfo`_:
A `GuestListFileInfo`_ object containing information for all the matching files in the filePath and the number of files left to be returned.
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
vim.fault.FileFault
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vmodl.fault.InvalidArgument`_:
If the matchPattern is an invalid regular expression.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
ChangeFileAttributesInGuest(vm, auth, guestFilePath, fileAttributes):
Changes the file attributes of a specified file inside the guest.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
guestFilePath (`str`_):
The complete path to the file to be copied in the guest. If the file points to an symbolic link, then the attributes of the target file are changed.
fileAttributes (`vim.vm.guest.FileManager.FileAttributes`_):
Specifies the different file attributes of the guest file to be changed. See `GuestFileAttributes`_ . If any property is not specified, then the specific attribute of the file will be unchanged.
Returns:
None
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.GuestComponentsOutOfDate`_:
if the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
if the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
if the operation is not enabled due to guest agent configuration.
InitiateFileTransferFromGuest(vm, auth, guestFilePath):
Initiates an operation to transfer a file from the guest.Obtains a reference to `FileTransferInformation`_ object for the file transfer operation. The information object contains a URL to the file inside the guest to be transferred to the client.See `FileTransferInformation`_ for information on how to use the information object. If the power state of the Virtual Machine is changed when the file transfer is in progress, or the Virtual Machine is migrated, then the transfer operation is aborted.In order to ensure a secure connection to the host when transferring a file using HTTPS, the X.509 certificate for the host must be used to authenticate the remote end of the connection. The certificate of the host that the virtual machine is running on can be retrieved using the following fields: vm ( `VirtualMachine`_ ) -runtime ( `VirtualMachineRuntimeInfo`_ ) -host ( `HostSystem`_ ) -config ( `HostConfigInfo`_ ) -certificate.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data.
guestFilePath (`str`_):
The complete path to the file inside the guest that has to be transferred to the client. It cannot be a path to a directory or a symbolic link.
Returns:
`vim.vm.guest.FileManager.FileTransferInformation`_:
A reference to `FileTransferInformation`_ .
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.GuestComponentsOutOfDate`_:
If the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
If the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
If the operation is not enabled due to guest agent configuration.
InitiateFileTransferToGuest(vm, auth, guestFilePath, fileAttributes, fileSize, overwrite):
Initiates an operation to transfer a file to the guest.Obtains a URL to the file inside the guest to be transferred from the client. The user should send a HTTP PUT request specifying the file content in the body of the request. Multiple PUT request cannot be sent to the URL simultaneously. URL will be invalidated after a successful PUT request is sent. If the power state of the Virtual Machine is changed when the file transfer is in progress, or the Virtual Machine is migrated, then the transfer operation is aborted.In order to ensure a secure connection to the host when transferring a file using HTTPS, the X.509 certificate for the host must be used to authenticate the remote end of the connection. The certificate of the host that the virtual machine is running on can be retrieved using the following fields: vm ( `VirtualMachine`_ ) -runtime ( `VirtualMachineRuntimeInfo`_ ) -host ( `HostSystem`_ ) -config ( `HostConfigInfo`_ ) -certificate.
Privilege:
Args:
vm (`vim.VirtualMachine`_):
Virtual Machine to perform the operation on.
auth (`vim.vm.guest.GuestAuthentication`_):
The guest authentication data. See `GuestAuthentication`_ .
guestFilePath (`str`_):
The complete destination path in the guest to transfer the file from the client. It cannot be a path to a directory or a symbolic link.
fileAttributes (`vim.vm.guest.FileManager.FileAttributes`_):
File attributes of the file that has to be created in the guest. See `GuestFileAttributes`_ . If any file attribute is not specified, then the default value of that property will be set for the file.
fileSize (`long`_):
Size of the file to transfer to the guest in bytes.
overwrite (`bool`_):
If set, the destination file is clobbered.
Returns:
`str`_:
A URL to which the user has to send a PUT request. The host part of the URL is returned as '*' if the hostname to be used is the name of the server to which the call was made. For example, if the call is made to esx-svr-1.domain1.com, and the file can be uploaded to http://esx-svr-1.domain1.com/guestFile?id=1=1234, the URL returned may be http:///guestFile?id=1=1234. The client replaces the asterisk with the server name on which it invoked the call.
Raises:
`vim.fault.GuestOperationsFault`_:
if there is an error processing a guest operation.
`vim.fault.InvalidState`_:
if the operation cannot be performed because of the virtual machine's current state.
`vim.fault.TaskInProgress`_:
if the virtual machine is busy.
`vim.fault.FileFault`_:
if there is a file error in the guest operating system.
`vim.fault.GuestOperationsUnavailable`_:
if the VM agent for guest operations is not running.
`vim.fault.InvalidPowerState`_:
if the VM is not powered on.
`vim.fault.GuestPermissionDenied`_:
if the operation fails because the guest authentication will not allow the operation.
`vim.fault.InvalidGuestLogin`_:
if the the guest authentication information was not accepted.
`vim.fault.GuestComponentsOutOfDate`_:
If the guest agent is too old to support the operation.
`vim.fault.OperationNotSupportedByGuest`_:
If the operation is not supported by the guest OS.
`vim.fault.OperationDisabledByGuest`_:
If the operation is not enabled due to guest agent configuration.
|