Managing Parallels Service PreferencesParallels Service preferences is a set of configuration parameters that control its behavior. The most important parameters are:
To obtain the preferences information use the Example """ This function shows how to view and modify Parallels Service preferences. @param server: An instance of prlsdkapi.Server identifying the Parallels Service. """ def srv_preferences_management(server):
print "" print "Parallels Service Preferences Management" print "------------------------------------------"
# The preferences info is obtained as a prlsdkapi.DispConfig object. try: result = server.get_common_prefs().wait() except prlsdkapi.PrlSDKError, e: print "Error: %s" % e return
disp_config = result.get_param()
# Obtain the default virtual machine directory. print "Default virtual machine directory: " + \ disp_config.get_default_vm_dir()
# The minimum allowed security level. # This setting ensures that the communication security level # specified at login satisfies the necessary requirements. security_level = disp_config.get_min_security_level()
if security_level == consts.PSL_LOW_SECURITY: security_level = "Low" elif security_level == consts.PSL_NORMAL_SECURITY: security_level = "Normal" elif security_level == consts.PSL_HIGH_SECURITY: security_level = "High"
print "Currently set minimum security level: " + security_level
# Modify the minimum security level. # First, mark the beginning of the editing operation (required step). try: server.common_prefs_begin_edit().wait() except prlsdkapi.PrlSDKError, e: print "Error: %s" % e return
# Set the new security level value. new_level = consts.PSL_HIGH_SECURITY disp_config.set_min_security_level(new_level)
# Commit the changes. try: server.common_prefs_commit(disp_config).wait() except prlsdkapi.PrlSDKError, e: print "Error: %s" % e return
print "Minimum security was set to High." |
||||
|