Parallels Service preferences is a set of parameters that control its default behaviour. The most important parameters are:
"""
This function shows how to manage Parallels Service preferences.
@param server: An instance of prlsdkapi.Server identifying the Parallels Service.
"""
def srv_preferences_mgmt(server):
# The preferences are obtained as a prlsdkapi.DispConfig object.
srv_pref = server.common_prefs
try:
srv_pref.wait()
except prlsdkapi.PrlSDKAsyncError, e:
print "Error: %s" % e
return
# The default virtual machine directory.
print "Default virtual machine directory: " + srv_pref.default_vm_dir
# Minimum security level.
security_level = ""
if srv_pref.min_security_level == prlsdk.consts.PSL_LOW_SECURITY:
security_level = "Low"
elif srv_pref.min_security_level == prlsdk.consts.PSL_NORMAL_SECURITY:
security_level = "Normal"
elif srv_pref.min_security_level == prlsdk.consts.PSL_HIGH_SECURITY:
security_level = "High"
print "Minimum security level: " + security_level
# Modify the minimum security level.
# First, mark the beginning of the editing operation.
server.begin_edit_common_prefs()
# Set the new security level value.
srv_pref.min_security_level = prlsdk.consts.PSL_NORMAL_SECURITY
# Commit the changes.
try:
srv_pref.commit().wait()
except prlsdkapi.PrlSDKAsyncError, e:
print "Unable to commit the changes: %s" % e
return