Parallels Virtualization SDK Reference Manual

Parallels Virtualization SDK
Python API Reference
September 03, 2015
Copyright © 1999-2015 Parallels IP Holdings GmbH and its affiliates. All rights reserved.
Code Samples: Virtual Machine Management ......................................................... 7
C
HAPTER
1

Introduction

In This Chapter
About This Guide ................................................................................................... 3
Organization of This Guide ...................................................................................... 3
How to Use This Guide ........................................................................................... 4
Virtual Machines vs. Parallels Containers ................................................................. 4
Code Samples — Parallels Container Management ................................................. 5

About This Guide

This guide is a part of the Parallels Virtualization SDK. It contains the Parallels Python API Reference documentation. Please note that this guide does not provide general information on how to use the Parallels Virtualization SDK. To learn the SDK basics, please read the Parallels Virtualization SDK Programmer's Guide, which is a companion book to this one.

Organization of This Guide

This guide is organized into the following chapters:
Getting Started. You are reading it now.
Parallels Python API Reference. The main chapter describing the Parallels Python package and
modules. The chapter has the following main sections:
Package prlsdkapi. Contains the main reference information. Classes and methods are
described here.
Module prlsdkapi.prlsdk. This section described an internal module. Do not use it in your
programs.
Module prlsdkapi.prlsdk.consts. Describes the API constants. Most of the constants are
combined into groups which are used as pseudo enumerations. Constants that belong to the same group have the same prefix in their names. For example, constants with a PDE_ prefix identify device types: PDE_GENERIC_DEVICE, PDE_HARD_DISK, PDE_GENERIC_NETWORK_ADAPTER, etc. Other constants are named in a similar manner.
Introduction
Module prlsdkapi.prlsdk.errors. Describes error code constants. The API has a very large
number of error codes, but the majority of them are used internally. The error code constants are named similarly to other constants (i.e. using prefixes for grouping).

How to Use This Guide

If you are just starting with the Parallels Virtualization SDK, your best source of information is Parallels Virtualization SDK Programmer's Guide. It explain the Parallels Python API concepts and provides descriptions and step-by-step instructions on how to use the API to perform the most common tasks. Once you are familiar with the basics, you can use this guide as a reference where you can find a particular function syntax or search for a function that provides a functionality that you need.
Searching for Symbols in This Guide
Please note that when searching this guide for a symbol with an underscore in its name, the search may not produce the desired results. If you are experiencing this problem, replace an underscore with a whitespace character when typing a symbol name in the Search box. For example, to search for the PDE_HARD_DISK symbol, type PDE HARD DISK (empty spaces between parts of the symbol name).

Virtual Machines vs. Parallels Containers

With Parallels Cloud Server you have a choice of creating and running two types of virtual servers: Parallels Virtual Machines and Parallels Containers. While the two server types use different virtualization technologies (Hypervisor and Operating System Virtualization respectively), the Parallels Python API can be used to manage both server types transparently. This means that the same set of classes and methods (with some exceptions) is used to perform operations on both Virtual Machines and Containers.
The following list provides an overview of the specifics and differences when using the API to manage Virtual Machines or Containers:
When obtaining the list of the available virtual servers with the Server.get_vm_list
method, the result set will contain the virtual servers of both types. When iterating through the list and obtaining an individual server configuration data, you can determine the server type using the VmConfig.get_vm_type method. The method returns the server type: consts.PVT_VM (Virtual Machine) or consts.PVT_CT (Container). Once you know the server type, you can perform the desired server management tasks accordingly.
When creating a virtual server, you have to specify the type of the server you want to create.
This is done by using the Vm.set_vm_type method passing the consts.PVT_VM or the consts.PVT_CT constant to it as a parameter.
4
Introduction
The majority of classes and methods operate on both virtual server types. A method and its
input/output parameters don't change. Some classes and methods are Virtual Machine specific or Container specific. In the Python API Reference documentation such classes and methods have a Parallels Virtual Machines only or Parallels Containers only note at the beginning of the description. If a class or a method description doesn't specify the server type, it means that it can operate on both Virtual Machines and Containers.
When working with a particular server type, the flow of a given programming task may be
slightly different. There aren't many tasks like that. The most common tasks that have these differences are documented in this guide and the Parallels Virtualization SDk Programmer's Guide.

Code Samples — Parallels Container Management

This section provides a collection of simplified sample code that demonstrates how to use the Parallels Python API to perform the most common Parallels Container management tasks. For simplicity, no error checking is implemented in the sample code below. When writing your own program, the error checking should be properly performed. For more complete information and code samples, please read the Parallels Virtualization SDK Programmer's Guide.
import os import select import prlsdkapi from prlsdkapi import consts # Initialize the SDK. def init(): print 'init_server_sdk' prlsdkapi.init_server_sdk() # Deinitialize the SDK. def deinit(): print 'deinit_sdk' prlsdkapi.deinit_sdk() # Create a Parallels Container. def create(srv, name): print 'create ct' ct = srv.create_vm() ct.set_vm_type(consts.PVT_CT) ct.set_name(name) ct.set_os_template('centos-6-x86_64') ct.reg('', True).wait() return ct # Register a Container with # Parallels Cloud Server def register(srv, path): print 'register ct' ct = srv.register_vm(path).wait() return ct # Change a Container name. def setName(ct, name): print 'set_name' ct.begin_edit().wait() ct.set_name(name)
5
Introduction
ct.commit().wait() # Set CPU limits for a Container. def setCpuLimit(ct, limit): print 'set_cpu_limit' ct.begin_edit().wait() ct.set_cpu_limit(limit) ct.commit().wait() # Set RAM size for a Container. def setRamSize(ct, size): print 'set_ram_size' ct.begin_edit().wait() ct.set_ram_size(size) ct.commit().wait() # Add a hard disk to a Container. def addHdd(ct, image, size): print 'add hdd' ct.begin_edit().wait() hdd = ct.create_vm_dev(consts.PDE_HARD_DISK) hdd.set_emulated_type(consts.PDT_USE_IMAGE_FILE) hdd.set_disk_type(consts.PHD_EXPANDING_HARD_DISK) hdd.set_disk_size(size) hdd.set_enabled(True) hdd.create_image(bRecreateIsAllowed = True, bNonInteractiveMode = True).wait() ct.commit().wait() # Execute a program in a Container. def execute(ct, cmd, args): print 'execute command' io = prlsdkapi.VmIO() io.connect_to_vm(ct, consts.PDCT_HIGH_QUALITY_WITHOUT_COMPRESSION).wait() # open guest session result = ct.login_in_guest('root', '').wait() guest_session = result.get_param() # format args and envs sdkargs = prlsdkapi.StringList() for arg in args: sdkargs.add_item(arg) sdkargs.add_item("") sdkenvs = prlsdkapi.StringList() sdkenvs.add_item("") # execute ifd, ofd = os.pipe() flags = consts.PRPM_RUN_PROGRAM_ENTER|consts.PFD_STDOUT job = guest_session.run_program(cmd, sdkargs, sdkenvs, nFlags = flags, nStdout = ofd) # read output output = '' while True: rfds, _, _ = select.select([ifd], [], [], 5) if not rfds: break buf = os.read(ifd, 256) output += buf print('output:\n%s--end of output' % output) # cleanup os.close(ifd) job.wait() guest_session.logout() io.disconnect_from_vm(ct) # MAIN PROGRAM def sample1():
6
Introduction
init() srv = prlsdkapi.Server() srv.login_local().wait() # Create and start a Container. ct = create(srv, '101') ct.start().wait() # Execute the '/bin/cat /proc/cpuinfo' command # in a Container. execute(ct, '/bin/cat', ['/proc/cpuinfo']) ct.stop().wait() # Set some parameters and add a hard disk # to a Container. setCpuLimit(ct, 50) setRamSize(ct, 2048) addHdd(ct, '/tmp/my_empty_hdd_image', 1024) # Clone a Container. ct2 = ct.clone('121', '').wait().get_param() print('Clone name = %s' % ct2.get_name()) # Unregister and registers back a Container. home_path = ct.get_home_path() ct.unreg() ct = srv.register_vm(home_path).wait().get_param() # Delete a Container. ct.delete() ct2.delete() srv.logoff().wait() deinit()

Code Samples: Virtual Machine Management

This section provides a collection of simplified sample code that demonstrates how to use the Parallels Python API to perform the most common Parallels Virtual Machine management tasks. For simplicity, no error checking is done in the sample code below. When writing your own program, the error checking should be properly implemented. For the complete information and code samples, please read the Parallels Virtualization SDK Programmer's Guide.
# Create a Virtual Machine def create(server):
# Get the ServerConfig object. result = server.get_srv_config().wait() srv_config = result.get_param()
# Create a Vm object and set the virtual server type # to Virtual Machine (PVT_VM). vm = server.create_vm() vm.set_vm_type(consts.PVT_VM)
# Set a default configuration for the VM. vm.set_default_config(srv_config, \ consts.PVS_GUEST_VER_WIN_WINDOWS8, True)
# Set the VM name. vm.set_name("Windows8")
# Modify the default RAM and HDD size. vm.set_ram_size(256) dev_hdd = vm.get_hard_disk(0)
7
Introduction
dev_hdd.set_disk_size(3000)
# Register the VM with the Parallels Cloud Server. vm.reg("", True).wait() # Change VM name. def setName(vm, name): print 'set_name' vm.begin_edit().wait() vm.set_name(name) vm.commit().wait() # Set boot device priority def vm_boot_priority(vm):
# Begin the virtual server editing operation. vm.begin_edit().wait()
# Modify boot device priority using the following order: # CD > HDD > Network > FDD. # Remove all other devices from the boot priority list (if any). count = vm.get_boot_dev_count() for i in range(count): boot_dev = vm.get_boot_dev(i)
# Enable the device. boot_dev.set_in_use(True)
# Set the device sequence index. dev_type = boot_dev.get_type()
if dev_type == consts.PDE_OPTICAL_DISK: boot_dev.set_sequence_index(0) elif dev_type == consts.PDE_HARD_DISK: boot_dev.set_sequence_index(1) elif dev_type == consts.PDE_GENERIC_NETWORK_ADAPTER: boot_dev.set_sequence_index(2) elif dev_type == consts.PDE_FLOPPY_DISK: boot_dev.set_sequence_index(3) else: boot_dev.remove()
# Commit the changes. vm.commit().wait() # Execute a program in a VM. def execute(vm): # Log in. g_login = "Administrator" g_password = "12345" # Create a StringList object to hold the # program input parameters and populate it. hArgsList = prlsdkapi.StringList() hArgsList.add_item("cmd.exe") hArgsList.add_item("/C") hArgsList.add_item("C:\\123.bat") # Create an empty StringList object. # The object is passed to the VmGuest.run_program method and # is used to specify the list of environment variables and # their values to add to the program execution environment. # In this sample, we are not adding any variables. # If you wish to add a variable, add it in the var_name=var_value format. hEnvsList = prlsdkapi.StringList() hEnvsList.add_item("")
8
Introduction
# Establish a user session. vm_guest = vm.login_in_guest(g_login, g_password).wait().get_param() # Run the program. vm_guest.run_program("cmd.exe", hArgsList, hEnvsList).wait() # Log out. vm_guest.logout().wait()
9
Parallels Python API Reference
API Documentation
September 3, 2015

Contents

Contents 1
1 Package prlsdkapi 7
1.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Class PrlSDKError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 Class ApiHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.5.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.6 Class Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.6.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.7 Class StringList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.7.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.7.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.8 Class HandleList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.8.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.8.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.9 Class OpTypeList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.9.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.9.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.10 Class Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.10.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.10.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.11 Class Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.11.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.11.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.12 Class EventParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.12.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.12.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.13 Class Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.13.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.13.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.14 Class Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.14.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.14.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1
CONTENTS CONTENTS
1.15 Class FsInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.15.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.15.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.16 Class FsEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.16.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.16.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.17 Class ServerConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.17.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.17.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.18 Class HostDevice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.18.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.18.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.19 Class HostHardDisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.19.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.19.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.20 Class HdPartition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.20.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
1.20.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1.21 Class HostNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1.21.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
1.21.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.22 Class HostPciDevice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.22.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
1.22.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
1.23 Class UserConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
1.23.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
1.23.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.24 Class UserInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
1.24.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.24.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.25 Class DispConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.25.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
1.25.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
1.26 Class VirtualNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
1.26.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
1.26.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
1.27 Class PortForward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
1.27.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
1.27.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
1.28 Class VmDevice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
1.28.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
1.28.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
1.29 Class VmHardDisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
1.29.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
1.29.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
1.30 Class VmHdPartition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
1.30.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
1.30.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
1.31 Class VmNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
1.31.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.31.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2
CONTENTS CONTENTS
1.32 Class VmUsb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.32.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.32.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.33 Class VmSound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.33.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.33.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
1.34 Class VmSerial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
1.34.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
1.34.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
1.35 Class VmConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.35.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.35.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
1.36 Class Vm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
1.36.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
1.36.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
1.37 Class VmGuest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
1.37.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
1.37.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
1.38 Class Share . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
1.38.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
1.38.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
1.39 Class ScreenRes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
1.39.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
1.39.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
1.40 Class BootDevice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
1.40.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
1.40.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
1.41 Class VmInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
1.41.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
1.41.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
1.42 Class FoundVmInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
1.42.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
1.42.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
1.43 Class AccessRights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
1.43.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
1.43.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
1.44 Class VmToolsInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
1.44.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
1.44.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
1.45 Class Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
1.45.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
1.45.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
1.46 Class StatCpu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
1.46.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
1.46.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
1.47 Class StatNetIface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
1.47.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
1.47.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
1.48 Class StatUser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
1.48.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
1.48.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
3
CONTENTS CONTENTS
1.49 Class StatDisk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
1.49.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
1.49.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
1.50 Class StatDiskPart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
1.50.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
1.50.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
1.51 Class StatProcess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
1.51.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
1.51.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
1.52 Class VmDataStatistic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
1.52.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
1.52.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
1.53 Class License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
1.53.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
1.53.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
1.54 Class ServerInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
1.54.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
1.54.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
1.55 Class NetService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
1.55.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
1.55.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
1.56 Class LoginResponse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
1.56.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
1.56.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
1.57 Class RunningTask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
1.57.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
1.57.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
1.58 Class TisRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
1.58.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
1.58.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
1.59 Class OsesMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
1.59.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
1.59.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
1.60 Class ProblemReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
1.60.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
1.60.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
1.61 Class ApplianceConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
1.61.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
1.61.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
1.62 Class OfflineManageService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
1.62.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
1.62.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
1.63 Class NetworkShapingEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
1.63.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
1.63.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
1.64 Class NetworkShapingConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
1.64.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
1.64.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
1.65 Class NetworkClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
1.65.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
1.65.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
4
CONTENTS CONTENTS
1.66 Class NetworkRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
1.66.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
1.66.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
1.67 Class CtTemplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
1.67.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
1.67.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
1.68 Class UIEmuInput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
1.68.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
1.68.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
1.69 Class UsbIdentity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
1.69.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
1.69.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
1.70 Class FirewallRule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
1.70.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
1.70.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
1.71 Class IPPrivNet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
1.71.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
1.71.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
1.72 Class PluginInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
1.72.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
1.72.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
1.73 Class CapturedVideoSource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
1.73.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
1.73.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
1.74 Class BackupResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
1.74.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
1.74.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
1.75 Class NetworkShapingBandwidthEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
1.75.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
1.75.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
1.76 Class CpuFeatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
1.76.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
1.76.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
1.77 Class CPUPool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
1.77.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
1.77.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
1.78 Class VmBackup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
1.78.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
1.78.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
1.79 Class IoDisplayScreenSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
1.79.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
1.80 Class VmIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
1.80.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
2 Module prlsdkapi.prlsdk 163
2.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
2.2 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
2.3 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
3 Module prlsdkapi.prlsdk.consts 262
3.1 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
5
CONTENTS CONTENTS
4 Module prlsdkapi.prlsdk.errors 316
4.1 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Index 412
6
1 Package prlsdkapi

1.1 Modules

Package prlsdkapi

prlsdk (Section – consts (Section 3, p. 262) – errors (Section
2, p. 163)
4, p. 316)

1.2 Functions

conv error(err)
sdk check result(result, err obj =None)
call sdk function(func name, *args)
set sdk library path(path)
get sdk library path()
is sdk initialized()
init desktop sdk()
init desktop wl sdk()
init workstation sdk()
init player sdk()
init server sdk()
conv handle arg(arg)
handle to object(handle )

1.3 Variables

Name Description
prlsdk module Value: os.environ [’PRLSDK’] sdklib Value: os.environ [’SDKLIB’] err Value: ’Cannot import module "prlsdk" !’ deinit sdk Value: DeinitSDK()
continued on next page
7

Class PrlSDKError Package prlsdkapi

Name Description
package Value: ’prlsdkapi’
1.4 Class PrlSDKError
object
exceptions.BaseException
exceptions.Exception
prlsdkapi.PrlSDKError

1.4.1 Methods

init (self, result, error code, err obj )
init (...) initializes x; see he lp (type(x)) for signature
x.
Overrides: object.
init extit(inherited documentation)
get result(self )
get details(self )
Inherited from exceptions.Exception
new ()
Inherited from exceptions.BaseException
delattr (), getattribute (), getitem (), getslice (), reduce (), repr (),
setattr (), setstate (), str (), unicode ()
Inherited from object
format (), hash (), redu ce ex (), sizeof (), subclasshook ()

1.4.2 Properties

Name Description
Inherited from exceptions.BaseException
args, message
Inherited from object
class
8

Class ApiHelper Package prlsdkapi

1.5 Class ApiHelper
Provides common Parallels Python API system methods.

1.5.1 Methods

init(self, version)
Initialize the Parallels API library.
init ex(self, nVersion, nAppMode, nFlags=0, nReserved=0)
Initialize the Parallels API library (extended version).
deinit(self )
De-initializes the library.
get version(self )
Return the Parallels API version number.
get app mode(self )
Return the Parallels API application mode.
get result description(self, nErrCode, bIsBriefM essage =True, bFormated=False)
Evaluate a return code and return a description of the problem.
get message type(self, nErrCode)
Evaluate the specified error code and return its classificatio n (warning, question, info, etc.).
msg can be ignored(self, nErrCode)
Evaluate an error code and determine if the error is critical.
get crash dumps path(self )
Return the name and path of the directory where Parallels crash dumps are stored.
9
Class ApiHelper Package prlsdkapi
init crash handler(self, sCrashDumpFileSuffix)
Initiate the standard Parallels crash dump handler.
create strings list(self )
create handles list(self )
create op type list(self, nTypeSize)
get supported oses types(self, nHostOsType)
Determine the supported OS types for the current API mode.
get supported oses versions(self, nHostOsType, nGuestOsType)
get default os version(self, nGuestOsType)
Return the default guest OS version for the specified guest OS type.
send problem report(self, sProblemReport, bUseProxy, sProxyHost, nProxyPort, sProxyUserLogin, sProxyUserPasswd, nProblemSendTimeout, nReserved)
Send a problem report to the Parallels support server.
send packed problem report(self, hProblemReport, bUseProxy, sProxyHost, nProxyPort, sProxyUserLogin, sProxyUserPasswd, nProblemSendTimeout, nReserved)
unregister remote device(self, device type)
Unregister a remote device.
send remote command(self, hVm, hCommand)
get remote command target(self, hCommand)
get remote command index(self, hCommand)
get remote command code(self, hCommand )
10

Class Debug Package prlsdkapi

get recommend min vm mem(self, nOsVersion)
Return recommended minimal memory size for guest OS defined in the OS version parameter.
create problem report(self, nReportScheme)
1.6 Class Debug
Provides common Parallels Python API debug methods.

1.6.1 Methods

get handles num(self, type)
Determine how many handles were instantiated in the API library.
prl result to string(self, value)
Return a readable string representation of the Result value.
handle type to string(self, handle type)
Return a readable string representation of the specified handle type.
event type to string(self, event type)
Return a readable string representation of the specified event type.

1.7 Class StringList

ob ject
prlsdkapi. Handle
prlsdkapi.StringList
The StringList class is a generic string container.
11
Class StringList Package prlsdkapi

1.7.1 Methods

init (self, handle=0)
init (...) initiali zes x; see help(type(x)) for signature
x.
Overrides: object. init extit(inherited documentation)
get items count(self )
add item(self, sItem)
get item(self, nItemIndex )
remove item(self, nItemIndex )
len (self )
getitem (self, index )
iter (self )
Inherited from prlsdkapi. Handle
del (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.7.2 Properties

Name Description
Inherited from object
class
12

Class HandleList Package prlsdkapi

1.8 Class HandleList
ob ject
prlsdkapi. Handle
prlsdkapi.HandleList
A generic container containing a list of handl es (objects).

1.8.1 Methods

init (self, handle=0)
init (...) initiali zes x; see help(type(x)) for signature
x.
Overrides: object. init extit(inherited documentation)
get items count(self )
add item(self, hItem)
get item(self, nItemIndex )
remove item(self, nItemIndex )
len (self )
getitem (self, index )
iter (self )
Inherited from prlsdkapi. Handle
del (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.8.2 Properties

13

Class OpTypeList Package prlsdkapi

Name Description
Inherited from object
class
1.9 Class OpTypeList
ob ject
prlsdkapi. Handle
prlsdkapi.OpTypeList

1.9.1 Methods

init (self, handle=0)
init (...) initiali zes x; see help(type(x)) for signature
x.
Overrides: object. init extit(inherited documentation)
get items count(self )
get item(self, nItemIndex )
remove item(self, nItemIndex )
get type size(self )
signed(self, nItemIndex )
unsigned(self, nItemIndex )
double(self, nItemIndex )
len (self )
getitem (self, index )
iter (self )
14

Class Result Package prlsdkapi

Inherited from prlsdkapi. Handle
del (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.9.2 Properties

Name Description
Inherited from object
class
1.10 Class Result
ob ject
prlsdkapi. Handle
prlsdkapi.Result
Contains the results of an asynchronous operation.

1.10.1 Methods

get params count(self )
Determine the number of items (strings, objects) in the Result object.
get param by index(self, nIndex)
Obtain an object containing the results identified by index.
get param(self )
Obtain an object containing the results of the corresponding asynchronous operation.
get param by index as string(self, nIndex )
Obtain a string result from the Result object identified by index.
15

Class Event Package prlsdkapi

get param as string(self )
Obtain a string result from the Result object.
len (self )
getitem (self, index )
iter (self )
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.10.2 Properties

Name Description
Inherited from object
class
1.11 Class Event
ob ject
prlsdkapi. Handle
prlsdkapi.Event
Contains information about a system event or an extended error informati on in an asyn­chronous method invocation.

1.11.1 Methods

get type(self )
Overrides: prlsdkapi. Handle.get type
get server(self )
16
Class Event Package prlsdkapi
get vm(self )
get job(self )
get params count(self )
get param(self, nIndex )
get param by name(self, sParamName)
get err code(self )
get err string(self, bIsBriefMessage, bFormated)
can be ignored(self )
is answer required( self )
get issuer type(self )
get issuer id(self )
create answer event(self, nAnswer)
len (self )
getitem (self, index )
iter (self )
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.11.2 Properties

17

Class EventParam Package prlsdkapi

Name Description
Inherited from object
class
1.12 Class EventParam
ob ject
prlsdkapi. Handle
prlsdkapi.EventParam
Contains the system event parameter data.

1.12.1 Methods

get name(self )
get type(self )
Overrides: prlsdkapi. Handle.get type
to string(self )
to cdata(self )
to uint32(self )
to int32(self )
to uint64(self )
to int64(self )
to boolean(self )
to handle(self )
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
18

Class Job Package prlsdkapi

Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.12.2 Properties

Name Description
Inherited from object
class
1.13 Class Job
ob ject
prlsdkapi. Handle
prlsdkapi.Job
Provides methods for managing asynchronous operations (jobs).

1.13.1 Methods

wait(self, msecs=2147483647)
Suspend the main thread and wait for the job to finish.
cancel(self )
Cancel the specified job.
get status(self )
Obtain the current job status.
get progress(self )
Obtain the job progress info.
get ret code(self )
Obtain the return code from the job object.
19

Class Server Package prlsdkapi

get result(self )
Obtain the Result object containing the results returned by the job.
get error(self )
Provide additional job error information.
get op code(self )
Return the job operation code.
is request was sent(self )
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.13.2 Properties

Name Description
Inherited from object
class
1.14 Class Server
ob ject
prlsdkapi. Handle
prlsdkapi.Server
The main class pr oviding methods for accessing Parallels Service. Most of the operations in the Parallels Python API begin with obtaining an instance of this class. The class is used to establish a connection with the Parallels Service. Its other methods can be used to perform various tasks related to th e Parallels Service itself, higher level virtual machine tasks, such as obtaining the virtual machine list or creating a virtual machine, and many others.
20
Class Server Package prlsdkapi

1.14.1 Methods

init (self, handle=0)
init (...) initiali zes x; see help(type(x)) for signature
x.
Overrides: object. init extit(inherited documentation)
check parallels server alive(self, timeout, sServerHostname)
Determine if the Parallels Service on the specified host is running.
Parameters
timeout: The desired operation timeout (in milliseconds).
sServerHostname: The name of the host machine for which to get
the Parallels Service status. To get the status for the local Parallels Service, the parameter can be null or empty.
create(self )
Create a new instance of the Server class.
Return Value
A new instance of Server.
login(self, host, user, passwd, sPrevSessionUuid=’’, port cmd =0, timeout=0, security level=2)
Login to a remote Parallels Service.
login local(self, sPrevSessionUuid=’’, port=0, security level=2)
Login to the local Parallels Service.
logoff(self )
Log off the Parallels Service.
get questions(self )
Allows to synchronously receive questions from Parallels Service.
set non interactive session(self, bNonInteractive, nFlags=0)
Set the session in noninteractive or interactive mode.
is non interactive session(self )
21
Class Server Package prlsdkapi
disable confirmation mode(self, sUser, sPasswd, nFlags =0)
Disable administrator confirmation mode for the session.
enable confirmation mode(self, nFlags =0)
Enable administrator confirmation mode for the session.
is confirmation mode enabled(self )
Determine confirmation mode for the session.
get srv config(self )
Obtain the ServerConfig object containing the host configuration information.
Return Value
A Job ob ject . The ServerConfig object is obtained from the Result object.
get common prefs(self )
Obtain the DispConfig object containing the specified Parallels Service preferences info.
Return Value
A Job ob ject .
common prefs begin edit(self )
Mark the beginning of the Parallels Service preferences modification operation. This method must be called before making any changes to the Parallels Service common preferences through DispConfig. When you are done making the changes, call Server.common prefs commit to commit the changes.
common prefs commit(self, hDispCfg)
Commit the Parallels Server preferences changes.
Parameters
hDispCfg: A instance of DispConfig contaning the Parallels Service
preferences info.
common prefs commit ex(self, hDispCfg, nFlags)
22
Class Server Package prlsdkapi
get user profile(self )
Obtain the UserConfig object containing profile data of the currently logged in user.
Return Value
A Job ob ject .
get user info list(self )
Obtain a list of UserInfo objects containing information about all known users.
Return Value
A Job ob ject .
get user info(self, sUserId)
Obtain the UserInfo object containing information about the speci fi e d u ser .
Parameters
sUserId: UUID of the user to obtain the information for.
Return Value
A Job ob ject .
get virtual network list(self, nFlags= 0)
Obtain the VirtualNet object containing information about all existing virtual networks.
add virtual network(self, hVirtNet, nFlags=0)
Add a new virtual network to the Parallels Service configuration.
Parameters
hVirtNet: An instance of the VirtualNet class containing the
vitual network information.
nFlags: Reserved parameter.
update virtual network(self, hVirtNet, nFlags=0)
Update parameters of an existing virtual network.
23
Class Server Package prlsdkapi
delete virtual network(self, hVirtNet, nFlags =0)
Remove an existing virtual network from the Parallels Service configuration.
Parameters
hVirtNet: An instance of VirtualNet identifying the virtual
network.
nFlags: Reserved parameter.
update offline service(self, hOffmgmtService, nFlags)
delete offline service(self, hOffmgmtService, nFlags )
get offline services list(self, nFlags)
update network classe s list(self, hNetworkClassesList, nFlags)
get network classes list(self, nFlags)
update network shaping config(self, hNetworkShapingConfig, nFlags)
get network shaping config(self, nFlags)
configure generic pci(self, hDevList, nFlags =0)
Configure the PCI device assignment.
Parameters
hDevList: A list of HostPciDevice objects.
nFlags: Reserved parameter.
get statistics(self )
Obtain the Statistics object containing the host resource usage statistics.
Return Value
A Job ob ject .
user profile begin edit(self )
user profile commit(self, hUserProfile)
Saves (commits) user profile changes to the Parallels Service.
24
Class Server Package prlsdkapi
is connected(self )
Determine if the connection to the specified Parallels Service is active.
get server info( self )
Obtain the ServerInfo object containing the host computer information.
Return Value
A Job ob ject .
register vm(self, strVmDirPath, bNonInteractiveMode=False)
Register an existing virtual machine with the Parallels Service. This is an asynchronous method.
Parameters
strVmDirPath: Name and path of the virtual machine
directory.
bNonInteractiveMode: Set to True to use non-interactive mode.
Set to False to use interactive mode.
Return Value
An instance of the Vm class containing information about the virtual machine that was registered.
register vm ex(self, strVmDirPath, nFlags)
Register an existing virtual machine with Parallels Service (extended version).
register vm with uuid(self, strVmDirPath, strVmUuid, nFlags)
register3rd party vm(self, strVmConfigPath, strVmRootDirPath, nFlags)
create vm(self )
Create a new instaince of the Vm class.
Return Value
A new instance of Vm.
get vm list(self )
Obtain a list of virtual machines from the host.
Return Value
A Job ob ject . The list of virtual machines can be obtained from the Result object as a list of Vm objects.
25
Class Server Package prlsdkapi
get vm list ex(self, nFlags)
get default vm config(self, nVmType, sConfigSample, nOsVersion, nFlags)
create vm backup(self, sVmUuid, sTargetHost, nTargetPort,
sTargetSessionId, strDescription=’’, backup flags=2048, reserved flags=0, force operation=True)
Backup an existing virtual machine to a backup server.
Parameters
sVmUuid: The virtual machine UUID
sTargetHost: The name of the target host machine.
nTargetPort: Port number on the target host.
sTargetSessionId: The targt Parallels Service session ID.
strDescription: Backup description.
backup
flags: Backup options.
reserved flags: Reserved backup flags.
force
operation: Ignore all possible questions from the Parallels
Service (non-interactive mode).
Return Value
A Job ob ject .
restore vm backup(self, sVmUuid, sBackupUuid, sTargetHost, nTargetPort, sTargetSessionId, sTargetVmHomePath=’’, sTargetVmName=’’, restore flags=0, reserved flags=0, force operation=True)
Restore a virtual machine from a backup server.
26
Class Server Package prlsdkapi
get backup tree(self, sU uid, sTargetHost, nTargetPort, sTargetSessionId, backup flags=2048, reserved flags=0, force operation=True)
Obtain a backup tree from the backup server.
Parameters
sVmUuid: The target virtual machine UUID. Empty
string gets the tree for all virtual machines.
sTargetHost: The name of the target host machine.
nTargetPort: Port number.
sTargetSessionId: The target Parallels Service session ID.
backup
flags: Backup options.
reserved flags: Reserved flags parameter.
force operation: Ignore all questions from the Parallels Service
(non-interactive mode).
Return Value
A Job ob ject . The backup tree data is obtained as an XML document from the Result object.
remove vm backup(self, sVmUuid, sBackupUuid, sTargetHost, nTargetPort, sTargetSessionId, remove flags, reserved flags, force operation)
Remove backup of the virtual machine from the backup server.
subscribe to host statistics(self )
Subscribe to receive host statistics. This is an asynchronous method.
Return Value
A Job ob ject .
unsubscribe from host statistics(self )
Cancel the host statistics subscription. This is an asynchronous method.
Return Value
A Job ob ject .
shutdown(self, bForceShutdown=False)
Shut down the Parallels Service.
shutdown ex(self, nFlags)
27
Class Server Package prlsdkapi
fs get disk list(self )
Returns a list of root directories on the host computer.
fs get dir entries(self, path)
Retrieve information about a file system entry on the host.
Parameters
path: Directory name or drive letter for which to get the
information.
Return Value
A Job ob ject . The directory information is returned as an FsInfo ob ject a n d i s ob t a ined from the Result object.
fs create dir(self, path)
Create a directory in the specified location on the host.
Parameters
path: Full name and path of the directory to create.
fs remove entry(self, path)
Remove a file system entry from the host computer.
Parameters
path: Name and path of the entry to remove.
fs can create file(self, path)
Determine if the current user has rights to create a fil e on t h e h ost .
Parameters
path: Full path of the target directory.
Return Value
Boolean. True - the user can create files in the specified directory. False - otherwise.
fs rename entry(self, oldPath, newPath)
Rename a file system entry on the host.
Parameters
oldPath: Name and path of the entry to rename.
newPath: New name and path.
28
Class Server Package prlsdkapi
update license(self, sKey, sUser, sCompany)
Installs Parallels license on the specified Parallels Service.
update license ex(self, sKey, sUser, sCompany, nFlags)
get license info(self )
Obtain the License object containing the Parallels licen se i n for m at i on.
Return Value
A Job ob ject .
send answer(self, hAnswer)
Send an answer to the Parallels Service in response to a question.
start search vm s( self, hStringsList=0)
Searche for unregistered virtual machines at t h e specified locat io n ( s) .
net service start(self )
Start the Parallels network service.
net service stop(self )
Stop the Parallels network service.
net service restart(self )
Restarts the Parallels network service.
net service restore defaults(self )
Restores the default settings of the Parallels network service.
get net service status(self )
Obtain the NetService object containing the Parallels n etwork service status information.
Return Value
A Job ob ject .
29
Class Server Package prlsdkapi
get problem report(self )
Obtain a problem report in the event of a virtual machine operation failure.
Return Value
A Job ob ject . The report is returned as a st r i n g th a t is o b t ai n ed from the Result object.
get packed problem report(self, nFlags )
attach to lost task(self, sTaskId)
Obtain a handle to a running task after the connection to the Parallels Service was lost.
Parameters
sTaskId: The ID of the task to attach to. The ID is obtained from
the LoginResponse object.
get supported oses(self )
create unattended cd(self, nGuestType, sUserName, sPasswd,
sFullUserName, sOsDistroPath, sOutImagePath)
Create a bootable ISO-image for unattended Linux installation.
fs generate entry name(self, sDirPath, sFilenamePrefix=’’, sFilenameSuffix=’’, sIndexDelimiter=’’)
Automatically generate a unique name for a new directory.
Parameters
sDirPath: Full name and path of the target directory.
sFilenamePrefix: A prefix to to use in the directory name. Pass
empty string for default.
sFilenameSuffix: A suffix to use in the name. Pass em pty string
for default.
sIndexDelimiter: A character to use as a delimiter between prefix
and index.
Return Value
A Job ob ject .
subscribe to perf stats(self, sFilter )
Subscribe to receive perfomance statistics.
30
Class Server Package prlsdkapi
unsubscribe from perf stats(self )
Cancels the performance statistics subscription.
get perf stats(self, sFilter )
has restriction(self, nRestrictionKey)
get restriction info(self, nRestrictionKey)
install appliance(self, hAppCfg, sVmParentPath, nFlags )
cancel install appliance(self, hAppCfg, nFlags)
stop install appliance(self, hAppCfg, nFlags)
get ct template list(self, nFlags)
remove ct template(self, sName, sOsTmplName, nFlags)
copy ct template(self, sN ame, sOsTmplN ame, sTargetServerHostname,
nTargetServerPort, sTargetServerSessionUuid, nFlags, nReservedFlags)
is feature supported(self, nFeatureId)
add ipprivate network(self, hPrivNet, nFlags)
remove ipprivate network(self, hPrivNet, nFlags)
update ipprivate network(self, hPrivNet, nFlags)
get ipprivate networks list(self, nFlags)
refresh plugins(self, nFlags)
get plugins list(self, sClassId, nFlags)
login ex(self, host, user, passwd, sPrevSessionUuid, port cmd, timeout,
security level, flags)
31

Class FsInfo Package prlsdkapi

login local ex(self, sPrevSessionUuid, port, security level, flags)
get disk free space(self, sPath, nFlags)
create desktop control(self )
get vm config(self, sSearchId, nFlags)
get cpupools list(self )
move to cpupool(self, hCpuPool)
recalculate cpupool(self, hCpuPool)
Inherited from prlsdkapi. Handle
del (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.14.2 Properties

Name Description
Inherited from object
class
1.15 Class FsInfo
ob ject
prlsdkapi. Handle
prlsdkapi.FsInfo
Contains information about a file system entry and its immed i at e child elements (files and directories) on the host computer.
32
Class FsInfo Package prlsdkapi

1.15.1 Methods

get type(self )
Determine the basic type of the file system entry.
Return Value
The file system type. Can be PFS WINDOWS LIKE FS, PFS UNIX LIKE FS.
Overrides: prlsdkapi.
Handle.get type
get fs type(self )
Determine the file system type of the file system entry.
Return Value
A Boolean value. True - log level i s con figured.
get child entries count(self )
Determine the number of child entries for the speci fi ed remote file system entry.
Return Value
Integer. The number of child entries.
get child entry(self, nIndex )
Obtain the FsEntry object containing a child entry information.
Parameters
nIndex: Integer. The index of the child entry to get the information
for.
Return Value
The FsEntry object containing the child entry information.
get parent entry(self )
Obtain the FsEntry object containing the parent file syste m entry info.
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()
33

Class FsEntry Package prlsdkapi

1.15.2 Properties

Name Description
Inherited from object
class
1.16 Class FsEntry
ob ject
prlsdkapi. Handle
prlsdkapi.FsEntry
Contains information about a file system entry (disk, directory, file) on the host computer.

1.16.1 Methods

get absolute path(self )
Return the specified file system entry absolute path.
Return Value
A string containing the path.
get relative name ( self )
Return the file system entry relative name.
Return Value
A string contaning the name.
get last modified date(self )
Return the date on which the specified file system entry was last modified.
Return Value
A string containing the date.
get size(self )
Return the file system entry size.
Return Value
A long containing the size (in bytes).
34
Class ServerConfig Package prlsdkapi
get permissions(self )
Return the specified file system entry permissions (read, write, execute) for the current user.
Return Value
An integer contaning the permissions. The permissions are specified as bitmasks.
get type(self )
Return the file system entry type (file, directory, drive).
Return Value
The entry type. Can be PSE
DRIVE, PSE DIRECTORY, PSE FILE.
Overrides: prlsdkapi. Handle.get type
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.16.2 Properties

Name Description
Inherited from object
class
1.17 Class ServerConfig
ob ject
prlsdkapi. Handle
prlsdkapi.ServerConfig
Provides methods for obtaining the host computer configuration information.
35
Class ServerConfig Package prlsdkapi

1.17.1 Methods

get host ram size(self )
Determine the amount of memory (RAM) available on the host.
get cpu model(self )
Determine the model of CPU of the host machine.
get cpu count(self )
Determine the number of CPUs in the host machine.
get cpu speed(self )
Determine the host machine CPU speed.
get cpu mode(self )
Determine the CPU mode (32 bit or 64 bit) of the host machine.
get cpu hvt(self )
Determine the hardware virtualization type of the host CPU.
get cpu features ex(self )
get cpu features masking capabilities(self )
get host os type(self )
Return the host operating system type.
get host os major(self )
Return the major version number of the host operating system.
get host os minor(self )
Return the minor version number of the host operati n g sy st em .
get host os sub minor(self )
Return the sub-minor version number of the host op er at i n g sy st em .
36
Class ServerConfig Package prlsdkapi
get host os str presentation(self )
Return the full host operating system information as a singl e st r i n g .
is sound default enabled(self )
Determine whether a sound device on the host is enabled or disabled.
is usb supported(self )
Determine if USB is supported on the host.
is vtd supported(self )
Determine whether VT-d is supported on the host.
get max host net adapters(self )
get max vm net adapters(self )
get hostname(self )
Return the hostname of the specified host or guest.
get default gateway(self )
Obtain the global default gateway address of th e specified host or guest.
get default gateway ipv6(self )
get dns servers(self )
Obtain the list of IP addresses of DNS servers for the host or guest.
get search domains(self )
Obtain the list of search domains for the specified host or guest.
get floppy disks count(self )
Determine the number of floppy disk drives on the host.
get floppy disk(self, nI ndex )
Obtain the HostDevice object containing information about a floppy disk drive on the host.
37
Class ServerConfig Package prlsdkapi
get optical disks count(self )
Determine the number of optical disk drives on the host.
get optical disk(self, nIndex )
Obtain the HostDevice object containing information about an optical disk drive on the host.
get serial ports count(self )
Determine the number of serial ports available on the host.
get serial port(self, nIndex )
Obtain the HostDevice object containing information about a serial port on the host.
get parallel ports count(self )
Determine the number of parallel ports on the host.
get parallel port(self, nIndex )
Obtain the HostDevice object containing information about a parallel port on the host.
get sound output devs count(self )
Determine the number of sound devices available on the host.
get sound output dev(self, nIndex )
Obtain the HostDevice object containing information about a sou nd device on the host.
get sound mixer devs count(self )
Determine the number of sound mixer devices available on the host.
get sound mixer dev(self, nIndex )
Obtain the HostDevice object containing information about a sound mixer device on the host.
get printers count(self )
Determine the number of printers installed on the host.
38
Class ServerConfig Package prlsdkapi
get printer(self, nIndex)
Obtain the HostDevice object containing information about a printer installed on the host.
get generic pci devices count(self )
Determine the number of PCI devices installed on the host.
get generic pci device(self, nIndex )
Obtain the HostDevice object containing information about a PCI device installed on the host.
get generic scsi devices count(self )
Determine the number of generic SCSI devices installed on the host.
get generic scsi device(self, nIndex )
Obtain the HostDevice object containing information about a generic SCSI device.
get usb devs count(self )
Determine the number of USB devices on the host.
get usb dev(self, nIndex )
Obtain the HostDevice object containing information about a USB device on the host.
get hard disks count(self )
Determine the number of hard disk drives on the h ost .
get hard disk(self, nIndex )
Obtain the HostHardDisk object containing information about a hard disks drive on the host.
get net adapters count(self )
Determine the number of network adapters available on the server.
get net adapter(self, nIndex )
Obtain the HostNet object containing information about a network adapter in the host or guest.
39

Class HostDevice Package prlsdkapi

Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.17.2 Properties

Name Description
Inherited from object
class
1.18 Class HostDevice
ob ject
prlsdkapi. Handle
prlsdkapi.HostDevice
Known Subclasses: prls d kapi.HostHardDisk, prlsdkapi.HostNet, prlsdkapi.HostPciDevice
A base class providing methods for obtaining information about physical devices on the h o st computer. The descendants of this class provide additional methods specific to a particular device type.

1.18.1 Methods

get name(self )
Obtain the device name.
get id(self )
Obtain the device ID.
get type(self )
Obtain the device type.
Overrides: prlsdkapi. Handle.get type
40

Class HostHardDisk Package prlsdkapi

is connected to vm(self )
Determine whether the device is connected to a virtual machine.
get device state(self )
Determine whether a virtual machine can directly use a PCI device through IOMMU technology.
set device state(self, nDeviceState)
Set whether a virtual machine can directly use a PCI device through IOMMU technology.
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.18.2 Properties

Name Description
Inherited from object
class
1.19 Class HostHardDisk
ob ject
prlsdkapi. Handle
prlsdkapi.HostDevice
prlsdkapi.HostHardDisk
Provides methods for obtaining information about a physical hard disk on t he host computer.
41
Class HostHardDisk Package prlsdkapi

1.19.1 Methods

get dev name(self )
Return the hard disk device name.
get dev id(self )
Return the hard disk device id.
get dev size(self )
Return the size of the hard disk device.
get disk index(self )
Return the index of a hard disk device.
get parts count(self )
Determine the number of partitions available on a hard drive.
get part(self, nIndex )
Obtain the HdPartition object identifying the specified hard disk partition.
Inherited from prlsdkapi.HostDevice(Section 1.18)
device state(), get id(), get name(), get type(), is connected to vm(), set device state()
get
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.19.2 Properties

Name Description
Inherited from object
class
42

Class HdPartition Package prlsdkapi

1.20 Class HdPartition
ob ject
prlsdkapi. Handle
prlsdkapi.HdPartition
Provides methods for obtain i n g information about a physical hard disk partition on the host computer.

1.20.1 Methods

get name(self )
Return the hard disk partition name.
Return Value
String. The partition name.
get sys name(self )
Return the hard disk partition system name.
Return Value
String . The partition name.
get size(self )
Return the hard disk partition size.
Return Value
Long. The partition size (in MB).
get index(self )
Return the index of the hard disk partition.
Return Value
Integer. The partition index.
get type(self )
Return a numerical code identifying the type of the partition.
Return Value
Integer. Partition type.
Overrides: prlsdkapi.
Handle.get type
43

Class HostNet Package prlsdkapi

is in use(self )
Determines whether the partition is in use ( contains valid file system, being used for swap, etc.).
Return Value
Boolean. True - partition is in use. False - partition is not in use.
is logical(self )
Determine whether the specified partition is a logical part it i o n .
Return Value
Boolean. True - partition is logical. False - partition is physical.
is active(self )
Determine whether the disk partition is active or inactive.
Return Value
Boolean. True - partition is active. False - p a r ti t i on i s n o t act i ve.
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.20.2 Properties

Name Description
Inherited from object
class
1.21 Class HostNet
ob ject
prlsdkapi. Handle
prlsdkapi.HostDevice
prlsdkapi.HostNet
44
Class HostNet Package prlsdkapi
Provides methods for obtaining information about a physical network adapter on the host computer.

1.21.1 Methods

get net adapter type(self )
Return the network adapter type.
get sys index(self )
Return the network adapter system index.
is enabled(self )
Determine whether the adapter is enabled or disabled.
is configure with dhcp(self )
Determine whether the adapter network settin gs are co n fi g u r ed through DHCP.
is configure with dhcp ipv6(self )
get default gateway(self )
Obtain the default gateway address for the specified network adapter.
get default gateway ipv6(self )
get mac address(self )
Return the MAC address of the specified network adapter .
get vlan tag(self )
Return the VLAN tag of the network adapter.
get net addresses(self )
Obtain the list of network addresses (IP address/Subnet mask pairs) assigned to the network adapter.
45

Class HostPciDevice Package prlsdkapi

get dns servers(self )
Obtain the list of addresses of DNS servers assigned to the specified network adapter.
get search domains(self )
Obtain a list of search domains assigned to the specified network adapter.
Inherited from prlsdkapi.HostDevice(Section 1.18)
get device state(), get id(), get name(), get type(), is connected to vm(), set device state()
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.21.2 Properties

Name Description
Inherited from object
class
1.22 Class HostPciDevi ce
ob ject
prlsdkapi. Handle
prlsdkapi.HostDevice
prlsdkapi.HostPciDevice
Provides methods for obtaining information about a PCI devi ce o n t h e h ost com puter.

1.22.1 Methods

get device class(self )
46
Class UserConfig Package prlsdkapi
is primary device(self )
Inherited from prlsdkapi.HostDevice(Section 1.18)
get device state(), get id(), get name(), get type(), is connected to vm(), set device state()
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.22.2 Properties

Name Description
Inherited from object
class
1.23 Class UserConfig
ob ject
prlsdkapi. Handle
prlsdkapi.UserConfig
Provides methods for obtaining information about the currently logged in user and for setting the user preferences.

1.23.1 Methods

get vm dir uuid(self )
Return name and path of the default virtual machine folder for the Parallels Service.
set vm dir uuid(self, sNewVmDirUuid)
Set the default virtual machine directory name and path for the Parallels Service.
47

Class UserInfo Package prlsdkapi

get default vm folder(self )
Return name and path of the default virtual machine directory for the user.
set default vm folder(self, sNewDefaultVmFolder)
Set the default virtual machine folder for the user.
can use mng console(self )
Determine if the user is allowed to use the Parallels Service Management Console.
can change srv s ets ( self )
Determine if the current user can modify Parallels Service preferences.
is local administrator(self )
Determine if the user is a local administrator on the host where Parallels Service is running.
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.23.2 Properties

Name Description
Inherited from object
class
1.24 Class UserInfo
ob ject
prlsdkapi. Handle
prlsdkapi.UserInfo
Provides methods for obtaining information about the specified Parallels Service user.
48
Class DispConfig Package prlsdkapi

1.24.1 Methods

get name(self )
Return the user name.
get uuid(self )
Returns the user Universally Unique Identifier ( UUID ) .
get session count(self )
Return the user active session count.
get default vm folder(self )
Return name and path of the default virtual machine directory for the user.
can change srv s ets ( self )
Determine whether the specified user is allowed to modify Parallels Service preferences.
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.24.2 Properties

Name Description
Inherited from object
class
1.25 Class DispConfig
ob ject
prlsdkapi. Handle
prlsdkapi.DispConfig
49
Class DispConfig Package prlsdkapi
Provides methods for managing Parallels Service preferences.

1.25.1 Methods

get default vm dir(self )
Obtain name and path of the directory in which new virtual machines are created by default.
Return Value
A string containing name and path of the default virtual machine directory.
get default ct dir(self )
get reserved mem limit(self )
Determine the amount of physical memory reserved for Parallels Service operation.
Return Value
Integer. The memory size in megabytes.
set reserved mem limit(self, nMemSize)
Set the amount of memory that will be allocated for Parallels Service operation.
Parameters
nMemSize: Integer. The memory size in megabytes.
get min vm mem(self )
Determine the minimum required memory size that must be allocated to an individual virtual machine.
Return Value
Integer. The memory size in megabytes.
set min vm mem(self, nMemSize)
Set the minimum required memory size that must be allocated to an individual virtual machine.
Parameters
nMemSize: Integer. The memory size in megabytes.
50
Class DispConfig Package prlsdkapi
get max vm mem(self )
Determine the maximum memory size that can be allocated to an i n d i vi d ual virtual machine.
Return Value
Integer. The memory size in megabytes.
set max vm mem(self, nMemSize)
Set the maximum memory size that can be allocated to an indivi d u a l v ir t ual machine.
Parameters
nMemSize: Integer. The memory size in megabytes.
get recommend max vm mem(self )
Determine the recommended memory size for an individual virtual machine.
Return Value
Integer. The memory size in megabytes.
set recommend max vm mem(self, nMemSize)
Set recommended memory size for an individual virtual machine.
Parameters
nMemSize: Integer. The memory size in megabytes.
get max reserv mem limit(self )
Return the maximum amount of memory that can be reserved for Parallels Service operation.
Return Value
Integer. The memory size, in megabytes.
set max reserv mem limit(self, nMemSize)
Set the upper limit of the memory size that can be reserved for Parallels Service operation.
Parameters
nMemSize: Integer. The memory size in megabytes.
51
Class DispConfig Package prlsdkapi
get min reserv mem limit(self )
Return the minimum amount of physical memory that must be reserved for Parallels Service operation.
Return Value
Integer. The memory size in megabytes.
set min reserv mem limit(self, nMemSize)
Set the lower limit of the memory size that must be reserved for Parallels Service operation.
Parameters
nMemSize: Integer. The memory size in megabytes.
is adjust mem auto(self )
Determine whether memory allocation for Parallels Service is performed automatically or manually.
Return Value
Boolean. True – automatic memory allocation. False – manual allocation.
set adjust mem auto(self, bAdjustMemAuto)
Set the Parallels Service memory allocation mode (automat i c or manual).
Parameters
bAdjustMemAuto: Boolean. Set to True for automatic mode. Set to
False for manual mode.
is send statistic report(self )
Determine whether the statistics reports (CEP) mechanism is activated.
Return Value
A Boolean value. True - CEP is activated. False - deactivated.
set send statistic report(self, bSendStatisticReport)
Turn on/off the mechanism of sending stati st i cs r eports (CEP).
Parameters
bSendStatisticReport: Boolean . Set to True to turn the CEP on.
Set to False to turn it off.
52
Class DispConfig Package prlsdkapi
get default vnchost name(self )
Return the default VNC host name for the Parallels Service.
Return Value
A string containing the VNC host name.
set default vnchost name(self, sNewHostName)
Set the base VNC host name.
Parameters
sNewHostName: String. The VNC host name to set.
get vncbase port(self )
Obtain the currently set base VNC port number.
Return Value
Integer. The port number.
set vncbase port(self, nPort )
Set the base VNC port number.
Parameters
nPort: Integer. Port number.
can change default settings(self )
Determine if new users have the right to modify Parallels Service preferences.
Return Value
Boolean. True indicates that new users can modify preferences. False indicates otherwise.
set can change def a ult settings(self, bDefaultChangeSettings)
Grant or deny a permission to new users to modify Parallels Service preferences.
Parameters
bDefaultChangeSettings: Bool ean . Set to True to grant the
permission. Set to False to deny it.
53
Class DispConfig Package prlsdkapi
get min security level(self )
Determine the lowest allowable security level that can be used to connect to the Parallels Service.
Return Value
One of the following constants: PSL LOW SECURITY – Plain TCP/IP (no encryption). PSL NORMAL SECURITY – impor t ant data is sent and received using SSL. PSL HIGH SECURITY – all data is sent and received using SSL.
set min security level(self, nMinSecurityLevel)
Set the lowest allowable security level that can be used to connect to the Parallels Service.
Parameters
nMinSecurityLevel: Security level to set. Can be one of the
following constants: PSL LOW SECURITY – Plain TCP/IP (no encryption). PSL NORMAL S ECUR ITY – im portant data is sent and received using SSL. PSL HIGH SECURITY – al l data is sent and received using SSL.
get confirmations list(self )
Obtain a list of operations that require administrator confirmation.
set confirmations list(self, hConfirmList)
Set the list of operations that require administrator con fi r m at i on.
get default backup server(self )
Return the default backup server host name or IP add r ess .
Return Value
A string containing the backup server host name of IP address.
set default backup server(self, sBackupServer )
Set the default backup server host name or IP address.
Parameters
sBackupServer: String. The default backup server host name or IP
address.
54
Class DispConfig Package prlsdkapi
get backup user l og in( self )
Return the backup user login name.
Return Value
A string containing the name.
set backup user l og in( self, sU ser Login)
Set the backup user login.
Parameters
sUserLogin: String. The backup user log in name to set.
set backup user pa ss word(self, sUserPassword)
Set the backup user password.
Parameters
sUserPassword: String. The backup us er p ass word to set.
is backup user pas sword enabled(self )
Determine if the backup user password is enabled .
Return Value
A Boolean value. True - backup u ser password is enabled. False ­password is disabled.
set backup user pa ss word enabled(self, bUserPasswordEnabled)
Enable or disable the backup user password.
Parameters
bUserPasswordEnabled: Boolean . Set to True to enable the
password. Set to False to diable it.
get default backup directory(self )
Return the name and path of the default backup directory.
Return Value
A string containing the directory name and path.
set default backup directory(self, sBackupDirectory)
Set name and path of the default backup directory.
get backup timeout(self )
55
Class DispConfig Package prlsdkapi
set backup timeout(self, nTimeout)
get default encryption plugin id(self )
set default encryption plugin id(self, sDefaultPluginId )
are plugins enabled(self )
enable plugins(self, bEnablePluginsSupport)
get vm cpu limit type(self )
set vm cpu limit type(self, nVmCpuLimitType)
is verbose log enabled(self )
Determine whether the verbose log level is configured for dispatcher and virtual machines processes.
Return Value
A Boolean value. True - log level i s con figured. False - log level is not configured.
set verbose log enabled(self, bEnabled)
Enable or disable the verbose log level for dispatcher and virtual machines processes.
is allow multiple pmc(self )
set allow multiple pmc(self, bEnabled)
is allow direct mobile(self )
set allow direct mobile(self, bEnabled)
is allow mobile clients(self )
get proxy connection status(self )
set proxy connection creds(self, sAccountId, sPassword)
56

Class VirtualNet Package prlsdkapi

get proxy connection user(self )
is log rotation enabled(self )
set log rotation enabled(self, bEnabled)
get cpu features mask ex(self )
set cpu features mask ex(self, hCpuFeatures)
get usb identity count(self )
get usb identity(self, nUsbIdentI ndex )
set usb ident as sociation(self, sSystemName, sVmUuid, nFlags)
get cpu pool(self )
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.25.2 Properties

Name Description
Inherited from object
class
1.26 Class VirtualNet
ob ject
prlsdkapi. Handle
prlsdkapi.VirtualNet
57
Class VirtualNet Package prlsdkapi
Provides methods for managing Parallels virtual networks.

1.26.1 Methods

init (self, handle=0)
x.
init (...) initiali zes x; see help(type(x)) for signature
Overrides: object.
init extit(inherited docum entation)
create(self )
Creates a new instance of VirtualNet.
get network id(self )
Return the ID of the specified virtual network.
set network id(self, sNetworkId)
Set the virtual network ID.
get description(self )
Return the description of the specified virtual network.
set description(self, sDescription)
Sets the virtual network description.
get network type(self )
Return the virtual network type.
set network type(self, nNetworkType)
Set the virtual network type.
get bound card mac(self )
Return the bound card MAC address of the specified virtual network.
set bound card mac(self, sBoundCardMac)
Sets the specified virtual network bound card MAC address.
58
Class VirtualNet Package prlsdkapi
get adapter name(self )
Return the name of the network adapter in the specified virtual network.
set adapter name(self, sAdapterName)
Sets the specified virtual network adapter name.
get adapter index(self )
Return a numeric index assigned to the network adapter in the specified virtual network.
set adapter index(self, nAdapterIndex)
Sets the specified adapter index.
get host ipaddress(self )
Return the host IP address of the specified virtual network.
set host ipaddress(self, sHostIPAddress)
Set the virtual network host IP address.
get host ip6address(self )
set host ip6address(self, sHostIPAddress)
get dhcp ipaddress(self )
Return the DHCP IP address of the specified virtual network.
set dhcp ipaddress(self, sDhcpIPAddress)
Set the virtual network DHCP IP address.
get dhcp ip6address(self )
set dhcp ip6address(self, sDhcpIPAddress)
get ipnet mask(self )
Return the IP net mask of the specified virtual network.
59
Class VirtualNet Package prlsdkapi
set ipnet mask(self, sIPNetMask)
Set the virtual network IP net mask.
get ip6net mask(self )
set ip6net mask(self, sIPNetMask)
get vlan tag(self )
Return the VLAN tag of the specified virtual network.
set vlan tag(self, nVlanTag)
Set the VLAN tag for the virtual network.
get ipscope start(self )
Returns the DHCP starting IP address of the specified virtual network.
set ipscope start(self, sIPScopeStart)
Set the virtual network DHCP starting IP address.
get ipscope end(self )
Return the DHCP ending IP address of the specified virtual network.
set ipscope end(self, sIPScopeEnd)
Set the virtual network DHCP ending IP address
get ip6scope start(self )
set ip6scope start(self, sIPScopeStart)
get ip6scope end(self )
set ip6scope end(self, sIPScopeEnd)
is enabled(self )
Determine whether the virtual network is enab l ed o r d is ab l ed .
60
Class VirtualNet Package prlsdkapi
set enabled(self, bEnabled)
Enable or disable the virtual network.
is adapter enabled(self )
Determine whether the virtual network adap t er is enabled or disabled.
set adapter enabled(self, bEnabled)
Enable or disable a virtual network adapter .
is dhcpserver enabled( self )
Determine whether the virtual network DHCP server is enabled or disabled.
set dhcpserver enabled( self, bEnabled)
Enable or disable the virtual network DHCP server.
is dhcp6server enabled( self )
set dhcp6server enabled( self, bEnabled)
is natserver enabl ed( self )
Determine whether the specified virtual network NAT server is enabled or disabled.
set natserver ena ble d(self , bEn abled)
Enable or disable the virtual network NAT server.
get port forward list(self, nPortFwdType)
Return the port forward entries list.
set port forward list(self, nPortFwdType, hPortFwdList )
Set the port forward entries list.
get bound adapter info(self, hSrvConfig )
Obtain info about a physical adapter, which is bound to the virtual network ob ject .
Inherited from prlsdkapi. Handle
61

Class PortForward Package prlsdkapi

del (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.26.2 Properties

Name Description
Inherited from object
class
1.27 Class PortForward
ob ject
prlsdkapi. Handle
prlsdkapi.PortForward
Provides access to the Port Forwarding functionality. Using this functionality, you can redirect all incoming data from a specific TCP p or t on the host computer to a specified port in a specified virtual machine.

1.27.1 Methods

init (self, handle=0)
init (...) initiali zes x; see help(type(x)) for signature
x.
Overrides: object.
init extit(inherited docum entation)
create(self )
Create a new instance of the PortForward class.
get incoming port(self )
Return the incoming port.
set incoming port(self, nIncomingPort)
Set the specified incoming port.
62

Class VmDevice Package prlsdkapi

get redirect ipaddress(self )
Return the redirect IP address of the specified port forward entry.
set redirect ipaddress(self, sRedirectIPAddress)
Set the specified port forward entry redirect IP address.
get redirect port(self )
Return the redirect port.
set redirect port(self, nRedirectPort)
Set the specified redirect port.
Inherited from prlsdkapi. Handle
del (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.27.2 Properties

Name Description
Inherited from object
class
1.28 Class VmDevice
ob ject
prlsdkapi. Handle
prlsdkapi.VmDevice
Known Subclasse s: prlsdkapi.VmHardDisk, prlsdkapi.VmNet, prlsdkapi.VmSerial, prlsd-
kapi.VmSound, prlsdkapi.VmUsb
A base class providing methods for virtual device management.
63
Class VmDevice Package prlsdkapi

1.28.1 Methods

create(self, nDeviceType)
Create a new virtual device object not bound to any virtual machine.
connect(self )
Connect a virtual device to a running virtual machine.
disconnect(self )
Disconnect a device from a running virtual machine.
create image(self, bRecreateIsAllowed=False, bNonInteractiveMode=True)
Physically create a virtual device image on the host.
copy image(self, sNewImageName, sTargetPath, nFlags)
resize image(self, nNewSize, nFlags)
Resize the virtual device image.
get index(self )
Return the index identifying the virtual device.
set index(self, nIndex )
Set theindex identifying the virtual device.
remove(self )
Remove the virtual device object from the parent virtual machine list.
get type(self )
Return the virtual device type.
Overrides: prlsdkapi. Handle.get type
is connected(self )
Determine if the virtual device is connected.
64
Class VmDevice Package prlsdkapi
set connected(self, bConnected )
Connect the virtual device.
is enabled(self )
Determine if the device is enabled.
set enabled(self, bEnabled)
Enable the specified virtual device.
is remote(self )
Determine if the virtual device is a remote device.
set remote(self, bRemote)
Change the ’remote’ flag for the specified device.
get emulated type(self )
Return the virtual device emulation type.
set emulated type( self, n EmulatedType)
Sets the virtual device emulation type.
get image path(self )
Return virtual device image path.
set image path(self, sNewImagePath)
Set the virtual device image path.
get sys name(self )
Return the virtual device system name.
set sys name(self, sNewSysName)
Set the virtual device system name.
get friendly name(self )
Return the virtual device user-friendly name.
65
Class VmDevice Package prlsdkapi
set friendly name(self, sNewFriendlyName)
Set the virtual device user-friendly name.
get description(self )
Return the description of a virtual device.
set description(self, sNewDescription)
Set the device description.
get iface type(self )
Return the virtual device interface type (IDE or SCSI).
set iface type(self, nIfaceType)
Set the virtual device interface type (IDE or SCSI).
get sub type(self )
set sub type(self, nSubType)
get stack index(self )
Return the virtual device stack index (position at the IDE/SCSI controller bus).
set stack index(self , nS tackI n dex )
Set the virtual device stack index (position at the IDE or SCSI controller bus).
set default stack index(self )
Generates a stack index for the device (the device interface, IDE or SCSI, must be set in advance).
get output file(self )
Return the virtual device output file.
set output file(self, sNewOutputFile)
Set the virtual device output file.
66

Class VmHardDisk Package prls d kapi

is passthrough(self )
Determine if the passthrough mode is enabled for the mass storage d ev i ce.
set passthrough(self, bPassthrough)
Enable the passthrough mode for the mass storage device (optical or hard disk).
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.28.2 Properties

Name Description
Inherited from object
class
1.29 Class VmHardDisk
ob ject
prlsdkapi. Handle
prlsdkapi.VmDevice
prlsdkapi.VmHardDisk
Provides methods for managing virtual hard disks in a virtual machine.

1.29.1 Methods

get disk type(self )
Return the hard disk type.
67
Class VmHardDisk Package prls d kapi
set disk type(self, nDiskType)
Set the type of the virtual hard disk.
is splitted(self )
Determine if the virtual hard disk is split into multiple files.
set splitted(self, bSplitted)
Sety whether the hard disk should be split into multiple files.
get disk size(self )
Return the hard disk size.
set disk size(self, nDiskSize)
Set the size of the virtual hard disk.
get size on disk(self )
Return the size of the occupied space on the hard disk.
set password(self, sPassword )
is encrypted(self )
check password(self, nFlags )
add partition(self )
Assign a boot camp partition to the virtual hard disk.
get partitions count(self )
Determine the number of partitions on the virtual hard disk.
get partition(self, nIndex )
Obtain the VmHdPartition object containing a hard disk partition info.
set mount point(self, sMountPoint)
get mount point(self )
68

Class VmHdPartition Package prlsdkapi

set auto compress enabled(self, bEnabled)
is auto compress enabled(self )
get storage url(self )
set storage url(self, sURL)
Inherited from prlsdkapi.VmDevice(Section 1.28)
connect(), copy image(), create ( ), create image(), d i sco n n ec t( ) , get description(), get emulated type(), get friendly name(), get iface type(), get image path(), get index(), get output file(), get stack index(), get sub type(), get sys name(), get type(), is connected(), is enabled(), is passthrough(), i s remote(), remove(), resize image(), set connected(), set default stack index(), set description(), set emulated type(), set enabled(), set friendly name(), set iface type(), set image path(), set index(), set output file(), set passthrough(), set remote(), set stack index(), set sub type(), set sys name()
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.29.2 Properties

Name Description
Inherited from object
class
1.30 Class VmHdPartition
ob ject
prlsdkapi. Handle
prlsdkapi.VmHdPartition
Provides methods for managing partitions of a virtual hard disk in a virtual machine.
69

Class VmNet Package prlsdkapi

1.30.1 Methods

remove(self )
Remove the specified partition object from the virtual hard disk list.
get sys name(self )
Return the hard disk partition system name.
set sys name(self, sSysName)
Set system name for the disk partition.
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id(), get type()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.30.2 Properties

Name Description
Inherited from object
class
1.31 Class VmNet
ob ject
prlsdkapi. Handle
prlsdkapi.VmDevice
prlsdkapi.VmNet
Provides methods for managing network adapte rs in a virtual machine.
70
Class VmNet Package prlsdkapi

1.31.1 Methods

get bound adapter index(self )
Return the index of the adapter to which this virtual adapter is bound.
set bound adapter index(self, nIndex )
Set the index of the adapter to which this virtual adapter should be bound.
get bound adapter name(self )
Return the name of the adapter to which this virtual adapter is bound.
set bound adapter name(self, sNewBoundAdapterName)
Set the name of the network adapter to which this virtual adapter will bind.
get mac address(self )
Return the MAC address of the virtual network adapter.
get mac address canonical(self )
set mac address(self, sNewMacAddress)
Set MAC address to the network ada p t er .
generate mac addr(self )
Generate a unique MAC address for the virtual network adapter.
is auto apply(self )
Determine if the networ k adapter is configured to automatically apply network settings inside guest.
set auto apply(self, bAutoApply)
Set whether the network adapter should be automatically configured.
get net addresses(self )
Obtain the list of IP address/subnet mask pairs which are assigned to the virtual network adapter.
71
Class VmNet Package prlsdkapi
set net addresses(self, hNetAddressesList )
Set IP addresses/subnet masks to the network adapter .
get dns servers(self )
Obtain the list of DNS servers which are assigned to the vi rt ual network adapter.
set dns servers(self, hDnsServersList)
Assign DNS servers to the network adapter.
get search domains(self )
Obtain the lists of search domains assigned to the virtual network adapter.
set search domains(self , hSearchDomainsList)
Assign search domains to the network adapter.
is configure with dhcp(self )
Determine if the network adapter is configured th r o u gh D HCP on the guest OS side.
set configure with dhcp(self, bConfigureWithDhcp)
Set whether the network adapter should be configured through DHCP or manually.
is configure with dhcp ipv6(self )
set configure with dhcp ipv6(self, bConfigureWithDhcp)
get default gateway(self )
Obtain the default gateway assigned to the virtu al network ad apter.
set default gateway(self, sN e wDefaultG ateway )
Set the default gateway address for the network adapter.
get default gateway ipv6(self )
set default gateway ipv6(self, sNewDefaultGateway)
72
Class VmNet Package prlsdkapi
get virtual network id(self )
Obtain the virtual network ID assigned to the vi r tual network adapter.
set virtual network id(self, sNewVirtualNetworkId )
Set the virtual network ID for the network adapter.
get adapter type(self )
set adapter type(self, nAdapterType)
is pkt filter prevent mac spoof (self )
set pkt filter prevent mac spoof (self, bPktFilterPreventMacSpoof )
is pkt filter prevent promisc(self )
set pkt filter prevent promisc(self, bPktFilterPreventPromisc)
is pkt filter prevent ip spoof (self )
set pkt filter prevent ip spoof (self, bPktFilterPreventIpSpoof )
is firewall enabled( self )
set firewall enabled( self, bEnabled)
get firewall default policy(self, nDirection)
set firewall defa ult policy(self, nDirection, nPolicy)
get firewall rule list(self, nDirection)
set firewall rule list(self, nDirection, hRuleList)
get host interface name(self )
set host interface name(self, sNewHostInterfaceName)
Inherited from prlsdkapi.VmDevice(Section 1.28)
73

Class VmUsb Package prlsdkapi

connect(), copy image(), create () , create image(), d i sco n n ec t( ) , get description(), get emulated type(), get friendly name(), get iface type(), get image path(), get index(), get output file(), get stack index(), get sub type(), get sys name(), get type(), is connected(), is enabled(), is passthrough(), i s remote(), remove(), resize image(), set connected(), set default stack index(), set description(), set emulated type(), set enabled(), set friendly name(), set iface type(), set image path(), set index(), set output file(), set passthrough(), set remote(), set stack index(), set sub type(), set sys name()
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.31.2 Properties

Name Description
Inherited from object
class
1.32 Class VmUsb
ob ject
prlsdkapi. Handle
prlsdkapi.VmDevice
prlsdkapi.VmUsb
Provides methods for managing USB devices in a virtual machine.

1.32.1 Methods

get autoconnect option(self )
Obtain the USB controller autoconnect device option.
set autoconnect option(self, nAutoconnectOption)
Set the USB controller autoconnect device option.
74

Class VmSound Package prlsdkapi

Inherited from prlsdkapi.VmDevice(Section 1.28)
connect(), copy image(), create ( ), create image(), d i sco n n ec t( ) , get description(), get emulated type(), get friendly name(), get iface type(), get image path(), get index(), get output file(), get stack index(), get sub type(), get sys name(), get type(), is connected(), is enabled(), is passthrough(), i s remote(), remove(), resize image(), set connected(), set default stack index(), set description(), set emulated type(), set enabled(), set friendly name(), set iface type(), set image path(), set index(), set output file(), set passthrough(), set remote(), set stack index(), set sub type(), set sys name()
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.32.2 Properties

Name Description
Inherited from object
class
1.33 Class VmSound
ob ject
prlsdkapi. Handle
prlsdkapi.VmDevice
prlsdkapi.VmSound
Provides methods for managing sound devices in a virtual machine.

1.33.1 Methods

get output dev(self )
Return the output device string for the sound device.
75
Class VmSound Package prlsdkapi
set output dev(self, sNewOutputDev )
Set the output device string for the sound device.
get mixer dev(self )
Return the mixer device string for the sound device.
set mixer dev(self, sNewMixerDev )
Set the mixer device string for the sound device.
Inherited from prlsdkapi.VmDevice(Section 1.28)
connect(), copy image(), create ( ), create image(), d i sco n n ec t( ) , get description(), get emulated type(), get friendly name(), get iface type(), get image path(), get index(), get output file(), get stack index(), get sub type(), get sys name(), get type(), is connected(), is enabled(), is passthrough(), i s remote(), remove(), resize image(), set connected(), set default stack index(), set description(), set emulated type(), set enabled(), set friendly name(), set iface type(), set image path(), set index(), set output file(), set passthrough(), set remote(), set stack index(), set sub type(), set sys name()
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.33.2 Properties

Name Description
Inherited from object
class
76

Class VmSerial Package prlsdkapi

1.34 Class VmSerial
ob ject
prlsdkapi. Handle
prlsdkapi.VmDevice
prlsdkapi.VmSerial
Provides methods for managing serial ports in a virtual machine.

1.34.1 Methods

get socket mode(self )
Return the socket mode of the virtual serial port.
set socket mode(self, nSocketMode )
Set the socket mode for the virtual serial port.
Inherited from prlsdkapi.VmDevice(Section 1.28)
connect(), copy image(), create ( ), create image(), d i sco n n ec t( ) , get description(), get emulated type(), get friendly name(), get iface type(), get image path(), get index(), get output file(), get stack index(), get sub type(), get sys name(), get type(), is connected(), is enabled(), is passthrough(), i s remote(), remove(), resize image(), set connected(), set default stack index(), set description(), set emulated type(), set enabled(), set friendly name(), set iface type(), set image path(), set index(), set output file(), set passthrough(), set remote(), set stack index(), set sub type(), set sys name()
Inherited from prlsdkapi. Handle
del (), init (), add ref(), free(), get handle type(), get package id()
Inherited from object
delattr (), format (), getattribute (), hash (), new (), reduce (), reduce ex (),
repr (), setattr (), sizeof (), str (), subclasshook ()

1.34.2 Properties

Name Description
Inherited from object
class
77
Class VmConfig Package prlsdkapi
1.35 Class VmConfig
ob ject
prlsdkapi. Handle
prlsdkapi.VmConfig
Known Subclasses: prlsdkapi.Vm
Provides methods for managing the configuration of a virtual machine.

1.35.1 Methods

set network rate list(self, hNetworkRateList)
get network rate list(self )
is rate bound(self )
set rate bound(self, bEnabled)
set os template(self, sOsTemplate)
get os template(self )
apply config sample(self, sConfigSample)
get app template list(self )
set app template list(self, hAppList)
set default config(self, hSrvConfig, guestOsVersion, needCreateDevices)
Set the default configuration for a new virtual machine based on the guest OS type.
is config invalid(self, nErrCode)
get config validity(self )
Return a constant indicating the virtual machine configuration validity.
78
Class VmConfig Package prlsdkapi
add default device(self, hSrvConfig, deviceType)
Automates the task of setting devices in a virtual machine.
add default device ex(self, hSrvConfig, deviceType)
is default device needed(self, guestOsVersion, deviceType)
Determine whether a defaul t virtual device is needed for running the OS of the specified type.
get default mem size(self, guestOsVersion, hostRam)
Return the default RAM size for the specified OS type and version.
get default hdd size(self, guestOsVersion)
Return the default hard disk size for to the specified OS type and version.
get default video ram size(self, guestOsVersion, hSrvConfig, bIs3DSupportEnabled )
Return the default video RAM size for the specified OS type and version.
create vm dev(self, nDeviceType)
Create a new virtual device handle of the specified type.
get access rights(self )
Obtain the AccessRights object.
get devs count(self )
Determine the total number of devices of all types installed in the virtual machine.
get all devices(self )
Obtains objects for all virtual devices in a virtual machine.
get devs count by type(self, vmDeviceType)
Obtain the number of virtual devices of the specified type.
79
Class VmConfig Package prlsdkapi
get dev by type ( self, vmD eviceType, nIndex)
Obtains a virtual device object according to the specified device type and index.
get floppy disks count(self )
Determine the number of floppy disk drives in a virtual machine.
get floppy disk(self, nI ndex )
Obtain the VmDevice object containing information about a floppy disk drive in a vrtiual machine.
get hard disks count(self )
Determines the number of virtual hard disks in a virtual machine.
get hard disk(self, nIndex )
Obtain the VmHardDisk object containing the specified virtual hard disk information.
get optical disks count(self )
Determine the number of optical disks in the specified virtual machine.
get optical disk(self, nIndex )
Obtain the VmDevice object containing information about a virtual optical disk.
get parallel ports count(self )
Determine the number of virtual parallel ports in the virtual machine.
get parallel port(self, nIndex )
Obtains the VmDevice object containing information about a virtual parallel port.
get serial ports count(self )
Determine the number of serial ports in a virtual machine.
get serial port(self, nIndex )
Obtain the VmSerial object containing information about a serial p o r t in a virtual machine.
80
Class VmConfig Package prlsdkapi
get sound devs count(self )
Determine the number of sound devices in a virtual machine.
get sound dev(self, nIndex )
Obtain the VmSound object containing information about a sound device in a virtual machine.
get usb devices count(self )
Determine the number of USB devices in a virtual machine.
get usb device(self, nIndex )
Obtain the VmUsb object containing information about a USB device in the virtual machine.
get net adapters count(self )
Determine the number of network adapters in a virtual machine.
get net adapter(self, nIndex )
Obtain the VmNet object containing information about a virtual network adapter.
get generic pci devs count(self )
Determines the number of generic PCI devices in a virtual machine.
get generic pci dev(self, nIndex)
Obtain the VmDevice object containing information about a generic PCI device.
get generic scsi devs count(self )
Determines the number of generic SCSI devices in a virtual machine.
get generic scsi dev(self, nIndex )
Obtain the VmDevice object containing information about a SCSI device in a virtual machine.
get display devs count(self )
Determine the number of display devices in a vir tual machine.
81
Class VmConfig Package prlsdkapi
get display dev(self, nIndex )
Obtains the VmDevice containing information about a display device in a virtual machine.
create share(self )
Create a new instance of Share and add it to the virtual machine list of shares.
get shares count(self )
Determine the number of shared folders in a virtual machine.
get share(self, nShareIndex)
Obtain the Share object containing information about a shared folder.
is smart guard enabled(self )
Determine whether the SmartGuard feature is enabled in the virtual machine.
set smart guard enabled(self, bEnabled)
Enable the SmartGuard feature in the virtual machine.
is smart guard notify before creatio n(self )
Determine whether the user will be notified on automatic snapshot creation by SmartGaurd.
set smart guard notify before creati on( self, b N otif yBeforeCreation)
Enable or disable notification of automatic snapshot creation, a SmartGuard feature.
get smart guard interval(self )
Determines the interval at which snapshots are taken by SmartGuard.
set smart guard interval(self, nInterval )
Set the time interval at wh i ch snapshots are taken by SmartGuard.
get smart guard max snapshots count(self )
Determines the maximum snapshot count, a S m ar t G u ar d sett i n g.
82
Class VmConfig Package prlsdkapi
set smart guard max snapshots count(self, nMaxSnapshotsCount)
Set the maximum snapshot count, a SmartGu a r d feature.
is user defined shared folders enabled(self )
Determine whether the user-defined shared folders are enabled or not.
set user defined shared folders enabled(self, bEnabled)
Enables or disables user-defined shared folders.
is smart mount enabled(self )
set smart mount enabled(self, bEnabled)
is smart mount removable drives enabled(self )
set smart mount removable drives enabled(self, bEnabled)
is smart mount dvds enabled(self )
set smart mount dvds enabled(self, bEnabled)
is smart mount network shares enable d(self )
set smart mount network shares enable d( self, b Enabled)
is shared profile enabled(self )
Determine whether the Shared Profile feature is enabled in the virtual machine.
set shared profile enabled(self, bEnabled)
Enable or disable the Shared Profile feature in the virtual machine.
is use desktop(self )
Determine whether the ’use desktop in share profile’ feature is enabled or not.
set use desktop(self, bEnabled)
Enable or disable the ’undo-desktop’ feature in the shared profile.
83
Class VmConfig Package prlsdkapi
is use documents(self )
Determine whether ’use documents in shared profile’ feature is enabled or not.
set use documents(self, bEnabled)
Enable or disable the ’use documents in shared profile’ feature.
is use pictures(self )
Determine whether the ’used pictures in shared profile’ feature is enabled or not.
set use pictures(self, bEnabled)
Enables or disables the ’use pictures in shared profile’ feature.
is use music(self )
Determine whether the ’use music in shared profile’ feature is enabled or not.
set use music(self, bEnabled )
Enables or disables the ’use music in shared profile’ feature.
is use downloads(self )
set use downloads(self, bEnabled)
is use movies(self )
set use movies(self, bEnabled)
is auto capture release mouse(self )
Determine whether the automatic capture and release of the mouse p oi nter is enabled.
set auto capture release mouse(self, bEnabled)
Enable or disables the automatic capture and release of the mouse pointer in a virtual machine.
is share clipboard(self )
Determine whether the clipboard sharing feature is enabled in the virtual machine.
84
Class VmConfig Package prlsdkapi
set share clipboard(self, bEnabled)
Enable or disable the clipboard sharing feature.
is offline management enabled(self )
Determine whether the offline management feature is enabled for the virtual machine.
set offline management enabled(self, bEnabled)
Enables or disables the offline management feature for the virtual machine.
is tools auto update enabled(self )
Enables or disables the Parallels Tools AutoUpdate feature for the virtual machine.
set tools auto update enabled(self, bEnabled)
Enable or disable the Parallels Tools AutoUpdate feature for the virtual machine.
is time synchronization enabled(self )
Determine whether the time synchronization feature is enabled in the virtual machine.
set time synchronization enabled(self, bEnabled)
Enable or disable the time synchronization feature in a virtual machine.
is time sync smart mode enabled(self )
Determine whether the smart time synchronization is enabled in a virtual machine.
set time sync smart mode enabled(self, bEnabled)
Enable or disable the smart time-synchronization mode in the virtual machine.
get time sync interval(self )
Obtain the time synchronization interval between the host and the guest OS.
set time sync interval(self, nTimeSyncInterval )
Set the time interval at which time in the virtual machine will be synchronized with the host OS.
85
Class VmConfig Package prlsdkapi
is allow select boot device( self )
Determine whether the ’select boot device’ option is shown on virtual machine startup.
set allow select boot device( self, bAllowed)
Switch on/off the ’select boot device’ dialog on virtual machine startup.
create scr res(self )
Create a new instance of ScreenRes and add it to the virtual machine resolution list.
get scr res count(self )
Determine the total number of screen resolutions available in a virtual machine.
get scr res(self, nScrResIndex)
Obtain the ScreenRes object identifying the specified virtual machine screen resolution.
create boot dev(self )
Create a new instance of BootDevice and add it to the virtual machine boot device list.
get boot dev count(self )
Determine the number of devices in the virtual machine boot device priority list.
get boot dev(self, nBootDevIndex)
Obtain the BootDevice object containing information about a speci fi ed boot device.
get name(self )
Return the virtual machine name.
set name(self, sNewVmName)
Set the virtual machine name.
86
Class VmConfig Package prlsdkapi
get hostname(self )
Obtain the hostname of the specified virtual machine.
set hostname(self, sNewVmHostname)
Set the virtual machine hostname.
get dns servers(self )
set dns servers(self, hDnsServersList)
get uuid(self )
Return the UUID (universally unique ID) of the virtual machine.
set uuid(self, sNewVmUuid)
Set the virtual machine UUID (universally u n i que ID).
get linked vm uuid( self )
get os type(self )
Return the type of the operating system that the specified virtual machine is running.
get os version(self )
Return the version of the operating system that the specified virt ual machine is running.
set os version(self, nVmOsVersion)
Set the virtual machine guest OS version.
get ram size(self )
Return the virtual machine memory (RAM) size, in megabytes.
set ram size(self, nVmRamSize)
Sets the virtual machine memory (RAM) size.
get video ram size(self )
Return the video memory size of the virtual machine.
87
Class VmConfig Package prlsdkapi
set video ram size(self, nVmVideoRamSize)
Set the virtual machine video memory size.
get host mem quota min(self )
set host mem quota min(self, nHostMemQuotaMin)
get host mem quota max(self )
set host mem quota max(self, nHostMemQuotaMax )
get host mem quota priority(self )
set host mem quota priority(self, nHostMemQuotaPriority)
is host mem auto quota(self )
set host mem auto quota(self, bHostMemAutoQuota)
get max balloon size(self )
set max balloon size(self, nMaxBalloonSize)
get cpu count(self )
Determine the number of CPUs in the virtual machine.
set cpu count(self, nVmCpuCount)
Set the number of CPUs for the virtual machine (the CPUs sho u l d be present in the machine).
get cpu mode(self )
Determine the specified virtual machine CPU mode (32 bit or 64 bi t ).
set cpu mode(self, nVmCpuMode)
Set CPU mode (32 bit or 64 bit) for the virtual machine.
get cpu accel level(self )
Determine the virtual machine CPU acceleration level.
88
Class VmConfig Package prlsdkapi
set cpu accel level(self, nVmCpuAccelLevel)
Set CPU acceleration level for the virtual machine.
is cpu vtx enabled(self )
Determine whether the x86 virtualization (such as Vt-x) is available in the virtual machine CPU.
is cpu hotplug enabled(self )
set cpu hotplug enabled(self, bVmCpuHotplugEnabled)
is3dacceleration enabled(self )
set3dacceleration enabled(self, bVm3DAccelerationEnabled )
set cpu units(self, nVmCpuUnits)
Set the number of CPU units that will be allocated to a virtual machine.
get cpu units(self )
Determine the number of CPU units allocated to a virtual machine.
is start disabled(self )
set start disabled(self, bStartDisabled)
set cpu limit(self, nVmCpuLimit)
Set the CPU usage limit (in percent) for a virtual machine.
get cpu limit(self )
Determine the CPU usage limit of a virtual machine, in percent.
get cpu mask(self )
set cpu mask(self, sMask)
get io priority(self )
Determines the specified virtual machine I/O priority.
89
Class VmConfig Package prlsdkapi
set io priority(self, nVmIoPriority)
Set the virtual machine I/O priority.
get iops limit(self )
set iops limit(self, nVmIopsLimit)
get server uuid(self )
Returns the UUID of the machine hosting the specified virtual machine.
get server host(self )
Return the hostname of the machine hosting the specified virtual machine.
get home path(self )
Return the virtual machine home directory name and path.
get location(self )
get icon(self )
Return the name of the icon file used by the specified virtual machine.
set icon(self, sNewVmIcon)
Set the virtual machine icon.
get description(self )
Return the virtual machine description.
set description(self, sNewVmDescription)
Set the virtual machine description.
is template(self )
Determine whether the virtual machine is a real machine or a template.
set template sign(self, bVmIsTemplate)
Modify a regular virtual machine to become a template, and vi se versa.
90
Class VmConfig Package prlsdkapi
get custom property(self )
Return the virtual machine custom property information.
set custom property(self, sNewVmCustomProperty)
Set the virtual machine custom property information.
get auto start(self )
Determine if the specified virtual machine is set to start automatically on Parallels Service start.
set auto start(self, nVmAutoStart)
Set the automatic startup option for the virtual machine.
get auto start delay(self )
Returns the time delay used during the virtual machine automatic startup.
set auto start delay(self, nVmAutoStartDelay)
Set the time delay that will be used during the virtual machine automatic startup.
get start login mode(self )
Return the automatic startup login mode for the virtual m a chine.
set start login mode(self, nVmStartLoginMode)
Set the automatic startup login mode for the specified virtual machine.
get start user login(self )
Return the user name used during the virtual machine automatic startup.
set start user creds(self, sStartUserLogin, sPassword)
Sset the automatic startup user login and password for the virtual machine.
get auto stop(self )
Determine the mode of the automatic shutdown for the specified virtual machine.
91
Loading...