com.vmware.vcenter.vm.guest package
Submodules
com.vmware.vcenter.vm.guest.filesystem_client module
The com.vmware.vcenter.vm.guest.filesystem_client module provides classes
for dealing with the filesystem of the guest operating system.
- class com.vmware.vcenter.vm.guest.filesystem_client.Directories(config)
- Bases: - vmware.vapi.bindings.stub.VapiInterface- The - Directoriesclass provides methods to manage directories in the guest filesystem. This class was added in vSphere API 7.0.2.0.- Parameters
- config ( - vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
 - create(vm, credentials, path, create_parents=None)
- Creates a directory in the guest operating system. - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- path ( - str) – The complete path to the directory to be created.
- create_parents ( - boolor- None) – Whether any parent directories should be created. If any failure occurs, some parent directories could be left behind. If None parent directories are not created.
 
- Raise
- com.vmware.vapi.std.errors_client.AlreadyExistsif- pathalready exists.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- pathdoes not exist and- create_parentsis not set. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be created because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 - create_temporary(vm, credentials, prefix, suffix, parent_path=None)
- Creates a temporary directory. - Creates a new unique temporary directory for the user to use as needed. The guest operating system may clean up the directory after a guest specific amount of time if - parent_pathis not set, or the user can remove the directory when no longer needed.- The new directory name will be created in a guest-specific format using - prefix, a guest generated string and- suffixin- parent_path.- . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- prefix ( - str) – The prefix to be given to the new temporary directory.
- suffix ( - str) – The suffix to be given to the new temporary directory.
- parent_path ( - stror- None) – The complete path to the directory in which to create the new directory. Directory If None a guest-specific default will be used.
 
- Return type
- str
- Returns
- The absolute path of the temporary directory that is created. 
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- parent_pathis not a directory. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- parent_pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- parent_pathis- setand does not exist. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- parent_pathcannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif a file cannot be created because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 - delete(vm, credentials, path, recursive=None)
- Deletes a directory in the guest operating system. - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- path ( - str) – The complete path to the directory to be deleted.
- recursive ( - boolor- None) – If true, all files and subdirectories are also deleted. If false, the directory must be empty for the operation to succeed. If None, any directory content is not deleted.
 
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis not a directory. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- pathis not found. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ResourceInUseif- pathhas content and- recursiveis None.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be deleted because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 - move(vm, credentials, path, new_path)
- Renames a directory in the guest. - Renames the directory, or copies and deletes the old contents as required by the underlying filsystem. - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- path ( - str) – The complete path to the directory to be moved.
- new_path ( - str) – The complete path to where the directory is moved or its new name. It cannot be a path to an existing directory or an existing file.
 
- Raise
- com.vmware.vapi.std.errors_client.AlreadyExistsif- new_pathalready exists.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis not a directory. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- new_pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- pathis not found. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the parent directory of- new_pathdoes not exist. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif a path cannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif a path cannot be renamed or moved because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 
- class com.vmware.vcenter.vm.guest.filesystem_client.ErrorReason(string)
- Bases: - vmware.vapi.bindings.enum.Enum- The - ErrorReasonclass defines the reasons a file or directory operation failed. This enumeration was added in vSphere API 7.0.2.0.- Note - This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page. - Parameters
- string ( - str) – String value for the- ErrorReasoninstance.
 - DIRECTORY_NOT_EMPTY = ErrorReason(string='DIRECTORY_NOT_EMPTY')
- Directory not empty. This class attribute was added in vSphere API 7.0.2.0. 
 - FILE_NOT_FOUND = ErrorReason(string='FILE_NOT_FOUND')
- The file is not found. This class attribute was added in vSphere API 7.0.2.0. 
 - FILE_TOO_LARGE = ErrorReason(string='FILE_TOO_LARGE')
- The file is too large. This class attribute was added in vSphere API 7.0.2.0. 
 - NOT_A_DIRECTORY = ErrorReason(string='NOT_A_DIRECTORY')
- The argument is not a directory. This class attribute was added in vSphere API 7.0.2.0. 
 - NOT_A_FILE = ErrorReason(string='NOT_A_FILE')
- An argument is not a file. This class attribute was added in vSphere API 7.0.2.0. 
 - NO_DISK_SPACE = ErrorReason(string='NO_DISK_SPACE')
- There is insufficent disk space. This class attribute was added in vSphere API 7.0.2.0. 
 - PATH_TOO_LONG = ErrorReason(string='PATH_TOO_LONG')
- The file path is too long. This class attribute was added in vSphere API 7.0.2.0. 
 
- class com.vmware.vcenter.vm.guest.filesystem_client.FileErrorDetails(reason=None, file_path=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - FileErrorDetailsclass describes additional error information for file and directory operations. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- reason ( - ErrorReason) – The reason for the error. This attribute was added in vSphere API 7.0.2.0.
- file_path ( - str) – The file path associated with the error. This attribute was added in vSphere API 7.0.2.0.
 
 
- class com.vmware.vcenter.vm.guest.filesystem_client.Files(config)
- Bases: - vmware.vapi.bindings.stub.VapiInterface- The - Filesclass provides methods to manage the files in the guest filesystem. This class was added in vSphere API 7.0.2.0.- Parameters
- config ( - vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
 - class FileAttributesInfo(last_modified=None, last_accessed=None, symlink_target=None, filesystem_family=None, win_attributes=None, posix_attributes=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.FileAttributesInfoclass describes the attributes of a file in a guest operating system. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- last_modified ( - datetime.datetime) – The date and time the file was last modified. This attribute was added in vSphere API 7.0.2.0.
- last_accessed ( - datetime.datetime) – The date and time the file was last accessed. This attribute was added in vSphere API 7.0.2.0.
- symlink_target ( - stror- None) – The target for the file if it’s a symbolic link. This is currently only set for Posix guest operating systems, but may be supported in the future on Windows guest operating systems that support symbolic links. This attribute was added in vSphere API 7.0.2.0. Set if the file is a symbolic link.
- filesystem_family ( - Files.FilesystemFamily) – The type of guest filesystem. This attribute was added in vSphere API 7.0.2.0.
- win_attributes ( - Files.WindowsFileAttributesInfo) – Windows-specific file information. This attribute was added in vSphere API 7.0.2.0. This attribute is optional and it is only relevant when the value of- filesystemFamilyis- Files.FilesystemFamily.WINDOWS.
- posix_attributes ( - Files.PosixFileAttributesInfo) – Posix-specific file information. This attribute was added in vSphere API 7.0.2.0. This attribute is optional and it is only relevant when the value of- filesystemFamilyis- Files.FilesystemFamily.POSIX.
 
 
 - class FileAttributesUpdateSpec(last_modified=None, last_accessed=None, windows=None, posix=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- File attributes used for updating an existing file with - Files.update(). This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- last_modified ( - datetime.datetimeor- None) – The date and time the file was last modified. This attribute was added in vSphere API 7.0.2.0. If None the value will not be changed.
- last_accessed ( - datetime.datetimeor- None) – The date and time the file was last accessed. This attribute was added in vSphere API 7.0.2.0. If None the value will not be changed.
- windows ( - Files.WindowsFileAttributesUpdateSpecor- None) – Windows-specific file update information. This attribute was added in vSphere API 7.0.2.0. Set if the guest operating system is Windows.
- posix ( - Files.PosixFileAttributesUpdateSpecor- None) – Posix-specific file update information. This attribute was added in vSphere API 7.0.2.0. Set if the guest operating system is Posix.
 
 
 - class FilesystemFamily(string)
- Bases: - vmware.vapi.bindings.enum.Enum- The - Files.FilesystemFamilyclass defines the types of guest operating fllesystem. This enumeration was added in vSphere API 7.0.2.0.- Note - This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page. - Parameters
- string ( - str) – String value for the- FilesystemFamilyinstance.
 - POSIX = FilesystemFamily(string='POSIX')
- Linux, Solaris, etc. This class attribute was added in vSphere API 7.0.2.0. 
 - WINDOWS = FilesystemFamily(string='WINDOWS')
- The guest OS is a Windows variant. This class attribute was added in vSphere API 7.0.2.0. 
 
 - class FilterSpec(match_pattern=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.FilterSpecclass contains information used to filter the results when listing files (see- Files.list()). This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- match_pattern ( - stror- None) – The perl-compatible regular expression used to filter the returned files. This attribute was added in vSphere API 7.0.2.0. If None the pattern ‘.*’ (match everything) is used.
 
 - class Info(type=None, size=None, attributes=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.Infoclass describes a file or directory in the guest operating system. Returned by- Files.get(). This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- type ( - Files.Type) – The type of file. This attribute was added in vSphere API 7.0.2.0.
- size ( - long) – The file size in bytes. This attribute was added in vSphere API 7.0.2.0.
- attributes ( - Files.FileAttributesInfo) – Attributes of a file. This attribute was added in vSphere API 7.0.2.0.
 
 
 - class IterationSpec(size=None, index=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.IterationSpecclass contains attributes used to break results into pages when listing files. See- Files.list()). This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- size ( - longor- None) – Specifies the maximum number of results to return. This attribute was added in vSphere API 7.0.2.0. If None information about at most 50 files will be returned.
- index ( - longor- None) – Which result to start the list with. If this value exceeds the number of results, an empty list will be returned. This attribute was added in vSphere API 7.0.2.0. If None, the start of the list of files will be returned.
 
 
 - class LastIterationStatus(string)
- Bases: - vmware.vapi.bindings.enum.Enum- The last status for the iterator. A field of this type is returned as part of the result and indicates to the caller of the API whether it can continue to make requests for more data. The last status only reports on the state of the iteration at the time data was last returned. As a result, it not does guarantee if the next call will succeed in getting more data or not. Failures to retrieve results will be returned as Error responses. These last statuses are only returned when the iterator is operating as expected. This enumeration was added in vSphere API 7.0.2.0. - Note - This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page. - Parameters
- string ( - str) – String value for the- LastIterationStatusinstance.
 - END_OF_DATA = LastIterationStatus(string='END_OF_DATA')
- Iterator has finished iterating through its inventory. There are currently no more entities to return and the caller can terminate iteration. If the iterator returned some data, the marker may be set to allow the iterator to continue from where it left off when additional data does become available. This value is used to indicate that all available data has been returned by the iterator. This class attribute was added in vSphere API 7.0.2.0. 
 - READY = LastIterationStatus(string='READY')
- Iterator has more data pending and is ready to provide it. The caller can request the next page of data at any time. The number of results returned may be less than the requested size. In other words, the iterator may not fill the page. The iterator has returned at least 1 result. This class attribute was added in vSphere API 7.0.2.0. 
 
 - class ListResult(files=None, total=None, start_index=None, end_index=None, status=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.ListResultclass describes the results of a- Files.list()method. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- files ( - listof- Files.Summary) – A list of- Files.Summaryclasses containing information for all the matching files. This attribute was added in vSphere API 7.0.2.0.
- total ( - long) – The total number of results from the- Files.list(). This is a hint to the user of the iterator regarding how many items are available to be retrieved. The total could change if the inventory of items are being changed. This attribute was added in vSphere API 7.0.2.0.
- start_index ( - longor- None) – Positional index into the logical item list of the first item returned in the list of results. The first item in the logical item list has an index of 0. This is a hint to the user of the iterator regarding the logical position in the iteration. For example, this can be used to display to the user which page of the iteration is being shown. The total could change if the inventory of items are being changed. This attribute was added in vSphere API 7.0.2.0. If None no items were returned.
- end_index ( - longor- None) – Positional index into the logical item list of the last item returned in the list of results. The first item in the logical item list has an index of 0. This is a hint to the user of the iterator regarding the logical position in the iteration. For example, this can be used to display to the user which page of the iteration is being shown. The total could change if the inventory of items are being changed. This attribute was added in vSphere API 7.0.2.0. If None no items were returned.
- status ( - Files.LastIterationStatus) – The last status for the iterator that indicates whether any more results can be expected if the caller continues to make requests for more data using the iterator. This attribute was added in vSphere API 7.0.2.0.
 
 
 - class PosixFileAttributesInfo(owner=None, group=None, permissions=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.PosixFileAttributesInfoclass describes information about file attributes specific to Posix Guest operating systems. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- owner ( - long) – The owner ID. This attribute was added in vSphere API 7.0.2.0.
- group ( - long) – The group ID. This attribute was added in vSphere API 7.0.2.0.
- permissions ( - str) – The file permissions in chmod(2) format. This attribute is presented as octal. This attribute was added in vSphere API 7.0.2.0.
 
 
 - class PosixFileAttributesUpdateSpec(owner_id=None, group_id=None, permissions=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.PosixFileAttributesUpdateSpecclass describes attributes that can be changed for a Posix file. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- owner_id ( - longor- None) – The owner ID. This attribute was added in vSphere API 7.0.2.0. If None the value will not be changed.
- group_id ( - longor- None) – The group ID. This attribute was added in vSphere API 7.0.2.0. If None the value will not be changed.
- permissions ( - stror- None) – The file permissions in chmod(2) format. This attribute is interpreted as octal. This attribute was added in vSphere API 7.0.2.0. If None the value will not be changed.
 
 
 - class Summary(filename=None, type=None, size=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.Summaryclass describes a file or directory in the guest operating system returned by a- Files.list()method. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- filename ( - str) – The name of the file or directory with any leading directories removed. This attribute was added in vSphere API 7.0.2.0.
- type ( - Files.Type) – The type of file. This attribute was added in vSphere API 7.0.2.0.
- size ( - long) – The file size in bytes. This attribute was added in vSphere API 7.0.2.0.
 
 
 - class Type(string)
- Bases: - vmware.vapi.bindings.enum.Enum- The - Files.Typeclass defines the valid types of files. This enumeration was added in vSphere API 7.0.2.0.- Note - This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page. - Parameters
- string ( - str) – String value for the- Typeinstance.
 - DIRECTORY = Type(string='DIRECTORY')
- directory. This class attribute was added in vSphere API 7.0.2.0. 
 - FILE = Type(string='FILE')
- normal file. This class attribute was added in vSphere API 7.0.2.0. 
 - SYMLINK = Type(string='SYMLINK')
- symbolic link. This class attribute was added in vSphere API 7.0.2.0. 
 
 - class WindowsFileAttributesInfo(hidden=None, read_only=None, created=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The {\@name WindowsFileAttributesInfo) class describes file attributes specific to Windows Guest operating systems. This class was added in vSphere API 7.0.2.0. - Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- hidden ( - bool) – The file is hidden. This attribute was added in vSphere API 7.0.2.0.
- read_only ( - bool) – The file is read-only. This attribute was added in vSphere API 7.0.2.0.
- created ( - datetime.datetime) – The date and time the file was created. This attribute was added in vSphere API 7.0.2.0.
 
 
 - class WindowsFileAttributesUpdateSpec(hidden=None, read_only=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Files.WindowsFileAttributesUpdateSpecclass describes attributes that can be changed for a Windows file. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- hidden ( - boolor- None) – The file is hidden. This attribute was added in vSphere API 7.0.2.0. If {term unset} the value will not be changed.
- read_only ( - boolor- None) – The file is read-only. This attribute was added in vSphere API 7.0.2.0. If {term unset} the value will not be changed.
 
 
 - create_temporary(vm, credentials, prefix, suffix, parent_path=None)
- 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. - The new file name will be created in a guest-specific format using - prefix, a guest generated string and- suffixin- parent_path.- . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- prefix ( - str) – The prefix to be given to the new temporary file.
- suffix ( - str) – The suffix to be given to the new temporary file.
- parent_path ( - stror- None) – The complete path to the directory in which to create the file. Directory to use if specified, otherwise a guest-specific default will be used.
 
- Return type
- str
- Returns
- The absolute path of the temporary file that is created. 
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- parent_pathis- setand is not a directory. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- parent_pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- parent_pathis- setand does not exist. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- parent_pathcannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif a file cannot be created because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 - delete(vm, credentials, path)
- Deletes a file in the guest operating system - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- path ( - str) – The complete path to the file or symbolic link to be deleted.
 
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis not a file. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- pathis not found. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be deleted because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 - get(vm, credentials, path)
- Returns information about a file or directory in the guest. - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- path ( - str) – The complete path to the file.
 
- Return type
- Returns
- Files.Infoobject containing information for the file.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- pathis not found. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be listed because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Query.
 
 
 - list(vm, credentials, path, iteration=None, filter=None)
- Returns information about files and directories in the guest. - Files are returned in operating system-specific (inode) order. If the directory is modified between queries, missing or duplicate results can occur. - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- path ( - str) – The complete path to the directory or file to query.
- iteration ( - Files.IterationSpecor- None) – The specification of a page of results to be retrieved. If None, the first page will be retrieved.
- filter ( - Files.FilterSpecor- None) – Specification to match files for which information should be returned. If None, the behavior is the equivalent to a- Files.FilterSpecwith all attributes None which means all filenames match the filter.
 
- Return type
- Returns
- A - Files.ListResultobject containing information for all the matching files in- filterand the total number of files that can be returned.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentIf {\@param.iteration} contains invalid data.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentIf- filtercontains an invalid regular expression.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- pathis not found. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be listed because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Query.
 
 
 - move(vm, credentials, path, new_path, overwrite=None)
- Renames a file in the guest. - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- path ( - str) – The complete path to the original file or symbolic link to be moved.
- new_path ( - str) – The complete path to the new file. It cannot be a path to an existing directory.
- overwrite ( - boolor- None) – If true, the destination file is overwritten. If None, the destination file is not overwritten.
 
- Raise
- com.vmware.vapi.std.errors_client.AlreadyExistsif the- new_pathalready exists and- overwriteis false.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis not a file. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- new_pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- pathdoes not exist. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the parent directory of- new_pathdoes not exist. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif a path cannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif a path cannot be renamed because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 - update(vm, credentials, path, file_attributes)
- Changes the file attributes of a specified file or directory inside the guest. - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication data.
- path ( - str) – The complete path to the file or directory to be changed in the guest. If the file points to an symbolic link, then the attributes of the target file are changed.
- file_attributes ( - Files.FileAttributesUpdateSpec) – Specifies the different file attributes of the guest file to be changed. See- Files.FileAttributesUpdateSpec.
 
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- file_attributesdoes not apply to the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis not a file. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- pathis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- pathis not found. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- pathcannot be updated because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest operating system.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 
- class com.vmware.vcenter.vm.guest.filesystem_client.StubFactory(stub_config)
- Bases: - vmware.vapi.bindings.stub.StubFactoryBase- Initialize StubFactoryBase - Parameters
- stub_config ( - vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance
 
- class com.vmware.vcenter.vm.guest.filesystem_client.Transfers(config)
- Bases: - vmware.vapi.bindings.stub.VapiInterface- The - Transfersclass provides methods to copy files into and out of the guest file system. This class was added in vSphere API 7.0.2.0.- Parameters
- config ( - vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
 - class CreateSpec(path=None, attributes=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Transfers.CreateSpecclass describes the details of a file transfer operation. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- path ( - str) – The complete destination path in the guest to transfer the file to or from the client. It cannot be a path to a directory or a symbolic link. This attribute was added in vSphere API 7.0.2.0.
- attributes ( - Transfers.FileCreationAttributesor- None) – Details about the file to be transferred into the guest. This attribute was added in vSphere API 7.0.2.0. Must be- setif the file is being transferred to the guest. Must not be- setif the file is being transferred from the guest.
 
 
 - class FileCreationAttributes(size=None, overwrite=None, last_modified=None, last_accessed=None, windows=None, posix=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Transfers.FileCreationAttributesclass describes file attributes used when transferring a file into the guest. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- size ( - long) – The size in bytes of the file to be transferred into the guest. This attribute was added in vSphere API 7.0.2.0.
- overwrite ( - boolor- None) – Whether an existing file should be overwritten. This attribute was added in vSphere API 7.0.2.0. If None any existing file will not be overwritten.
- last_modified ( - datetime.datetimeor- None) – The date and time the file was last modified. This attribute was added in vSphere API 7.0.2.0. If None the value will be the time when the file is transferred into the guest.
- last_accessed ( - datetime.datetimeor- None) – The date and time the file was last accessed. This attribute was added in vSphere API 7.0.2.0. If None the value will be the time when the file is transferred into the guest.
- windows ( - Transfers.WindowsFileAttributesCreateSpecor- None) – Windows-specific file creation information. This attribute was added in vSphere API 7.0.2.0. If None, the behavior is equivalent to a- Transfers.WindowsFileAttributesCreateSpecwith all attributes None which means the defaults are used. May only be- setif the guest operating system is Windows.
- posix ( - Transfers.PosixFileAttributesCreateSpecor- None) – Posix-specific file creation information. This attribute was added in vSphere API 7.0.2.0. If None, the behavior is equivalent to a- Transfers.PosixFileAttributesCreateSpecwith all attributes None which means the defaults are used. May only be- setif the guest operating system is Posix.
 
 
 - class PosixFileAttributesCreateSpec(owner_id=None, group_id=None, permissions=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Transfers.PosixFileAttributesCreateSpecclass describes creation information about file attributes specific to Posix guest operating systems. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- owner_id ( - longor- None) – The owner ID. If this property is not specified when passing a- Transfers.PosixFileAttributesCreateSpecobject to- Transfers.create(), the default value will be the owner Id of the user who invoked the file transfer operation. This attribute was added in vSphere API 7.0.2.0. Defaults to uid of user invoking the operation.
- group_id ( - longor- None) – The group ID. If this property is not specified when passing a- Transfers.PosixFileAttributesCreateSpecobject to- Transfers.create(), the default value will be the group Id of the user who invoked the file transfer operation. This attribute was added in vSphere API 7.0.2.0. Defaults to gid of user invoking the operation.
- permissions ( - stror- None) – The file permissions in chmod(2) format. If this property is not specified when passing a- Transfers.PosixFileAttributesCreateSpecobject to- Transfers.create(), the file will be created with 0644 permissions. This attribute is interpreted as octal. This attribute was added in vSphere API 7.0.2.0. Defaults to 0644.
 
 
 - class WindowsFileAttributesCreateSpec(hidden=None, read_only=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Transfers.WindowsFileAttributesCreateSpecclass describes creation information about file attributes specific to Windows guest operating systems. This class was added in vSphere API 7.0.2.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- hidden ( - boolor- None) – The file is hidden. This attribute was added in vSphere API 7.0.2.0. If None the file will not be hidden.
- read_only ( - boolor- None) – The file is read-only. This attribute was added in vSphere API 7.0.2.0. If None the file will be writeable.
 
 
 - create(vm, credentials, spec)
- Initiates an operation to transfer a file to or from the guest. - 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. - When transferring a file into the guest and overwriting an existing file, the old file attributes are not preserved. - 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: XXX insert link to certificate in Host config XXX - . This method was added in vSphere API 7.0.2.0. - Parameters
- vm ( - str) – Virtual Machine to perform the operation on. The parameter must be an identifier for the resource type:- VirtualMachine.
- credentials ( - com.vmware.vcenter.vm.guest_client.Credentials) – The guest authentication credentials.
- spec ( - Transfers.CreateSpec) – A specification of the type of file transfer and any applicable attibutes.
 
- Return type
- str
- Returns
- The URL to which the user has to send an HTTP request. The URL will become invalid once a successful request is sent. If the file is being transferred from the guest, an HTTP GET should be used. If the file is being transferred to the guest, HTTP PUT should be used. The URL is valid only for 10 minutes from the time it is generated. The URL becomes invalid whenever the virtual machine is powered off, suspended, unregistered or migrated to a new host. 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 is available for download from https://esx-svr-1.domain1.com/guestFile?id=1&token=1234, the URL returned may be {\@literal aHR0cHM6Ly8mIzQyOy9ndWVzdEZpbGU/aWQ9MSZ0b2tlbj0xMjM0}. The client replaces the asterisk with the server name on which it invoked the call. 
- Raise
- com.vmware.vapi.std.errors_client.AlreadyExistsif- Transfers.CreateSpec.pathin- specexists and- Transfers.FileCreationAttributes.overwriteis false when transferring a file to the guest.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- Transfers.CreateSpec.pathin- specis not a file. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.InvalidArgumentif- Transfers.CreateSpec.pathin- specis too long. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.NotAllowedInCurrentStateif the virtual machine is not running.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif- Transfers.CreateSpec.pathin- specis not found. The value of- com.vmware.vapi.std.errors_client.Error.datawill contain all the attributes defined in the- FileErrorDetailsproviding additional information about the failure.
- Raise
- com.vmware.vapi.std.errors_client.ResourceBusyif the virtual machine is busy.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif the VMware Tools is not running.
- Raise
- com.vmware.vapi.std.errors_client.UnableToAllocateResourceif is insuffcient space for the new file when transferring a file to the guest.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the- credentialsobject was not valid.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- Transfers.CreateSpec.pathin- speccannot be accessed.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif- Transfers.CreateSpec.pathin- speccannot be copied because the guest authentication will not allow the operation.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is not supported by the VMware Tools in the guest OS.
- Raise
- com.vmware.vapi.std.errors_client.Unsupportedif the operation is disabled by the VMware Tools in the guest OS.
- Raise
- com.vmware.vapi.std.errors_client.Unauthorizedif you do not have all of the privileges described as follows:- The resource - VirtualMachinereferenced by the parameter- vmrequires- VirtualMachine.GuestOperations.Modify.
 
 
 
com.vmware.vcenter.vm.guest.networking_client module
The com.vmware.vcenter.vm.guest.networking_client module provides classes
for dealing with the guest operating system networking.
- class com.vmware.vcenter.vm.guest.networking_client.Interfaces(config)
- Bases: - vmware.vapi.bindings.stub.VapiInterface- The - Interfacesclass provides methods for retrieving guest operating system network interface information. This class was added in vSphere API 7.0.0.0.- Parameters
- config ( - vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
 - class Info(dns_values=None, mac_address=None, dns=None, ip=None, wins_servers=None, nic=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Interfaces.Infoclass describes a virtual network adapter configured in the guest operating system. This class was added in vSphere API 7.0.0.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- dns_values ( - com.vmware.vcenter.vm.guest_client.DnsAssignedValuesor- None) – Client DNS values. Data assigned by DNS. This attribute was added in vSphere API 7.0.0.0. If None no DNS assigned value exists.
- mac_address ( - stror- None) – MAC address of the adapter. This attribute was added in vSphere API 7.0.0.0. If None then not supported by the Guest OS.
- dns ( - com.vmware.vcenter.vm.guest_client.DnsConfigInfoor- None) – DNS configuration of the adapter. See- com.vmware.vcenter.vm.guest_client.Networking.Info.dnsfor system wide settings. This attribute was added in vSphere API 7.0.0.0. If None then not assigned by the Guest OS.
- ip ( - Interfaces.IpConfigInfoor- None) – IP configuration settings of the adapter. This attribute was added in vSphere API 7.0.0.0. If None then not supported by the Guest OS.
- wins_servers ( - listof- stror- None) – The IP addresses of any WINS name servers for the adapter. This attribute was added in vSphere API 7.0.0.0. If None then not supported by the Guest OS.
- nic ( - stror- None) – Link to the corresponding virtual device. This attribute was added in vSphere API 7.0.0.0. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:- com.vmware.vcenter.vm.hardware.Ethernet. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:- com.vmware.vcenter.vm.hardware.Ethernet. If None then the interface is not backed by a virtual device.
 
 
 - class IpAddressInfo(ip_address=None, prefix_length=None, origin=None, state=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Interfaces.IpAddressInfoclass describes a specific IP Address. This class was added in vSphere API 7.0.0.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- ip_address ( - str) – IPv4 address is specified using dotted decimal notation. For example, “192.0.2.1”. IPv6 addresses are 128-bit addresses specified using eight fields of up to four hexadecimal digits. A colon separates each field (:). For example, 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of the symbol ‘::’ to represent multiple 16-bit groups of contiguous 0’s only once in an address as described in RFC 2373. This attribute was added in vSphere API 7.0.0.0.
- prefix_length ( - long) – Denotes the length of a generic Internet network address prefix. Prefix length: the valid range of values is 0-32 for IPv4, and 0-128 for IPv6. A value of n corresponds to an IP address mask that has n contiguous 1-bits from the most significant bit (MSB), with all other bits set to 0. A value of zero is valid only if the calling context defines it. This attribute was added in vSphere API 7.0.0.0.
- origin ( - Interfaces.IpAddressOriginor- None) – How this address was configured. This attribute was added in vSphere API 7.0.0.0. If None the data was not available.
- state ( - Interfaces.IpAddressStatus) – The state of this ipAddress. This attribute was added in vSphere API 7.0.0.0.
 
 
 - class IpAddressOrigin(string)
- Bases: - vmware.vapi.bindings.enum.Enum- The - Interfaces.IpAddressOriginclass specifies how an IP address was obtained for an interface. See RFC 4293 IpAddressOriginTC. This enumeration was added in vSphere API 7.0.0.0.- Note - This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page. - Parameters
- string ( - str) – String value for the- IpAddressOrigininstance.
 - DHCP = IpAddressOrigin(string='DHCP')
- The address is configured through dhcp. This class attribute was added in vSphere API 7.0.0.0. 
 - LINKLAYER = IpAddressOrigin(string='LINKLAYER')
- The address is obtained through stateless autoconfiguration (autoconf). See RFC 4862, IPv6 Stateless Address Autoconfiguration. This class attribute was added in vSphere API 7.0.0.0. 
 - MANUAL = IpAddressOrigin(string='MANUAL')
- The address is configured manually. This class attribute was added in vSphere API 7.0.0.0. 
 - OTHER = IpAddressOrigin(string='OTHER')
- Any other type of address configuration other than the below mentioned ones will fall under this category. For e.g., automatic address configuration for the link local address falls under this type. This class attribute was added in vSphere API 7.0.0.0. 
 - RANDOM = IpAddressOrigin(string='RANDOM')
- The address is chosen by the system at random e.g., an IPv4 address within 169.254/16, or an RFC 3041 privacy address. This class attribute was added in vSphere API 7.0.0.0. 
 
 - class IpAddressStatus(string)
- Bases: - vmware.vapi.bindings.enum.Enum- The - Interfaces.IpAddressStatusclass defines the present status of an address on an interface. See RFC 4293 IpAddressStatusTC. This enumeration was added in vSphere API 7.0.0.0.- Note - This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page. - Parameters
- string ( - str) – String value for the- IpAddressStatusinstance.
 - DEPRECATED = IpAddressStatus(string='DEPRECATED')
- Indicates that this is a valid but deprecated address that should no longer be used as a source address. This class attribute was added in vSphere API 7.0.0.0. 
 - DUPLICATE = IpAddressStatus(string='DUPLICATE')
- Indicates the address has been determined to be non-unique on the link, this address will not be reachable. This class attribute was added in vSphere API 7.0.0.0. 
 - INACCESSIBLE = IpAddressStatus(string='INACCESSIBLE')
- Indicates that the address is not accessible because interface is not operational. This class attribute was added in vSphere API 7.0.0.0. 
 - INVALID = IpAddressStatus(string='INVALID')
- Indicates that this isn’t a valid address. This class attribute was added in vSphere API 7.0.0.0. 
 - PREFERRED = IpAddressStatus(string='PREFERRED')
- Indicates that this is a valid address. This class attribute was added in vSphere API 7.0.0.0. 
 - TENTATIVE = IpAddressStatus(string='TENTATIVE')
- Indicates that the uniqueness of the address on the link is presently being verified. This class attribute was added in vSphere API 7.0.0.0. 
 - UNKNOWN = IpAddressStatus(string='UNKNOWN')
- Indicates that the status cannot be determined. This class attribute was added in vSphere API 7.0.0.0. 
 
 - class IpConfigInfo(ip_addresses=None, dhcp=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Interfaces.IpConfigInfoclass describes the protocol version independent address reporting data object for network interfaces. This class was added in vSphere API 7.0.0.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- ip_addresses ( - listof- Interfaces.IpAddressInfo) – IP addresses configured on the interface. This attribute was added in vSphere API 7.0.0.0.
- dhcp ( - com.vmware.vcenter.vm.guest_client.DhcpConfigInfoor- None) – Client side DHCP for an interface. This attribute was added in vSphere API 7.0.0.0. If None the IP was not configured by DHCP.
 
 
 - list(vm)
- Returns information about the networking interfaces in the guest operating system. This method was added in vSphere API 7.0.0.0. - Parameters
- vm ( - str) – Virtual machine ID The parameter must be an identifier for the resource type:- VirtualMachine.
- Return type
- Returns
- Information about the interfaces configured in the guest operating system. Interfaces are ordered in a guest operating system specific determined order. 
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user can not be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif VMware Tools is not running.
 
 
- class com.vmware.vcenter.vm.guest.networking_client.Routes(config)
- Bases: - vmware.vapi.bindings.stub.VapiInterface- The - Routesclass provides methods for retrieving guest operating system network routing information. This class was added in vSphere API 7.0.0.0.- Parameters
- config ( - vmware.vapi.bindings.stub.StubConfiguration) – Configuration to be used for creating the stub.
 - class Info(network=None, prefix_length=None, gateway_address=None, interface_index=None)
- Bases: - vmware.vapi.bindings.struct.VapiStruct- The - Routes.Infoclass describes an individual host, network or default destination network reachable through a gateway. This class was added in vSphere API 7.0.0.0.- Tip - The arguments are used to initialize data attributes with the same names. - Parameters
- network ( - str) – IP Address of the destination IP network. IPv4 address is specified using dotted decimal notation. For example, “192.0.2.1”. IPv6 addresses are 128-bit specified using as eight fields of up to four hexadecimal digits. A colon separates each field (:). For example, 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of symbol ‘::’ to represent multiple 16-bit groups of contiguous 0’s only once in an address as described in RFC 2373. This attribute was added in vSphere API 7.0.0.0.
- prefix_length ( - long) – The prefix length. For IPv4 the value range is 0-32. For IPv6 prefixLength is a decimal value range 0-128. The property represents the number of contiguous, higher-order bits of the address that make up the network portion of the IP address. This attribute was added in vSphere API 7.0.0.0.
- gateway_address ( - stror- None) – Where to send the packets for this route. Unicast IP Address of the next hop router. IPv4 address is specified using dotted decimal notation. For example, “192.0.2.1”. IPv6 addresses are 128-bit specified using as eight fields of up to four hexadecimal digits. A colon separates each field (:). For example, 2001:DB8:101::230:6eff:fe04:d9ff. The address can also consist of symbol ‘::’ to represent multiple 16-bit groups of contiguous 0’s only once in an address as described in RFC 2373. This attribute was added in vSphere API 7.0.0.0. If None no gateway is set for the route.
- interface_index ( - longor- None) – The network interface associated with this route. This is an index into the result of- Interfaces.list()The index refers to the relative position of an element in a- list. For example, an index of 0 refers to the first element in the- listwhile an index of 1 refers to the second element. This attribute was added in vSphere API 7.0.0.0. If None the route is not associated with a network interface.
 
 
 - list(vm)
- Returns information about network routing in the guest operating system. This method was added in vSphere API 7.0.0.0. - Parameters
- vm ( - str) – Virtual machine ID The parameter must be an identifier for the resource type:- VirtualMachine.
- Return type
- listof- Routes.Info
- Returns
- Information about the network routes configured in the guest operating system. 
- Raise
- com.vmware.vapi.std.errors_client.Errorif the system reports an error while responding to the request.
- Raise
- com.vmware.vapi.std.errors_client.NotFoundif the virtual machine is not found.
- Raise
- com.vmware.vapi.std.errors_client.Unauthenticatedif the user can not be authenticated.
- Raise
- com.vmware.vapi.std.errors_client.ServiceUnavailableif VMware Tools is not running.
 
 
- class com.vmware.vcenter.vm.guest.networking_client.StubFactory(stub_config)
- Bases: - vmware.vapi.bindings.stub.StubFactoryBase- Initialize StubFactoryBase - Parameters
- stub_config ( - vmware.vapi.bindings.stub.StubConfiguration) – Stub config instance