Virtualization - exportVirtualGuestJobRun
Virtualization - exportVirtualGuestJobRun
Description :
This command exports the results (job run log) of a Virtual Guest Job run to a file. You must identify the job run by its run ID.
Return type : java.lang.Void
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
runId | Integer | ID of the Virtual Guest Job run whose results you want to export. |
exportFileName | String | Name of the file that holds the export. |
Example
The following example shows how to export the job run result of a Virtual Guest Job.
Script
# Get the DBKey of the job for which you want to export the logs
JOB_DBKEY=Virtualization getDBKeyByGroupAndName "/VMware VGJ" "VMware - VGJ - 001"
# From the job key, get the job run keys. Here the result could be multiple job run keys based on the number of times the job has been run. In this example, the job has been run only once and therefore you see only one entry listed in the result.
JobRun findAllRunKeysByJobKey $JOB_DBKEY
Result : DBKey:SJobRunModelKeyImpl:2000002-2003100
# Get the job run ID using the job run key
JOB_RUN_ID=JobRun jobRunKeyToJobRunId DBKey:SJobRunModelKeyImpl:2000002-2003100
Use the job run ID to export the job run logs
Virtualization exportVirtualGuestJobRun $JOB_RUN_ID "C:/temp/jobRunLog.csv"
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*