Server - setPropertyValue


Server - setPropertyValue

Description :

This command sets a property value on a server. The property name must be defined in the Server property class. The property must be defined as editable.

To set the default value of a property of type property class (for example a class named 'MY_CLASS') to an instance of the MY_CLASS property class, use the following syntax:

KEY=`blcli Server getServerDBKeyByName server1`
blcli Server setPropertyValue ${KEY} MY_PROP "Class://SystemObject/MY_CLASS/MY_PSI"

where MY_PSI is a property instance of the MY_CLASS property class.

For encrypted property types, you can use the BMC BladeLogic blenc encryption utility to encrypt values that you set with this command. The syntax is:

blenc value

where value is the value you want to encrypt.

Sample usage:

KEY=`blcli Server getServerDBKeyByName server1`
VAL=`blenc "property_value" | grep ^BLencrypt: | cut -f2 -d: | tr-d '[:cntrl:]' `
blcli Server setPropertyValue $KEY TEST_ENC_PROP $VAL

Return type : com.bladelogic.om.infra.model.server.Server

Command Input :

Variable Name

Variable Type

Description

serverKey

DBKey

Handle to the server.

propertyName

String

Name of the property.

valueAsString

String

The value to set.

Example

This example script assumes that a server key is present in the CLI variable server_key. It also assumes that a property called is_approved has been defined in the Server property class.

Script

Server setPropertyValue $server_key is_approved true

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*