SnapshotJob - createAssetBasedSnapshotJob
SnapshotJob - createAssetBasedSnapshotJob
Description :
This command creates a Snapshot Job based on assets (that is, server objects) that you select. When creating a Snapshot Job, we recommend that you create Snapshot Jobs based on templates (see SnapshotJob createTemplateBasedSnapshotJob ) rather than using this command.
This command returns a handle to the newly created Snapshot Job. The DBKey can be used in other commands that need to reference the Snapshot Job you have created.
You must provide an ID for the job group that will contain this Snapshot Job and the name of the server that is the target of the snapshot.
The templateKey argument provides a DBKey identifying the template that describes the assets on which the snapshot is based. This template must be an anonymous template. To create an anonymous template, use any template creation command from the Template namespace and supply a value of false to the bExplicit parameter of that command. For example, Template createFileTemplate fileTemplateName groupIdValue false //localhost/tmp false false false false false false false false would create an anonymous File Template where the third parameter supplied to it, false, right before the file path would let this command know that it should create an anonymous template.
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
jobName | String | Name of the job to be created. |
groupId | Integer | ID of the parent job group for the Snapshot Job. |
templateKey | DBKey | Handle to the template describing the assets to be included in the Snapshot Job. This template must be an anonymous template. |
serverName | String | Target server for the Snapshot Job. |
Example
The following example shows how to create a Snapshot Job based on the assets in a specified template:
Script
TEMPLATE_GROUP="/Template_Group"
TEMPLATE="Template_Name"
JOB_NAME="Job Name"
JOB_GROUP="Job Group Name"
TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`
JOB_GROUP_ID=`blcli JobGroup groupNameToId $JOB_GROUP`
AssetBasedSnapshotJob=`blcli SnapshotJob createAssetBasedSnapshotJob $JOB_NAME $JOB_GROUP_ID $TEMPLATE_KEY $SERVER`