Component - setPropertyValue
Component - setPropertyValue
Description :
This command sets a property value on a component. The property name must be defined in the Component property class, or as a local property in the component's component template. The property must be defined as editable.
You can use the BMC BladeLogic blenc encryption utility to encrypt values you set with this command. For syntax and sample usage, see Server : setPropertyValue . This command returns the handle to the updated component on which the property has been set.
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
objectKey | DBKey | DBKey of the component. |
propertyName | String | Name of the property. |
valueAsString | String | Value of the property. |
Example
The following example script assumes that a dbkey is present for the component in the CLI variable COMPONENT_DBKEY. It also assumes that a property called install_dir has been defined as a local property in the component's component template.
Script
# Fetch the device ID of the Added Server.
SERVER_NAME='vw-pun-blg-dv15'
SERVER_DEVICEID=`blcli Server getServerIdByName $SERVER_NAME`
# Get the template DBKey.
TEMPLATE_NAME=test
TEMPLATE_GROUP=/test
TEMPLATE_DBKEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE_NAME`
# Create a component against the template.
COMPONENT_DBKEY=`blcli Component createComponent $SERVER_NAME $TEMPLATE_DBKEY $SERVER_DEVICEID`
# Set property to the component.
COMPONENT_DBKEY=`blcli Component setPropertyValue $COMPONENT_DBKEY install_dir '/c/tmp'`