BlPackage - createPackageForChangeTracking_1

BlPackage - createPackageForChangeTracking

Description :

This command creates a BLPackage based on all the information collected from the delta information collected by a Snapshot Job result.

Snapshots can have several templates specified in them. This command allows packaging change tracking results for only one target of one template.

If there is software in the snapshot result needed to match to depot software, the command will try to find the match specified in the match mapping file. If the command cannot find it, or you did not provide a software matching file, the command will try matching to default depot software. If the command cannot find default depot software, it skips the software.

The software matching file is a comma seperated text file, where each line contains a software name followed by the depot software DBKey. (To get the DBKey of depot software, you can use the Depot Object : getDBKeyByTypeStringGroupAndName command.)

Here is a sample line from a software matching file:

"AdventNet SNMP Utilities 4","DBKey:SDepotObjectKey:3-1" This command returns a handle to the newly created package and can be used as input to commands that need a handle to the package.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

packageName

String

Name of the package.

groupId

Integer

ID of a group that should contain the package.

bCollectFileAcl

Boolean

True to package the file ACLs, false otherwise.

bCollectFileAttributes

Boolean

True to package the file attributes, false otherwise.

bCopyFileContents

Boolean

True to package the file contents, false otherwise.

bCollectRegistryAcl

Boolean

True to package the registry ACLs, false otherwise.

snapshotJobKey

DBKey

Handle to the Snapshot Job you want to package.

snapshotJobRunKey

DBKey

Handle to the Snapshot Job Run Key you want to package.

templateKey

DBKey

Handle to the template that should be packaged in the snapshot.

targetServerName

String

Name of the target server.

matchFile

String

NSH path of the matching software file.

Example

This example shows how to create a BLPackage from a change tracking result. It assumes that a Snapshot Job has been run more than once to capture some delta and the change tracking information interested here is for the latest run:

Script


SNAPSHOT1_JOB_DBKEY=`blcli SnapshotJob getDBKeyByGroupAndName /jobgroup1 snapshot1` 

SNAPSHOT1_RUN_DBKEY=`blcli JobRun findLastRunKeyByJobKey $SNAPSHOT1_DBKEY` 

# Name of the package. 

PACKAGE_NAME="package1" 

# Get the ID of the depot group in which the package will be saved. 

DEPOT_GROUP_ID=`blcli DepotGroup groupNameToId /parent/group1` 

# This boolean value sets the File Options - Collect asset control lists (ACL) attributes check box. True for checked. 

bCollectFileAcl="false" 

# This boolean value sets the File Options - Collect file/directory attributes check box. True for checked. 

bCollectFileAttributes="false" 

# This boolean value sets the File Options - Copy file contents check box. True for checked. 

bCopyFileContents="true" 

# This boolean value sets the Registry Options - Collect access control list (ACL) attributes check box. True for checked. 

bCollectRegistryAcl="false" 

# A collection of the above options. 

PACKAGE_OPTIONS="$bCollectFileAcl $bCollectFileAttributes $bCopyFileContents $bCollectRegistryAcl" 

# Get the template DBKey for the asset you wish to package. 

TEMPLATE_NAME=template1 

TEMPLATE_GROUP=/template_group 

TEMPLATE_DBKEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE_NAME 

# Name of the software matching file. 

SOFTWARE_MATCH_FILE="/C/tmp/map.txt" 

# Now create new package. 

PACKAGE1_DBKEY=`blcli BlPackage createPackageForChangeTracking $PACKAGE_NAME $DEPOT_GROUP_ID $PACKAGE_OPTIONS $SNAPSHOT1_JOB_DBKEY $SNAPSHOT1_RUN_DBKEY $TEMPLATE_DBKEY $TARGET_SERVER_NAME $SOFTWARE_MATCH_FILE` 

# Note that the snapshotJobRunKey and the templateKey values  typically have the following format: DBKey:className:templateId-templateVersionId-BlValueId.  For example: DBKey:STemplateModelKeyImpl:2000061-1-2005000.  Furthermore, although BLCLI verifies most elements within this string  (className, templateID, and templateVersionId) and issues an error when an  erroneous value is specified, the BlValueId is not verified and does  not produce an error when faulty. 



Was this page helpful? Yes No Submitting... Thank you

Comments