Template - addFilePart
Template - addFilePart
Description :
This command adds a file asset to an existing template.
The asset path should be the full path in NSH format. This command returns a handle to the updated template. Note that this handle is different from any previously returned handles. All other handles are invalid.
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
---|---|---|
templateKey | DBKey | Handle to the existing template to which you want to add a file asset. |
assetPath | String | NSH-style path to the asset. |
bIncludeLightChecksum | Boolean | True to perform light checksum, false not to perform light checksum. |
bIncludeChecksum | Boolean | True to perform full checksum, false not to perform light checksum. |
bIncludeFileAcls | Boolean | True to collect file ACLs, false otherwise. |
bCopyFiles | Boolean | True to copy the files into the BMC BladeLogic database, false otherwise. |
bAuditFileSize | Boolean | True to compare file size in an audit, false otherwise. |
bAuditFileCreatedDate | Boolean | True to compare file creation date in an audit, false otherwise. (Windows only) |
bAuditFileModifiedDate | Boolean | True to compare file modification date in an audit, false otherwise. |
bAuditFilePermissions | Boolean | True to compare file permissions in an audit, false otherwise. (UNIX only) |
bAuditFileUidGid | Boolean | True to compare file UID/GID in an audit, false otherwise. (UNIX only) |
Example
The following example shows you how to add a file asset to a template. You can add other asset types in a similar manner.
Script
# Name of the existing template.
TEMPLATE_NAME="template1"
# Template group in which template is stored.
TEMPLATE_GROUP="/parent/group1"
# Get the template DBKey using the above information.
TEMPLATE_DBKEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE_NAME`
# The path to the asset. The easiest way to first determine the asset path is to add a similar asset through the GUI.
ASSET_PATH="/C/dir/file_asset.txt"
# The following steps set the options for the file asset.
# Setting a value to true is the same as checking one of the checkboxes in the options section of the component template dialog.
# Order is important, and each option must be true or false.
# snapshot/audit - Light Checksum
OPTIONS="true"
# snapshot/audit - Full Checksum
OPTIONS="${OPTIONS} true"
# snapshot - collect file ACL
OPTIONS="${OPTIONS} false"
# snapshot/audit - backup files
OPTIONS="${OPTIONS} false"
# audit - file size
OPTIONS="${OPTIONS} false"
# audit - file creation date
OPTIONS="${OPTIONS} false"
# audit - file modification date
OPTIONS="${OPTIONS} false"
# audit - file permissions
OPTIONS="${OPTIONS} false"
# audit - UID/GID
OPTIONS="${OPTIONS} false"
# Now add the asset to the template.
TEMPLATE_DBKEY=`blcli Template addFilePart $TEMPLATE_DBKEY $ASSET_PATH $OPTIONS`
# Use the returned DBKey to add more assets/lists to the template.