Previous page

Next page

Locate page in Contents

Synchronous Methods

A typical synchronous method returns the result directly to the caller as soon as it completes executing. In the following example the vm_config.get_name method obtains the name of a virtual machine and returns it to the caller:

vm_name = vm_config.get_name()

Synchronous methods in the Parallels Python API are usually used to extract data from local objects that were populated earlier in the program. The data can be extracted as objects or native Python data types. Examples include obtaining virtual machine properties, such as name and OS version, virtual hard disk type and size, network interface emulation type or MAC address, etc. In contrast, objects that are populated with the data from the Parallels Service side are obtained using asynchronous methods, which are described in the following section.

Synchronous methods throw the prlsdkapi.PrlSDKError exception. For more information on exceptions, see the Error Handling section.